Package org.apache.ivy.util.url
Interface URLHandler
-
- All Known Subinterfaces:
TimeoutConstrainedURLHandler
- All Known Implementing Classes:
AbstractURLHandler,BasicURLHandler,HttpClientHandler,URLHandlerDispatcher
@Deprecated public interface URLHandlerDeprecated.Starting 2.5.0, theTimeoutConstrainedURLHandleris preferred in favour of this interfaceThis interface is responsible for handling some URL manipulation (stream opening, downloading, check reachability, ...).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classURLHandler.URLInfoDeprecated.
-
Field Summary
Fields Modifier and Type Field Description static intREQUEST_METHOD_GETDeprecated.Using the slower REQUEST method for getting the basic URL infos.static intREQUEST_METHOD_HEADDeprecated.Using the faster HEAD method for getting the basic URL infos.static URLHandler.URLInfoUNAVAILABLEDeprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddownload(java.net.URL src, java.io.File dest, CopyProgressListener l)Deprecated.longgetContentLength(java.net.URL url)Deprecated.Please prefer getURLInfo when several infos are needed.longgetContentLength(java.net.URL url, int timeout)Deprecated.longgetLastModified(java.net.URL url)Deprecated.Please prefer getURLInfo when several infos are needed.longgetLastModified(java.net.URL url, int timeout)Deprecated.Please prefer getURLInfo when several infos are needed.URLHandler.URLInfogetURLInfo(java.net.URL url)Deprecated.URLHandler.URLInfogetURLInfo(java.net.URL url, int timeout)Deprecated.booleanisReachable(java.net.URL url)Deprecated.Please prefer getURLInfo when several infos are needed.booleanisReachable(java.net.URL url, int timeout)Deprecated.Please prefer getURLInfo when several infos are needed.java.io.InputStreamopenStream(java.net.URL url)Deprecated.voidsetRequestMethod(int requestMethod)Deprecated.voidupload(java.io.File src, java.net.URL dest, CopyProgressListener l)Deprecated.
-
-
-
Field Detail
-
REQUEST_METHOD_GET
static final int REQUEST_METHOD_GET
Deprecated.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:
- Constant Field Values
-
REQUEST_METHOD_HEAD
static final int REQUEST_METHOD_HEAD
Deprecated.Using the faster HEAD method for getting the basic URL infos. Works for most common networks.- See Also:
- Constant Field Values
-
UNAVAILABLE
static final URLHandler.URLInfo UNAVAILABLE
Deprecated.
-
-
Method Detail
-
isReachable
boolean isReachable(java.net.URL url)
Deprecated.Please prefer getURLInfo when several infos are needed.- Parameters:
url- the url to check- Returns:
- true if the target is reachable
-
isReachable
boolean isReachable(java.net.URL url, int timeout)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
long getContentLength(java.net.URL url)
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
long getContentLength(java.net.URL url, int timeout)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
long getLastModified(java.net.URL url)
Deprecated.Please prefer getURLInfo when several infos are needed.- Parameters:
url- the url to check- Returns:
- last modified timestamp of the given url
-
getLastModified
long getLastModified(java.net.URL url, int timeout)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
URLHandler.URLInfo getURLInfo(java.net.URL url)
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
URLHandler.URLInfo getURLInfo(java.net.URL url, int timeout)
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
java.io.InputStream openStream(java.net.URL url) throws java.io.IOExceptionDeprecated.- Parameters:
url- ditto- Returns:
- InputStream
- Throws:
java.io.IOException- if something goes wrong
-
download
void download(java.net.URL src, java.io.File dest, CopyProgressListener l) throws java.io.IOExceptionDeprecated.- Parameters:
src- URLdest- Filel- CopyProgressListener- Throws:
java.io.IOException- if something goes wrong
-
upload
void upload(java.io.File src, java.net.URL dest, CopyProgressListener l) throws java.io.IOExceptionDeprecated.- Parameters:
src- Filedest- URLl- CopyProgressListener- Throws:
java.io.IOException- if something goes wrong
-
setRequestMethod
void setRequestMethod(int requestMethod)
Deprecated.
-
-