From 0137b4cc49ebbc599380685f68e7b492020427ed Mon Sep 17 00:00:00 2001
From: Julian Reschke <reschke@apache.org>
Date: Thu, 8 May 2025 10:15:21 +0100
Subject: [PATCH] JCR-5145: Upgrade Commons VFS to 2.10.0

---
 jackrabbit-vfs-ext/pom.xml                    | 47 +++----------------
 .../vfs/ext/ds/TestVFSDataStore.java          |  6 ++-
 2 files changed, 11 insertions(+), 42 deletions(-)

diff --git a/jackrabbit-vfs-ext/pom.xml b/jackrabbit-vfs-ext/pom.xml
index fe7841ee9f6..418d84b9e9d 100644
--- a/jackrabbit-vfs-ext/pom.xml
+++ b/jackrabbit-vfs-ext/pom.xml
@@ -44,57 +44,22 @@
         <dependency>
           <groupId>org.apache.commons</groupId>
           <artifactId>commons-vfs2</artifactId>
-          <version>2.9.0</version>
+          <version>2.10.0</version>
           <exclusions>
             <exclusion>
-              <groupId>commons-logging</groupId>
-              <artifactId>commons-logging</artifactId>
-            </exclusion>
-            <exclusion>
-              <!-- see JCR-4839 -->
-              <groupId>org.apache.hadoop</groupId>
-              <artifactId>hadoop-hdfs-client</artifactId>
-            </exclusion>
-          </exclusions>
-        </dependency>
-        <!-- see JCR-4839 -->
-        <dependency>
-          <groupId>org.apache.hadoop</groupId>
-          <artifactId>hadoop-hdfs-client</artifactId>
-          <version>3.4.0</version>
-          <exclusions>
-            <exclusion>
-              <groupId>org.jetbrains.kotlin</groupId>
-              <artifactId>kotlin-stdlib-common</artifactId>
+              <groupId>commons-io</groupId>
+              <artifactId>commons-io</artifactId>
             </exclusion>
           </exclusions>
         </dependency>
-        <!-- see JCR-4839 -->
-        <dependency>
-          <groupId>org.jetbrains.kotlin</groupId>
-          <artifactId>kotlin-stdlib</artifactId>
-          <version>1.9.25</version>
-        </dependency>
         <dependency>
           <groupId>org.apache.commons</groupId>
           <artifactId>commons-vfs2-jackrabbit2</artifactId>
-          <version>2.9.0</version>
+          <version>2.10.0</version>
           <exclusions>
             <exclusion>
-              <groupId>commons-logging</groupId>
-              <artifactId>commons-logging</artifactId>
-            </exclusion>
-            <exclusion>
-              <groupId>org.apache.httpcomponents</groupId>
-              <artifactId>httpclient</artifactId>
-            </exclusion>
-            <exclusion>
-              <groupId>org.apache.jackrabbit</groupId>
-              <artifactId>jackrabbit-webdav</artifactId>
-            </exclusion>
-            <exclusion>
-              <groupId>org.apache.jackrabbit</groupId>
-              <artifactId>jackrabbit-standalone-components</artifactId>
+              <groupId>commons-io</groupId>
+              <artifactId>commons-io</artifactId>
             </exclusion>
           </exclusions>
         </dependency>
diff --git a/jackrabbit-vfs-ext/src/test/java/org/apache/jackrabbit/vfs/ext/ds/TestVFSDataStore.java b/jackrabbit-vfs-ext/src/test/java/org/apache/jackrabbit/vfs/ext/ds/TestVFSDataStore.java
index 869223a31f8..43736aaba2f 100644
--- a/jackrabbit-vfs-ext/src/test/java/org/apache/jackrabbit/vfs/ext/ds/TestVFSDataStore.java
+++ b/jackrabbit-vfs-ext/src/test/java/org/apache/jackrabbit/vfs/ext/ds/TestVFSDataStore.java
@@ -190,7 +190,11 @@ protected void doSetFileSystemOptionsPropertiesInString() throws Exception {
         File [] identities = configBuilder.getIdentities(fso);
         Assert.assertNotNull(identities);
         Assert.assertEquals(1, identities.length);
-        Assert.assertEquals("/home/tester/.ssh/id_rsa", FilenameUtils.separatorsToUnix(identities[0].getPath()));
+        String expectedPath = identities[0].getPath();
+        if (FilenameUtils.getPrefixLength(expectedPath) != 0) {
+            expectedPath = expectedPath.substring(FilenameUtils.getPrefixLength(expectedPath) - 1);
+        }
+        Assert.assertEquals("/home/tester/.ssh/id_rsa", FilenameUtils.separatorsToUnix(expectedPath));
         Assert.assertEquals(Integer.valueOf(30000), configBuilder.getTimeout(fso));
 
         dataStore.close();
