How to download a dataset using java -
i want make app download paper mentioned in image taking domain input. have been able download single file other website unable download paper form acm digital library. need download entire data set.
here code used download single file.
string filename = "1.txt"; url link = new url("http://shayconcepts.com"); 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 modify download entire data set
Comments
Post a Comment