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

commit 3714fdd41a251c02362b372568b023230e37aea9
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Oct 19 08:10:47 2023 -0400

    Camel-case parameter and internal names
    
    Javadoc
---
 .../archivers/ar/ArArchiveInputStream.java         |  6 ++--
 .../compress/archivers/sevenz/SevenZFile.java      |  4 +--
 .../compress/archivers/tar/package-info.java       |  2 +-
 .../gzip/GzipCompressorOutputStream.java           |  8 ++---
 .../compress/compressors/gzip/GzipParameters.java  |  6 ++--
 .../commons/compress/utils/FileNameUtils.java      | 42 +++++++++++-----------
 .../apache/commons/compress/AbstractTestCase.java  |  8 ++---
 .../apache/commons/compress/ArchiveReadTest.java   |  2 +-
 .../archivers/memory/MemoryArchiveInputStream.java | 10 +++---
 .../compress/archivers/sevenz/SevenZFileTest.java  |  4 +--
 .../compress/archivers/zip/ExplodeSupportTest.java |  8 ++---
 .../brotli/BrotliCompressorInputStreamTest.java    |  2 +-
 12 files changed, 51 insertions(+), 51 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
 
b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
index 8da2689b..08b03cd3 100644
--- 
a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
+++ 
b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
@@ -226,7 +226,7 @@ public class ArArchiveInputStream extends 
ArchiveInputStream {
      */
     private String getExtendedName(final int offset) throws IOException {
         if (namebuffer == null) {
-            throw new IOException("Cannot process GNU long filename as no // 
record was found");
+            throw new IOException("Cannot process GNU long file name as no // 
record was found");
         }
         for (int i = offset; i < namebuffer.length; i++) {
             if (namebuffer[i] == '\012' || namebuffer[i] == 0) {
@@ -301,11 +301,11 @@ public class ArArchiveInputStream extends 
ArchiveInputStream {
 
         entryOffset = offset;
 
-//        GNU ar uses a '/' to mark the end of the filename; this allows for 
the use of spaces without the use of an extended filename.
+//        GNU ar uses a '/' to mark the end of the file name; this allows for 
the use of spaces without the use of an extended file name.
 
         // entry name is stored as ASCII string
         String temp = ArchiveUtils.toAsciiString(metaData, NAME_OFFSET, 
NAME_LEN).trim();
-        if (isGNUStringTable(temp)) { // GNU extended filenames entry
+        if (isGNUStringTable(temp)) { // GNU extended file names entry
             currentEntry = readGNUStringTable(metaData, LENGTH_OFFSET, 
LENGTH_LEN);
             return getNextArEntry();
         }
diff --git 
a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java 
b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
index 8dd12721..47fcb5fb 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
@@ -471,11 +471,11 @@ public class SevenZFile implements Closeable {
         this(channel, fileName, password, false, SevenZFileOptions.DEFAULT);
     }
 
-    private SevenZFile(final SeekableByteChannel channel, final String 
filename,
+    private SevenZFile(final SeekableByteChannel channel, final String 
fileName,
                        final byte[] password, final boolean closeOnError, 
final SevenZFileOptions options) throws IOException {
         boolean succeeded = false;
         this.channel = channel;
-        this.fileName = filename;
+        this.fileName = fileName;
         this.options = options;
         try {
             archive = readHeaders(password);
diff --git 
a/src/main/java/org/apache/commons/compress/archivers/tar/package-info.java 
b/src/main/java/org/apache/commons/compress/archivers/tar/package-info.java
index 842106dd..5e64dc5a 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/package-info.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/package-info.java
@@ -21,7 +21,7 @@
  * Provides stream classes for reading and writing archives using the TAR 
format.
  * <p>
  * There are many different format dialects that call themselves TAR. The 
classes of this package can read and write archives in the traditional pre-POSIX
- * <strong>ustar</strong> format and support GNU specific extensions for long 
filenames that GNU tar itself by now refers to as <strong>oldgnu</strong>.
+ * <strong>ustar</strong> format and support GNU specific extensions for long 
file names that GNU tar itself by now refers to as <strong>oldgnu</strong>.
  * </p>
  */
 package org.apache.commons.compress.archivers.tar;
\ No newline at end of file
diff --git 
a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
 
b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
index ee7a74a5..e1c1a1f7 100644
--- 
a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
+++ 
b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
@@ -194,14 +194,14 @@ public class GzipCompressorOutputStream extends 
CompressorOutputStream {
     }
 
     private void writeHeader(final GzipParameters parameters) throws 
IOException {
-        final String filename = parameters.getFilename();
+        final String fileName = parameters.getFilename();
         final String comment = parameters.getComment();
 
         final ByteBuffer buffer = ByteBuffer.allocate(10);
         buffer.order(ByteOrder.LITTLE_ENDIAN);
         buffer.putShort((short) GZIPInputStream.GZIP_MAGIC);
         buffer.put((byte) Deflater.DEFLATED); // compression method (8: 
deflate)
-        buffer.put((byte) ((filename != null ? FNAME : 0) | (comment != null ? 
FCOMMENT : 0))); // flags
+        buffer.put((byte) ((fileName != null ? FNAME : 0) | (comment != null ? 
FCOMMENT : 0))); // flags
         buffer.putInt((int) (parameters.getModificationTime() / 1000));
 
         // extra flags
@@ -218,8 +218,8 @@ public class GzipCompressorOutputStream extends 
CompressorOutputStream {
 
         out.write(buffer.array());
 
-        if (filename != null) {
-            out.write(getBytes(filename));
+        if (fileName != null) {
+            out.write(getBytes(fileName));
             out.write(0);
         }
 
diff --git 
a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java
 
b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java
index 4c6be46c..04abf5fc 100644
--- 
a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java
+++ 
b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipParameters.java
@@ -33,7 +33,7 @@ public class GzipParameters {
 
     private int compressionLevel = Deflater.DEFAULT_COMPRESSION;
     private long modificationTime;
-    private String filename;
+    private String fileName;
     private String comment;
     private int operatingSystem = 255; // Unknown OS by default
     private int bufferSize = 512;
@@ -70,7 +70,7 @@ public class GzipParameters {
     }
 
     public String getFilename() {
-        return filename;
+        return fileName;
     }
 
     public long getModificationTime() {
@@ -132,7 +132,7 @@ public class GzipParameters {
      * @param fileName the name of the file without the directory path
      */
     public void setFilename(final String fileName) {
-        this.filename = fileName;
+        this.fileName = fileName;
     }
 
     /**
diff --git a/src/main/java/org/apache/commons/compress/utils/FileNameUtils.java 
b/src/main/java/org/apache/commons/compress/utils/FileNameUtils.java
index ac5ef468..fae96359 100644
--- a/src/main/java/org/apache/commons/compress/utils/FileNameUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/FileNameUtils.java
@@ -37,13 +37,13 @@ public class FileNameUtils {
     }
 
     /**
-     * Gets the basename (i.e. the part up to and not including the
-     * last ".") of the last path segment of a filename.
+     * Gets the base name (i.e. the part up to and not including the
+     * last ".") of the last path segment of a file name.
      * <p>Will return the file name itself if it doesn't contain any
-     * dots. All leading directories of the {@code filename} parameter
+     * dots. All leading directories of the {@code file name} parameter
      * are skipped.</p>
-     * @return the basename of filename
-     * @param path the path of the file to obtain the basename of.
+     * @return the base name of file name
+     * @param path the path of the file to obtain the base name of.
      * @since 1.22
      */
     public static String getBaseName(final Path path) {
@@ -55,30 +55,30 @@ public class FileNameUtils {
     }
 
     /**
-     * Gets the basename (i.e. the part up to and not including the
-     * last ".") of the last path segment of a filename.
+     * Gets the base name (i.e. the part up to and not including the
+     * last ".") of the last path segment of a file name.
      *
      * <p>Will return the file name itself if it doesn't contain any
-     * dots. All leading directories of the {@code filename} parameter
+     * dots. All leading directories of the {@code file name} parameter
      * are skipped.</p>
      *
-     * @return the basename of filename
-     * @param filename the name of the file to obtain the basename of.
+     * @return the base name of file name
+     * @param fileName the name of the file to obtain the base name of.
      */
-    public static String getBaseName(final String filename) {
-        if (filename == null) {
+    public static String getBaseName(final String fileName) {
+        if (fileName == null) {
             return null;
         }
-        return fileNameToBaseName(new File(filename).getName());
+        return fileNameToBaseName(new File(fileName).getName());
     }
 
     /**
      * Gets the extension (i.e. the part after the last ".") of a file.
      * <p>Will return an empty string if the file name doesn't contain
      * any dots. Only the last segment of a the file name is consulted
-     * - i.e. all leading directories of the {@code filename}
+     * - i.e. all leading directories of the {@code file name}
      * parameter are skipped.</p>
-     * @return the extension of filename
+     * @return the extension of file name
      * @param path the path of the file to obtain the extension of.
      * @since 1.22
      */
@@ -95,16 +95,16 @@ public class FileNameUtils {
      *
      * <p>Will return an empty string if the file name doesn't contain
      * any dots. Only the last segment of a the file name is consulted
-     * - i.e. all leading directories of the {@code filename}
+     * - i.e. all leading directories of the {@code fileName}
      * parameter are skipped.</p>
      *
-     * @return the extension of filename
-     * @param filename the name of the file to obtain the extension of.
+     * @return the extension of file name
+     * @param fileName the name of the file to obtain the extension of.
      */
-    public static String getExtension(final String filename) {
-        if (filename == null) {
+    public static String getExtension(final String fileName) {
+        if (fileName == null) {
             return null;
         }
-        return fileNameToExtension(new File(filename).getName());
+        return fileNameToExtension(new File(fileName).getName());
     }
 }
diff --git a/src/test/java/org/apache/commons/compress/AbstractTestCase.java 
b/src/test/java/org/apache/commons/compress/AbstractTestCase.java
index f92a29e6..d06cfe6e 100644
--- a/src/test/java/org/apache/commons/compress/AbstractTestCase.java
+++ b/src/test/java/org/apache/commons/compress/AbstractTestCase.java
@@ -146,18 +146,18 @@ public abstract class AbstractTestCase {
      * Add an entry to the archive, and keep track of the names in archiveList.
      *
      * @param out
-     * @param filename
+     * @param fileName
      * @param infile
      * @throws IOException
      * @throws FileNotFoundException
      */
-    private void addArchiveEntry(final ArchiveOutputStream out, final String 
filename, final File infile)
+    private void addArchiveEntry(final ArchiveOutputStream out, final String 
fileName, final File infile)
             throws IOException, FileNotFoundException {
-        final ArchiveEntry entry = out.createArchiveEntry(infile, filename);
+        final ArchiveEntry entry = out.createArchiveEntry(infile, fileName);
         out.putArchiveEntry(entry);
         Files.copy(infile.toPath(), out);
         out.closeArchiveEntry();
-        archiveList.add(filename);
+        archiveList.add(fileName);
     }
 
     /**
diff --git a/src/test/java/org/apache/commons/compress/ArchiveReadTest.java 
b/src/test/java/org/apache/commons/compress/ArchiveReadTest.java
index 98091e78..e3b62dff 100644
--- a/src/test/java/org/apache/commons/compress/ArchiveReadTest.java
+++ b/src/test/java/org/apache/commons/compress/ArchiveReadTest.java
@@ -80,7 +80,7 @@ public class ArchiveReadTest extends AbstractTestCase {
         }
     }
 
-    // files.txt contains size and filename
+    // files.txt contains size and file name
     @Override
     protected String getExpectedString(final ArchiveEntry entry) {
         return entry.getSize() + " " + entry.getName();
diff --git 
a/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveInputStream.java
 
b/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveInputStream.java
index d896c6e6..22e74c26 100644
--- 
a/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveInputStream.java
+++ 
b/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveInputStream.java
@@ -25,18 +25,18 @@ import 
org.apache.commons.compress.archivers.ArchiveInputStream;
 
 public final class MemoryArchiveInputStream extends ArchiveInputStream {
 
-    private final String[] filenames;
+    private final String[] fileNames;
     private final String[] content;
     private int p;
 
     public MemoryArchiveInputStream( final String[][] pFiles ) {
         final int pFilesLength = pFiles.length;
-        filenames = new String[pFilesLength];
+        fileNames = new String[pFilesLength];
         content = new String[pFilesLength];
 
         for (int i = 0; i < pFilesLength; i++) {
             final String[] nameAndContent = pFiles[i];
-            filenames[i] = nameAndContent[0];
+            fileNames[i] = nameAndContent[0];
             content[i] = nameAndContent[1];
         }
         p = 0;
@@ -44,11 +44,11 @@ public final class MemoryArchiveInputStream extends 
ArchiveInputStream {
 
     @Override
     public ArchiveEntry getNextEntry() throws IOException {
-        if (p >= filenames.length) {
+        if (p >= fileNames.length) {
             return null;
         }
 
-        return new MemoryArchiveEntry(filenames[p]);
+        return new MemoryArchiveEntry(fileNames[p]);
     }
 
     @Override
diff --git 
a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
 
b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
index c7176141..5747470c 100644
--- 
a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
+++ 
b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
@@ -89,8 +89,8 @@ public class SevenZFileTest extends AbstractTestCase {
             SevenZArchiveEntry::getCreationTime, 
SevenZArchiveEntry::getCreationDate);
     }
 
-    private void checkHelloWorld(final String filename) throws Exception {
-        try (SevenZFile sevenZFile = new SevenZFile(getFile(filename))) {
+    private void checkHelloWorld(final String fileName) throws Exception {
+        try (SevenZFile sevenZFile = new SevenZFile(getFile(fileName))) {
             final SevenZArchiveEntry entry = sevenZFile.getNextEntry();
             assertEquals("Hello world.txt", entry.getName());
             assertDates(entry, "2013-05-07T19:40:48Z", null, null);
diff --git 
a/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java
 
b/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java
index 4f080368..57f6a1b7 100644
--- 
a/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java
+++ 
b/src/test/java/org/apache/commons/compress/archivers/zip/ExplodeSupportTest.java
@@ -38,8 +38,8 @@ import org.junit.jupiter.api.Test;
 
 public class ExplodeSupportTest {
 
-    private void testArchiveWithImplodeCompression(final String filename, 
final String entryName) throws IOException {
-        try (ZipFile zip = new ZipFile(new File(filename))) {
+    private void testArchiveWithImplodeCompression(final String fileName, 
final String entryName) throws IOException {
+        try (ZipFile zip = new ZipFile(new File(fileName))) {
             final ZipArchiveEntry entry = zip.getEntries().nextElement();
             assertEquals(entryName, entry.getName(), "entry name");
             assertTrue(zip.canReadEntryData(entry), "entry can't be read");
@@ -84,8 +84,8 @@ public class ExplodeSupportTest {
         
testZipStreamWithImplodeCompression("target/test-classes/moby-imploded.zip", 
"README");
     }
 
-    private void testZipStreamWithImplodeCompression(final String filename, 
final String entryName) throws IOException {
-        try (ZipArchiveInputStream zin = new 
ZipArchiveInputStream(Files.newInputStream(new File(filename).toPath()))) {
+    private void testZipStreamWithImplodeCompression(final String fileName, 
final String entryName) throws IOException {
+        try (ZipArchiveInputStream zin = new 
ZipArchiveInputStream(Files.newInputStream(new File(fileName).toPath()))) {
             final ZipArchiveEntry entry = zin.getNextZipEntry();
             assertEquals(entryName, entry.getName(), "entry name");
             assertTrue(zin.canReadEntryData(entry), "entry can't be read");
diff --git 
a/src/test/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStreamTest.java
 
b/src/test/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStreamTest.java
index 75cf1f6b..1cb4dd6f 100644
--- 
a/src/test/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStreamTest.java
+++ 
b/src/test/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStreamTest.java
@@ -76,7 +76,7 @@ public class BrotliCompressorInputStreamTest extends 
AbstractTestCase {
     public void singleByteReadWorksAsExpected() throws IOException {
         try (InputStream is = newInputStream("brotli.testdata.compressed");
                 final BrotliCompressorInputStream in = new 
BrotliCompressorInputStream(is)) {
-            // starts with filename "XXX"
+            // starts with file name "XXX"
             assertEquals('X', in.read());
         }
     }

Reply via email to