com.atlassian.bamboo.v2.build.agent.messages
Class ArtifactStreams

java.lang.Object
  extended by 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.


Constructor Summary
ArtifactStreams()
           
 
Method Summary
static File deserialiseStreamToDir(InputStream in, File destination)
          Deserialises an input stream into the supplied destination path
static com.google.common.base.Function<File,String> fileToZipEntryName(File rootDir)
          returns a zip entry name for given file name by relativising it with the supplied root directory paramater.
static Iterator<String> iterateFilesAndDirs(File rootDir)
          Similar to FileUtils#iterateFilesAndDirs(File, IOFileFilter, IOFileFilter) but returns file names relative to root dir.
static ArtifactHandlerPublishingResult writeFileSetToStream(org.apache.tools.ant.types.FileSet fileSet, OutputStream out)
          Serialises a fileset into an output stream.
static ArtifactHandlerPublishingResult writeFilesToStream(File rootDir, Iterator<String> files, OutputStream out)
          Serialises a files into an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtifactStreams

public ArtifactStreams()
Method Detail

fileToZipEntryName

public static com.google.common.base.Function<File,String> fileToZipEntryName(File rootDir)
returns a zip entry name for given file name by relativising it with the supplied root directory paramater.


deserialiseStreamToDir

@Nullable
public static File deserialiseStreamToDir(InputStream in,
                                                   File destination)
                                   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)
                                                            throws IOException
Serialises a fileset into an output stream.

Throws:
IOException

writeFilesToStream

public static ArtifactHandlerPublishingResult writeFilesToStream(File rootDir,
                                                                 Iterator<String> files,
                                                                 OutputStream out)
                                                          throws IOException
Serialises a files into an output stream.

Throws:
IOException

iterateFilesAndDirs

@NotNull
public static Iterator<String> iterateFilesAndDirs(File rootDir)
Similar to FileUtils#iterateFilesAndDirs(File, IOFileFilter, IOFileFilter) but returns file names relative to root dir. Also, does not include the root directory in the result.



Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.