Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make an app that will download all the paper mentioned in the image by taking the domain as input. I have been able to download a single file from some other website but was unable to download a paper form acm digital library. what I need to do is download the entire data set.

Here is the code that I used to download a single file:
Java
String fileName = "1.txt"; //The file that will be saved on your computer
URL link = new URL("http://delivery.acm.org/10.1145/2340000/2333745/p367-rogers.pdf?ip=14.139.236.219&id=2333745&acc=ACTIVE%20SERVICE&key=045416EF4DDA69D9.F1486EDFD37746FC.4D4702B0C3E38B35.4D4702B0C3E38B35&CFID=493229062&CFTOKEN=47839990&__acm__=1427535499_1f0bc4b26af326afb3e683fc4f578624"); //The file that you want to download 
//Code to download
InputStream in = new BufferedInputStream(link.openStream());
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buf = new byte[2048];
int n = 0;
while (-1!=(n=in.read(buf)))
{
  out.write(buf, 0, n);
}
out.close();
in.close();
byte[] response = out.toByteArray();

FileOutputStream fos = new FileOutputStream(fileName);
fos.write(response);

fos.close();

How can I modify it to download entire data set?
java dataset
Posted
Updated 28-Mar-15 22:36pm
v2
Comments
Richard MacCutchan 29-Mar-15 3:39am    
You cannot do it unless the website provides a service to serve all the files.
triptisonkar 30-Apr-15 0:57am    
Can we do it on linux?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900