imran ansari created VFS-857:
--------------------------------

             Summary: listFiles() fails if the FTP Server (IIS based) contains 
any file with name in non-ascii Unicode character
                 Key: VFS-857
                 URL: https://issues.apache.org/jira/browse/VFS-857
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 2.9.0
         Environment: Microsoft IIS based FTP Server

!image-2025-02-14-19-24-23-511.png!
            Reporter: imran ansari
         Attachments: image-2025-02-14-19-24-23-511.png

FTPClient method listFiles() fails if the FTP Server contains a file with name 
in non-ascii Unicode character. This is mainly reported if the server is 
{*}Microsoft IIS based{*}.

 

VFS2 is not sending "OPTS UTF8 true" in the request for list files.


The following code does not have any effect in case the FTP Server is IIS.
{code:java}
confBuilder.setControlEncoding(options, StandardCharsets.UTF_8.displayName());
confBuilder.setAutodetectUtf8(options, Boolean.TRUE);
confBuilder.setFileType(options, FtpFileType.BINARY);{code}

org.apache.commons.vfs2.FileSystemException: Could not find files in 
"ftp://192.168.100.8/";

 
{panel:title=Stack Trace}
Caused by: org.apache.commons.vfs2.FileSystemException: Could not find files in 
"ftp://192.168.100.8/";.
    at 
org.apache.commons.vfs2//org.apache.commons.vfs2.provider.AbstractFileObject.findFiles(AbstractFileObject.java:1016)
    at 
org.apache.commons.vfs2//org.apache.commons.vfs2.provider.AbstractFileObject.listFiles(AbstractFileObject.java:1664)
    at 
org.apache.commons.vfs2//org.apache.commons.vfs2.provider.AbstractFileObject.findFiles(AbstractFileObject.java:991)
    ... 18 more
Caused by: java.nio.file.InvalidPathException: Illegal char <?> at index 49: 
/Best Practices & Guidelines/???? ???? ????? ???? ?? ???? ?? ????? ???? 
?????.docx
    at 
java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
    at 
java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
    at java.base/java.nio.file.Path.of(Path.java:147)
{panel}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to