Code:
File f = new File("C:\Cache.zip");
if(!(f.exists())) {
try
{
long startTime = System.currentTimeMillis();
System.out.println("Connecting to site...\n");
URL url = new URL("http://www.dropbox.com/blahblahblahblah");
url.openConnection();
InputStream reader = url.openStream();
FileOutputStream writer = new FileOutputStream("C:/Cache.zip");
byte[] buffer = new byte[153600];
int totalBytesRead = 0;
int bytesRead = 0;
System.out.println("Reading ZIP file 150KB at a time.\n");
while ((bytesRead = reader.read(buffer)) > 0)
{
writer.write(buffer, 0, bytesRead);
buffer = new byte[153600];
totalBytesRead += bytesRead;
}
long endTime = System.currentTimeMillis();
System.out.println("Done. " + (new Integer(totalBytesRead).toString()) + " bytes read (" + (new Long(endTime - startTime).toString()) + " millseconds).\n");
writer.close();
reader.close();
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
} else {
System.out.println("Cache exists, no need to Download it.");
}
But I think your problem is you haven't made any changes to the client, and just expected it to work for you (As it would seem from your post), so this wouldn't help you at all in that case.
1) The cache URL might not exist anymore (Usually when you download clients, the previous Cache URL goes down after some time)
2) People are trying to connect to your VPS, which doesn't have the server files on it (As it would seem from your post) - Why are you trying to upload Client.class to your VPS?
3) The IP the client is connecting to isn't your own (You haven't edited it)
Probably one of the three that is your problem.