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 2026/03/02 12:59:25 UTC

(commons-vfs) branch master updated (6985bfcfc -> bafb54b49)

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 6985bfcfc Bump org.apache.commons:commons-parent from 96 to 97.
     new 61e1c45e5 Javadoc
     new 22423f31c Javadoc
     new 5d9ce7625 Javadoc
     new bafb54b49 [VFS-861] Http5FileProvider Basic authentication fails: UserAuthenticationData.setData(Type, char[]) should clone its array input.

The 4 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:
 .../provider/hdfs/HdfsRandomAccessContent.java     |  6 +--
 .../commons/vfs2/UserAuthenticationData.java       | 16 +++++---
 .../vfs2/provider/http5/Http5FileProvider.java     | 44 +++++++++++-----------
 .../commons/vfs2/UserAuthenticationDataTest.java   | 13 ++++---
 src/changes/changes.xml                            |  1 +
 5 files changed, 43 insertions(+), 37 deletions(-)


(commons-vfs) 02/04: Javadoc

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 22423f31c78b8040ec996acb09de2eeeb7f73022
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 2 07:32:55 2026 -0500

    Javadoc
---
 .../org/apache/commons/vfs2/provider/http5/Http5FileProvider.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
index e54601a83..65d452eb0 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
@@ -168,7 +168,7 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider {
     }
 
     /**
-     * Create an {@link HttpClient} object for an http4 file system.
+     * Creates an {@link HttpClient} object for an http4 file system.
      *
      * @param builder Configuration options builder for http4 provider
      * @param rootName The root path
@@ -182,7 +182,7 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider {
     }
 
     /**
-     * Create an {@link HttpClientBuilder} object. Invoked by {@link #createHttpClient(Http5FileSystemConfigBuilder, GenericFileName, FileSystemOptions)}.
+     * Creates an {@link HttpClientBuilder} object. Invoked by {@link #createHttpClient(Http5FileSystemConfigBuilder, GenericFileName, FileSystemOptions)}.
      *
      * @param builder Configuration options builder for HTTP4 provider
      * @param rootName The root path
@@ -215,7 +215,7 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider {
     }
 
     /**
-     * Create an {@link HttpClientContext} object for an http4 file system.
+     * Creates an {@link HttpClientContext} object for an http4 file system.
      *
      * @param builder Configuration options builder for http4 provider
      * @param rootName The root path
@@ -286,7 +286,7 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider {
     }
 
     /**
-     * Create {@link SSLContext} for HttpClient. Invoked by {@link #createHttpClientBuilder(Http5FileSystemConfigBuilder, GenericFileName, FileSystemOptions)}.
+     * Creates {@link SSLContext} for HttpClient. Invoked by {@link #createHttpClientBuilder(Http5FileSystemConfigBuilder, GenericFileName, FileSystemOptions)}.
      *
      * @param builder Configuration options builder for HTTP4 provider
      * @param fileSystemOptions The FileSystem options


(commons-vfs) 01/04: Javadoc

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 61e1c45e56a1addba3587e4875b5208a8e711e19
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 2 07:32:39 2026 -0500

    Javadoc
---
 .../apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java
index 9d7766677..9ac422204 100644
--- a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java
+++ b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java
@@ -38,10 +38,10 @@ public class HdfsRandomAccessContent extends AbstractRandomAccessContent {
     private final Path path;
 
     /**
-     * Create random access content.
+     * Creates a new instance for random access content.
      *
-     * @param path A Hadoop Path
-     * @param fs A Hadoop FileSystem
+     * @param path A Hadoop Path.
+     * @param fs A Hadoop FileSystem.
      * @throws IOException when the path cannot be processed.
      */
     public HdfsRandomAccessContent(final Path path, final FileSystem fs) throws IOException {


(commons-vfs) 03/04: Javadoc

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 5d9ce7625dfd251fe8cdc2e7fbcd161c6cfac2cd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 2 07:33:26 2026 -0500

    Javadoc
---
 .../vfs2/provider/http5/Http5FileProvider.java     | 36 +++++++++++-----------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
index 65d452eb0..ff8d8fe9a 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http5/Http5FileProvider.java
@@ -170,10 +170,10 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider {
     /**
      * Creates an {@link HttpClient} object for an http4 file system.
      *
-     * @param builder Configuration options builder for http4 provider
-     * @param rootName The root path
-     * @param fileSystemOptions The file system options
-     * @return an {@link HttpClient} object
+     * @param builder Configuration options builder for http4 provider.
+     * @param rootName The root path.
+     * @param fileSystemOptions The file system options.
+     * @return an {@link HttpClient} object.
      * @throws FileSystemException if an error occurs.
      */
     protected HttpClient createHttpClient(final Http5FileSystemConfigBuilder builder, final GenericFileName rootName,
@@ -184,11 +184,11 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider {
     /**
      * Creates an {@link HttpClientBuilder} object. Invoked by {@link #createHttpClient(Http5FileSystemConfigBuilder, GenericFileName, FileSystemOptions)}.
      *
-     * @param builder Configuration options builder for HTTP4 provider
-     * @param rootName The root path
-     * @param fileSystemOptions The FileSystem options
-     * @return an {@link HttpClientBuilder} object
-     * @throws FileSystemException if an error occurs
+     * @param builder Configuration options builder for HTTP4 provider.
+     * @param rootName The root path.
+     * @param fileSystemOptions The FileSystem options.
+     * @return an {@link HttpClientBuilder} object.
+     * @throws FileSystemException if an error occurs.
      */
     protected HttpClientBuilder createHttpClientBuilder(final Http5FileSystemConfigBuilder builder, final GenericFileName rootName,
             final FileSystemOptions fileSystemOptions) throws FileSystemException {
@@ -217,11 +217,11 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider {
     /**
      * Creates an {@link HttpClientContext} object for an http4 file system.
      *
-     * @param builder Configuration options builder for http4 provider
-     * @param rootName The root path
-     * @param fileSystemOptions The FileSystem options
-     * @param authData The {@code UserAuthenticationData} object
-     * @return an {@link HttpClientContext} object
+     * @param builder Configuration options builder for http4 provider.
+     * @param rootName The root path.
+     * @param fileSystemOptions The FileSystem options.
+     * @param authData The {@code UserAuthenticationData} object.
+     * @return an {@link HttpClientContext} object.
      */
     protected HttpClientContext createHttpClientContext(final Http5FileSystemConfigBuilder builder,
             final GenericFileName rootName, final FileSystemOptions fileSystemOptions,
@@ -288,10 +288,10 @@ public class Http5FileProvider extends AbstractOriginatingFileProvider {
     /**
      * Creates {@link SSLContext} for HttpClient. Invoked by {@link #createHttpClientBuilder(Http5FileSystemConfigBuilder, GenericFileName, FileSystemOptions)}.
      *
-     * @param builder Configuration options builder for HTTP4 provider
-     * @param fileSystemOptions The FileSystem options
-     * @return a {@link SSLContext} for HttpClient
-     * @throws FileSystemException if an error occurs
+     * @param builder Configuration options builder for HTTP4 provider.
+     * @param fileSystemOptions The FileSystem options.
+     * @return a {@link SSLContext} for HttpClient.
+     * @throws FileSystemException if an error occurs.
      */
     protected SSLContext createSSLContext(final Http5FileSystemConfigBuilder builder,
             final FileSystemOptions fileSystemOptions) throws FileSystemException {


(commons-vfs) 04/04: [VFS-861] Http5FileProvider Basic authentication fails: UserAuthenticationData.setData(Type, char[]) should clone its array input.

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 bafb54b49db0cfa9c163fce03f28ff3d09742bb6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 2 07:43:26 2026 -0500

    [VFS-861] Http5FileProvider Basic authentication fails:
    UserAuthenticationData.setData(Type, char[]) should clone its array
    input.
---
 .../org/apache/commons/vfs2/UserAuthenticationData.java  | 16 ++++++++++------
 .../apache/commons/vfs2/UserAuthenticationDataTest.java  | 13 +++++++------
 src/changes/changes.xml                                  |  1 +
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
index d2f0d50d0..827e90f43 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
@@ -21,6 +21,7 @@ import java.util.Objects;
 import java.util.TreeMap;
 
 import org.apache.commons.lang3.ArrayFill;
+import org.apache.commons.lang3.ObjectUtils;
 
 /**
  * Contains various authentication data.
@@ -61,7 +62,8 @@ public class UserAuthenticationData {
         }
 
         /**
-         * @return The hash code.
+         * {@inheritDoc}
+         *
          * @since 2.0
          */
         @Override
@@ -70,6 +72,8 @@ public class UserAuthenticationData {
         }
 
         /**
+         * {@inheritDoc}
+         *
          * @return The type.
          * @since 2.0
          */
@@ -99,7 +103,7 @@ public class UserAuthenticationData {
     }
 
     /**
-     * Deletes all data stored within this authenticator.
+     * Clears all data stored within this authenticator.
      */
     public void cleanup() {
         // step 1: nullify character buffers
@@ -121,12 +125,12 @@ public class UserAuthenticationData {
     }
 
     /**
-     * Sets a data to this collection.
+     * Sets a typed char array. The array is cloned before storage.
      *
-     * @param type The Type to add
-     * @param data The data associated with the Type
+     * @param type The Type to add.
+     * @param data The data associated with the Type.
      */
     public void setData(final Type type, final char[] data) {
-        authenticationData.put(type, data);
+        authenticationData.put(type, ObjectUtils.clone(data));
     }
 }
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/UserAuthenticationDataTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/UserAuthenticationDataTest.java
index dad4e1b60..29c412d8b 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/UserAuthenticationDataTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/UserAuthenticationDataTest.java
@@ -24,13 +24,15 @@ import org.junit.jupiter.api.Test;
 
 public class UserAuthenticationDataTest {
 
+    private static final char[] DATA = "PMC".toCharArray();
+    
     @Test
     public void testCharacterBasedData() {
         final UserAuthenticationData data = new UserAuthenticationData();
-        final char[] array = "PMC".toCharArray();
+        final char[] array = DATA.clone();
         data.setData(UserAuthenticationData.USERNAME, array);
         data.setData(UserAuthenticationData.DOMAIN, "Apache".toCharArray());
-        assertSame(array, data.getData(UserAuthenticationData.USERNAME));
+        assertArrayEquals(array, data.getData(UserAuthenticationData.USERNAME));
         assertArrayEquals("Apache".toCharArray(), data.getData(UserAuthenticationData.DOMAIN));
         data.setData(UserAuthenticationData.DOMAIN, "Apache Commons".toCharArray());
         assertArrayEquals("Apache Commons".toCharArray(), data.getData(UserAuthenticationData.DOMAIN));
@@ -39,17 +41,16 @@ public class UserAuthenticationDataTest {
         data.cleanup();
         assertNull(data.getData(UserAuthenticationData.USERNAME));
         assertNull(data.getData(UserAuthenticationData.DOMAIN));
-        final char[] nulls = { 0, 0, 0 };
-        assertArrayEquals(nulls, array);
+        assertArrayEquals(DATA, array);
     }
 
     @Test
     public void testCustomType() {
         final UserAuthenticationData.Type type = new UserAuthenticationData.Type("JUNIT");
         final UserAuthenticationData data = new UserAuthenticationData();
-        final char[] array = "test".toCharArray();
+        final char[] array = DATA.clone();
         data.setData(type, array);
-        assertSame(array, data.getData(type));
+        assertArrayEquals(array, data.getData(type));
     }
 
 }
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 971ba5411..20f14dcaf 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -60,6 +60,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Fix build on Java 25, it's no longer experimental on GH CI.</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">DefaultFileMonitor now restores the current thread's interrupt flag when catching InterruptedException.</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">SftpFileSystem.executeCommand(String, StringBuilder) now restores the current thread's interrupt flag when catching InterruptedException.</action>
+      <action type="fix" dev="ggregory" due-to="Vaishnavi Kumbhar, Gary Gregory" issue="VFS-861">Http5FileProvider Basic authentication fails: UserAuthenticationData.setData(Type, char[]) should clone its array input.</action>
       <!-- ADD -->
       <action type="add" dev="ggregory" due-to="Gary Gregory">Add org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.sendOptions(String, String).</action>
       <action type="add" dev="ggregory" due-to="Gary Gregory">Add FtpFileSystemConfigBuilder.getControlEncodingCharset(FileSystemOptions) and deprecate getControlEncoding(FileSystemOptions).</action>