public interface FileResource<T extends FileResource<T>> extends Resource<File>
| Modifier and Type | Method and Description |
|---|---|
boolean |
createNewFile()
Create the file in the underlying resource system.
|
T |
createTempResource()
Create a temporary
FileResource |
void |
deleteOnExit()
Requests that the file or directory denoted by this resource be deleted when the virtual machine terminates.
|
DirectoryResource |
getParent()
A parent for a FileResource is always a DirectoryResource
|
long |
getSize()
Returns the size of the file denoted by this abstract pathname
|
boolean |
isDirectory()
Return true if this
FileResource exists and is actually a directory, otherwise return false; |
boolean |
isExecutable()
Returns if a file is executable
|
boolean |
isReadable()
Returns if a file is readable
|
boolean |
isStale()
Returns true if the underlying resource has been modified on the file system since it was initially loaded.
|
boolean |
isWritable()
Returns if a file is writable
|
void |
markUpToDate()
Re-read the last modified timestamp for this resource.
|
boolean |
mkdir()
Create a new single directory for this resource.
|
boolean |
mkdirs()
Create all directories required for this resource to exist.
|
boolean |
renameTo(FileResource<?> target)
Rename this
Resource to the given FileResource |
boolean |
renameTo(String pathspec)
Rename this
Resource to the given path. |
T |
setContents(char[] data)
Set the contents of this
FileResource to the given character array. |
T |
setContents(InputStream data)
Set the contents of this
FileResource to the contents of the given InputStream. |
T |
setContents(String data)
Set the contents of this
FileResource to the given String |
createFrom, delete, delete, exists, getChild, getFullyQualifiedName, getName, getResourceFactory, getResourceInputStream, getUnderlyingResourceObject, listResources, listResources, reifyboolean isDirectory()
FileResource exists and is actually a directory, otherwise return false;boolean isStale()
void markUpToDate()
boolean mkdir()
mkdirs()boolean mkdirs()
void deleteOnExit()
Once deletion has been requested, it is not possible to cancel the request. This method should therefore be used with care.
T setContents(String data)
FileResource to the given StringT setContents(char[] data)
FileResource to the given character array.T setContents(InputStream data)
FileResource to the contents of the given InputStream.boolean createNewFile()
T createTempResource()
FileResourceboolean renameTo(FileResource<?> target)
Resource to the given FileResourcelong getSize()
boolean isWritable()
boolean isReadable()
boolean isExecutable()
DirectoryResource getParent()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.