|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.awakefw.file.api.client.AwakeUrl
public final class AwakeUrl
Main class for executing URL downloads.
All long operations that need to be run on a separated thread may be followed
in Swing using a Java Progress Bar or Progress Monitor: just implement the
AwakeProgressManager interface.
HttpProxy,
AwakeProgressManager| Constructor Summary | |
|---|---|
AwakeUrl()
Constructor. |
|
AwakeUrl(HttpProxy httpProxy)
Constructor that allows to define a proxy. |
|
AwakeUrl(HttpProxy httpProxy,
HttpProtocolParameters httpProtocolParameters)
Constructor that allows to define a proxy and protocol parameters. |
|
| Method Summary | |
|---|---|
String |
download(URL url)
Creates a String from an URL. |
void |
download(URL url,
File file)
Creates a File from an URL. |
int |
getHttpStatusCode()
Returns the http status code of the last executed download. |
String |
getVersion()
Returns the Awake File Version. |
void |
setAwakeProgressManager(AwakeProgressManager awakeProgressManager)
Allows to set an Awake Progress Manager instance. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AwakeUrl(HttpProxy httpProxy,
HttpProtocolParameters httpProtocolParameters)
throws IllegalArgumentException
httpProxy - the http proxy to usehttpProtocolParameters - the http parameters to use
IllegalArgumentExceptionpublic AwakeUrl(HttpProxy httpProxy)
httpProxy - the http proxy to usepublic AwakeUrl()
| Method Detail |
|---|
public void setAwakeProgressManager(AwakeProgressManager awakeProgressManager)
awakeProgressManager - the Awake Progress Manager instancepublic int getHttpStatusCode()
public void download(URL url,
File file)
throws IllegalArgumentException,
UnknownHostException,
FileNotFoundException,
InterruptedException,
IOException
url - the URLfile - the file to create from the download.
IllegalArgumentException - if url or file is null
UnknownHostException - if Host url (http://www.acme.org) does not exists or no
Internet Connection.
FileNotFoundException - if it is impossible to connect to the URL.
InterruptedException - if the download is interrupted by user through an
AwakeProgressManager
IOException - For all other IO / Network / System Error
public String download(URL url)
throws UnknownHostException,
IOException
url - the URL
UnknownHostException - if Host url (http://www.acme.org) does not exists or no
Internet Connection.
FileNotFoundException - if it is impossible to connect to the URL.
IOException - For all other IO / Network / System Errorpublic String getVersion()
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||