You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/08/14 14:09:52 UTC
(commons-compress) branch master updated: [COMPRESS-686] Compression into BZip2 format has unexpected end of file
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push:
new ff5694ee6 [COMPRESS-686] Compression into BZip2 format has unexpected end of file
ff5694ee6 is described below
commit ff5694ee67ba4a6cd810d5072020c06d93c0fdd9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 14 10:09:48 2024 -0400
[COMPRESS-686] Compression into BZip2 format has unexpected end of file
Use resolveSibling()
---
.../org/apache/commons/compress/compressors/bzip2/Compress686Test.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/compressors/bzip2/Compress686Test.java b/src/test/java/org/apache/commons/compress/compressors/bzip2/Compress686Test.java
index 39c154b8a..ca5a0bed4 100644
--- a/src/test/java/org/apache/commons/compress/compressors/bzip2/Compress686Test.java
+++ b/src/test/java/org/apache/commons/compress/compressors/bzip2/Compress686Test.java
@@ -30,7 +30,6 @@ import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.nio.file.Paths;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.io.TempDir;
@@ -55,7 +54,7 @@ public class Compress686Test {
}
private Path decompressBzip2File(final Path file) throws IOException {
- final Path decompressedFile = Paths.get(file.getParent().toString(), file.getFileName().toString() + ".decompressed");
+ final Path decompressedFile = file.resolveSibling(file.getFileName().toString() + ".decompressed");
try (BZip2CompressorInputStream bzIn = new BZip2CompressorInputStream(Files.newInputStream(file));
OutputStream outputStream = new FileOutputStream(decompressedFile.toFile())) {
IOUtils.copy(bzIn, outputStream);