Author: sebb
Date: Sat Jan 17 13:04:23 2015
New Revision: 1652600
URL: http://svn.apache.org/r1652600
Log:
No code change; split RE so separators are more clearly identified
Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
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=1652600&r1=1652599&r2=1652600&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
Sat Jan 17 13:04:23 2015
@@ -85,11 +85,20 @@ public class UnixFTPEntryParser extends
*/
private static final String REGEX =
"([bcdelfmpSs-])"
-
+"(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\+?\\s*"
- + "(\\d+)\\s+" // link count
+
+"(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\+?"
// permissions
+
+ + "\\s*" // separator TODO why
allow it to be omitted??
+
+ + "(\\d+)" // link count
+
+ + "\\s+" // separator
+
+ "(?:(\\S+(?:\\s\\S+)*?)\\s+)?" // owner name
(optional spaces)
+ "(?:(\\S+(?:\\s\\S+)*)\\s+)?" // group name
(optional spaces)
- + "(\\d+(?:,\\s*\\d+)?)\\s+" // size or n,m
+ + "(\\d+(?:,\\s*\\d+)?)" // size or n,m
+
+ + "\\s+" // separator
+
/*
* numeric or standard format date:
* yyyy-mm-dd (expecting hh:mm to follow)
@@ -98,12 +107,17 @@ public class UnixFTPEntryParser extends
* 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+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3}))\\s+"
+ +
"((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3}))"
+
+ + "\\s+" // separator
+
/*
year (for non-recent standard format) - yyyy
or time (for numeric or recent standard format) [h]h:mm
*/
- + "(\\d+(?::\\d+)?)\\s+"
+ + "(\\d+(?::\\d+)?)"
+
+ + "\\s+" // separator
+ "(\\S*)(\\s*.*)"; // the rest