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 2021/11/27 21:24:33 UTC

[commons-vfs] branch master updated (96794e4 -> 176acdc)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git.


    from 96794e4  Fix Checkstyle NewlineAtEndOfFile: File does not end with a newline.
     new 32e637a  Make priavte final.
     new 9e79018  Fix Checkstyle MagicNumber.
     new 975af34  Fix Checkstyle FileTabCharacter: File contains tab characters.
     new 43bc8d3  Fix Checkstyle WhitespaceAfter.
     new 176acdc  Fix Checkstyle WhitespaceAround.

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/commons/vfs2/provider/HostFileNameParser.java  |  4 ++--
 .../org/apache/commons/vfs2/provider/ftp/FtpFileObject.java   |  3 ++-
 .../org/apache/commons/vfs2/provider/jar/JarFileObject.java   | 10 +++++-----
 .../apache/commons/vfs2/provider/sftp/SftpClientFactory.java  |  8 ++++----
 .../org/apache/commons/vfs2/provider/sftp/SftpFileObject.java |  2 +-
 .../org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java |  2 +-
 .../org/apache/commons/vfs2/provider/tar/TarFileSystem.java   |  2 +-
 .../java/org/apache/commons/vfs2/util/DefaultCryptor.java     | 11 ++++-------
 .../main/java/org/apache/commons/vfs2/util/URIBitSets.java    |  4 +++-
 9 files changed, 23 insertions(+), 23 deletions(-)

[commons-vfs] 03/05: Fix Checkstyle FileTabCharacter: File contains tab characters.

Posted by gg...@apache.org.
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-vfs.git

commit 975af34b77887e10952c31e14e8c95cfbaf8cd21
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 27 16:19:24 2021 -0500

    Fix Checkstyle FileTabCharacter: File contains tab characters.
