Package com.gengoai.io.resource
Interface NonTraversableResource
-
- All Superinterfaces:
Resource
- All Known Implementing Classes:
ByteArrayResource
,EmptyResource
,InputStreamResource
,OutputStreamResource
,ReaderResource
,StdinResource
,StdoutResource
,StringResource
,WriterResource
public interface NonTraversableResource extends Resource
Defines a resources whose hierarchy is not traversable.- Author:
- David B. Bracewell
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.gengoai.io.resource.Resource
Resource.Deserializer
-
-
Field Summary
-
Fields inherited from interface com.gengoai.io.resource.Resource
ALL_FILE_PATTERN
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Iterator<Resource>
childIterator(boolean recursive)
Iterator over the childrendefault Iterator<Resource>
childIterator(String pattern, boolean recursive)
Iterator over the childrendefault Resource
getChild(String relativePath)
Creates a new Resource that is relative to this resource.default List<Resource>
getChildren()
Lists all the resources that are directly under this resource.default List<Resource>
getChildren(boolean recursive)
Lists all the resources that are directly under this resource.default List<Resource>
getChildren(String pattern)
Lists all the resources that are directly under this resource.default List<Resource>
getChildren(String pattern, boolean recursive)
Lists all the resources that are directly under this resource.default List<Resource>
getChildren(Pattern pattern, boolean recursive)
Lists all the resources that are directly under this resource.default Resource
getParent()
Gets parent.-
Methods inherited from interface com.gengoai.io.resource.Resource
append, append, asFile, asPath, asURI, asURL, baseName, canRead, canWrite, compressed, copy, delete, delete, deleteOnExit, descriptor, exists, forEach, getCharset, inputStream, isCompressed, isDirectory, lines, mkdir, mkdirs, outputStream, path, readBytes, reader, readLines, readObject, readToString, setCharset, setCompression, setIsCompressed, uncompressed, write, write, writeObject, writer
-
-
-
-
Method Detail
-
getChild
default Resource getChild(String relativePath)
Description copied from interface:Resource
Creates a new Resource that is relative to this resource.
-
childIterator
default Iterator<Resource> childIterator(String pattern, boolean recursive)
Description copied from interface:Resource
Iterator over the children- Specified by:
childIterator
in interfaceResource
- Parameters:
pattern
- The pattern to determine what files we wantrecursive
- should we iterator recursively?- Returns:
- An iterator over the children
-
getChildren
default List<Resource> getChildren()
Description copied from interface:Resource
Lists all the resources that are directly under this resource.
- Specified by:
getChildren
in interfaceResource
- Returns:
- A list of all the resources one level under this resource.
-
getChildren
default List<Resource> getChildren(Pattern pattern, boolean recursive)
Description copied from interface:Resource
Lists all the resources that are directly under this resource.
- Specified by:
getChildren
in interfaceResource
- Parameters:
pattern
- The file matching patternrecursive
- Gets all children recursively- Returns:
- A list of all the resources one level under this resource.
-
getChildren
default List<Resource> getChildren(String pattern)
Description copied from interface:Resource
Lists all the resources that are directly under this resource.
- Specified by:
getChildren
in interfaceResource
- Parameters:
pattern
- The file matching pattern- Returns:
- A list of all the resources one level under this resource.
-
getChildren
default List<Resource> getChildren(String pattern, boolean recursive)
Description copied from interface:Resource
Lists all the resources that are directly under this resource.
- Specified by:
getChildren
in interfaceResource
- Parameters:
pattern
- The file matching patternrecursive
- Gets all children recursively- Returns:
- A list of all the resources one level under this resource.
-
getChildren
default List<Resource> getChildren(boolean recursive)
Description copied from interface:Resource
Lists all the resources that are directly under this resource.
- Specified by:
getChildren
in interfaceResource
- Parameters:
recursive
- Gets all children recursively- Returns:
- A list of all the resources one level under this resource.
-
childIterator
default Iterator<Resource> childIterator(boolean recursive)
Description copied from interface:Resource
Iterator over the children- Specified by:
childIterator
in interfaceResource
- Parameters:
recursive
- should we iterator recursively?- Returns:
- An iterator over the children
-
-