Package org.apache.commons.vfs2.impl
Class Resource
java.lang.Object
org.apache.commons.vfs2.impl.Resource
Helper class for VFSClassLoader. This represents a resource loaded with the classloader.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FileObject
private final String
private final FileObject
private final FileObject
-
Constructor Summary
ConstructorsConstructorDescriptionResource
(String name, FileObject root, FileObject resource) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBytes()
Returns the data for this resource as a byte array.Returns the code source as an URL.Returns the FileObject of the resource.getPackageAttribute
(Attributes.Name attrName) Returns an attribute of the package containing the resource.Returns the folder for the package containing the resource.Returns the name of the package containing the resource.getURL()
Returns the URL of the resource.
-
Field Details
-
root
-
resource
-
packageFolder
-
packageName
-
-
Constructor Details
-
Resource
Creates a new instance.- Parameters:
root
- The code source FileObject.resource
- The resource of the FileObject.- Throws:
FileSystemException
-
-
Method Details
-
getURL
Returns the URL of the resource.- Throws:
FileSystemException
-
getPackageName
Returns the name of the package containing the resource. -
getPackageAttribute
Returns an attribute of the package containing the resource.- Throws:
FileSystemException
-
getPackageFolder
Returns the folder for the package containing the resource. -
getFileObject
Returns the FileObject of the resource. -
getCodeSourceURL
Returns the code source as an URL.- Throws:
FileSystemException
-
getBytes
Returns the data for this resource as a byte array.- Throws:
IOException
-