Class AbstractBuildArtifact<T extends BuildArtifactsBase>
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.AbstractBuildArtifact<T>
-
- All Implemented Interfaces:
BuildArtifact
,BuildArtifactInfo
- Direct Known Subclasses:
ExternalBuildArtifactFile
,ExternalBuildArtifactFolder
public abstract class AbstractBuildArtifact<T extends BuildArtifactsBase> extends Object implements BuildArtifact
- Author:
- vbedrosova
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBuildArtifact(T origin, String path, long size, boolean isFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Collection<BuildArtifact>
getChildren()
Returns sub items of the artifact.InputStream
getInputStream()
Creates input stream for this artifact.String
getName()
protected T
getOrigin()
String
getRelativePath()
long
getSize()
Computes artifact size.long
getTimestamp()
int
hashCode()
boolean
isArchive()
boolean
isContainer()
boolean
isDirectory()
boolean
isFile()
String
toString()
-
-
-
Method Detail
-
getOrigin
@NotNull protected T getOrigin()
-
getRelativePath
@NotNull public String getRelativePath()
- Specified by:
getRelativePath
in interfaceBuildArtifactInfo
- Returns:
- artifact relative path
-
getName
@NotNull public String getName()
- Specified by:
getName
in interfaceBuildArtifactInfo
- Returns:
- artifact file name
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectory
in interfaceBuildArtifact
- Returns:
- true if this artifact represents a directory
-
isArchive
public boolean isArchive()
- Specified by:
isArchive
in interfaceBuildArtifact
- Returns:
- true if this artifact is archive file (.zip, .jar, .tar.gz, etc.)
-
isFile
public boolean isFile()
- Specified by:
isFile
in interfaceBuildArtifact
- Returns:
- true if this artifact is regular file (may be archive at the same time)
-
isContainer
public boolean isContainer()
- Specified by:
isContainer
in interfaceBuildArtifact
- Returns:
- true if this artifact is directory or (archive if used BuildArtifactsViewMode with isViewArchivesContent == true)
-
getSize
public long getSize()
Description copied from interface:BuildArtifact
Computes artifact size. This method is not recursive.- Specified by:
getSize
in interfaceBuildArtifact
- Returns:
- artifact size for file or 0 otherwise
-
getTimestamp
public long getTimestamp()
- Specified by:
getTimestamp
in interfaceBuildArtifact
- Returns:
- artifact last modification timestamp
-
getInputStream
@NotNull public InputStream getInputStream() throws IOException
Description copied from interface:BuildArtifact
Creates input stream for this artifact. Client must close the stream at end Exception will be thrown if artifact does not contains content- Specified by:
getInputStream
in interfaceBuildArtifact
- Returns:
- file content or null
- Throws:
IOException
-
getChildren
@NotNull public Collection<BuildArtifact> getChildren()
Description copied from interface:BuildArtifact
Returns sub items of the artifact. Sub items is child artifacts if artifacts is directory. Or returns archive root's child if used BuildArtifactsViewMode with isViewArchivesContent==true- Specified by:
getChildren
in interfaceBuildArtifact
- Returns:
- see above
-
-