You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2005/04/16 15:04:35 UTC
svn commit: r161565 - in jakarta/commons/proper/net/trunk/src:
java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
Author: scohen
Date: Sat Apr 16 06:04:34 2005
New Revision: 161565
URL: http://svn.apache.org/viewcvs?view=rev&rev=161565
Log:
Handle the symbolic link case found by Neeme Praks
Modified:
jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
Modified: jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java?view=diff&r1=161564&r2=161565
==============================================================================
--- jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java (original)
+++ jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java Sat Apr 16 06:04:34 2005
@@ -80,7 +80,7 @@
+ "(?:(\\S+)\\s+)?"
+ "(\\d+)\\s+"
+ "(\\S+)\\s+(\\S+)\\s+((\\S+)(?:\\s+))?" /*the two or three parts of the date in any order*/
- + "(\\S+)(\\s*.*)";
+ + "(\\w+)(\\s*.*)";
/**
Modified: jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java?view=diff&r1=161564&r2=161565
==============================================================================
--- jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java (original)
+++ jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java Sat Apr 16 06:04:34 2005
@@ -69,7 +69,9 @@
"-rwsr-sr-- 1 500 500 0 Mar 25 08:23 testSuidExec",
"-rwsr-sr-- 1 500 500 0 Mar 25 0:23 testSuidExec2",
"drwxrwx---+ 23 500 500 0 Jan 10 13:09 testACL",
- "-rw-r--r-- 1 1 3518644 May 25 12:12 std"
+ "-rw-r--r-- 1 1 3518644 May 25 12:12 std",
+ "lrwxrwxrwx 1 neeme neeme 23 Mar 2 18:06 macros -> ./../../global/macros/."
+
};
/**
@@ -99,6 +101,8 @@
{
String testNumericDF =
"-rw-r----- 1 neeme neeme 346 2005-04-08 11:22 services.vsp";
+ String testNumericDF2 =
+ "lrwxrwxrwx 1 neeme neeme 23 2005-03-02 18:06 macros -> ./../../global/macros/.";
UnixFTPEntryParser parser =
new UnixFTPEntryParser(UnixFTPEntryParser.NUMERIC_DATE_CONFIG);
@@ -117,6 +121,11 @@
cal.set(Calendar.HOUR_OF_DAY, 11);
cal.set(Calendar.MINUTE, 22);
assertEquals(cal.getTime(), f.getTimestamp().getTime());
+
+ FTPFile f2 = parser.parseFTPEntry(testNumericDF2);
+ assertNotNull("Failed to parse " + testNumericDF2,
+ f2);
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org