---
 .../org/apache/commons/vfs2/provider/HostFileNameParser.java  |  4 ++--
 .../org/apache/commons/vfs2/provider/jar/JarFileObject.java   | 10 +++++-----
 .../java/org/apache/commons/vfs2/util/DefaultCryptor.java     | 11 ++++-------
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java
index e602cc3..d76270a 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/HostFileNameParser.java
@@ -236,9 +236,9 @@ public class HostFileNameParser extends AbstractFileNameParser {
 
         final FileSystemManager fsm;
         if (context != null) {
-        	fsm = context.getFileSystemManager();
+            fsm = context.getFileSystemManager();
         } else {
-        	fsm = VFS.getManager();
+            fsm = VFS.getManager();
         }
 
         // Extract the scheme
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileObject.java
index 5d03b06..2cdb6cb 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileObject.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileObject.java
@@ -41,13 +41,13 @@ public class JarFileObject extends ZipFileObject {
     private Attributes attributes;
 
     protected JarFileObject(final AbstractFileName name, final ZipEntry entry, final JarFileSystem fs,
-            final boolean zipExists) throws FileSystemException {
+        final boolean zipExists) throws FileSystemException {
         super(name, entry, fs, zipExists);
         if (entry != null) {
-			// For Java 9 and up: Force the certificates to be read and cached now. This avoids an
-			// IllegalStateException in java.util.jar.JarFile.isMultiRelease() when it tries
-			// to read the certificates and the file is closed.
-        	((JarEntry) entry).getCertificates();
+            // For Java 9 and up: Force the certificates to be read and cached now. This avoids an
+            // IllegalStateException in java.util.jar.JarFile.isMultiRelease() when it tries
+            // to read the certificates and the file is closed.
+            ((JarEntry) entry).getCertificates();
         }
         this.fs = fs;
 
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java
index 7036b61..c1c25ff 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/DefaultCryptor.java
@@ -102,21 +102,18 @@ public class DefaultCryptor implements Cryptor {
         final char[] chars = str.toCharArray();
         final int length = chars.length / 2;
         final byte[] decoded = new byte[length];
-        if (length * 2 != chars.length)
-        {
-        	throw new IllegalArgumentException("The given string must have even number of hex chars.");
+        if (length * 2 != chars.length) {
+            throw new IllegalArgumentException("The given string must have even number of hex chars.");
         }
         int index = 0;
         for (int i = 0; i < length; i++) {
             final int id1 = indexOf(HEX_CHARS, chars[index++]);
             if (id1 == INDEX_NOT_FOUND) {
-                throw new IllegalArgumentException(
-                        "Character " + chars[index-1] + " at position " + (index-1) + " is not a valid hexidecimal character");
+                throw new IllegalArgumentException("Character " + chars[index - 1] + " at position " + (index - 1) + " is not a valid hexidecimal character");
             }
             final int id2 = indexOf(HEX_CHARS, chars[index++]);
             if (id2 == INDEX_NOT_FOUND) {
-                throw new IllegalArgumentException(
-                        "Character " + chars[index-1] + " at position " + (index-1) + " is not a valid hexidecimal character");
+                throw new IllegalArgumentException("Character " + chars[index - 1] + " at position " + (index - 1) + " is not a valid hexidecimal character");
             }
             decoded[i] = (byte) ((id1 << BITS_IN_HALF_BYTE) | id2);
         }

[commons-vfs] 05/05: Fix Checkstyle WhitespaceAround.

Posted by gg...@apache.org.
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-vfs.git

commit 176acdcc4d032fa0e98be1fff68885d9ac6e1bc6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 27 16:24:08 2021 -0500

    Fix Checkstyle WhitespaceAround.
---
 .../main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java  | 3 ++-
 .../java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
index c79d0b9..b6c07d9 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java
@@ -639,5 +639,6 @@ public class FtpFileObject extends AbstractFileObject<FtpFileSystem> {
                 newFileInfo.setType(FTPFile.DIRECTORY_TYPE);
             }
             this.ftpFile = newFileInfo == null ? UNKNOWN : newFileInfo;
-        }}
+        }
+    }
 }
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
index 9b1a594..b1397f3 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
@@ -125,7 +125,7 @@ public class SftpFileSystem extends AbstractFileSystem {
     private boolean detectExecDisabled() {
         try {
             return getUId() == UNIDENTIFED;
-        } catch(final JSchException | IOException e) {
+        } catch (final JSchException | IOException e) {
             LOG.debug("Cannot get UID, assuming no exec channel is present", e);
             return true;
         }

[commons-vfs] 04/05: Fix Checkstyle WhitespaceAfter.

Posted by gg...@apache.org.
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-vfs.git

commit 43bc8d3d276a369bcdfc33365af715f9ea28d77a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 27 16:22:13 2021 -0500

    Fix Checkstyle WhitespaceAfter.
---
 .../org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java  | 8 ++++----
 .../org/apache/commons/vfs2/provider/sftp/SftpFileObject.java     | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
index 348feaa..549ca65 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
@@ -132,7 +132,7 @@ public final class SftpClientFactory {
      * @throws FileSystemException if an error occurs.
      */
     public static Session createConnection(final String hostname, final int port, final char[] username,
-            final char[] password, final FileSystemOptions fileSystemOptions) throws FileSystemException {
+        final char[] password, final FileSystemOptions fileSystemOptions) throws FileSystemException {
         final JSch jsch = new JSch();
 
         // new style - user passed
@@ -200,15 +200,15 @@ public final class SftpClientFactory {
             if (proxyHost != null) {
                 final int proxyPort = builder.getProxyPort(fileSystemOptions);
                 final SftpFileSystemConfigBuilder.ProxyType proxyType = builder.getProxyType(fileSystemOptions);
-                final String proxyUser =  builder.getProxyUser(fileSystemOptions);
+                final String proxyUser = builder.getProxyUser(fileSystemOptions);
                 final String proxyPassword = builder.getProxyPassword(fileSystemOptions);
                 Proxy proxy = null;
                 if (SftpFileSystemConfigBuilder.PROXY_HTTP.equals(proxyType)) {
                     proxy = createProxyHTTP(proxyHost, proxyPort);
-                    ((ProxyHTTP)proxy).setUserPasswd(proxyUser, proxyPassword);
+                    ((ProxyHTTP) proxy).setUserPasswd(proxyUser, proxyPassword);
                 } else if (SftpFileSystemConfigBuilder.PROXY_SOCKS5.equals(proxyType)) {
                     proxy = createProxySOCKS5(proxyHost, proxyPort);
-                    ((ProxySOCKS5)proxy).setUserPasswd(proxyUser, proxyPassword);
+                    ((ProxySOCKS5) proxy).setUserPasswd(proxyUser, proxyPassword);
                 } else if (SftpFileSystemConfigBuilder.PROXY_STREAM.equals(proxyType)) {
                     proxy = createStreamProxy(proxyHost, proxyPort, fileSystemOptions, builder);
                 }
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
index 56efc83..7093493 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
@@ -457,7 +457,7 @@ public class SftpFileObject extends AbstractFileObject<SftpFileSystem> {
         statSelf();
         boolean isInGroup = false;
         if (checkIds) {
-            if(getAbstractFileSystem().isExecDisabled()) {
+            if (getAbstractFileSystem().isExecDisabled()) {
                 // Exec is disabled, so we won't be able to ascertain the current user's UID and GID.
                 // Return "always-true" permissions as a workaround, knowing that the SFTP server won't
                 // let us perform unauthorized actions anyway.

[commons-vfs] 02/05: Fix Checkstyle MagicNumber.

Posted by gg...@apache.org.
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-vfs.git

commit 9e79018bb48459de82bce4ae183f7b82510710fa
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 27 16:17:52 2021 -0500

    Fix Checkstyle MagicNumber.
---
 .../src/main/java/org/apache/commons/vfs2/util/URIBitSets.java        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIBitSets.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIBitSets.java
index dff37b3..f373394 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIBitSets.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/util/URIBitSets.java
@@ -30,6 +30,8 @@ import org.apache.commons.vfs2.provider.GenericURLFileName;
  */
 final class URIBitSets {
 
+    private static final int NBITS = 256;
+
     // ---------------------- Generous characters for each component validation
 
     /**
@@ -878,7 +880,7 @@ final class URIBitSets {
     }
 
     private static BitSet createBitSet() {
-        return new BitSet(256);
+        return new BitSet(NBITS);
     }
 
     private URIBitSets() {

[commons-vfs] 01/05: Make priavte final.

Posted by gg...@apache.org.
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-vfs.git

commit 32e637a325e80cd96bc9c4d552f1a7ad2c199f4d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 27 13:46:56 2021 -0500

    Make priavte final.
---
 .../main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
index 96fe00a..7f169a8 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
@@ -50,7 +50,7 @@ import org.apache.commons.vfs2.provider.bzip2.Bzip2FileObject;
 public class TarFileSystem extends AbstractFileSystem {
     private static final Log LOG = LogFactory.getLog(TarFileSystem.class);
 
-    private final char[] ENC = {'!'};
+    private static final char[] ENC = {'!'};
 
     private final File file;