Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. URL website = new URL("http://www.website.com/file.exe");
  2. ReadableByteChannel rbc = Channels.newChannel(website.openStream());
  3. FileOutputStream fos = new FileOutputStream("file.exe");
  4. fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
  5.  
  6. URL url = new URL(fileURL);
  7. HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
  8. httpConn.addRequestProperty("User-Agent", "Firefox 5.0");
  9. httpConn.setRequestProperty("Referer", "http://www.google.com");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement