Class VcsBrowserDir
- java.lang.Object
-
- jetbrains.buildServer.vcs.browser.VcsBrowserDir
-
- All Implemented Interfaces:
Element
- Direct Known Subclasses:
RootVcsBrowserDir
public class VcsBrowserDir extends Object implements Element
- Author:
- dmitry.neverov
-
-
Field Summary
Fields Modifier and Type Field Description protected VcsWorkspaceAccessmyVcs
-
Constructor Summary
Constructors Constructor Description VcsBrowserDir(Browser browser, VcsWorkspaceAccess vcs, VcsFile vcsDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)BrowsergetBrowser()Iterable<Element>getChildren()Returns the ordered list of element's children.StringgetFullName()Returns the unique full name of the element (relative to the root).InputStreamgetInputStream()Returns the input stream of the element content.StringgetName()Returns the element's name.longgetSize()Returns the size of the element content.inthashCode()booleanisContentAvailable()Returns whether the content is available for the element.booleanisLeaf()Returns whether the element is a leaf, i.e.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.util.browser.Element
getLastModifiedTimestamp
-
-
-
-
Field Detail
-
myVcs
protected final VcsWorkspaceAccess myVcs
-
-
Constructor Detail
-
VcsBrowserDir
public VcsBrowserDir(@NotNull Browser browser, @NotNull VcsWorkspaceAccess vcs, @NotNull VcsFile vcsDir)
-
-
Method Detail
-
getName
@NotNull public String getName()
Description copied from interface:ElementReturns the element's name.
-
getFullName
@NotNull public String getFullName()
Description copied from interface:ElementReturns the unique full name of the element (relative to the root).- Specified by:
getFullNamein interfaceElement- Returns:
- full element name
-
isLeaf
public boolean isLeaf()
Description copied from interface:ElementReturns whether the element is a leaf, i.e. cannot have child nodes.
-
getChildren
public Iterable<Element> getChildren() throws BrowserException
Description copied from interface:ElementReturns the ordered list of element's children. Method should returnnullfor a leaf element, and a notnullinstance for other elements. List can be empty. All children's names are different.- Specified by:
getChildrenin interfaceElement- Returns:
- the list of children, or null
- Throws:
BrowserException- in case of an error
-
isContentAvailable
public boolean isContentAvailable()
Description copied from interface:ElementReturns 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:
isContentAvailablein interfaceElement- Returns:
- true iff the content is available
-
getInputStream
@NotNull public InputStream getInputStream() throws IllegalStateException, IOException, BrowserException
Description copied from interface:ElementReturns 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:
getInputStreamin interfaceElement- Returns:
- content input stream
- Throws:
IllegalStateException- if the content is not availableIOException- if the input cannot be provided due to I/O errorBrowserException- indicates a general error occurred during input stream opening
-
getSize
public long getSize()
Description copied from interface:ElementReturns 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.
-
getBrowser
@NotNull public Browser getBrowser()
- Specified by:
getBrowserin interfaceElement- Returns:
- browser created this element
-
-