Author: sebb
Date: Thu Mar 10 01:03:44 2011
New Revision: 1080088
URL: http://svn.apache.org/viewvc?rev=1080088&view=rev
Log:
NET-365 FTPClient.listFiles() does not work properly, if remote server speaks
German.
Match non-space{3} instead of A-Za-z{3}
Modified:
commons/proper/net/trunk/src/changes/changes.xml
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
Modified: commons/proper/net/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1080088&r1=1080087&r2=1080088&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml (original)
+++ commons/proper/net/trunk/src/changes/changes.xml Thu Mar 10 01:03:44 2011
@@ -57,8 +57,13 @@ The <action> type attribute can be add,u
<body>
<release version="3.0" date="TBA" description="TBA">
+ <action issue="NET-365" dev="sebb" type="fix">
+ FTPClient.listFiles() does not work properly, if remote server
speaks German.
+ Match non-space{3} instead of A-Za-z{3}
+ </action>
<action issue="NET-366" dev="sebb" type="fix">
- FTPClientConfig: setServerLanguageCode and setShortMonthNames do
not work
+ FTPClientConfig: setServerLanguageCode and setShortMonthNames do
not work.
+ Ensure that config is passed to all parsers that can use it.
</action>
<action issue="NET-276" dev="sebb" type="fix">
NNTPClient has problems with group listings for large groups.
Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java?rev=1080088&r1=1080087&r2=1080088&view=diff
==============================================================================
---
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
(original)
+++
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
Thu Mar 10 01:03:44 2011
@@ -91,10 +91,12 @@ public class UnixFTPEntryParser extends
/*
* numeric or standard format date:
* yyyy-mm-dd (expecting hh:mm to follow)
- * MMMM [d]d
+ * MMM [d]d
* [d]d MMM
+ * N.B. use non-space for MMM to allow for languages such as German
which use
+ * diacritics (e.g. umlaut) in some abbreviations.
*/
- +
"((?:\\d+[-/]\\d+[-/]\\d+)|(?:[a-zA-Z]{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+[a-zA-Z]{3}))\\s+"
+ +
"((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3}))\\s+"
/*
year (for non-recent standard format) - yyyy
or time (for numeric or recent standard format) [h]h:mm