Class BuildArtifactImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.artifacts.BuildArtifactImpl
-
- All Implemented Interfaces:
BuildArtifact
,BuildArtifactInfo
,InternalBuildArtifact
public final class BuildArtifactImpl extends Object implements InternalBuildArtifact
- Author:
- Eugene Petrenko (eugene.petrenko@gmail.com) Date: 14.04.11 18:06
-
-
Constructor Summary
Constructors Constructor Description BuildArtifactImpl(BuildArtifactsImpl host, File file, String relativePath)
-
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.File
getFile()
Returns the underlying file.InputStream
getInputStream()
Creates input stream for this artifact.String
getName()
String
getRelativePath()
long
getSize()
Computes artifact size.long
getTimestamp()
boolean
hasChildren()
int
hashCode()
boolean
isArchive()
boolean
isContainer()
boolean
isDirectory()
boolean
isFile()
String
toString()
-
-
-
Constructor Detail
-
BuildArtifactImpl
public BuildArtifactImpl(@NotNull BuildArtifactsImpl host, @NotNull File file, @NotNull String relativePath)
-
-
Method Detail
-
getFile
@NotNull public File getFile()
Returns the underlying file.
- Specified by:
getFile
in interfaceInternalBuildArtifact
- Returns:
- the underlying file.
- See Also:
InternalBuildArtifact.getFile()
-
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
-
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
-
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.)
-
isContainer
public boolean isContainer()
- Specified by:
isContainer
in interfaceBuildArtifact
- Returns:
- true if this artifact is directory or (archive if used BuildArtifactsViewMode with isViewArchivesContent == true)
-
isFile
public boolean isFile()
- Specified by:
isFile
in interfaceBuildArtifact
- Returns:
- true if this artifact is regular file (may be archive at the same time)
-
hasChildren
public boolean hasChildren()
-
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
-
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
-
-