Java:
public void downloadFile(String geturl, String output) throws Throwable {
final URL url = new URL(geturl);
final URLConnection conn = url.openConnection();
if (jCheckBox1.isSelected()){
String host = jTextField9.getText();
String port = jTextField10.getText();
String user = jTextField11.getText();
String pw = jTextField12.getText();
System.setProperty("proxyPort", port);
System.setProperty("proxyHost", host);
System.setProperty( "http.proxyUser", user );
System.setProperty( "http.proxyPassword", pw );
}
final InputStream is = new BufferedInputStream(conn.getInputStream());
final OutputStream os =
new BufferedOutputStream(new FileOutputStream(output));
int fsize = (int) size;
byte[] chunk = new byte[fsize];
int chunkSize;
while ((chunkSize = is.read(chunk)) != -1) {
os.write(chunk, 0, chunkSize);
}
os.flush();
os.close();
is.close();
}
Moin Gemeinde,
diese methode läuft eigentlich einwandfrei. nun will ich das an einem rechner mit proxy benutzen und das was ich bis jetzt gefunden hab - läuft nicht

kann da vllt einer mithelfen?
Zuletzt bearbeitet: