Interface URLHandler
- All Known Subinterfaces:
TimeoutConstrainedURLHandler
- All Known Implementing Classes:
AbstractURLHandler, BasicURLHandler, HttpClientHandler, URLHandlerDispatcher
Deprecated.
This interface is responsible for handling some URL manipulation (stream opening, downloading,
check reachability, ...).
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.Using the slower REQUEST method for getting the basic URL infos.static final intDeprecated.Using the faster HEAD method for getting the basic URL infos.static final URLHandler.URLInfoDeprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoiddownload(URL src, File dest, CopyProgressListener l) Deprecated.longgetContentLength(URL url) Deprecated.Please prefer getURLInfo when several infos are needed.longgetContentLength(URL url, int timeout) Deprecated.longgetLastModified(URL url) Deprecated.Please prefer getURLInfo when several infos are needed.longgetLastModified(URL url, int timeout) Deprecated.Please prefer getURLInfo when several infos are needed.getURLInfo(URL url) Deprecated.getURLInfo(URL url, int timeout) Deprecated.booleanisReachable(URL url) Deprecated.Please prefer getURLInfo when several infos are needed.booleanisReachable(URL url, int timeout) Deprecated.Please prefer getURLInfo when several infos are needed.openStream(URL url) Deprecated.voidsetRequestMethod(int requestMethod) Deprecated.voidupload(File src, URL dest, CopyProgressListener l) Deprecated.
-
Field Details
-
REQUEST_METHOD_GET
static final int REQUEST_METHOD_GETDeprecated.Using the slower REQUEST method for getting the basic URL infos. Use this when getting errors behind a problematic/special proxy or firewall chain.- See Also:
-
REQUEST_METHOD_HEAD
static final int REQUEST_METHOD_HEADDeprecated.Using the faster HEAD method for getting the basic URL infos. Works for most common networks.- See Also:
-
UNAVAILABLE
Deprecated.
-
-
Method Details
-
isReachable
Deprecated.Please prefer getURLInfo when several infos are needed.- Parameters:
url- the url to check- Returns:
- true if the target is reachable
-
isReachable
Deprecated.Please prefer getURLInfo when several infos are needed.- Parameters:
url- the url to checktimeout- the timeout in milliseconds- Returns:
- true if the target is reachable
-
getContentLength
Deprecated.Please prefer getURLInfo when several infos are needed.- Parameters:
url- the url to check- Returns:
- the length of the target if the given url is reachable, 0 otherwise. No error code in case of http urls.
-
getContentLength
Deprecated.- Parameters:
url- the url to checktimeout- the maximum time before considering an url is not reachable a timeout of zero indicates no timeout- Returns:
- the length of the target if the given url is reachable, 0 otherwise. No error code in case of http urls.
-
getLastModified
Deprecated.Please prefer getURLInfo when several infos are needed.- Parameters:
url- the url to check- Returns:
- last modified timestamp of the given url
-
getLastModified
Deprecated.Please prefer getURLInfo when several infos are needed.- Parameters:
url- the url to checktimeout- the timeout in milliseconds- Returns:
- last modified timestamp of the given url
-
getURLInfo
Deprecated.- Parameters:
url- The url from which information is retrieved.- Returns:
- The URLInfo extracted from the given url, or
UNAVAILABLEinstance when the url is not reachable.
-
getURLInfo
Deprecated.- Parameters:
url- The url from which information is retrieved.timeout- The timeout in milliseconds.- Returns:
- The URLInfo extracted from the given url, or
UNAVAILABLEwhen the url is not reachable, never null.
-
openStream
Deprecated.- Parameters:
url- ditto- Returns:
- InputStream
- Throws:
IOException- if something goes wrong
-
download
Deprecated.- Parameters:
src- URLdest- Filel- CopyProgressListener- Throws:
IOException- if something goes wrong
-
upload
Deprecated.- Parameters:
src- Filedest- URLl- CopyProgressListener- Throws:
IOException- if something goes wrong
-
setRequestMethod
void setRequestMethod(int requestMethod) Deprecated.
-
TimeoutConstrainedURLHandleris preferred in favour of this interface