public interface FileResource<T extends FileResource<T>> extends Resource<File>, WriteableResource<FileResource<T>,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.
|
long |
getLastModified()
Get the last modified time-stamp of this resource.
|
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
|
boolean |
mkdir()
Create a new single directory for this resource.
|
boolean |
mkdirs()
Create all directories required for this resource to exist.
|
ResourceMonitor |
monitor()
Monitors this FileResource
|
ResourceMonitor |
monitor(ResourceFilter filter)
Monitors this FileResource using the given filter
|
void |
refresh()
Re-read the file-system meta-data for this resource (such as last modified time-stamp, and permissions.)
|
boolean |
renameTo(FileResource<?> target)
Rename this
Resource to the given FileResource |
boolean |
renameTo(String pathspec)
Rename this
Resource to the given path. |
void |
setLastModified(long currentTimeMillis)
Set the last modified time-stamp of this resource.
|
getResourceOutputStream, setContents, setContents, setContents, setContents, setContents
createFrom, delete, delete, exists, getChild, getContents, getContents, getFullyQualifiedName, getName, getResourceFactory, getResourceInputStream, getUnderlyingResourceObject, listResources, listResources, reify, resolveChildren
getFacet, getFacets, getFacets, hasAllFacets, hasAllFacets, hasFacet, supports
boolean isDirectory()
true
if this FileResource
exists and is actually a directory, otherwise return false;boolean isStale()
true
if the underlying resource has been modified on the file system since it was initially
loaded.void refresh()
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.
boolean createNewFile()
T createTempResource()
FileResource
boolean renameTo(FileResource<?> target)
Resource
to the given FileResource
long getSize()
boolean isWritable()
boolean isReadable()
boolean isExecutable()
DirectoryResource getParent()
ResourceMonitor monitor()
ResourceMonitor monitor(ResourceFilter filter)
long getLastModified()
void setLastModified(long currentTimeMillis)
Copyright © 2015 JBoss by Red Hat. All rights reserved.