public static class FileSystemBrowser.DirectoryElement extends FileSystemBrowser.FileElement
| Constructor and Description |
|---|
DirectoryElement(Browser browser,
java.io.File file,
java.io.File root) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<Element> |
getChildren()
Returns the ordered list of element's children.
|
java.io.InputStream |
getInputStream()
Returns the input stream of the element content.
|
long |
getSize()
Returns the size of the element content.
|
boolean |
isContentAvailable()
Returns whether the content is available for the element.
|
boolean |
isLeaf()
Returns whether the element is a leaf, i.e.
|
equals, getBrowser, getFile, getFullName, getName, hashCode, toStringpublic DirectoryElement(@NotNull
Browser browser,
@NotNull
java.io.File file,
@NotNull
java.io.File root)
public boolean isLeaf()
ElementisLeaf in interface ElementisLeaf in class FileSystemBrowser.FileElementpublic java.lang.Iterable<Element> getChildren() throws BrowserException
Elementnull for a leaf element, and a
not null instance for other elements.
List can be empty. All children's names are different.getChildren in interface ElementgetChildren in class FileSystemBrowser.FileElementBrowserException - in case of an errorpublic boolean isContentAvailable()
ElementgetInputStream() method will result in exception.isContentAvailable in interface ElementisContentAvailable in class FileSystemBrowser.FileElement@NotNull
public java.io.InputStream getInputStream()
throws java.lang.IllegalStateException,
java.io.IOException
Element
If the content is not available for the element (see Element.isContentAvailable()), an exception is thrown.
getInputStream in interface ElementgetInputStream in class FileSystemBrowser.FileElementjava.lang.IllegalStateException - if the content is not availablejava.io.IOException - if the input cannot be provided due to I/O errorpublic long getSize()
throws java.lang.IllegalStateException
Element
If the content is not available for the element (see Element.isContentAvailable()) or due to performance reasons a negative value may be returned.
Though some implementations can provide the content size, while the content is not available.
getSize in interface ElementgetSize in class FileSystemBrowser.FileElementjava.lang.IllegalStateException