public class BasicURLHandler extends AbstractURLHandler
URLHandler.URLInfo
REQUEST_METHOD_GET, REQUEST_METHOD_HEAD, UNAVAILABLE
Constructor and Description |
---|
BasicURLHandler() |
Modifier and Type | Method and Description |
---|---|
void |
download(java.net.URL src,
java.io.File dest,
CopyProgressListener l) |
static java.lang.String |
getCharSetFromContentType(java.lang.String contentType)
Extract the charset from the Content-Type header string, or default to ISO-8859-1 as per
rfc2616-sec3.html#sec3.7.1 .
|
URLHandler.URLInfo |
getURLInfo(java.net.URL url)
Returns the URLInfo of the given url or a
URLHandler.UNAVAILABLE instance, if the url is not
reachable. |
URLHandler.URLInfo |
getURLInfo(java.net.URL url,
int timeout)
never returns null, return UNAVAILABLE when url is not reachable
|
java.io.InputStream |
openStream(java.net.URL url) |
void |
upload(java.io.File source,
java.net.URL dest,
CopyProgressListener l) |
getContentLength, getContentLength, getDecodingInputStream, getLastModified, getLastModified, getRequestMethod, getUserAgent, isReachable, isReachable, normalizeToString, normalizeToURL, setRequestMethod, validatePutStatusCode
public URLHandler.URLInfo getURLInfo(java.net.URL url)
URLHandler
URLHandler.UNAVAILABLE
instance, if the url is not
reachable.url
- The url from which information is retrieved.URLHandler.UNAVAILABLE
when the url is not
available.public URLHandler.URLInfo getURLInfo(java.net.URL url, int timeout)
URLHandler
url
- The url from which information is retrieved.timeout
- The timeout in milliseconds.URLHandler.UNAVAILABLE
when the url is not
available.public static java.lang.String getCharSetFromContentType(java.lang.String contentType)
contentType
- the Content-Type header stringpublic java.io.InputStream openStream(java.net.URL url) throws java.io.IOException
java.io.IOException
public void download(java.net.URL src, java.io.File dest, CopyProgressListener l) throws java.io.IOException
java.io.IOException
public void upload(java.io.File source, java.net.URL dest, CopyProgressListener l) throws java.io.IOException
java.io.IOException