Skip to content
Permalink
Browse files
  • Loading branch information
garydgregory committed Feb 3, 2022
2 parents ff3cc63 + 43af45d commit b0bf28a8ce852bccfdd0b0dadbe5164be18bfdb8
Show file tree
Hide file tree
Showing 177 changed files with 1,821 additions and 1,130 deletions.
@@ -18,8 +18,10 @@ updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
day: "friday"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
day: "friday"

This file was deleted.

43 pom.xml
@@ -40,7 +40,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

<commons.felix.version>5.1.3</commons.felix.version>
<commons.felix.version>5.1.4</commons.felix.version>

<commons.componentid>compress</commons.componentid>
<commons.module.name>org.apache.commons.compress</commons.module.name>
@@ -73,8 +73,9 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
<commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/${project.artifactId}</commons.scmPubUrl>
<japicmp.skip>false</japicmp.skip>

<pax.exam.version>4.13.1</pax.exam.version>
<slf4j.version>1.7.30</slf4j.version>
<junit.version>5.8.2</junit.version>
<pax.exam.version>4.13.5</pax.exam.version>
<slf4j.version>1.7.35</slf4j.version>
<commons.jacoco.version>0.8.7</commons.jacoco.version>
<commons.japicmp.version>0.15.4</commons.japicmp.version>
<commons.javadoc.version>3.3.1</commons.javadoc.version>
@@ -88,21 +89,33 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.

<dependencies>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
<version>1.5.0-5</version>
<version>1.5.2-1</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -132,11 +145,17 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.marschall</groupId>
<artifactId>memoryfilesystem</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
<scope>test</scope>
</dependency>

