Package org.apache.jackrabbit.core.fs
Class FileSystemResource
java.lang.Object
org.apache.jackrabbit.core.fs.FileSystemResource
A
FileSystemResource represents a resource (i.e. file) in a
FileSystem.-
Constructor Summary
ConstructorsConstructorDescriptionFileSystemResource(FileSystem fs, String path) Creates a newFileSystemResource -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Deletes this resource.voiddelete(boolean pruneEmptyParentDirs) Deletes this resource.booleanbooleanexists()Returns theFileSystemwhere this resource is located.getName()Returns the name of this resource.Returns the parent directory of this resource.getPath()Returns the path of this resource.inthashCode()Returns zero to satisfy the Object equals/hashCode contract.longlonglength()voidCreates the parent directory of this resource, including any necessary but nonexistent parent directories.voidspool(OutputStream out) Spools this resource to the given output stream.toString()Returns the path string of this resource.
-
Constructor Details
-
FileSystemResource
Creates a newFileSystemResource- Parameters:
fs- theFileSystemwhere the resource is locatedpath- the path of the resource in theFileSystem
-
-
Method Details
-
getFileSystem
Returns theFileSystemwhere this resource is located.- Returns:
- the
FileSystemwhere this resource is located.
-
getPath
Returns the path of this resource.- Returns:
- the path of this resource.
-
getParentDir
Returns the parent directory of this resource.- Returns:
- the parent directory.
-
getName
Returns the name of this resource.- Returns:
- the name.
-
makeParentDirs
Creates the parent directory of this resource, including any necessary but nonexistent parent directories.- Throws:
FileSystemException
-
delete
Deletes this resource. Same asdelete(boolean)called withfalse.- Throws:
FileSystemException- See Also:
-
delete
Deletes this resource.- Parameters:
pruneEmptyParentDirs- iftrue, empty parent folders will automatically be deleted- Throws:
FileSystemException- See Also:
-
exists
- Throws:
FileSystemException- See Also:
-
getInputStream
- Throws:
FileSystemException- See Also:
-
spool
Spools this resource to the given output stream.- Parameters:
out- output stream where to spool the resource- Throws:
FileSystemException- if the input stream for this resource could not be obtainedIOException- if an error occurs while while spooling- See Also:
-
getOutputStream
- Throws:
FileSystemException- See Also:
-
lastModified
- Throws:
FileSystemException- See Also:
-
length
- Throws:
FileSystemException- See Also:
-
toString
Returns the path string of this resource. This is just the string returned by themethod.getPath() -
equals
-
hashCode
public int hashCode()Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.
-