Class FileResource
- java.lang.Object
-
- org.apache.ivy.plugins.repository.file.FileResource
-
-
Constructor Summary
Constructors Constructor Description FileResource(FileRepository repository, java.io.File f)
-
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 sizejava.io.FilegetFile()longgetLastModified()Get the date the resource was last modifiedjava.lang.StringgetName()Get the name of the resource.FileRepositorygetRepository()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()
-
-
-
Constructor Detail
-
FileResource
public FileResource(FileRepository repository, java.io.File f)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:ResourceGet the name of the resource.
-
clone
public Resource clone(java.lang.String cloneName)
Description copied from interface:ResourceClones this resource with a new resource with a different name
-
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
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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getFile
public java.io.File getFile()
-
getRepository
public FileRepository getRepository()
-
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
-
-