Skip to content

Commit 3a9117b

Browse files
author
lore
committed
Added check for xz to return xz compressor output stream
1 parent ce16809 commit 3a9117b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/org/codehaus/plexus/archiver/tar/TarArchiver.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
2121
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
2222
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
23+
import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream;
2324
import org.codehaus.plexus.archiver.AbstractArchiver;
2425
import org.codehaus.plexus.archiver.ArchiveEntry;
2526
import org.codehaus.plexus.archiver.ArchiverException;
@@ -465,7 +466,8 @@ public static enum TarCompressionMethod
465466
none,
466467
gzip,
467468
bzip2,
468-
snappy
469+
snappy,
470+
xz
469471

470472
}
471473

@@ -484,6 +486,11 @@ else if ( TarCompressionMethod.snappy.equals( tarCompressionMethod ) )
484486
{
485487
return new SnappyOutputStream( bufferedOutputStream( ostream ) );
486488
}
489+
else if (TarCompressionMethod.xz.equals( tarCompressionMethod ) )
490+
{
491+
return new XZCompressorOutputStream( bufferedOutputStream( ostream ) );
492+
}
493+
487494
return ostream;
488495
}
489496

0 commit comments

Comments
 (0)