-
Notifications
You must be signed in to change notification settings - Fork 1
Sync Web
Adamki11s edited this page Jan 30, 2012
·
2 revisions
Sync Web contains two simple yet useful functions. Download and FetchSource.
Create an instance of SyncWeb first.
SyncWeb web = new SyncWeb();
Download a File Asynchronously (Displays a % completed in the log)
web.download(String link, File downloadLocation);
web.download("Some url", new File("download.file"));
Download the source code of a webpage Asynchronously
try {
URL url = new URL("some website link");
String source = web.fetchSource(url);
} catch (MalformedURLException e) {
e.printStackTrace();
}