|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface URLHandler
This interface is responsible for handling some URL manipulation (stream opening, downloading, check reachability, ...).
Nested Class Summary | |
---|---|
static class |
URLHandler.URLInfo
|
Field Summary | |
---|---|
static URLHandler.URLInfo |
UNAVAILABLE
|
Method Summary | |
---|---|
void |
download(java.net.URL src,
java.io.File dest,
CopyProgressListener l)
|
long |
getContentLength(java.net.URL url)
Returns the length of the target if the given url is reachable, and without error code in case of http urls. |
long |
getContentLength(java.net.URL url,
int timeout)
Returns the length of the target if the given url is reachable, and without error code in case of http urls. |
long |
getLastModified(java.net.URL url)
Please prefer getURLInfo when several infos are needed. |
long |
getLastModified(java.net.URL url,
int timeout)
Please prefer getURLInfo when several infos are needed. |
URLHandler.URLInfo |
getURLInfo(java.net.URL url)
never returns null, return UNAVAILABLE when url is not reachable |
URLHandler.URLInfo |
getURLInfo(java.net.URL url,
int timeout)
never returns null, return UNAVAILABLE when url is not reachable |
boolean |
isReachable(java.net.URL url)
Please prefer getURLInfo when several infos are needed. |
boolean |
isReachable(java.net.URL url,
int timeout)
Please prefer getURLInfo when several infos are needed. |
java.io.InputStream |
openStream(java.net.URL url)
|
Field Detail |
---|
static final URLHandler.URLInfo UNAVAILABLE
Method Detail |
---|
boolean isReachable(java.net.URL url)
url
- the url to check
boolean isReachable(java.net.URL url, int timeout)
url
- the url to check
long getContentLength(java.net.URL url)
url
- the url to check
long getContentLength(java.net.URL url, int timeout)
url
- the url to checktimeout
- the maximum time before considering an url is not reachable
a timeout of zero indicates no timeout
long getLastModified(java.net.URL url)
url
- the url to check
long getLastModified(java.net.URL url, int timeout)
url
- the url to check
URLHandler.URLInfo getURLInfo(java.net.URL url)
url
-
URLHandler.URLInfo getURLInfo(java.net.URL url, int timeout)
url
-
java.io.InputStream openStream(java.net.URL url) throws java.io.IOException
java.io.IOException
void download(java.net.URL src, java.io.File dest, CopyProgressListener l) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |