Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 11296 invoked from network); 15 Apr 2005 16:46:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Apr 2005 16:46:37 -0000 Received: (qmail 46810 invoked by uid 500); 15 Apr 2005 16:46:32 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 46725 invoked by uid 500); 15 Apr 2005 16:46:31 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 46710 invoked by uid 500); 15 Apr 2005 16:46:31 -0000 Received: (qmail 46706 invoked by uid 99); 15 Apr 2005 16:46:31 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 15 Apr 2005 09:46:31 -0700 Received: (qmail 11280 invoked by uid 65534); 15 Apr 2005 16:46:30 -0000 Message-ID: <20050415164630.11279.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Fri, 15 Apr 2005 16:46:29 -0000 Subject: svn commit: r161502 - jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java To: commons-cvs@jakarta.apache.org From: rwinston@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: rwinston Date: Fri Apr 15 09:46:29 2005 New Revision: 161502 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D161502 Log: Changed REGEX variable to accomodate date dtrings with only two components.= There may be a better way to do this, however this seems to support both t= ypes. Existing unit tests pass. Modified: jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/pa= rser/UnixFTPEntryParser.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/jav= a/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java?view=3Ddiff&r1= =3D161501&r2=3D161502 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/pa= rser/UnixFTPEntryParser.java (original) +++ jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/pa= rser/UnixFTPEntryParser.java Fri Apr 15 09:46:29 2005 @@ -70,7 +70,7 @@ + "(\\S+)\\s+" + "(?:(\\S+)\\s+)?" + "(\\d+)\\s+" - + "(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+" /*the three parts of the date in any = order*/ + + "(\\S+)\\s+(\\S+)\\s+((\\S+)(?:\\s+))?" /*the three parts of the date = in any order*/ + "(\\S+)(\\s*.*)"; =20 =20 @@ -129,9 +129,10 @@ String usr =3D group(16); String grp =3D group(17); String filesize =3D group(18); - String datestr =3D group(19) + " " + group(20) + " " + group(2= 1); - String name =3D group(22); - String endtoken =3D group(23); + String datestr =3D group(19) + " " + group(20); + if(group(22) !=3D null && group(22) !=3D "") datestr +=3D " " = + group(22); + String name =3D group(23); + String endtoken =3D group(24); =20 try { --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org