Created
August 7, 2014 14:31
-
-
Save pgbytes/febfb417e2c8e53d301f to your computer and use it in GitHub Desktop.
Download a web resource using apache commons #java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private byte[] downloadObject(String srcUrl) throws IOException | |
{ | |
URL url = new URL(srcUrl); | |
InputStream in = new BufferedInputStream(url.openStream()); | |
return IOUtils.toByteArray(in); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment