public class DirectoryResource extends FileResource<DirectoryResource>
file, lastModification, scratch, scratchFileflags, parent, resourceFactory| Constructor and Description |
|---|
DirectoryResource(ResourceFactory factory,
File file) |
| Modifier and Type | Method and Description |
|---|---|
DirectoryResource |
createFrom(File file)
Create a new
Resource instance for the target file. |
DirectoryResource |
createTempResource() |
protected List<Resource<?>> |
doListResources()
Strategy method for returning child resources.
|
boolean |
equals(Object obj) |
Resource<?> |
getChild(String name)
Obtain a reference to the child resource.
|
DirectoryResource |
getChildDirectory(String name)
Obtain a reference to the child
DirectoryResource. |
<E,T extends Resource<E>> |
getChildOfType(Class<T> type,
String name)
Using the given type, obtain a reference to the child resource of the given type.
|
String |
getName()
Return the common name of the resource.
|
DirectoryResource |
getOrCreateChildDirectory(String name) |
Resource<?> |
getParent()
Get the parent of the current resource.
|
String |
toString() |
createNewFile, delete, delete, deleteOnExit, exists, getFullyQualifiedName, getResourceInputStream, getUnderlyingResourceObject, isDirectory, isStale, markUpToDate, mkdir, mkdirs, reify, renameTo, renameTo, setContents, setContents, setContentsgetFlags, getResourceFactory, hashCode, isFlagSet, listResources, listResources, setFlag, unsetFlagpublic DirectoryResource(ResourceFactory factory, File file)
protected List<Resource<?>> doListResources()
AbstractResourcedoListResources in class AbstractResource<File>public Resource<?> getChild(String name)
getChild in interface Resource<File>getChild in class FileResource<DirectoryResource>public DirectoryResource getChildDirectory(String name) throws ResourceException
DirectoryResource. If that resource does not exist, return a new instance.
If the resource exists and is not a DirectoryResource, throw ResourceExceptionResourceExceptionpublic DirectoryResource getOrCreateChildDirectory(String name)
public <E,T extends Resource<E>> T getChildOfType(Class<T> type, String name) throws ResourceException
ResourceExceptionResourceExceptionpublic DirectoryResource createTempResource()
createTempResource in class FileResource<DirectoryResource>public DirectoryResource createFrom(File file)
FileResourceResource instance for the target file. The new Resource should be of the same type as
this.createFrom in interface Resource<File>createFrom in class FileResource<DirectoryResource>file - The file to create the resource instance from.public Resource<?> getParent()
FileResourcegetParent in interface Resource<File>getParent in class FileResource<DirectoryResource>public String getName()
ResourcegetName in interface Resource<File>getName in class FileResource<DirectoryResource>public boolean equals(Object obj)
equals in class AbstractResource<File>Copyright © 2013 JBoss by Red Hat. All Rights Reserved.