public abstract class AbstractURLHandler extends java.lang.Object implements URLHandler
URLHandler.URLInfoREQUEST_METHOD_GET, REQUEST_METHOD_HEAD, UNAVAILABLE| Constructor and Description |
|---|
AbstractURLHandler() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected java.io.InputStream |
getDecodingInputStream(java.lang.String encoding,
java.io.InputStream in) |
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.
|
int |
getRequestMethod() |
protected java.lang.String |
getUserAgent() |
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.
|
protected java.lang.String |
normalizeToString(java.net.URL url) |
protected java.net.URL |
normalizeToURL(java.net.URL url) |
void |
setRequestMethod(int requestMethod) |
protected void |
validatePutStatusCode(java.net.URL dest,
int statusCode,
java.lang.String statusMessage) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdownload, getURLInfo, getURLInfo, openStream, uploadpublic boolean isReachable(java.net.URL url)
URLHandlerisReachable in interface URLHandlerurl - the url to checkpublic boolean isReachable(java.net.URL url,
int timeout)
URLHandlerisReachable in interface URLHandlerurl - the url to checkpublic long getContentLength(java.net.URL url)
URLHandlergetContentLength in interface URLHandlerurl - the url to checkpublic long getContentLength(java.net.URL url,
int timeout)
URLHandlergetContentLength in interface URLHandlerurl - the url to checktimeout - the maximum time before considering an url is not reachable a timeout of zero
indicates no timeoutpublic long getLastModified(java.net.URL url)
URLHandlergetLastModified in interface URLHandlerurl - the url to checkpublic long getLastModified(java.net.URL url,
int timeout)
URLHandlergetLastModified in interface URLHandlerurl - the url to checkprotected java.lang.String getUserAgent()
protected void validatePutStatusCode(java.net.URL dest,
int statusCode,
java.lang.String statusMessage)
throws java.io.IOException
java.io.IOExceptionpublic void setRequestMethod(int requestMethod)
setRequestMethod in interface URLHandlerpublic int getRequestMethod()
protected java.lang.String normalizeToString(java.net.URL url)
throws java.io.IOException
java.io.IOExceptionprotected java.net.URL normalizeToURL(java.net.URL url)
throws java.io.IOException
java.io.IOExceptionprotected java.io.InputStream getDecodingInputStream(java.lang.String encoding,
java.io.InputStream in)
throws java.io.IOException
java.io.IOException