Forge - Resource Addon API 2.0.0.Alpha3

org.jboss.forge.resource
Interface DirectoryResource

All Superinterfaces:
org.jboss.forge.facets.Faceted<ResourceFacet>, FileResource<DirectoryResource>, Resource<File>

public interface DirectoryResource
extends FileResource<DirectoryResource>

A standard, build-in, resource for representing directories on the file-system.

Author:
Mike Brock, Lincoln Baxter, III

Method Summary
 DirectoryResource getChildDirectory(String name)
          Obtain a reference to the child DirectoryResource.
<E,T extends Resource<E>>
T
getChildOfType(Class<T> type, String name)
          Using the given type, obtain a reference to the child resource of the given type.
 DirectoryResource getOrCreateChildDirectory(String name)
          Obtain a reference to the child DirectoryResource.
 
Methods inherited from interface org.jboss.forge.resource.FileResource
createNewFile, createTempResource, deleteOnExit, getSize, isDirectory, isExecutable, isReadable, isStale, isWritable, markUpToDate, mkdir, mkdirs, renameTo, renameTo, setContents, setContents, setContents
 
Methods inherited from interface org.jboss.forge.resource.Resource
createFrom, delete, delete, exists, getChild, getFullyQualifiedName, getName, getParent, getResourceFactory, getResourceInputStream, getUnderlyingResourceObject, listResources, listResources, reify
 
Methods inherited from interface org.jboss.forge.facets.Faceted
getFacet, getFacets, getFacets, hasAllFacets, hasAllFacets, hasFacet, install, supports, uninstall
 

Method Detail

getChildDirectory

DirectoryResource getChildDirectory(String name)
                                    throws ResourceException
Obtain a reference to the child DirectoryResource. If that resource does not exist, return a new instance. If the resource exists and is not a DirectoryResource, throw ResourceException

Throws:
ResourceException

getOrCreateChildDirectory

DirectoryResource getOrCreateChildDirectory(String name)
Obtain a reference to the child DirectoryResource. If that resource does not exist, return a new instance and attempt to create the a directory of the given name. If the resource exists and is not a DirectoryResource, throw ResourceException


getChildOfType

<E,T extends Resource<E>> T getChildOfType(Class<T> type,
                                           String name)
                                     throws ResourceException
Using the given type, obtain a reference to the child resource of the given type. If the result is not of the requested type and does not exist, return null. If the result is not of the requested type and exists, throw ResourceException

Throws:
ResourceException

Forge - Resource Addon API 2.0.0.Alpha3

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.