Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.jar

public Class JarArchiveOutputStream

extends ZipArchiveOutputStream
Class Inheritance
Imports
java.io.IOException, .OutputStream, org.apache.commons.compress.archivers.zip.JarMarker, .ZipArchiveEntry, .ZipArchiveOutputStream

Subclass that adds a special extra field to the very first entry which allows the created archive to be used as an executable jar on Solaris.

Field Summary

Modifier and TypeField and Description
private boolean
Inherited from org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream:
defDEFAULT_COMPRESSIONDEFLATEDEFS_FLAGfinishedSTORED

Constructor Summary

AccessConstructor and Description
public
public
JarArchiveOutputStream(final OutputStream
the output stream to wrap
out
,
final String
the encoding to use. Use null for the platform default.
encoding
)

Constructs a new instance that wraps the output stream using the provided encoding.

Method Summary

Modifier and TypeMethod and Description
public void
putArchiveEntry(final ZipArchiveEntry
describes the entry
entry
)

Overrides org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.putArchiveEntry.

Writes the headers for an archive entry to the output stream.
Inherited from org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream:
addRawArchiveEntrycanWriteEntryDataclosecloseArchiveEntrycreateArchiveEntrycreateArchiveEntrydeflatefinishflushgetBytesWrittengetEncodingisSeekablesetCommentsetCreateUnicodeExtraFieldssetEncodingsetFallbackToUTF8setLevelsetMethodsetUseLanguageEncodingFlagsetUseZip64writewriteCentralDirectoryEndwriteCentralFileHeaderwriteDataDescriptorwriteLocalFileHeaderwriteOutwriteOutwritePreamblewritePreamblewriteZip64CentralDirectory

Field Detail

jarMarkerAddedback to summary
private boolean jarMarkerAdded

Constructor Detail

JarArchiveOutputStreamback to summary
public JarArchiveOutputStream(final OutputStream out)
JarArchiveOutputStreamback to summary
public JarArchiveOutputStream(final OutputStream out, final String encoding)

Constructs a new instance that wraps the output stream using the provided encoding.

Parameters
out:OutputStream

the output stream to wrap

encoding:String

the encoding to use. Use null for the platform default.

Since
1.10

Method Detail

putArchiveEntryback to summary
public void putArchiveEntry(final ZipArchiveEntry entry) throws IOException

Overrides org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.putArchiveEntry.

Doc from org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.putArchiveEntry.

Writes the headers for an archive entry to the output stream. The caller must then write the content to the stream and call closeArchiveEntry() to complete the process.

Parameters
entry:ZipArchiveEntry

Doc from org.apache.commons.compress.archivers.ArchiveOutputStream.putArchiveEntry.

describes the entry

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.commons.compress.archivers.ArchiveOutputStream.putArchiveEntry.

if an I/O error occurs