|
Forge - Shell API 1.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.forge.resources.AbstractResource<File>
org.jboss.forge.resources.FileResource<DirectoryResource>
org.jboss.forge.resources.DirectoryResource
public class DirectoryResource
A standard, build-in, resource for representing directories on the file-system.
| Field Summary |
|---|
| Fields inherited from class org.jboss.forge.resources.FileResource |
|---|
file, lastModification, scratch, scratchFile |
| Fields inherited from class org.jboss.forge.resources.AbstractResource |
|---|
flags, parent, resourceFactory |
| Constructor Summary | |
|---|---|
DirectoryResource(ResourceFactory factory,
File file)
|
|
| Method Summary | ||
|---|---|---|
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. |
|
|
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()
|
|
| Methods inherited from class org.jboss.forge.resources.FileResource |
|---|
createNewFile, delete, delete, deleteOnExit, exists, getResourceInputStream, getUnderlyingResourceObject, isDirectory, isStale, markUpToDate, mkdir, mkdirs, reify, renameTo, renameTo, setContents, setContents, setContents |
| Methods inherited from class org.jboss.forge.resources.AbstractResource |
|---|
getFlags, getFullyQualifiedName, getResourceFactory, hashCode, isFlagSet, listResources, listResources, setFlag, unsetFlag |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DirectoryResource(ResourceFactory factory,
File file)
| Method Detail |
|---|
protected List<Resource<?>> doListResources()
AbstractResource
doListResources 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 ResourceException
ResourceExceptionpublic DirectoryResource getOrCreateChildDirectory(String name)
public <E,T extends Resource<E>> T getChildOfType(Class<T> type,
String name)
throws ResourceException
ResourceException
ResourceExceptionpublic 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()
FileResource
getParent in interface Resource<File>getParent in class FileResource<DirectoryResource>public String getName()
Resource
getName in interface Resource<File>getName in class FileResource<DirectoryResource>public String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class AbstractResource<File>
|
Forge - Shell API 1.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||