public interface Resource<T>
| Modifier and Type | Method and Description |
|---|---|
Resource<T> |
createFrom(T file)
Create a new resource instance for the target resource reference of the type that this current resource is.
|
boolean |
delete()
Delete this resource, return true if successful, false if not.
|
boolean |
delete(boolean recursive)
Delete this resource, return true if successful, false if not.
|
boolean |
exists()
Return true if this
Resource exists, return false if not. |
Resource<?> |
getChild(String name)
Get a child of this resource.
|
Set<ResourceFlag> |
getFlags() |
String |
getFullyQualifiedName()
Return the fully qualified name of the resource (if applicable).
|
String |
getName()
Return the common name of the resource.
|
Resource<?> |
getParent()
Get the parent of the current resource.
|
ResourceFactory |
getResourceFactory()
Return the
ResourceFactory with which this Resource was created. |
InputStream |
getResourceInputStream()
Get the
InputStream represented by this Resource. |
T |
getUnderlyingResourceObject()
Get the underlying object represented by this
Resource |
boolean |
isFlagSet(ResourceFlag flag)
Return true if the given
ResourceFlag is set. |
List<Resource<?>> |
listResources()
Return a list of child resources of the current resource.
|
List<Resource<?>> |
listResources(ResourceFilter filter)
Return a list of child resources of the current resource matching the given
ResourceFilter. |
<R extends Resource<?>> |
reify(Class<R> type)
Ask this
Resource if it is actually a resource of the given type; if it is, return a new reference to the
resource as the given type, otherwise return null. |
void |
setFlag(ResourceFlag flag)
Set the given
ResourceFlag. |
void |
unsetFlag(ResourceFlag flag)
Unset the given
ResourceFlag. |
boolean delete()
throws UnsupportedOperationException
UnsupportedOperationException - if deleting is not supported by the underlying implementation.boolean delete(boolean recursive)
throws UnsupportedOperationException
recursive - if false and this resource both supports recursive deletion and contains children, deletion will
not occur; otherwise, if true, deletion will propagate to all child resources. Implementations may
choose simply to delegate to delete()UnsupportedOperationException - if deleting is not supported by the underlying implementation.String getName()
String getFullyQualifiedName()
Resource<?> getParent()
Resource<T> createFrom(T file)
file - The target reference to create the resource instance from.List<Resource<?>> listResources()
List<Resource<?>> listResources(ResourceFilter filter)
ResourceFilter.T getUnderlyingResourceObject()
ResourceInputStream getResourceInputStream()
InputStream represented by this Resource.Resource<?> getChild(String name)
void setFlag(ResourceFlag flag)
ResourceFlag.void unsetFlag(ResourceFlag flag)
ResourceFlag.boolean isFlagSet(ResourceFlag flag)
ResourceFlag is set.boolean exists()
Resource exists, return false if not.Set<ResourceFlag> getFlags()
<R extends Resource<?>> R reify(Class<R> type)
Resource if it is actually a resource of the given type; if it is, return a new reference to the
resource as the given type, otherwise return null.ResourceFactory getResourceFactory()
ResourceFactory with which this Resource was created. If no factory was used, return
null.Copyright © 2013 JBoss by Red Hat. All Rights Reserved.