Interface Resources<T extends Resource>

    • Method Detail

      • getSource

        Folder getSource()
        Returns the source of the resources. Items in this collection will be moved or copied relative to the source. For example, if this object contains the files '/a/b/c.txt' and '/d/e/f.txt' and the source is '/d' copy to '/x/ will result in '/x/b/c.txt' and 'x/e/f.txt'.
        Returns:
        the source for the resources
      • folders

        Resources<Folder> folders()
        Return a new Resources instance containing only Folderss from this collection.
        Returns:
        the folders
      • include

        Resources<T> include​(ResourceFilter... filters)
        Return a new Resources instance containing items that match any of the specified filters.
        Parameters:
        filters - the include filters
        Returns:
        filtered Resources
      • exclude

        Resources<T> exclude​(ResourceFilter... filters)
        Return a new Resources instance removing items that match any of the specified filters.
        Parameters:
        filters - the exclude filters
        Returns:
        filtered Resources
      • delete

        void delete()
        Delete the current resource (and any children). If this resource does not exist then no operation is performed.
      • moveTo

        Resources<T> moveTo​(Folder folder)
        Move this resource to the specified folder. Any duplicate Files will be replaced (existing Folder resources will be merged). If the resource does not exist no operation is performed.
        Parameters:
        folder - the folder to move the resource to
        Returns:
        a resource collection containing the new destination resources
        Throws:
        ResourceDoesNotExistException - if this resource no longer exists
      • copyTo

        Resources<T> copyTo​(Folder folder)
        Recursively copy this resource to the specified folder. Any duplicate Files will be replaced (existing Folder resources will be merged). If the resource does not exist no operation is performed.
        Parameters:
        folder - the folder to copy the resource to
        Returns:
        a resource collection containing the new destination resources
        Throws:
        ResourceDoesNotExistException - if this resource no longer exists
      • performOperation

        <O extends ResourceOperation<T>> O performOperation​(O operation)
        Perform the given operation with each Resource in this collection.
        Parameters:
        operation - the operation to perform
        Returns:
        the operation that was performed
      • fetchAll

        java.util.List<T> fetchAll()
        Fetch all Resources from this collection and return the result as a List. This will trigger iteration over each element.
        Returns:
        a List of all Resources in this collection.