Class URLResource
java.lang.Object
org.apache.ivy.plugins.repository.url.URLResource
- All Implemented Interfaces:
LocalizableResource, Resource
-
Constructor Summary
ConstructorsConstructorDescriptionURLResource(URL url) URLResource(URL url, TimeoutConstraint timeoutConstraint) -
Method Summary
Modifier and TypeMethodDescriptionClones this resource with a new resource with a different namebooleanexists()Determine if the resource is available.longGet the resource sizegetFile()longGet the date the resource was last modifiedgetName()Get the name of the resource.getURL()booleanisLocal()Is this resource local to this host, i.e.Opens a stream on this resourcetoString()
-
Constructor Details
-
URLResource
-
URLResource
-
-
Method Details
-
getName
-
clone
-
getLastModified
public long getLastModified()Description copied from interface:ResourceGet the date the resource was last modified- Specified by:
getLastModifiedin interfaceResource- Returns:
- A
longvalue representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or0Lif the file does not exist or if an I/O error occurs.
-
getContentLength
public long getContentLength()Description copied from interface:ResourceGet the resource size- Specified by:
getContentLengthin interfaceResource- Returns:
- a
longvalue representing the size of the resource in bytes.
-
exists
-
getURL
-
toString
-
isLocal
-
openStream
Description copied from interface:ResourceOpens a stream on this resource- Specified by:
openStreamin interfaceResource- Returns:
- the opened input stream
- Throws:
IOException- if something goes wrong
-
getFile
- Specified by:
getFilein interfaceLocalizableResource- Returns:
- the local file of this resource.
-