commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tqup3 (JIRA)" <>
Subject [jira] [Created] (NET-609) DefaultUnixFTPFileEntryParserFactory Issue (leading spaces removal configuration)
Date Fri, 06 Jan 2017 11:14:58 GMT
Tqup3 created NET-609:

             Summary: DefaultUnixFTPFileEntryParserFactory Issue (leading spaces removal configuration)
                 Key: NET-609
             Project: Commons Net
          Issue Type: Bug
          Components: FTP
    Affects Versions: 3.4
            Reporter: Tqup3

I have an issue when calling listFiles() method on a FTP server.
The FTPFileEntry parser fail to parse the entry by adding a non existing leading space in
the filename.

In the FTP library, a boolean field is existing to remove the leading spaces and needs to
be set to true (in my case).

The issue is in the file (L124-L128) :
if (parser == null) { // Now try for aliases
            String ukey = key.toUpperCase(java.util.Locale.ENGLISH);
            if (ukey.indexOf(FTPClientConfig.SYST_UNIX) >= 0)
            { // FTPClientConfig.SYST_UNIX = "UNIX"
                parser = new UnixFTPEntryParser(config, false);
            else if  (ukey.indexOf(FTPClientConfig.SYST_UNIX_TRIM_LEADING) >= 0)
            { // FTPClientConfig.SYST_UNIX_TRIM_LEADING = "UNIX_LTRIM"
                parser = new UnixFTPEntryParser(config, true);
            // ...

I think the issue is that the else if condition is unreachable because if second condition
is true, the first condition is matching too :
FTPClientConfig.SYST_UNIX = "UNIX"

I think the issue is related to the commit on NET-566 (commit:

This message was sent by Atlassian JIRA

View raw message