@@ -168,7 +187,7 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>7.0.1</version>
<version>7.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -56,8 +56,18 @@ The <action> type attribute can be add,update,fix,remove.
<action issue="COMPRESS-596" type="fix" date="2021-12-07" dev="Peter Lee" due-to="Tamas Mucs">
Fix minor problem in examples.
</action>
<action issue="COMPRESS-584" type="fix" date="2021-08-11" dev="matthijsln" due-to="Matthijs Laan, Peter Lee">
Add a limit to the copy buffer in IOUtils.readRange() to
avoid reading more from a channel than asked for.
Github Pull Request #214.
</action>
<action type="fix" dev="ggregory" due-to="Helder Magalhães, Gary Gregory, PeterAlfredLee">
Documentation nits #217.
</action>
<!-- ADD -->
<!-- none yet -->
<action issue="COMPRESS-602" type="add" dev="ggregory" due-to="Postelnicu George, Gary Gregory">
Migrate zip package to use NIO #236.
</action>
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Dependabot">
Bump mockito-core from 3.11.1 to 4.2.0 #209, #224, #231, #235.
@@ -66,10 +76,10 @@ The <action> type attribute can be add,update,fix,remove.
Bump org.apache.felix.framework from 7.0.0 to 7.0.1 #208.
</action>
<action type="update" dev="ggregory" due-to="Dependabot">
Bump memoryfilesystem from 2.1.0 to 2.2.0 #212.
Bump memoryfilesystem from 2.1.0 to 2.3.0 #212, #237.
</action>
<action type="update" dev="ggregory" due-to="Dependabot">
Bump zstd-jni from 1.5.0-2 to 1.5.0-5 #215, #233.
Bump zstd-jni from 1.5.0-2 to 1.5.2-1 #215, #233, #238, #240.
</action>
<action type="update" issue="COMPRESS-582" dev="ggregory" due-to="Alex Landau, Stephan, Gary Gregory">
Bump Pack200 packages from ASM 3.2 to 9.2 #216.
@@ -79,11 +89,6 @@ The <action> type attribute can be add,update,fix,remove.
- org.apache.commons.compress.harmony.pack200.SegmentAnnotationVisitor
- org.apache.commons.compress.harmony.pack200.SegmentFieldVisitor
</action>
<action issue="COMPRESS-584" type="fix" date="2021-08-11" dev="matthijsln" due-to="Matthijs Laan, Peter Lee">
Add a limit to the copy buffer in IOUtils.readRange() to
avoid reading more from a channel than asked for.
Github Pull Request #214.
</action>
<action type="update" dev="ggregory" due-to="Dependabot">
Bump maven-javadoc-plugin from 3.3.0 to 3.3.1 #221.
</action>
@@ -100,7 +105,13 @@ The <action> type attribute can be add,update,fix,remove.
Bump commons.japicmp.version from 0.15.3 to 0.15.4.
</action>
<action type="update" dev="ggregory" due-to="Dependabot">
Bump maven-bundle-plugin from 5.1.2 to 5.1.3 (#234).
Bump maven-bundle-plugin from 5.1.2 to 5.1.4 #234, #239.
</action>
<action type="update" dev="ggregory" due-to="Dependabot">
Bump org.apache.felix.framework from 7.0.1 to 7.0.3 #232.
</action>
<action type="update" dev="kinow" due-to="Dependabot">
Bump slf4j-api from 1.7.30 to 1.7.35 #213, #241.
</action>
</release>
<release version="1.21" date="2021-07-12"
@@ -37,7 +37,6 @@
import java.util.Arrays;
import java.util.BitSet;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
@@ -2003,7 +2002,7 @@ public static boolean matches(final byte[] signature, final int length) {
return true;
}

private static long skipBytesFully(final ByteBuffer input, long bytesToSkip) throws IOException {
private static long skipBytesFully(final ByteBuffer input, long bytesToSkip) {
if (bytesToSkip < 1) {
return 0;
}
@@ -134,26 +134,26 @@
* The C structure for a xstar (Jörg Schilling star) Tar Entry's header is:
* <pre>
* struct star_header {
* char name[100]; // offset 0
* char mode[8]; // offset 100
* char uid[8]; // offset 108
* char gid[8]; // offset 116
* char size[12]; // offset 124
* char mtime[12]; // offset 136
* char chksum[8]; // offset 148
* char typeflag; // offset 156
* char linkname[100]; // offset 157
* char magic[6]; // offset 257
* char version[2]; // offset 263
* char uname[32]; // offset 265
* char gname[32]; // offset 297
* char devmajor[8]; // offset 329
* char devminor[8]; // offset 337
* char prefix[131]; // offset 345
* char atime[12]; // offset 476
* char ctime[12]; // offset 488
* char mfill[8]; // offset 500
* char xmagic[4]; // offset 508 "tar"
* char name[100]; // offset 0
* char mode[8]; // offset 100
* char uid[8]; // offset 108
* char gid[8]; // offset 116
* char size[12]; // offset 124
* char mtime[12]; // offset 136
* char chksum[8]; // offset 148
* char typeflag; // offset 156
* char linkname[100]; // offset 157
* char magic[6]; // offset 257
* char version[2]; // offset 263
* char uname[32]; // offset 265
* char gname[32]; // offset 297
* char devmajor[8]; // offset 329
* char devminor[8]; // offset 337
* char prefix[131]; // offset 345
* char atime[12]; // offset 476
* char ctime[12]; // offset 488
* char mfill[8]; // offset 500
* char xmagic[4]; // offset 508 "tar"
* };
* </pre>
* <p>which is identical to new-style POSIX up to the first 130 bytes of the prefix.</p>
@@ -22,8 +22,9 @@
import org.apache.commons.compress.parallel.ScatterGatherBackingStore;
import org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Deque;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentLinkedDeque;
@@ -66,7 +67,7 @@ private static class DefaultBackingStoreSupplier implements ScatterGatherBacking

@Override
public ScatterGatherBackingStore get() throws IOException {
final File tempFile = File.createTempFile("parallelscatter", "n" + storeNum.incrementAndGet());
final Path tempFile = Files.createTempFile("parallelscatter", "n" + storeNum.incrementAndGet());
return new FileBasedScatterGatherBackingStore(tempFile);
}
}
@@ -27,6 +27,7 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.util.Iterator;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
@@ -186,7 +187,18 @@ public void close() throws IOException {
* @throws FileNotFoundException if the file cannot be found
*/
public static ScatterZipOutputStream fileBased(final File file) throws FileNotFoundException {
return fileBased(file, Deflater.DEFAULT_COMPRESSION);
return pathBased(file.toPath(), Deflater.DEFAULT_COMPRESSION);
}

/**
* Create a {@link ScatterZipOutputStream} with default compression level that is backed by a file
* @param path The path to offload compressed data into.
* @return A ScatterZipOutputStream that is ready for use.
* @throws FileNotFoundException if the path cannot be found
* @since 1.22
*/
public static ScatterZipOutputStream pathBased(final Path path) throws FileNotFoundException {
return pathBased(path, Deflater.DEFAULT_COMPRESSION);
}

/**
@@ -198,7 +210,19 @@ public static ScatterZipOutputStream fileBased(final File file) throws FileNotFo
* @throws FileNotFoundException if the file cannot be found
*/
public static ScatterZipOutputStream fileBased(final File file, final int compressionLevel) throws FileNotFoundException {
final ScatterGatherBackingStore bs = new FileBasedScatterGatherBackingStore(file);
return pathBased(file.toPath(), compressionLevel);
}

/**
* Create a {@link ScatterZipOutputStream} that is backed by a file
* @param path The path to offload compressed data into.
* @param compressionLevel The compression level to use, @see #Deflater
* @return A ScatterZipOutputStream that is ready for use.
* @throws FileNotFoundException if the path cannot be found
* @since 1.22
*/
public static ScatterZipOutputStream pathBased(final Path path, final int compressionLevel) throws FileNotFoundException {
final ScatterGatherBackingStore bs = new FileBasedScatterGatherBackingStore(path);
// lifecycle is bound to the ScatterZipOutputStream returned
final StreamCompressor sc = StreamCompressor.create(compressionLevel, bs); //NOSONAR
return new ScatterZipOutputStream(bs, sc);

0 comments on commit b0bf28a

Please sign in to comment.