Package com.swoval.files
Interface DirectoryDataView<T>
-
- All Superinterfaces:
java.lang.AutoCloseable,DirectoryView,FileTreeDataView<T>,FileTreeView
public interface DirectoryDataView<T> extends FileTreeDataView<T>, DirectoryView
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileTreeDataViews.Entry<T>getEntry()Returns the cache entry associated with the directory returned byDirectoryView.getTypedPath()}.java.util.List<TypedPath>list(int maxDepth, Filter<? super TypedPath> filter)List all of the files for thepath, returning only those files that are accepted by the provided filter.java.util.List<TypedPath>list(java.nio.file.Path path, int maxDepth, Filter<? super TypedPath> filter)List all of the files for thepath, returning only those files that are accepted by the provided filter.java.util.List<FileTreeDataViews.Entry<T>>listEntries(int maxDepth, Filter<? super FileTreeDataViews.Entry<T>> filter)List all of the files for thepath</code> that are accepted by the <code>filter.java.util.List<FileTreeDataViews.Entry<T>>listEntries(java.nio.file.Path path, int maxDepth, Filter<? super FileTreeDataViews.Entry<T>> filter)List all of the files for thepath</code> that are accepted by the <code>filter.-
Methods inherited from interface com.swoval.files.DirectoryView
getMaxDepth, getPath, getTypedPath
-
-
-
-
Method Detail
-
getEntry
FileTreeDataViews.Entry<T> getEntry()
Returns the cache entry associated with the directory returned byDirectoryView.getTypedPath()}.- Returns:
- the cache entry.
-
listEntries
java.util.List<FileTreeDataViews.Entry<T>> listEntries(int maxDepth, Filter<? super FileTreeDataViews.Entry<T>> filter) throws java.io.IOException
List all of the files for thepath</code> that are accepted by the <code>filter.- Parameters:
maxDepth- the maximum depth of subdirectories to returnfilter- include only paths accepted by this- Returns:
- a List of Entry instances accepted by the filter. The list will be empty if the path is not a subdirectory of this CachedDirectory or if it is a subdirectory, but the CachedDirectory was created without the recursive flag.
- Throws:
java.io.IOException- if the path cannot be listed.
-
list
java.util.List<TypedPath> list(int maxDepth, Filter<? super TypedPath> filter) throws java.io.IOException
List all of the files for thepath, returning only those files that are accepted by the provided filter.- Specified by:
listin interfaceDirectoryView- Parameters:
maxDepth- the maximum depth of subdirectories to queryfilter- include only paths accepted by the filter- Returns:
- a List of
Pathinstances accepted by the filter. - Throws:
java.io.IOException- if the path cannot be listed.
-
listEntries
java.util.List<FileTreeDataViews.Entry<T>> listEntries(java.nio.file.Path path, int maxDepth, Filter<? super FileTreeDataViews.Entry<T>> filter) throws java.io.IOException
List all of the files for thepath</code> that are accepted by the <code>filter.- Specified by:
listEntriesin interfaceFileTreeDataView<T>- Parameters:
path- the path to list. If this is a file, returns a list containing the Entry for the file or an empty list if the file is not monitored by the path.maxDepth- the maximum depth of subdirectories to returnfilter- include only paths accepted by this- Returns:
- a List of Entry instances accepted by the filter. The list will be empty if the path is not a subdirectory of this CachedDirectory or if it is a subdirectory, but the CachedDirectory was created without the recursive flag.
- Throws:
java.io.IOException- if the path cannot be listed.
-
list
java.util.List<TypedPath> list(java.nio.file.Path path, int maxDepth, Filter<? super TypedPath> filter) throws java.io.IOException
List all of the files for thepath, returning only those files that are accepted by the provided filter.- Specified by:
listin interfaceFileTreeDataView<T>- Specified by:
listin interfaceFileTreeView- Parameters:
path- the root path to listmaxDepth- the maximum depth of subdirectories to queryfilter- include only paths accepted by the filter- Returns:
- a List of
Pathinstances accepted by the filter. - Throws:
java.io.IOException- if the path cannot be listed.
-
-