@@ -0,0 +1,2493 @@
+package ExecutableInterfaces;%0Aimport java.io.BufferedInputStream;%0Aimport java.io.BufferedOutputStream;%0Aimport java.io.FileOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.OutputStream;%0Aimport java.net.MalformedURLException;%0Aimport java.net.URL;%0Aimport java.util.ArrayList;%0A%0A/*%0A%09I'm pretty sure I didn't write the codebase of this class. Sadly, I didn't keep reference to the author.%0A%09So, if you, as author of this code, find this:%0A%09  -Thanks, I found it useful.%0A%09  -Let me know, so I can add a reference to your work. %0A*/%0Apublic class JWget %0A%7B%0A%09//-------------------------------------------------------------------------------------------------------------%0A%09public static void jwGet(String saveAsFile, String urlOfFile) throws MalformedURLException,IOException %0A%09%7B%0A%09%09InputStream httpIn = null;%0A%09%09OutputStream fileOutput = null;%0A%09%09OutputStream bufferedOut = null;%0A%0A%09%09// check the http connection before we do anything to the fs%0A%09%09httpIn = new BufferedInputStream(new URL(urlOfFile).openStream());%0A%09%09// prep saving the file%0A%09%09fileOutput = new FileOutputStream(saveAsFile);%0A%09%09bufferedOut = new BufferedOutputStream(fileOutput, 1024);%0A%09%09byte data%5B%5D = new byte%5B1024%5D;%0A%09%09boolean fileComplete = false;%0A%09%09int count = 0;%0A%09%09while (!fileComplete) %0A%09%09%7B%0A%09%09%09count = httpIn.read(data, 0, 1024);%0A%09%09%09if (count %3C= 0) %0A%09%09%09%7B%0A%09%09%09%09fileComplete = true;%0A%09%09%09%7D %0A%09%09%09else %0A%09%09%09%7B%0A%09%09%09%09bufferedOut.write(data, 0, count);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09bufferedOut.close();%0A%09%09fileOutput.close();%0A%09%09httpIn.close();%0A%09%7D%0A%09//-------------------------------------------------------------------------------------------------------------%0A%09public static ArrayList%3CByte%3E jwGet(String urlOfFile) throws MalformedURLException,IOException %0A%09%7B%0A%09%09ArrayList%3CByte%3E result=new ArrayList%3CByte%3E();%0A%09%09InputStream httpIn = null;%0A%0A%09%09// check the http connection before we do anything to the fs%0A%09%09httpIn = new BufferedInputStream(new URL(urlOfFile).openStream());%0A%09%09byte data%5B%5D = new byte%5B1024%5D;%0A%09%09boolean fileComplete = false;%0A%09%09int count = 0;%0A%09%09while (!fileComplete) %0A%09%09%7B%0A%09%09%09count = httpIn.read(data, 0, 1024);%0A%09%09%09if (count %3C= 0) %0A%09%09%09%7B%0A%09%09%09%09fileComplete = true;%0A%09%09%09%7D %0A%09%09%09else %0A%09%09%09%7B%0A%09%09%09%09//TODO! guetto code. Should try to use kind of result.addAll( (ArrayList%3CByte)Arrays.asList(data) ) or sth%0A%09%09%09%09for(int i=0;i%3Ccount;i++)%0A%09%09%09%09%7B%0A%09%09%09%09%09result.add(new Byte(data%5Bi%5D));%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09httpIn.close();%0A%09%09return result;%0A%09%7D%0A%09//-------------------------------------------------------------------------------------------------------------%0A%0A%7D%0A

Create JWget.java