Package org.apache.ivy.util.url
Class HttpClientHandler
- java.lang.Object
-
- org.apache.ivy.util.url.AbstractURLHandler
-
- org.apache.ivy.util.url.HttpClientHandler
-
- All Implemented Interfaces:
URLHandler
public class HttpClientHandler extends AbstractURLHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHttpClientHandler.HttpClientHelper-
Nested classes/interfaces inherited from interface org.apache.ivy.util.url.URLHandler
URLHandler.URLInfo
-
-
Field Summary
-
Fields inherited from interface org.apache.ivy.util.url.URLHandler
REQUEST_METHOD_GET, REQUEST_METHOD_HEAD, UNAVAILABLE
-
-
Constructor Summary
Constructors Constructor Description HttpClientHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddownload(java.net.URL src, java.io.File dest, CopyProgressListener l)intgetHttpClientMajorVersion()URLHandler.URLInfogetURLInfo(java.net.URL url)Returns the URLInfo of the given url or aURLHandler.UNAVAILABLEinstance, if the url is not reachable.URLHandler.URLInfogetURLInfo(java.net.URL url, int timeout)never returns null, return UNAVAILABLE when url is not reachablejava.io.InputStreamopenStream(java.net.URL url)voidupload(java.io.File src, java.net.URL dest, CopyProgressListener l)-
Methods inherited from class org.apache.ivy.util.url.AbstractURLHandler
getContentLength, getContentLength, getDecodingInputStream, getLastModified, getLastModified, getRequestMethod, getUserAgent, isReachable, isReachable, normalizeToString, normalizeToURL, setRequestMethod, validatePutStatusCode
-
-
-
-
Method Detail
-
openStream
public java.io.InputStream openStream(java.net.URL url) throws java.io.IOException- Throws:
java.io.IOException
-
download
public void download(java.net.URL src, java.io.File dest, CopyProgressListener l) throws java.io.IOException- Throws:
java.io.IOException
-
upload
public void upload(java.io.File src, java.net.URL dest, CopyProgressListener l) throws java.io.IOException- Throws:
java.io.IOException
-
getURLInfo
public URLHandler.URLInfo getURLInfo(java.net.URL url)
Description copied from interface:URLHandlerReturns the URLInfo of the given url or aURLHandler.UNAVAILABLEinstance, if the url is not reachable.- Parameters:
url- The url from which information is retrieved.- Returns:
- The URLInfo extracted from the given url, or
URLHandler.UNAVAILABLEwhen the url is not available.
-
getURLInfo
public URLHandler.URLInfo getURLInfo(java.net.URL url, int timeout)
Description copied from interface:URLHandlernever returns null, return UNAVAILABLE when url is not reachable- Parameters:
url- The url from which information is retrieved.timeout- The timeout in milliseconds.- Returns:
- The URLInfo extracted from the given url, or
URLHandler.UNAVAILABLEwhen the url is not available.
-
getHttpClientMajorVersion
public int getHttpClientMajorVersion()
-
-