Class VfsResource
- java.lang.Object
-
- org.apache.ivy.plugins.repository.vfs.VfsResource
-
-
Constructor Summary
Constructors Constructor Description VfsResource(java.lang.String vfsURI, org.apache.commons.vfs2.FileSystemManager fsManager)
-
Method Summary
All Methods Static 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()Flag indicating whether a resource is available for queryingjava.util.List<java.lang.String>getChildren()Get a list of direct descendants of the given resource.org.apache.commons.vfs2.FileContentgetContent()longgetContentLength()Get the size of the resourcelonggetLastModified()Get the last modification time of the resource.java.lang.StringgetName()Get the name of the resource.booleanisLocal()Is this resource local to this host, i.e. is it on the file system?static java.lang.Stringnormalize(java.lang.String vfsURI)The VFS FileName getURI method seems to have a bug in it where file: URIs will have 4 forward slashes instead of 3.java.io.InputStreamopenStream()Opens a stream on this resourcebooleanphysicallyExists()Return a flag indicating whether a provided VFS resource physically existsjava.lang.StringtoString()
-
-
-
Method Detail
-
getChildren
public java.util.List<java.lang.String> getChildren()
Get a list of direct descendants of the given resource. Note that attempts to get a list of children does not result in an error. Instead an error message is logged and an empty ArrayList returned.- Returns:
- A
ArrayListof VFSResources
-
getContent
public org.apache.commons.vfs2.FileContent getContent()
-
getName
public java.lang.String getName()
Get 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
-
normalize
public static java.lang.String normalize(java.lang.String vfsURI)
The VFS FileName getURI method seems to have a bug in it where file: URIs will have 4 forward slashes instead of 3.- Parameters:
vfsURI- ditto- Returns:
- a normalized String representing the VFS URI
-
getLastModified
public long getLastModified()
Get the last modification time of the resource.- Specified by:
getLastModifiedin interfaceResource- Returns:
- a
longindicating last modified time.
-
getContentLength
public long getContentLength()
Get the size of the resource- Specified by:
getContentLengthin interfaceResource- Returns:
- a
longrepresenting the size of the resource (in bytes).
-
exists
public boolean exists()
Flag indicating whether a resource is available for querying
-
physicallyExists
public boolean physicallyExists()
Return a flag indicating whether a provided VFS resource physically exists- Returns:
trueif the resource physically exists,falseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
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
-
-