Class ArtifactStreams
- java.lang.Object
-
- com.atlassian.bamboo.v2.build.agent.messages.ArtifactStreams
-
public class ArtifactStreams extends Object
Class used to handle serialising of files from directories into streams and deserialising them.
-
-
Field Summary
Fields Modifier and Type Field Description static Duration
TOO_LONG_PROCESSING_DURATION
-
Constructor Summary
Constructors Constructor Description ArtifactStreams()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull ArtifactUnpackResult
deserialiseStreamToDir(InputStream in, Path destination, com.atlassian.event.api.EventPublisher eventPublisher)
Deserialises an input stream into the supplied destination pathstatic @NotNull Stream<String>
iterateFilesAndDirs(Path rootDir)
Similar toFileUtils.iterateFilesAndDirs(File, IOFileFilter, IOFileFilter)
but works onPath
s and returns file names relative to root dir.static ArtifactHandlerPublishingResult
writeFileSetToStream(org.apache.tools.ant.types.FileSet fileSet, OutputStream out, boolean compression)
Serialises a fileset into an output stream.static ArtifactHandlerPublishingResult
writeFilesToStream(Path rootDir, Stream<String> filesStream, OutputStream out, boolean httpCompressionOn)
Serialises a files into an output stream.
-
-
-
Field Detail
-
TOO_LONG_PROCESSING_DURATION
public static final Duration TOO_LONG_PROCESSING_DURATION
-
-
Method Detail
-
deserialiseStreamToDir
@NotNull public static @NotNull ArtifactUnpackResult deserialiseStreamToDir(InputStream in, Path destination, com.atlassian.event.api.EventPublisher eventPublisher) throws IOException
Deserialises an input stream into the supplied destination path- Throws:
IOException
-
writeFileSetToStream
public static ArtifactHandlerPublishingResult writeFileSetToStream(org.apache.tools.ant.types.FileSet fileSet, OutputStream out, boolean compression) throws IOException
Serialises a fileset into an output stream.- Throws:
IOException
-
writeFilesToStream
public static ArtifactHandlerPublishingResult writeFilesToStream(Path rootDir, Stream<String> filesStream, OutputStream out, boolean httpCompressionOn) throws IOException
Serialises a files into an output stream.- Throws:
IOException
-
iterateFilesAndDirs
@NotNull public static @NotNull Stream<String> iterateFilesAndDirs(Path rootDir) throws IOException
Similar toFileUtils.iterateFilesAndDirs(File, IOFileFilter, IOFileFilter)
but works onPath
s and returns file names relative to root dir. Also, does not include the root directory in the result.- Throws:
IOException
-
-