[ 
https://issues.apache.org/jira/browse/NET-566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14262684#comment-14262684
 ] 

Sebb commented on NET-566:
--------------------------

Unix file names can contain just about any character except '/'.
They can start with a space, but creating such files is not a good idea as it 
makes them tricky to process.
Unix even supports a file name consisting of a single space.

NET already supports MLSD, for example:

http://commons.apache.org/proper/commons-net/javadocs/api-3.3/org/apache/commons/net/ftp/FTPClient.html#mlistDir%28%29

and MLST

http://commons.apache.org/proper/commons-net/javadocs/api-3.3/org/apache/commons/net/ftp/FTPClient.html#mlistFile%28java.lang.String%29

See also

http://commons.apache.org/proper/commons-net/javadocs/api-3.3/org/apache/commons/net/ftp/FTPClient.html#listNames%28%29

which may be useful.

However note that MLSD/MLST are not supported by all ftp servers. Not sure 
about NLST.

> UnixFTPEntryParser Drops Leading Spaces from File Names
> -------------------------------------------------------
>
>                 Key: NET-566
>                 URL: https://issues.apache.org/jira/browse/NET-566
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.3
>         Environment: OSX client, Linux ftpd
>            Reporter: Gary Russell
>
> The {{UnixFTPEntryParser}} [regular expression | 
> http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java?view=markup]
>  (line 106) consumes all spaces between the timestamp and the file name.
> The {{FTPFile.name}} property ends up getting a value with stripped leading 
> spaces.
> Reported by Spring Integration user at https://jira.spring.io/browse/INT-3591



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to