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
ConnectionRequest request = new ConnectionRequest(url, true); | |
request.setContentType("text/xml"); |
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
ConnectionRequest request = new ConnectionRequest(url, false); | |
request.setHttpMethod("HEAD"); |
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
ConnectionRequest request = new ConnectionRequest(url + | |
"MyArgName=" + Util.encodeUrl(value), false); |
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
ConnectionRequest request = new ConnectionRequest(url, false); | |
request.addArgument("MyArgName", value); |
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
NetworkManager.getInstance().updateThreadCount(4); |
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
ConnectionRequest request = new ConnectionRequest(url, false); | |
// request will be handled synchronously | |
NetworkManager.getInstance().addToQueueAndWait(request); | |
byte[] resultOfRequest = request.getData(); |
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
ConnectionRequest request = new ConnectionRequest(url, false) { | |
protected void readResponse(InputStream input) { | |
// just read from the response input stream | |
} | |
protected void postResponse() { | |
// invoked on the EDT after processing is complete to allow the networking code | |
// to update the UI | |
} |
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
ConnectionRequest request = new ConnectionRequest(url, false); | |
request.addResponseListener((e) -> { | |
// process the response | |
}); | |
// request will be handled asynchronously | |
NetworkManager.getInstance().addToQueue(request); |
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
Form hi = new Form("FileSystemTree", new BorderLayout()); | |
TreeModel tm = new TreeModel() { | |
@Override | |
public Vector getChildren(Object parent) { | |
String[] files; | |
if(parent == null) { | |
files = FileSystemStorage.getInstance().getRoots(); | |
return new Vector<Object>(Arrays.asList(files)); | |
} else { | |
try { |
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
GZConnectionRequest con = new GZConnectionRequest(); | |
con.addRequestHeader("Accept-Encoding", "gzip"); |