Package hudson.util.io
Class ArchiverFactory
- java.lang.Object
-
- hudson.util.io.ArchiverFactory
-
- All Implemented Interfaces:
Serializable
public abstract class ArchiverFactory extends Object implements Serializable
CreatesArchiveron top of a stream.- Since:
- 1.359
- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ArchiverFactoryTARUncompressed tar format.static ArchiverFactoryTARGZtar+gzstatic ArchiverFactoryZIPZip format.
-
Constructor Summary
Constructors Constructor Description ArchiverFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Archivercreate(OutputStream out)Creates an archiver on top of the given stream.abstract Archivercreate(OutputStream out, Charset filenamesEncoding)Creates an archiver on top of the given stream.static ArchiverFactorycreateZipWithPrefix(String prefix, OpenOption... openOptions)Zip format, with prefix and optional OpenOptions.
-
-
-
Field Detail
-
TAR
public static ArchiverFactory TAR
Uncompressed tar format.
-
TARGZ
public static ArchiverFactory TARGZ
tar+gz
-
ZIP
public static ArchiverFactory ZIP
Zip format.
-
-
Method Detail
-
create
@NonNull public Archiver create(OutputStream out) throws IOException
Creates an archiver on top of the given stream. File names in the archive are encoded with default character set.- Throws:
IOException
-
create
@NonNull public abstract Archiver create(OutputStream out, Charset filenamesEncoding) throws IOException
Creates an archiver on top of the given stream.- Parameters:
filenamesEncoding- the encoding to be used in the archive for file names- Throws:
IOException- Since:
- 2.449
-
createZipWithPrefix
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static ArchiverFactory createZipWithPrefix(String prefix, OpenOption... openOptions)
Zip format, with prefix and optional OpenOptions.- Parameters:
prefix- The portion of file path that will be added at the beginning of the relative path inside the archive. If non-empty, a trailing forward slash will be enforced.openOptions- the options to apply when opening files.
-
-