Class BasicResource
- java.lang.Object
-
- org.apache.ivy.plugins.repository.BasicResource
-
-
Constructor Summary
Constructors Constructor Description BasicResource(java.lang.String name, boolean exists, long contentLength, long lastModified, boolean local)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resourceclone(java.lang.String cloneName)Clones this resource with a new resource with a different namebooleanexists()Determine if the resource is available.longgetContentLength()Get the resource sizelonggetLastModified()Get the date the resource was last modifiedjava.lang.StringgetName()Get the name of the resource.booleanisLocal()Is this resource local to this host, i.e. is it on the file system?java.io.InputStreamopenStream()Opens a stream on this resourcejava.lang.StringtoString()
-
-
-
Method Detail
-
clone
public Resource clone(java.lang.String cloneName)
Description copied from interface:ResourceClones this resource with a new resource with a different name
-
exists
public boolean exists()
Description copied from interface:ResourceDetermine if the resource is available. Note that this method only checks for availability, not for actual existence.
-
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.
-
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.
-
getName
public java.lang.String getName()
Description copied from interface:ResourceGet the name of the resource.
-
isLocal
public boolean isLocal()
Description copied from interface:ResourceIs this resource local to this host, i.e. is it on the file system?
-
openStream
public java.io.InputStream openStream() throws java.io.IOExceptionDescription copied from interface:ResourceOpens a stream on this resource- Specified by:
openStreamin interfaceResource- Returns:
- the opened input stream
- Throws:
java.io.IOException- if something goes wrong
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-