Package hudson.util.io
Class ArchiverFactory
java.lang.Object
hudson.util.io.ArchiverFactory
- All Implemented Interfaces:
Serializable
Creates
Archiver
on top of a stream.- Since:
- 1.359
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic ArchiverFactory
Uncompressed tar format.static ArchiverFactory
tar+gzstatic ArchiverFactory
Zip format. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(OutputStream out) Creates an archiver on top of the given stream.abstract Archiver
create
(OutputStream out, Charset filenamesEncoding) Creates an archiver on top of the given stream.static ArchiverFactory
createZipWithPrefix
(String prefix, OpenOption... openOptions) Zip format, with prefix and optional OpenOptions.
-
Field Details
-
TAR
Uncompressed tar format. -
TARGZ
tar+gz -
ZIP
Zip format.
-
-
Constructor Details
-
ArchiverFactory
public ArchiverFactory()
-
-
Method Details
-
create
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.
-