Class AbstractURLHandler
java.lang.Object
org.apache.ivy.util.url.AbstractURLHandler
- All Implemented Interfaces:
URLHandler
- Direct Known Subclasses:
BasicURLHandler, HttpClientHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface URLHandler
URLHandler.URLInfo -
Field Summary
Fields inherited from interface URLHandler
REQUEST_METHOD_GET, REQUEST_METHOD_HEAD, UNAVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static TimeoutConstraintcreateTimeoutConstraints(int connectionTimeout) longgetContentLength(URL url) Please prefer getURLInfo when several infos are needed.longgetContentLength(URL url, int timeout) protected InputStreamgetDecodingInputStream(String encoding, InputStream in) longgetLastModified(URL url) Please prefer getURLInfo when several infos are needed.longgetLastModified(URL url, int timeout) Please prefer getURLInfo when several infos are needed.intprotected StringbooleanisReachable(URL url) Please prefer getURLInfo when several infos are needed.booleanisReachable(URL url, int timeout) Please prefer getURLInfo when several infos are needed.protected StringnormalizeToString(URL url) protected URLnormalizeToURL(URL url) voidsetRequestMethod(int requestMethod) protected voidvalidatePutStatusCode(URL dest, int statusCode, String statusMessage) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface URLHandler
download, getURLInfo, getURLInfo, openStream, upload
-
Constructor Details
-
AbstractURLHandler
public AbstractURLHandler()
-
-
Method Details
-
isReachable
Description copied from interface:URLHandlerPlease prefer getURLInfo when several infos are needed.- Specified by:
isReachablein interfaceURLHandler- Parameters:
url- the url to check- Returns:
- true if the target is reachable
-
isReachable
Description copied from interface:URLHandlerPlease prefer getURLInfo when several infos are needed.- Specified by:
isReachablein interfaceURLHandler- Parameters:
url- the url to checktimeout- the timeout in milliseconds- Returns:
- true if the target is reachable
-
getContentLength
Description copied from interface:URLHandlerPlease prefer getURLInfo when several infos are needed.- Specified by:
getContentLengthin interfaceURLHandler- 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
- Specified by:
getContentLengthin interfaceURLHandler- 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
Description copied from interface:URLHandlerPlease prefer getURLInfo when several infos are needed.- Specified by:
getLastModifiedin interfaceURLHandler- Parameters:
url- the url to check- Returns:
- last modified timestamp of the given url
-
getLastModified
Description copied from interface:URLHandlerPlease prefer getURLInfo when several infos are needed.- Specified by:
getLastModifiedin interfaceURLHandler- Parameters:
url- the url to checktimeout- the timeout in milliseconds- Returns:
- last modified timestamp of the given url
-
getUserAgent
-
validatePutStatusCode
protected void validatePutStatusCode(URL dest, int statusCode, String statusMessage) throws IOException - Throws:
IOException
-
setRequestMethod
public void setRequestMethod(int requestMethod) - Specified by:
setRequestMethodin interfaceURLHandler
-
getRequestMethod
public int getRequestMethod() -
normalizeToString
- Throws:
IOException
-
normalizeToURL
- Throws:
IOException
-
getDecodingInputStream
- Throws:
IOException
-
createTimeoutConstraints
-