Class FileSystemBrowser.DirectoryElement
- java.lang.Object
-
- jetbrains.buildServer.util.browser.FileSystemBrowser.FileElement
-
- jetbrains.buildServer.util.browser.FileSystemBrowser.DirectoryElement
-
- All Implemented Interfaces:
Element
- Enclosing class:
- FileSystemBrowser
public static class FileSystemBrowser.DirectoryElement extends FileSystemBrowser.FileElement
-
-
Constructor Summary
Constructors Constructor Description DirectoryElement(Browser browser, java.io.File file, java.io.File root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class jetbrains.buildServer.util.browser.FileSystemBrowser.FileElement
equals, getBrowser, getFile, getFullName, getLastModifiedTimestamp, getName, hashCode, toString
-
-
-
-
Constructor Detail
-
DirectoryElement
public DirectoryElement(@NotNull Browser browser, @NotNull java.io.File file, @NotNull java.io.File root)
-
-
Method Detail
-
isLeaf
public boolean isLeaf()
Description copied from interface:Element
Returns whether the element is a leaf, i.e. cannot have child nodes.- Specified by:
isLeaf
in interfaceElement
- Overrides:
isLeaf
in classFileSystemBrowser.FileElement
- Returns:
- true if the element is a leaf
-
getChildren
public java.lang.Iterable<Element> getChildren() throws BrowserException
Description copied from interface:Element
Returns the ordered list of element's children. Method should returnnull
for a leaf element, and a notnull
instance for other elements. List can be empty. All children's names are different.- Specified by:
getChildren
in interfaceElement
- Overrides:
getChildren
in classFileSystemBrowser.FileElement
- Returns:
- the list of children, or null
- Throws:
BrowserException
- in case of an error
-
isContentAvailable
public boolean isContentAvailable()
Description copied from interface:Element
Returns whether the content is available for the element. The content is usually available for leaf elements and not available for non-leaf ones. If it's not, the callgetInputStream()
method will result in exception.- Specified by:
isContentAvailable
in interfaceElement
- Overrides:
isContentAvailable
in classFileSystemBrowser.FileElement
- Returns:
- true iff the content is available
-
getInputStream
@NotNull public java.io.InputStream getInputStream() throws java.lang.IllegalStateException, java.io.IOException
Description copied from interface:Element
Returns the input stream of the element content. The caller is responsible for closing the stream at the end.If the content is not available for the element (see
Element.isContentAvailable()
), an exception is thrown.- Specified by:
getInputStream
in interfaceElement
- Overrides:
getInputStream
in classFileSystemBrowser.FileElement
- Returns:
- content input stream
- Throws:
java.lang.IllegalStateException
- if the content is not availablejava.io.IOException
- if the input cannot be provided due to I/O error
-
getSize
public long getSize() throws java.lang.IllegalStateException
Description copied from interface:Element
Returns the size of the element content.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.- Specified by:
getSize
in interfaceElement
- Overrides:
getSize
in classFileSystemBrowser.FileElement
- Returns:
- content size or negative value when unavailable
- Throws:
java.lang.IllegalStateException
-
-