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 Resource
clone(java.lang.String cloneName)
Clones this resource with a new resource with a different nameboolean
exists()
Determine if the resource is available.long
getContentLength()
Get the resource sizelong
getLastModified()
Get the date the resource was last modifiedjava.lang.String
getName()
Get the name of the resource.boolean
isLocal()
Is this resource local to this host, i.e.java.io.InputStream
openStream()
Opens a stream on this resourcejava.lang.String
toString()
-
-
-
Method Detail
-
clone
public Resource clone(java.lang.String cloneName)
Description copied from interface:Resource
Clones this resource with a new resource with a different name
-
exists
public boolean exists()
Description copied from interface:Resource
Determine 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:Resource
Get the resource size- Specified by:
getContentLength
in interfaceResource
- Returns:
- a
long
value representing the size of the resource in bytes.
-
getLastModified
public long getLastModified()
Description copied from interface:Resource
Get the date the resource was last modified- Specified by:
getLastModified
in interfaceResource
- Returns:
- A
long
value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or0L
if the file does not exist or if an I/O error occurs.
-
getName
public java.lang.String getName()
Description copied from interface:Resource
Get the name of the resource.
-
isLocal
public boolean isLocal()
Description copied from interface:Resource
Is this resource local to this host, i.e. is it on the file system?
-
openStream
public java.io.InputStream openStream() throws java.io.IOException
Description copied from interface:Resource
Opens a stream on this resource- Specified by:
openStream
in interfaceResource
- Returns:
- the opened input stream
- Throws:
java.io.IOException
- if something goes wrong
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-