public class FileSystemResource
extends java.lang.Object
FileSystemResource
represents a resource (i.e. file) in a
FileSystem
.Constructor and Description |
---|
FileSystemResource(FileSystem fs,
java.lang.String path)
Creates a new
FileSystemResource |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes this resource.
|
void |
delete(boolean pruneEmptyParentDirs)
Deletes this resource.
|
boolean |
equals(java.lang.Object obj) |
boolean |
exists() |
FileSystem |
getFileSystem()
Returns the
FileSystem where this resource is located. |
java.io.InputStream |
getInputStream() |
java.lang.String |
getName()
Returns the name of this resource.
|
java.io.OutputStream |
getOutputStream() |
java.lang.String |
getParentDir()
Returns the parent directory of this resource.
|
java.lang.String |
getPath()
Returns the path of this resource.
|
int |
hashCode()
Returns zero to satisfy the Object equals/hashCode contract.
|
long |
lastModified() |
long |
length() |
void |
makeParentDirs()
Creates the parent directory of this resource, including any necessary
but nonexistent parent directories.
|
void |
spool(java.io.OutputStream out)
Spools this resource to the given output stream.
|
java.lang.String |
toString()
Returns the path string of this resource.
|
public FileSystemResource(FileSystem fs, java.lang.String path)
FileSystemResource
fs
- the FileSystem
where the resource is locatedpath
- the path of the resource in the FileSystem
public FileSystem getFileSystem()
FileSystem
where this resource is located.FileSystem
where this resource is located.public java.lang.String getPath()
public java.lang.String getParentDir()
public java.lang.String getName()
public void makeParentDirs() throws FileSystemException
FileSystemException
public void delete() throws FileSystemException
delete(boolean)
called with false
.FileSystemException
FileSystem.deleteFile(java.lang.String)
public void delete(boolean pruneEmptyParentDirs) throws FileSystemException
pruneEmptyParentDirs
- if true
, empty parent folders will
automatically be deletedFileSystemException
FileSystem.deleteFile(java.lang.String)
public boolean exists() throws FileSystemException
FileSystemException
FileSystem.exists(java.lang.String)
public java.io.InputStream getInputStream() throws FileSystemException
FileSystemException
FileSystem.getInputStream(java.lang.String)
public void spool(java.io.OutputStream out) throws FileSystemException, java.io.IOException
out
- output stream where to spool the resourceFileSystemException
- if the input stream for this resource could
not be obtainedjava.io.IOException
- if an error occurs while while spoolingFileSystem.getInputStream(java.lang.String)
public java.io.OutputStream getOutputStream() throws FileSystemException
FileSystemException
FileSystem.getOutputStream(java.lang.String)
public long lastModified() throws FileSystemException
FileSystemException
FileSystem.lastModified(java.lang.String)
public long length() throws FileSystemException
FileSystemException
FileSystem.length(java.lang.String)
public java.lang.String toString()
getPath()
method.toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"