Class ArtifactElement
- java.lang.Object
-
- jetbrains.buildServer.web.artifacts.browser.ArtifactElement
-
- All Implemented Interfaces:
Element
,ZipElement
,ArtifactTreeElement
public class ArtifactElement extends Object implements ArtifactTreeElement
- Author:
- Vladislav.Rassokhin
-
-
Constructor Summary
Constructors Constructor Description ArtifactElement(BuildArtifact artifact)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Browser
getBrowser()
Iterable<Element>
getChildren()
Returns the ordered list of element's children.String
getFullName()
Returns the unique full name of the element (relative to the root).InputStream
getInputStream()
Returns the input stream of the element content.Long
getLastModified()
Returns element last modification time.String
getName()
Returns the element's name.long
getSize()
Returns the size of the element content.int
hashCode()
boolean
isArchive()
Returns whether this element is an archive, and can be expanded.boolean
isContentAvailable()
Returns whether the content is available for the element.boolean
isInsideArchive()
Returns whether this element is one inside an archive.boolean
isLeaf()
Returns whether the element is a leaf, i.e.String
toString()
-
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
-
-
-
-
Constructor Detail
-
ArtifactElement
public ArtifactElement(@NotNull BuildArtifact artifact)
-
-
Method Detail
-
getName
@NotNull public String getName()
Description copied from interface:Element
Returns the element's name.
-
getFullName
@NotNull public String getFullName()
Description copied from interface:Element
Returns the unique full name of the element (relative to the root).- Specified by:
getFullName
in interfaceElement
- Returns:
- full element name
-
isLeaf
public boolean isLeaf()
Description copied from interface:Element
Returns whether the element is a leaf, i.e. cannot have child nodes.
-
getChildren
public 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
- 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
- Returns:
- true iff the content is available
-
getInputStream
@NotNull public InputStream getInputStream() throws IllegalStateException, 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
- Returns:
- content input stream
- Throws:
IllegalStateException
- if the content is not availableIOException
- if the input cannot be provided due to I/O error
-
getSize
public long getSize()
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.
-
getBrowser
@NotNull public Browser getBrowser()
- Specified by:
getBrowser
in interfaceElement
- Returns:
- browser created this element
-
getLastModified
@Nullable public Long getLastModified()
Description copied from interface:ArtifactTreeElement
Returns element last modification time. May return null if the content is not available for the element (seeElement.isContentAvailable()
) or due to performance reasons.- Specified by:
getLastModified
in interfaceArtifactTreeElement
- Returns:
- see above
-
isArchive
public boolean isArchive()
Description copied from interface:ZipElement
Returns whether this element is an archive, and can be expanded.- Specified by:
isArchive
in interfaceZipElement
- Returns:
- whether this element is an archive, and can be expanded
-
isInsideArchive
public boolean isInsideArchive()
Description copied from interface:ZipElement
Returns whether this element is one inside an archive.- Specified by:
isInsideArchive
in interfaceZipElement
- Returns:
- whether this element is one inside an archive
-
-