public class TreeNode extends Object implements Serializable, Iterable
It contains an Result which represents the file this node points to.
Because this node itself can point to a directory, it also contains a List of #getChilds() childs).
The node can also optionally have a {@link #getContent() content}, which will return {@code null} if the node points to a directory.
This class also implements the {@link Iterable} interface making it suitable for use with componets such as {@code foreach} or {@code batch}. The methods in such interface are implemented by delegating into the {@link #getChilds()} list.
Instances are immutable and are to be created through a {@link Builder} instance.
| Modifier and Type | Class and Description |
|---|---|
static class |
TreeNode.Builder
Implementation of the buidler design pattern to create instances of
TreeNode |
| Modifier and Type | Method and Description |
|---|---|
FileAttributes |
getAttributes() |
List<TreeNode> |
getChilds() |
InputStream |
getContent() |
org.mule.runtime.api.metadata.MediaType |
getMediaType() |
Iterator |
iterator() |
Spliterator |
spliterator() |
public FileAttributes getAttributes()
FileAttributes object with the node's metadatapublic org.mule.runtime.api.metadata.MediaType getMediaType()
DataType with type metadata about the referenced nodepublic InputStream getContent()
InputStream if the node is a file, or null if it's a directorypublic Iterator iterator()
iterator in interface IterablegetChilds() Iteratorpublic Spliterator spliterator()
spliterator in interface IterablegetChilds() SpliteratorCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.