[
https://issues.apache.org/jira/browse/NET-566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14281406#comment-14281406
]
Sebb commented on NET-566:
--------------------------
Thanks!
I've checked many of the ftp mirrors used by the ASF and they all return a
single space between date and filename, so I'm leaning towards making that the
default behaviour. But it should still be possible to select the original
behaviour if necessary.
As part of this, the following commit allows the user to disable leading space
trimming:
URL: http://svn.apache.org/r1652621
Log:
NET-566 UnixFTPEntryParser Drops Leading Spaces from File Names
Add option to parser to not skip leading spaces
TODO make this the default but still allow reversion
Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
More work remains to be done on this to ensure that all existing uses of the
Unix parser are catered for.
e.g. the NT Parser may use the Unix parser, it must be possible for it to
continue to use the old parser settings if the default is changed.
> 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
> Attachments: unixParser.patch
>
>
> 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)