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 2025/07/28 11:32:24 UTC
(commons-vfs) branch master updated (386134021 -> 062a5582c)
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 386134021 Bump github/codeql-action from 3.29.2 to 3.29.4 (#702)
new d89606b8c Camel case instance variable name
new aaba7932b Javadoc
new 26c8d9299 Javadoc
new ba68d0ee7 Reduce vertical whitespace
new 1fdad6dd7 Javadoc
new f4307695c Javadoc
new fa9f49b54 Javadoc
new c8b79c203 Reduce vertical whitespace
new 3bd63fcf3 Move instance variable declarationm closer to usage
new 6e4832c2a No need for these @SuppressWarnings since the whole class is deprecated
new 062a5582c Migrate from deprecated method
The 11 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:
.../commons/vfs2/auth/StaticUserAuthenticator.java | 14 ++++----------
.../apache/commons/vfs2/cache/AbstractFilesCache.java | 2 +-
.../commons/vfs2/cache/FileSystemAndNameKey.java | 6 +++---
.../org/apache/commons/vfs2/cache/LRUFilesCache.java | 19 ++++++++++---------
.../org/apache/commons/vfs2/cache/NullFilesCache.java | 2 +-
.../apache/commons/vfs2/cache/SoftRefFilesCache.java | 11 -----------
.../apache/commons/vfs2/cache/WeakRefFilesCache.java | 6 +++---
.../commons/vfs2/provider/ftp/FtpClientFactory.java | 5 +++--
.../provider/http4/Http4FileContentInfoFactory.java | 12 +++---------
.../commons/vfs2/provider/http4/Http4FileSystem.java | 2 --
10 files changed, 28 insertions(+), 51 deletions(-)
(commons-vfs) 01/11: Camel case instance variable name
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 d89606b8c8cdedcd7174ab11d7419f78c08af0e8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:47:36 2025 -0400
Camel case instance variable name
---
.../main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
index a8b735643..878aaafbc 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
@@ -53,11 +53,11 @@ public class LRUFilesCache extends AbstractFilesCache {
private static final long serialVersionUID = 20101208L;
/** The FileSystem */
- private final FileSystem filesystem;
+ private final FileSystem fileSystem;
MyLRUMap(final FileSystem filesystem, final int size) {
super(size, true);
- this.filesystem = filesystem;
+ this.fileSystem = filesystem;
}
@Override
@@ -77,9 +77,9 @@ public class LRUFilesCache extends AbstractFilesCache {
if (super.removeLRU(linkEntry)) {
// force detach
IOUtils.closeQuietly(fileObject, e -> VfsLog.warn(getLogger(), log, Messages.getString("vfs.impl/LRUFilesCache-remove-ex.warn"), e));
- final Map<?, ?> files = fileSystemCache.get(filesystem);
+ final Map<?, ?> files = fileSystemCache.get(fileSystem);
if (files.isEmpty()) {
- fileSystemCache.remove(filesystem);
+ fileSystemCache.remove(fileSystem);
}
return true;
}
(commons-vfs) 07/11: 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 fa9f49b5429143626562b080f6f9e58230f4cfee
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:56:04 2025 -0400
Javadoc
---
.../main/java/org/apache/commons/vfs2/cache/WeakRefFilesCache.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/WeakRefFilesCache.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/WeakRefFilesCache.java
index 3363aacb1..d30a1af56 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/WeakRefFilesCache.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/WeakRefFilesCache.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.commons.vfs2.cache;
import java.lang.ref.Reference;
@@ -23,9 +24,8 @@ import java.lang.ref.WeakReference;
import org.apache.commons.vfs2.FileObject;
/**
- * This implementation caches every file as long as it is strongly reachable by the Java vm. As soon as the object is no
- * longer reachable it will be discarded. In contrast to the SoftRefFilesCache this implementation might free resources
- * faster as it doesn't wait until a memory limitation.
+ * Caches every file as long as it is strongly reachable by the Java VM. As soon as the object is no longer reachable it will be discarded. In contrast to the
+ * {@link SoftRefFilesCache} this implementation might free resources faster as it doesn't wait until a memory limitation.
*
* @see java.lang.ref.WeakReference
*/
(commons-vfs) 08/11: Reduce vertical whitespace
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 c8b79c203bc61f681420219b01a86bc2b663c0b1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:57:09 2025 -0400
Reduce vertical whitespace
---
.../apache/commons/vfs2/auth/StaticUserAuthenticator.java | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
index eeefe9989..8e4e9c85a 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
@@ -31,13 +31,13 @@ public class StaticUserAuthenticator implements UserAuthenticator, Comparable<St
private static final Log LOG = LogFactory.getLog(StaticUserAuthenticator.class);
- /** The user name */
+ /** The user name. */
private final String userName;
- /** The password */
+ /** The password. */
private final String password;
- /** The user domain */
+ /** The user domain. */
private final String domain;
/**
@@ -58,13 +58,11 @@ public class StaticUserAuthenticator implements UserAuthenticator, Comparable<St
if (otherString == null) {
return 1;
}
-
return thisString.compareTo(otherString);
}
if (otherString != null) {
return -1;
}
-
return 0;
}
@@ -90,18 +88,14 @@ public class StaticUserAuthenticator implements UserAuthenticator, Comparable<St
if (this == obj) {
return true;
}
-
if (obj == null) {
return false;
}
-
if (getClass() != obj.getClass()) {
return false;
}
-
final StaticUserAuthenticator other = (StaticUserAuthenticator) obj;
- return Objects.equals(domain, other.domain) && Objects.equals(userName, other.userName)
- && Objects.equals(password, other.password);
+ return Objects.equals(domain, other.domain) && Objects.equals(userName, other.userName) && Objects.equals(password, other.password);
}
/**
(commons-vfs) 05/11: 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 1fdad6dd7e897fca4c639505c0ecbb08e28f2565
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:55:56 2025 -0400
Javadoc
---
.../src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java
index 21913e34d..aa61b6251 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/AbstractFilesCache.java
@@ -21,7 +21,7 @@ import org.apache.commons.vfs2.FilesCache;
import org.apache.commons.vfs2.provider.AbstractVfsComponent;
/**
- * Abstract base class for FilesCache implementations.
+ * Abstracts {@link FilesCache} implementations.
*/
public abstract class AbstractFilesCache extends AbstractVfsComponent implements FilesCache {
(commons-vfs) 06/11: 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 f4307695cf08a15cb0c7f9cdc3f69b91b5de4c49
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:56:00 2025 -0400
Javadoc
---
.../src/main/java/org/apache/commons/vfs2/cache/NullFilesCache.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/NullFilesCache.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/NullFilesCache.java
index aa6d881c8..bc7154190 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/NullFilesCache.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/NullFilesCache.java
@@ -21,7 +21,7 @@ import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystem;
/**
- * A {@link org.apache.commons.vfs2.FilesCache} implementation.
+ * A no-op {@link org.apache.commons.vfs2.FilesCache} implementation.
* <p>
* This implementation never ever caches a single file.
* </p>
(commons-vfs) 03/11: 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 26c8d929989203f99b3c6677f6bee737e3e8760a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:52:12 2025 -0400
Javadoc
---
.../java/org/apache/commons/vfs2/cache/FileSystemAndNameKey.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/FileSystemAndNameKey.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/FileSystemAndNameKey.java
index c55c8fda9..4c375bc18 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/FileSystemAndNameKey.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/FileSystemAndNameKey.java
@@ -27,13 +27,13 @@ import org.apache.commons.vfs2.FileSystem;
*/
final class FileSystemAndNameKey implements Comparable<FileSystemAndNameKey> {
- /** The FileSystem */
+ /** The FileSystem. */
private final FileSystem fileSystem;
- /** The FileName */
+ /** The FileName. */
private final FileName fileName;
- /** Hash code to identify this object */
+ /** Hash code to identify this object. */
private final int fileSystemId;
FileSystemAndNameKey(final FileSystem fileSystem, final FileName fileName) {
(commons-vfs) 09/11: Move instance variable declarationm closer to usage
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 3bd63fcf30097d7bb4c7901168fffb491f48b0a9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:59:48 2025 -0400
Move instance variable declarationm closer to usage
---
.../vfs2/provider/http4/Http4FileContentInfoFactory.java | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileContentInfoFactory.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileContentInfoFactory.java
index 0bc7fb693..eac5d8fb7 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileContentInfoFactory.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileContentInfoFactory.java
@@ -48,24 +48,18 @@ public class Http4FileContentInfoFactory implements FileContentInfoFactory {
@SuppressWarnings("unchecked")
@Override
public FileContentInfo create(final FileContent fileContent) throws FileSystemException {
- String contentMimeType = null;
- String contentCharset = null;
-
- try (Http4FileObject<Http4FileSystem> http4File = (Http4FileObject<Http4FileSystem>) FileObjectUtils
- .getAbstractFileObject(fileContent.getFile())) {
+ try (Http4FileObject<Http4FileSystem> http4File = (Http4FileObject<Http4FileSystem>) FileObjectUtils.getAbstractFileObject(fileContent.getFile())) {
final HttpResponse lastHeadResponse = http4File.getLastHeadResponse();
-
final Header header = lastHeadResponse.getFirstHeader(HTTP.CONTENT_TYPE);
-
+ String contentMimeType = null;
+ String contentCharset = null;
if (header != null) {
final ContentType contentType = ContentType.parse(header.getValue());
contentMimeType = contentType.getMimeType();
-
if (contentType.getCharset() != null) {
contentCharset = contentType.getCharset().name();
}
}
-
return new DefaultFileContentInfo(contentMimeType, contentCharset);
} catch (final IOException e) {
throw new FileSystemException(e);
(commons-vfs) 10/11: No need for these @SuppressWarnings since the whole class is deprecated
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 6e4832c2af51fff4f6f9c1b5802e5579015f0911
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 07:00:59 2025 -0400
No need for these @SuppressWarnings since the whole class is deprecated
---
.../java/org/apache/commons/vfs2/provider/http4/Http4FileSystem.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileSystem.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileSystem.java
index 35f2c41ff..4aa37e385 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileSystem.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http4/Http4FileSystem.java
@@ -77,13 +77,11 @@ public class Http4FileSystem extends AbstractFileSystem {
this.httpClientContext = httpClientContext;
}
- @SuppressWarnings("deprecation")
@Override
protected void addCapabilities(final Collection<Capability> caps) {
caps.addAll(Http4FileProvider.CAPABILITIES);
}
- @SuppressWarnings("deprecation")
@Override
protected FileObject createFile(final AbstractFileName name) throws Exception {
return new Http4FileObject<>(name, this);
(commons-vfs) 04/11: Reduce vertical whitespace
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 ba68d0ee7287b3da4963b0c38a6f7c0a7f196914
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:55:09 2025 -0400
Reduce vertical whitespace
---
.../java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
index e58dd04d0..30a41dbf9 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
@@ -78,7 +78,6 @@ public class SoftRefFilesCache extends AbstractFilesCache {
public synchronized void clear(final FileSystem fileSystem) {
final Map<FileName, Reference<FileObject>> files = getOrCreateFilesystemCache(fileSystem);
final Iterator<FileSystemAndNameKey> iterKeys = refReverseMap.values().iterator();
-
while (iterKeys.hasNext()) {
final FileSystemAndNameKey key = iterKeys.next();
if (key.getFileSystem() == fileSystem) {
@@ -86,7 +85,6 @@ public class SoftRefFilesCache extends AbstractFilesCache {
files.remove(key.getFileName());
}
}
-
if (files.isEmpty()) {
close(fileSystem);
}
@@ -107,7 +105,6 @@ public class SoftRefFilesCache extends AbstractFilesCache {
if (log.isDebugEnabled()) {
log.debug("Close FileSystem: " + fileSystem.getRootName().getFriendlyURI());
}
-
fileSystemCache.remove(fileSystem);
if (fileSystemCache.isEmpty()) {
endThread();
@@ -136,12 +133,10 @@ public class SoftRefFilesCache extends AbstractFilesCache {
@Override
public synchronized FileObject getFile(final FileSystem fileSystem, final FileName fileName) {
final Map<FileName, Reference<FileObject>> files = getOrCreateFilesystemCache(fileSystem);
-
final Reference<FileObject> ref = files.get(fileName);
if (ref == null) {
return null;
}
-
final FileObject fo = ref.get();
if (fo == null) {
removeFile(fileSystem, fileName);
@@ -175,13 +170,10 @@ public class SoftRefFilesCache extends AbstractFilesCache {
if (log.isDebugEnabled()) {
log.debug("putFile: " + this.getSafeName(fileObject));
}
-
synchronized (this) {
final Map<FileName, Reference<FileObject>> files = getOrCreateFilesystemCache(fileObject.getFileSystem());
-
final Reference<FileObject> ref = createReference(fileObject, refQueue);
final FileSystemAndNameKey key = new FileSystemAndNameKey(fileObject.getFileSystem(), fileObject.getName());
-
final Reference<FileObject> old = files.put(fileObject.getName(), ref);
if (old != null) {
refReverseMap.remove(old);
@@ -195,13 +187,10 @@ public class SoftRefFilesCache extends AbstractFilesCache {
if (log.isDebugEnabled()) {
log.debug("putFile: " + this.getSafeName(fileObject));
}
-
synchronized (this) {
final Map<FileName, Reference<FileObject>> files = getOrCreateFilesystemCache(fileObject.getFileSystem());
-
final Reference<FileObject> ref = createReference(fileObject, refQueue);
final FileSystemAndNameKey key = new FileSystemAndNameKey(fileObject.getFileSystem(), fileObject.getName());
-
final Reference<FileObject> reference = files.get(fileObject.getName());
if (reference != null && reference.get() != null) {
return false;
(commons-vfs) 02/11: 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 aaba7932bad88620559f70478e387182371dd8fc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 06:51:30 2025 -0400
Javadoc
---
.../java/org/apache/commons/vfs2/cache/LRUFilesCache.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
index 878aaafbc..0bf1744d0 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/cache/LRUFilesCache.java
@@ -36,7 +36,7 @@ import org.apache.commons.vfs2.VfsLog;
import org.apache.commons.vfs2.util.Messages;
/**
- * This implementation caches every file using {@link LRUMap}.
+ * Caches every file using an {@link LRUMap}.
* <p>
* The default constructor uses a LRU size of 100 per file system.
* </p>
@@ -44,9 +44,10 @@ import org.apache.commons.vfs2.util.Messages;
public class LRUFilesCache extends AbstractFilesCache {
/**
- * The file cache
+ * The file cache.
*/
private class MyLRUMap extends LRUMap<FileName, FileObject> {
+
/**
* serialVersionUID format is YYYYMMDD for the date of the last binary change.
*/
@@ -88,7 +89,7 @@ public class LRUFilesCache extends AbstractFilesCache {
}
}
- /** The default LRU size */
+ /** The default LRU size. */
private static final int DEFAULT_LRU_SIZE = 100;
/** The logger to use. */
@@ -111,7 +112,7 @@ public class LRUFilesCache extends AbstractFilesCache {
/**
* Constructs a new instance with the desired LRU size.
*
- * @param lruSize the LRU size
+ * @param lruSize the LRU size.
*/
public LRUFilesCache(final int lruSize) {
this.lruSize = lruSize;
@@ -147,7 +148,7 @@ public class LRUFilesCache extends AbstractFilesCache {
/**
* Gets or creates a new Map.
*
- * @param fileSystem the key
+ * @param fileSystem the key.
* @return an existing or new Map.
*/
protected Map<FileName, FileObject> getOrCreateFilesystemCache(final FileSystem fileSystem) {
(commons-vfs) 11/11: Migrate from deprecated method
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 062a5582c72faccf0c86dd71a672cf75d2722d26
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jul 28 07:32:18 2025 -0400
Migrate from deprecated method
---
.../java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
index 55f2cbab9..09268c015 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java
@@ -21,6 +21,7 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.net.Proxy;
+import java.nio.charset.Charset;
import java.time.Duration;
import org.apache.commons.lang3.Range;
@@ -166,9 +167,9 @@ public final class FtpClientFactory {
if (connectTimeout != null) {
client.setDefaultTimeout(DurationUtils.toMillisInt(connectTimeout));
}
- final String controlEncoding = builder.getControlEncoding(fileSystemOptions);
+ final Charset controlEncoding = builder.getControlEncodingCharset(fileSystemOptions);
if (controlEncoding != null) {
- client.setControlEncoding(controlEncoding);
+ client.setControlEncoding(controlEncoding.name());
}
final Boolean autodetectUTF8 = builder.getAutodetectUtf8(fileSystemOptions);
if (autodetectUTF8 != null) {