Class ArArchiveOutputStream
java.lang.Object
java.io.OutputStream
edu.internet2.middleware.grouperInstallerExt.org.apache.commons.compress.archivers.ArchiveOutputStream
edu.internet2.middleware.grouperInstallerExt.org.apache.commons.compress.archivers.ar.ArArchiveOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Implements the "ar" archive format as an output stream.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
BSD ar extensions are used to store long file names in the archive.static final int
Fail if a long file name is required in the archive. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Calls finish if necessary, and then closes the OutputStreamvoid
Closes the archive entry, writing any trailer information that may be required.createArchiveEntry
(File inputFile, String entryName) Create an archive entry using the inputFile and entryName provided.void
finish()
Finishes the addition of entries to this stream, without closing it.void
putArchiveEntry
(ArchiveEntry pEntry) Writes the headers for an archive entry to the output stream.void
setLongFileMode
(int longFileMode) Set the long file mode.void
write
(byte[] b, int off, int len) Methods inherited from class edu.internet2.middleware.grouperInstallerExt.org.apache.commons.compress.archivers.ArchiveOutputStream
canWriteEntryData, count, count, getBytesWritten, getCount, write
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Field Details
-
LONGFILE_ERROR
public static final int LONGFILE_ERRORFail if a long file name is required in the archive.- See Also:
-
LONGFILE_BSD
public static final int LONGFILE_BSDBSD ar extensions are used to store long file names in the archive.- See Also:
-
-
Constructor Details
-
ArArchiveOutputStream
-
-
Method Details
-
setLongFileMode
public void setLongFileMode(int longFileMode) Set the long file mode. This can be LONGFILE_ERROR(0) or LONGFILE_BSD(1). This specifies the treatment of long file names (names >= 16). Default is LONGFILE_ERROR.- Parameters:
longFileMode
- the mode to use- Since:
- 1.3
-
closeArchiveEntry
Description copied from class:ArchiveOutputStream
Closes the archive entry, writing any trailer information that may be required.- Specified by:
closeArchiveEntry
in classArchiveOutputStream
- Throws:
IOException
-
putArchiveEntry
Description copied from class:ArchiveOutputStream
Writes the headers for an archive entry to the output stream. The caller must then write the content to the stream and callArchiveOutputStream.closeArchiveEntry()
to complete the process.- Specified by:
putArchiveEntry
in classArchiveOutputStream
- Parameters:
pEntry
- describes the entry- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
close
Calls finish if necessary, and then closes the OutputStream- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
createArchiveEntry
Description copied from class:ArchiveOutputStream
Create an archive entry using the inputFile and entryName provided.- Specified by:
createArchiveEntry
in classArchiveOutputStream
- Returns:
- the ArchiveEntry set up with details from the file
- Throws:
IOException
-
finish
Description copied from class:ArchiveOutputStream
Finishes the addition of entries to this stream, without closing it. Additional data can be written, if the format supports it.- Specified by:
finish
in classArchiveOutputStream
- Throws:
IOException
- if the user forgets to close the entry.
-