Class VitamArchiveStreamFactory
java.lang.Object
fr.gouv.vitam.common.storage.compress.VitamArchiveStreamFactory
Factory to create ArchiveInputStreams from names
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.compress.archivers.ArchiveInputStream
createArchiveInputStream
(javax.ws.rs.core.MediaType mediaType, InputStream in) Create an archive input stream from an archiver name and an input stream.org.apache.commons.compress.archivers.ArchiveInputStream
createArchiveInputStream
(javax.ws.rs.core.MediaType mediaType, InputStream in, String encoding) Create an archive input stream from an archiver name and an input stream.
-
Constructor Details
-
VitamArchiveStreamFactory
public VitamArchiveStreamFactory()
-
-
Method Details
-
createArchiveInputStream
public org.apache.commons.compress.archivers.ArchiveInputStream createArchiveInputStream(javax.ws.rs.core.MediaType mediaType, InputStream in) throws IOException, org.apache.commons.compress.archivers.ArchiveException Create an archive input stream from an archiver name and an input stream.- Parameters:
mediaType
- MediaType objectMediaType
the archive name, i.e. ZIP, TAR, or GZIPin
- the input stream- Returns:
- the archive input stream
- Throws:
org.apache.commons.compress.archivers.ArchiveException
- if the archiver name is not knownIOException
IllegalArgumentException
- if the archiver name or stream is null
-
createArchiveInputStream
public org.apache.commons.compress.archivers.ArchiveInputStream createArchiveInputStream(javax.ws.rs.core.MediaType mediaType, InputStream in, @Nullable String encoding) throws org.apache.commons.compress.archivers.ArchiveException, IOException Create an archive input stream from an archiver name and an input stream.- Parameters:
mediaType
- MediaType objectMediaType
the archive name, i.e. ZIP, TAR, or GZIPin
- the input stream- Returns:
- the archive input stream
- Throws:
org.apache.commons.compress.archivers.ArchiveException
- if the archiver name is not knownIOException
IllegalArgumentException
- if the archiver name or stream is null
-