Package com.wavemaker.commons.io
Class AbstractResources<T extends Resource>
- java.lang.Object
-
- com.wavemaker.commons.io.AbstractResources<T>
-
- All Implemented Interfaces:
Resources<T>,java.lang.Iterable<T>
- Direct Known Subclasses:
FilteredResources,ResourcesCollection
public abstract class AbstractResources<T extends Resource> extends java.lang.Object implements Resources<T>
Abstract base forResourcesimplementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractResources()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resources<T>copyTo(Folder folder)Recursively copy this resource to the specified folder.voiddelete()Delete the current resource (and any children).Resources<T>exclude(ResourceFilter... filters)Return a newResourcesinstance removing items that match any of the specified filters.java.util.List<T>fetchAll()Fetch allResources from this collection and return the result as aList.Resources<File>files()Resources<Folder>folders()Return a newResourcesinstance containing onlyFolderss from this collection.protected ResourceFilterContextgetResourceFilterContext()Resources<T>include(ResourceFilter... filters)Return a newResourcesinstance containing items that match any of the specified filters.Resources<T>moveTo(Folder folder)Move this resource to the specified folder.<OPERATION extends ResourceOperation<T>>
OPERATIONperformOperation(OPERATION operation)Perform the given operation with eachResourcein this collection.
-
-
-
Method Detail
-
getResourceFilterContext
protected final ResourceFilterContext getResourceFilterContext()
-
folders
public Resources<Folder> folders()
Description copied from interface:ResourcesReturn a newResourcesinstance containing onlyFolderss from this collection.
-
include
public Resources<T> include(ResourceFilter... filters)
Description copied from interface:ResourcesReturn a newResourcesinstance containing items that match any of the specified filters.
-
exclude
public Resources<T> exclude(ResourceFilter... filters)
Description copied from interface:ResourcesReturn a newResourcesinstance removing items that match any of the specified filters.
-
delete
public void delete()
Description copied from interface:ResourcesDelete the current resource (and any children). If this resource does not exist then no operation is performed.
-
performOperation
public <OPERATION extends ResourceOperation<T>> OPERATION performOperation(OPERATION operation)
Description copied from interface:ResourcesPerform the given operation with eachResourcein this collection.- Specified by:
performOperationin interfaceResources<T extends Resource>- Parameters:
operation- the operation to perform- Returns:
- the operation that was performed
-
-