| org.apache.ivy.util.url.URLHandler
All known Subclasses: org.apache.ivy.util.url.AbstractURLHandler, org.apache.ivy.util.url.URLHandlerDispatcher,
URLHandler | public interface URLHandler (Code) | | This interface is responsible for handling some URL manipulation (stream opening, downloading,
check reachability, ...).
|
Inner Class :public static class URLInfo | |
Method Summary | |
public void | download(URL src, File dest, CopyProgressListener l) | public long | getContentLength(URL url) Returns the length of the target if the given url is reachable, and without error code in
case of http urls. | public long | getContentLength(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. | public long | getLastModified(URL url) Please prefer getURLInfo when several infos are needed. | public long | getLastModified(URL url, int timeout) Please prefer getURLInfo when several infos are needed. | public URLInfo | getURLInfo(URL url) Returns the URLInfo of the given url or a
URLHandler.UNAVAILABLE instance,
if the url is not reachable.
Parameters: url - The url from which information is retrieved. | public URLInfo | getURLInfo(URL url, int timeout) never returns null, return UNAVAILABLE when url is not reachable
Parameters: url - The url from which information is retrieved. Parameters: timeout - The timeout in milliseconds. | public boolean | isReachable(URL url) Please prefer getURLInfo when several infos are needed. | public boolean | isReachable(URL url, int timeout) Please prefer getURLInfo when several infos are needed. | public InputStream | openStream(URL url) |
UNAVAILABLE | final public static URLInfo UNAVAILABLE(Code) | | |
getContentLength | public long getContentLength(URL url)(Code) | | Returns the length of the target if the given url is reachable, and without error code in
case of http urls. Please prefer getURLInfo when several infos are needed.
Parameters: url - the url to check the length of the target if available, 0 if not reachable |
getContentLength | public long getContentLength(URL url, int timeout)(Code) | | Returns the length of the target if the given url is reachable, and without error code in
case of http urls.
Parameters: url - the url to check Parameters: timeout - the maximum time before considering an url is not reachable a timeout of zeroindicates no timeout the length of the target if available, 0 if not reachable |
getLastModified | public long getLastModified(URL url)(Code) | | Please prefer getURLInfo when several infos are needed.
Parameters: url - the url to check last modified timestamp of the given url |
getLastModified | public long getLastModified(URL url, int timeout)(Code) | | Please prefer getURLInfo when several infos are needed.
Parameters: url - the url to check last modified timestamp of the given url |
getURLInfo | public URLInfo getURLInfo(URL url)(Code) | | Returns the URLInfo of the given url or a
URLHandler.UNAVAILABLE instance,
if the url is not reachable.
Parameters: url - The url from which information is retrieved. The URLInfo extracted from the given url, or URLHandler.UNAVAILABLE whenthe url is not available. |
getURLInfo | public URLInfo getURLInfo(URL url, int timeout)(Code) | | never returns null, return UNAVAILABLE when url is not reachable
Parameters: url - The url from which information is retrieved. Parameters: timeout - The timeout in milliseconds. The URLInfo extracted from the given url, or URLHandler.UNAVAILABLE whenthe url is not available. |
isReachable | public boolean isReachable(URL url)(Code) | | Please prefer getURLInfo when several infos are needed.
Parameters: url - the url to check true if the target is reachable |
isReachable | public boolean isReachable(URL url, int timeout)(Code) | | Please prefer getURLInfo when several infos are needed.
Parameters: url - the url to check true if the target is reachable |
|
|