Class VfsResource
java.lang.Object
org.apache.ivy.plugins.repository.vfs.VfsResource
- All Implemented Interfaces:
Resource
VFS implementation of the Resource interface
-
Constructor Summary
ConstructorDescriptionVfsResource
(String vfsURI, org.apache.commons.vfs2.FileSystemManager fsManager) -
Method Summary
Modifier and TypeMethodDescriptionClones this resource with a new resource with a different nameboolean
exists()
Flag indicating whether a resource is available for queryingGet a list of direct descendants of the given resource.org.apache.commons.vfs2.FileContent
long
Get the size of the resourcelong
Get the last modification time of the resource.getName()
Get the name of the resource.boolean
isLocal()
Is this resource local to this host, i.e.static String
The VFS FileName getURI method seems to have a bug in it where file: URIs will have 4 forward slashes instead of 3.Opens a stream on this resourceboolean
Return a flag indicating whether a provided VFS resource physically existstoString()
-
Constructor Details
-
VfsResource
-
-
Method Details
-
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
ArrayList
of VFSResources
-
getContent
public org.apache.commons.vfs2.FileContent getContent() -
getName
Get the name of the resource. -
clone
Description copied from interface:Resource
Clones this resource with a new resource with a different name -
normalize
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:
getLastModified
in interfaceResource
- Returns:
- a
long
indicating last modified time.
-
getContentLength
public long getContentLength()Get the size of the resource- Specified by:
getContentLength
in interfaceResource
- Returns:
- a
long
representing 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:
true
if the resource physically exists,false
otherwise.
-
toString
-
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
Description copied from interface:Resource
Opens a stream on this resource- Specified by:
openStream
in interfaceResource
- Returns:
- the opened input stream
- Throws:
IOException
- if something goes wrong
-