This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
import java.net.InetAddress; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.net.UnknownHostException; | |
import java.util.EventListener; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
URL url = new URL("http://127.0.0.1/scripts/download.php"); | |
ReadableByteChannel readableByteChannel = Channels.newChannel(url.openStream()); | |
FileOutputStream fileOutputStream = new FileOutputStream("resourceFileName.db"); | |
fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE); | |
} catch (Exception ex) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FormURLEncodedToJSON(str) { | |
"use strict"; | |
var obj, i, pt, keys, j, ev; | |
if (typeof FormURLEncodedToJSON.br !== 'function') { | |
FormURLEncodedToJSON.br = function(repl) { | |
if (repl.indexOf(']') !== -1) { | |
return repl.replace(/\](.+?)(,|$)/g, function($1, $2, $3) { | |
return FormURLEncodedToJSON.br( $2 + '}' + $3 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.netty.channel.ChannelException; | |
import io.netty.channel.ChannelOption; | |
import io.netty.handler.timeout.ReadTimeoutHandler; | |
import io.netty.handler.timeout.WriteTimeoutHandler; | |
import lombok.Getter; | |
import lombok.Setter; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.context.properties.ConfigurationProperties; |
OlderNewer