commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sco...@apache.org
Subject cvs commit: jakarta-commons/net/src/test/org/apache/commons/net/ftp ListingFunctionalTest.java
Date Tue, 06 Apr 2004 04:40:57 GMT
scohen      2004/04/05 21:40:57

  Modified:    net/src/java/org/apache/commons/net/ftp/parser
                        EnterpriseUnixFTPEntryParser.java
                        OS400FTPEntryParser.java UnixFTPEntryParser.java
                        VMSFTPEntryParser.java
                        DefaultFTPFileEntryParserFactory.java
                        NTFTPEntryParser.java OS2FTPEntryParser.java
               net/src/test/org/apache/commons/net/ftp/parser
                        DefaultFTPFileEntryParserFactoryTest.java
                        NTFTPEntryParserTest.java
               net/src/java/org/apache/commons/net/ftp
                        FTPFileListParserImpl.java
                        FTPFileEntryParserImpl.java
               net/src/test/org/apache/commons/net/ftp
                        ListingFunctionalTest.java
  Added:       net/src/java/org/apache/commons/net/ftp/parser
                        CompositeFileEntryParser.java
                        RegexFTPFileEntryParserImpl.java
               net/src/test/org/apache/commons/net/ftp/parser AllTests.java
  Log:
  PR: 28215
  Submitted by: Mario Ivankovits
  Reviewed by:	Steve Cohen
  
  Mario Ivankovits' elegant solution to the problem of the
  "ambidextrous" NT parser which can be configured as either
  Windows format or Unix.
  
  Changed slightly by Steve Cohen, avoiding spreading the impression that
  a server might switch at random between windows and unix.  Slight
  refactoring of tests to reflect the above change, and added
  AllTests.java in the ftp.parser directory.  Also moved Mario's new
  CompositeFileEntryParser and RegexFileEntryParser into the
  ftp.parser package.
  
  Revision  Changes    Path
  1.10      +3 -4      jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParser.java
  
  Index: EnterpriseUnixFTPEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParser.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- EnterpriseUnixFTPEntryParser.java	29 Feb 2004 10:26:56 -0000	1.9
  +++ EnterpriseUnixFTPEntryParser.java	6 Apr 2004 04:40:57 -0000	1.10
  @@ -13,11 +13,10 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp.parser;
  +package org.apache.commons.net.ftp.parser;
   import java.util.Calendar;
   
   import org.apache.commons.net.ftp.FTPFile;
  -import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
   
   /**
    * Parser for the Connect Enterprise Unix FTP Server From Sterling Commerce.  
  @@ -33,7 +32,7 @@
    * @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for usage instructions)
    * @see org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory
    */
  -public class EnterpriseUnixFTPEntryParser extends FTPFileEntryParserImpl
  +public class EnterpriseUnixFTPEntryParser extends RegexFTPFileEntryParserImpl
   {
   
       /**
  
  
  
  1.2       +135 -136  jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java
  
  Index: OS400FTPEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OS400FTPEntryParser.java	26 Mar 2004 12:54:57 -0000	1.1
  +++ OS400FTPEntryParser.java	6 Apr 2004 04:40:57 -0000	1.2
  @@ -1,136 +1,135 @@
  -/*
  - * Copyright 2004 The Apache Software Foundation
  - *
  - * Licensed under the Apache License, Version 2.0 (the "License");
  - * you may not use this file except in compliance with the License.
  - * You may obtain a copy of the License at
  - *
  - *     http://www.apache.org/licenses/LICENSE-2.0
  - *
  - * Unless required by applicable law or agreed to in writing, software
  - * distributed under the License is distributed on an "AS IS" BASIS,
  - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - * See the License for the specific language governing permissions and
  - * limitations under the License.
  - */
  -package org.apache.commons.net.ftp.parser;
  -
  -import org.apache.commons.net.ftp.FTPFile;
  -import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
  -
  -import java.util.Calendar;
  -
  -/**
  - * @version $Id$
  - */
  -
  -public class OS400FTPEntryParser extends FTPFileEntryParserImpl
  -{
  -	private static final String REGEX =
  -		"(\\S+)\\s+"				// user
  -		+ "(\\d+)\\s+"				// size
  -		+ "(\\d\\d)/(\\d\\d)/(\\d\\d)\\s+" // year/month/day
  -		+ "([0-2][0-9]):([0-5][0-9]):([0-5][0-9])\\s+" // hour:minutes:seconds
  -		+ "(\\*\\S+)\\s+"				// *STMF/*DIR
  -		+ "(\\S+/?)\\s*";				// filename
  -
  -	public OS400FTPEntryParser()
  -	{
  -		super(REGEX);
  -	}
  -
  -	public FTPFile parseFTPEntry(String entry)
  -	{
  -
  -		FTPFile file = new FTPFile();
  -		file.setRawListing(entry);
  -		int type;
  -
  -		if (matches(entry))
  -		{
  -			String usr = group(1);
  -			String filesize = group(2);
  -			String yr = group(3);
  -			String mo = group(4);
  -			String da = group(5);
  -			String hr = group(6);
  -			String min = group(7);
  -			String sec = group(8);
  -			String typeStr = group(9);
  -			String name = group(10);
  -
  -			if (typeStr.equalsIgnoreCase("*STMF"))
  -			{
  -				type = FTPFile.FILE_TYPE;
  -			}
  -			else if (typeStr.equalsIgnoreCase("*DIR"))
  -			{
  -				type = FTPFile.DIRECTORY_TYPE;
  -			}
  -			else
  -			{
  -				type = FTPFile.UNKNOWN_TYPE;
  -			}
  -
  -			file.setType(type);
  -
  -			file.setUser(usr);
  -
  -			try
  -			{
  -				file.setSize(Integer.parseInt(filesize));
  -			}
  -			catch (NumberFormatException e)
  -			{
  -				// intentionally do nothing
  -			}
  -
  -			Calendar cal = Calendar.getInstance();
  -			cal.set(Calendar.SECOND, 0);
  -			cal.set(Calendar.MINUTE, 0);
  -			cal.set(Calendar.HOUR_OF_DAY, 0);
  -
  -			try
  -			{
  -				int year = Integer.parseInt(yr, 10);
  -				if (year < 70)
  -				{
  -					year += 2000;
  -				}
  -				else
  -				{
  -					year += 1900;
  -				}
  -
  -				cal.set(Calendar.YEAR, year);
  -				cal.set(Calendar.MONTH, Integer.parseInt(mo, 10)-1);
  -				cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(da, 10));
  -
  -				cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hr, 10));
  -				cal.set(Calendar.MINUTE, Integer.parseInt(min, 10));
  -				cal.set(Calendar.SECOND, Integer.parseInt(sec, 10));
  -
  -				file.setTimestamp(cal);
  -			}
  -			catch (NumberFormatException e)
  -			{
  -				// do nothing, date will be uninitialized
  -			}
  -
  -			if (name.endsWith("/"))
  -			{
  -				name = name.substring(0, name.length() - 1);
  -			}
  -			int pos = name.lastIndexOf('/');
  -			if (pos > -1)
  -			{
  -				name = name.substring(pos + 1);
  -			}
  -
  -			file.setName(name);
  -
  -			return file;
  -		}
  -		return null;
  -	}
  -}
  +/*
  + * Copyright 2004 The Apache Software Foundation
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *     http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +package org.apache.commons.net.ftp.parser;
  +
  +import org.apache.commons.net.ftp.FTPFile;
  +
  +import java.util.Calendar;
  +
  +/**
  + * @version $Id$
  + */
  +
  +public class OS400FTPEntryParser extends RegexFTPFileEntryParserImpl
  +{
  +	private static final String REGEX =
  +		"(\\S+)\\s+"				// user
  +		+ "(\\d+)\\s+"				// size
  +		+ "(\\d\\d)/(\\d\\d)/(\\d\\d)\\s+" // year/month/day
  +		+ "([0-2][0-9]):([0-5][0-9]):([0-5][0-9])\\s+" // hour:minutes:seconds
  +		+ "(\\*\\S+)\\s+"				// *STMF/*DIR
  +		+ "(\\S+/?)\\s*";				// filename
  +
  +	public OS400FTPEntryParser()
  +	{
  +		super(REGEX);
  +	}
  +
  +	public FTPFile parseFTPEntry(String entry)
  +	{
  +
  +		FTPFile file = new FTPFile();
  +		file.setRawListing(entry);
  +		int type;
  +
  +		if (matches(entry))
  +		{
  +			String usr = group(1);
  +			String filesize = group(2);
  +			String yr = group(3);
  +			String mo = group(4);
  +			String da = group(5);
  +			String hr = group(6);
  +			String min = group(7);
  +			String sec = group(8);
  +			String typeStr = group(9);
  +			String name = group(10);
  +
  +			if (typeStr.equalsIgnoreCase("*STMF"))
  +			{
  +				type = FTPFile.FILE_TYPE;
  +			}
  +			else if (typeStr.equalsIgnoreCase("*DIR"))
  +			{
  +				type = FTPFile.DIRECTORY_TYPE;
  +			}
  +			else
  +			{
  +				type = FTPFile.UNKNOWN_TYPE;
  +			}
  +
  +			file.setType(type);
  +
  +			file.setUser(usr);
  +
  +			try
  +			{
  +				file.setSize(Integer.parseInt(filesize));
  +			}
  +			catch (NumberFormatException e)
  +			{
  +				// intentionally do nothing
  +			}
  +
  +			Calendar cal = Calendar.getInstance();
  +			cal.set(Calendar.SECOND, 0);
  +			cal.set(Calendar.MINUTE, 0);
  +			cal.set(Calendar.HOUR_OF_DAY, 0);
  +
  +			try
  +			{
  +				int year = Integer.parseInt(yr, 10);
  +				if (year < 70)
  +				{
  +					year += 2000;
  +				}
  +				else
  +				{
  +					year += 1900;
  +				}
  +
  +				cal.set(Calendar.YEAR, year);
  +				cal.set(Calendar.MONTH, Integer.parseInt(mo, 10)-1);
  +				cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(da, 10));
  +
  +				cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hr, 10));
  +				cal.set(Calendar.MINUTE, Integer.parseInt(min, 10));
  +				cal.set(Calendar.SECOND, Integer.parseInt(sec, 10));
  +
  +				file.setTimestamp(cal);
  +			}
  +			catch (NumberFormatException e)
  +			{
  +				// do nothing, date will be uninitialized
  +			}
  +
  +			if (name.endsWith("/"))
  +			{
  +				name = name.substring(0, name.length() - 1);
  +			}
  +			int pos = name.lastIndexOf('/');
  +			if (pos > -1)
  +			{
  +				name = name.substring(pos + 1);
  +			}
  +
  +			file.setName(name);
  +
  +			return file;
  +		}
  +		return null;
  +	}
  +}
  
  
  
  1.12      +3 -4      jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
  
  Index: UnixFTPEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- UnixFTPEntryParser.java	26 Mar 2004 12:32:21 -0000	1.11
  +++ UnixFTPEntryParser.java	6 Apr 2004 04:40:57 -0000	1.12
  @@ -13,10 +13,9 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp.parser;
  +package org.apache.commons.net.ftp.parser;
   import java.util.Calendar;
   import org.apache.commons.net.ftp.FTPFile;
  -import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
   
   /**
    * Implementation FTPFileEntryParser and FTPFileListParser for standard 
  @@ -29,7 +28,7 @@
    * @version $Id$
    * @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for usage instructions)
    */
  -public class UnixFTPEntryParser extends FTPFileEntryParserImpl
  +public class UnixFTPEntryParser extends RegexFTPFileEntryParserImpl
   {
       /**
        * months abbreviations looked for by this parser.  Also used
  
  
  
  1.21      +3 -4      jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
  
  Index: VMSFTPEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- VMSFTPEntryParser.java	29 Feb 2004 10:26:56 -0000	1.20
  +++ VMSFTPEntryParser.java	6 Apr 2004 04:40:57 -0000	1.21
  @@ -13,7 +13,7 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp.parser;
  +package org.apache.commons.net.ftp.parser;
   import java.io.BufferedReader;
   import java.io.IOException;
   import java.io.InputStream;
  @@ -21,7 +21,6 @@
   import java.util.StringTokenizer;
   
   import org.apache.commons.net.ftp.FTPFile;
  -import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
   import org.apache.commons.net.ftp.FTPListParseEngine;
   
   /**
  @@ -46,7 +45,7 @@
    * @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for usage instructions)
    * @see org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory
    */
  -public class VMSFTPEntryParser extends FTPFileEntryParserImpl
  +public class VMSFTPEntryParser extends RegexFTPFileEntryParserImpl
   {
   
   
  
  
  
  1.10      +71 -27    jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
  
  Index: DefaultFTPFileEntryParserFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultFTPFileEntryParserFactory.java	26 Mar 2004 12:54:57 -0000	1.9
  +++ DefaultFTPFileEntryParserFactory.java	6 Apr 2004 04:40:57 -0000	1.10
  @@ -13,7 +13,8 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp.parser;
  +package org.apache.commons.net.ftp.parser;
  +
   import org.apache.commons.net.ftp.FTPFileEntryParser;
   
   /**
  @@ -36,7 +37,7 @@
        * qualified classname of a class implementing the
        * FTPFileEntryParser interface.  If that succeeds, a parser 
        * object of this class is instantiated and is returned.
  -     * <p>
  +	 * <p/>
        * If <code>key</code> is not recognized as a fully qualified
        * classname known to the system, this method will then attempt
        * to see whether it <b>contains</b> a string identifying one of
  @@ -46,6 +47,7 @@
        * the corresponding parser successfully parses.  This enables 
        * this factory to be used in the auto-detection system. 
        * <p/>
  +	 *
        * @param key    should be a fully qualified classname corresponding to
        *               a class implementing the FTPFileEntryParser interface<br/>
        *               OR<br/>
  @@ -57,48 +59,90 @@
        *               <li><code>os/2</code></li>
        *               <li><code>vms</code></li>
        *               </ul>
  -     * 
        * @return the FTPFileEntryParser corresponding to the supplied key.
  -     * @exception ParserInitializationException
  -     *                   thrown if for any reason the factory cannot resolve 
  +	 * @throws ParserInitializationException thrown if for any reason the factory cannot resolve
        *                   the supplied key into an FTPFileEntryParser.
        * @see FTPFileEntryParser
        */
       public FTPFileEntryParser createFileEntryParser(String key) 
       {
           Class parserClass = null;
  -        try {
  +		try
  +		{
               parserClass = Class.forName(key);
               return (FTPFileEntryParser) parserClass.newInstance();
  -        } catch (ClassNotFoundException e) {
  +		}
  +		catch (ClassNotFoundException e)
  +		{
               String ukey = null;
  -            if (null != key) {
  +			if (null != key)
  +			{
                   ukey = key.toUpperCase();
               }
  -            if (ukey.indexOf("UNIX") >= 0) {
  +			if (ukey.indexOf("UNIX") >= 0)
  +			{
  +				return createUnixFTPEntryParser();
  +			}
  +			else if (ukey.indexOf("VMS") >= 0)
  +			{
  +				return createVMSVersioningFTPEntryParser();
  +			}
  +			else if (ukey.indexOf("WINDOWS") >= 0)
  +			{
  +				return createNTFTPEntryParser();
  +			}
  +			else if (ukey.indexOf("OS/2") >= 0)
  +			{
  +				return createOS2FTPEntryParser();
  +			}
  +			else if (ukey.indexOf("OS/400") >= 0)
  +			{
  +				return createOS400FTPEntryParser();
  +			}
  +			else
  +			{
  +				throw new ParserInitializationException("Unknown parser type: " + key);
  +			}
  +		}
  +		catch (ClassCastException e)
  +		{
  +			throw new ParserInitializationException(parserClass.getName()
  +					+ " does not implement the interface "
  +					+ "org.apache.commons.net.ftp.FTPFileEntryParser.", e);
  +		}
  +		catch (Throwable e)
  +		{
  +			throw new ParserInitializationException("Error initializing parser", e);
  +		}
  +	}
  +
  +	public FTPFileEntryParser createUnixFTPEntryParser()
  +	{
                   return new UnixFTPEntryParser();
  -            } else if (ukey.indexOf("VMS") >= 0) {
  +	}
  +
  +	public FTPFileEntryParser createVMSVersioningFTPEntryParser()
  +	{
                   return new VMSVersioningFTPEntryParser();
  -            } else if (ukey.indexOf("WINDOWS") >= 0) {
  -                return new NTFTPEntryParser();
  -            } else if (ukey.indexOf("OS/2") >= 0) {
  +	}
  +
  +	public FTPFileEntryParser createNTFTPEntryParser()
  +	{
  +		return new CompositeFileEntryParser(new FTPFileEntryParser[]
  +		{
  +			new NTFTPEntryParser(),
  +			new UnixFTPEntryParser()
  +		});
  +	}
  +
  +	public FTPFileEntryParser createOS2FTPEntryParser()
  +	{
                   return new OS2FTPEntryParser();
  -			} else if (ukey.indexOf("OS/400") >= 0) {
  -                return new OS400FTPEntryParser();
  -            } else {
  -                throw new ParserInitializationException(
  -                    "Unknown parser type: " + key);
  -            }
  -        } catch (ClassCastException e) {
  -            throw new ParserInitializationException(
  -                parserClass.getName() 
  -                + " does not implement the interface " 
  -                + "org.apache.commons.net.ftp.FTPFileEntryParser.", e);
  -        } catch (Throwable e) {
  -            throw new ParserInitializationException(
  -                "Error initializing parser", e);
           }
   
  +	public FTPFileEntryParser createOS400FTPEntryParser()
  +	{
  +		return new OS400FTPEntryParser();
       }
   }
   
  
  
  
  1.13      +3 -4      jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
  
  Index: NTFTPEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- NTFTPEntryParser.java	10 Mar 2004 03:37:16 -0000	1.12
  +++ NTFTPEntryParser.java	6 Apr 2004 04:40:57 -0000	1.13
  @@ -13,10 +13,9 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp.parser;
  +package org.apache.commons.net.ftp.parser;
   import java.util.Calendar;
   import org.apache.commons.net.ftp.FTPFile;
  -import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
   
   /**
    * Implementation of FTPFileEntryParser and FTPFileListParser for NT Systems.
  @@ -26,7 +25,7 @@
    * @version $Id$
    * @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for usage instructions)
    */
  -public class NTFTPEntryParser extends FTPFileEntryParserImpl
  +public class NTFTPEntryParser extends RegexFTPFileEntryParserImpl
   {
       /**
        * this is the regular expression used by this parser.
  
  
  
  1.10      +3 -4      jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParser.java
  
  Index: OS2FTPEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParser.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- OS2FTPEntryParser.java	29 Feb 2004 10:26:56 -0000	1.9
  +++ OS2FTPEntryParser.java	6 Apr 2004 04:40:57 -0000	1.10
  @@ -13,10 +13,9 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp.parser;
  +package org.apache.commons.net.ftp.parser;
   import java.util.Calendar;
   import org.apache.commons.net.ftp.FTPFile;
  -import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
   
   /**
    * Implementation of FTPFileEntryParser and FTPFileListParser for OS2 Systems.
  @@ -26,7 +25,7 @@
    * @version $Id$
    * @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for usage instructions)
    */
  -public class OS2FTPEntryParser extends FTPFileEntryParserImpl
  +public class OS2FTPEntryParser extends RegexFTPFileEntryParserImpl
   
   {
       /**
  
  
  
  1.1                  jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/CompositeFileEntryParser.java
  
  Index: CompositeFileEntryParser.java
  ===================================================================
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.commons.net.ftp.parser;
  
  import org.apache.commons.net.ftp.FTPFileEntryParser;
  import org.apache.commons.net.ftp.FTPFile;
  import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
  
  /**
   * This implementation allows to pack some FileEntryParsers together
   * and handle the case where to returned dirstyle isnt clearly defined.
   * The matching parser will be cached.
   * If the cached parser wont match due to the server changed the dirstyle,
   * a new matching parser will be searched.
   *
   * @author Mario Ivankovits <mario@ops.co.at>
   */
  public class CompositeFileEntryParser extends FTPFileEntryParserImpl
  {
  	private final FTPFileEntryParser[] ftpFileEntryParsers;
  	private FTPFileEntryParser cachedFtpFileEntryParser;
  
  	public CompositeFileEntryParser(FTPFileEntryParser[] ftpFileEntryParsers)
  	{
  		super();
  
  		this.cachedFtpFileEntryParser = null;
  		this.ftpFileEntryParsers = ftpFileEntryParsers;
  	}
  
  	public FTPFile parseFTPEntry(String listEntry)
  	{
          if (cachedFtpFileEntryParser != null)
  		{
  			FTPFile matched = cachedFtpFileEntryParser.parseFTPEntry(listEntry);
  			if (matched != null)
  			{
  				return matched;
  			}
  		} 
  		else
  		{
  			for (int iterParser=0; iterParser < ftpFileEntryParsers.length; iterParser++)
  			{
  				FTPFileEntryParser ftpFileEntryParser = ftpFileEntryParsers[iterParser];
  	
  				FTPFile matched = ftpFileEntryParser.parseFTPEntry(listEntry);
  				if (matched != null)
  				{
  					cachedFtpFileEntryParser = ftpFileEntryParser;
  					return matched;
  				}
  			}
  		}
          return null;
  	}
  }
  
  
  
  1.1                  jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
  
  Index: RegexFTPFileEntryParserImpl.java
  ===================================================================
  /*
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.commons.net.ftp.parser;
  
  import org.apache.commons.net.ftp.FTPFileEntryParserImpl;
  import org.apache.oro.text.regex.MalformedPatternException;
  import org.apache.oro.text.regex.MatchResult;
  import org.apache.oro.text.regex.Pattern;
  import org.apache.oro.text.regex.PatternMatcher;
  import org.apache.oro.text.regex.Perl5Compiler;
  import org.apache.oro.text.regex.Perl5Matcher;
  
  /**
   * This abstract class implements both the older FTPFileListParser and
   * newer FTPFileEntryParser interfaces with default functionality.
   * All the classes in the parser subpackage inherit from this.
   *
   * This is the base for all regular based FTPFileEntryParser
   * 
   * @author Steve Cohen <scohen@apache.org>
   */
  public abstract class RegexFTPFileEntryParserImpl extends FTPFileEntryParserImpl
  {
      /**
       * internal pattern the matcher tries to match, representing a file 
       * entry
       */
      private Pattern pattern = null;
  
      /**
       * internal match result used by the parser
       */
      private MatchResult result = null;
  
      /**
       * Internal PatternMatcher object used by the parser.  It has protected
       * scope in case subclasses want to make use of it for their own purposes.
       */
      protected PatternMatcher _matcher_ = null;
  
      
      /**
       * The constructor for a RegexFTPFileEntryParserImpl object.
       * 
       * @param regex  The regular expression with which this object is 
       * initialized.
       * 
       * @exception IllegalArgumentException
       * Thrown if the regular expression is unparseable.  Should not be seen in 
       * normal conditions.  It it is seen, this is a sign that a subclass has 
       * been created with a bad regular expression.   Since the parser must be 
       * created before use, this means that any bad parser subclasses created 
       * from this will bomb very quickly,  leading to easy detection.  
       */
      public RegexFTPFileEntryParserImpl(String regex)
      {
  		super();
  
          try
          {
              _matcher_ = new Perl5Matcher();
              pattern   = new Perl5Compiler().compile(regex);
          } 
          catch (MalformedPatternException e) 
          {
              throw new IllegalArgumentException (
                  "Unparseable regex supplied:  " + regex);
          }
      }
  
   
      /**
       * Convenience method delegates to the internal MatchResult's matches()
       * method.
       *
       * @param s the String to be matched
       * @return true if s matches this object's regular expression.
       */
      public boolean matches(String s)
      {
          this.result = null;
          if (_matcher_.matches(s.trim(), this.pattern))
          {
              this.result = _matcher_.getMatch();
          }
          return null != this.result;
      }
  
      /**
       * Convenience method delegates to the internal MatchResult's groups()
       * method.
       *
       * @return the number of groups() in the internal MatchResult.
       */
      public int getGroupCnt()
      {
          if (this.result == null)
          {
              return 0;
          }
          return this.result.groups();
      }
  
      /**
       * Convenience method delegates to the internal MatchResult's group()
       * method.
       * 
       * @param matchnum match group number to be retrieved
       * 
       * @return the content of the <code>matchnum'th<code> group of the internal
       *         match or null if this method is called without a match having 
       *         been made.
       */
      public String group(int matchnum)
      {
          if (this.result == null)
          {
              return null;
          }
          return this.result.group(matchnum);
      }
  
      /**
       * For debugging purposes - returns a string shows each match group by 
       * number.
       * 
       * @return a string shows each match group by number.
       */
      public String getGroupsAsString()
      {
          StringBuffer b = new StringBuffer();
          for (int i = 1; i <= this.result.groups(); i++)
          {
              b.append(i).append(") ").append(this.result.group(i))
                  .append(System.getProperty("line.separator"));
          }
          return b.toString();
  
      }
  }
  
  /* Emacs configuration
   * Local variables:        **
   * mode:             java  **
   * c-basic-offset:   4     **
   * indent-tabs-mode: nil   **
   * End:                    **
   */
  
  
  
  1.5       +2 -2      jakarta-commons/net/src/test/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
  
  Index: DefaultFTPFileEntryParserFactoryTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/test/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultFTPFileEntryParserFactoryTest.java	26 Mar 2004 12:54:57 -0000	1.4
  +++ DefaultFTPFileEntryParserFactoryTest.java	6 Apr 2004 04:40:57 -0000	1.5
  @@ -13,7 +13,7 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp.parser;
  +package org.apache.commons.net.ftp.parser;
   import junit.framework.TestCase;
   
   import org.apache.commons.net.ftp.FTPFileEntryParser;
  @@ -50,7 +50,7 @@
           }
   
           parser = factory.createFileEntryParser("WindowsNT");
  -        assertTrue(parser instanceof NTFTPEntryParser);
  +        assertTrue(parser instanceof CompositeFileEntryParser);
           
           parser = factory.createFileEntryParser("ThigaVMSaMaJig");
           assertTrue(parser instanceof VMSFTPEntryParser);
  
  
  
  1.9       +72 -31    jakarta-commons/net/src/test/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
  
  Index: NTFTPEntryParserTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/test/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- NTFTPEntryParserTest.java	10 Mar 2004 03:37:16 -0000	1.8
  +++ NTFTPEntryParserTest.java	6 Apr 2004 04:40:57 -0000	1.9
  @@ -13,7 +13,7 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp.parser;
  +package org.apache.commons.net.ftp.parser;
   import org.apache.commons.net.ftp.FTPFile;
   import org.apache.commons.net.ftp.FTPFileEntryParser;
   
  @@ -21,29 +21,47 @@
   
   /**
    * @author <a href="mailto:scohen@apache.org">Steve Cohen</a>
  - * @versionn $Id$
  + * @version $Id$
    */
   public class NTFTPEntryParserTest extends FTPParseTestFramework
   {
   
  -    private static final String [] goodsamples = {
  -                "05-26-95  10:57AM               143712 $LDR$",
  -                "05-20-97  03:31PM                  681 .bash_history",
  -                "12-05-96  05:03PM       <DIR>          absoft2",
  -                "11-14-97  04:21PM                  953 AUDITOR3.INI",
  -                "05-22-97  08:08AM                  828 AUTOEXEC.BAK",
  -                "01-22-98  01:52PM                  795 AUTOEXEC.BAT",
  -                "05-13-97  01:46PM                  828 AUTOEXEC.DOS",
  -                "12-03-96  06:38AM                  403 AUTOTOOL.LOG",
  -                "12-03-96  06:38AM       <DIR>          123xyz",
  -				"01-20-97  03:48PM       <DIR>          bin",
  -
  -            };
  +    private static final String [][] goodsamples = { 
  +    {
  +            "05-26-95  10:57AM               143712 $LDR$",
  +            "05-20-97  03:31PM                  681 .bash_history",
  +            "12-05-96  05:03PM       <DIR>          absoft2",
  +            "11-14-97  04:21PM                  953 AUDITOR3.INI",
  +            "05-22-97  08:08AM                  828 AUTOEXEC.BAK",
  +			"01-22-98  01:52PM                  795 AUTOEXEC.BAT",
  +			"05-13-97  01:46PM                  828 AUTOEXEC.DOS",
  +			"12-03-96  06:38AM                  403 AUTOTOOL.LOG",
  +			"12-03-96  06:38AM       <DIR>          123xyz",
  +			"01-20-97  03:48PM       <DIR>          bin",
  +	},
  +	{
  +			"-rw-r--r--   1 root     root       111325 Apr 27  2001 zxJDBC-2.0.1b1.tar.gz", 
  +			"-rw-r--r--   1 root     root       190144 Apr 27  2001 zxJDBC-2.0.1b1.zip",
  +			"-rwxr-xr-x   2 500      500           166 Nov  2  2001 73131-testtes1.afp",
  +			"-rw-r--r--   1 500      500           166 Nov  9  2001 73131-testtes1.AFP",
  +    	}
  +    };
  +    
  +    private static final String [] inconsistentsamples = {
  +    	"-rw-r--r--   1 root     root       111325 Apr 27  2001 zxJDBC-2.0.1b1.tar.gz", 
  +    	"-rwxr-xr-x   2 500      500           166 Nov  2  2001 73131-testtes1.afp",
  +		"05-22-97  08:08AM                  828 AUTOEXEC.BAK",
  +		"01-22-98  01:52PM                  795 AUTOEXEC.BAT",
  +		"05-13-97  01:46PM                  828 AUTOEXEC.DOS",
  +		"12-03-96  06:38AM                  403 AUTOTOOL.LOG",
  +		
  +    };
   
       private static final String [] badsamples = {
                   "05-26-1995  10:57AM               143712 $LDR$",
                   "20-05-97  03:31PM                  681 .bash_history",
  -                "12-05-96  17:03         <DIR>          absoft2",
  +				"drwxr-xr-x   2 root     99           4096 Feb 23 30:01 zzplayer",
  +				"12-05-96  17:03         <DIR>          absoft2",
                   "05-22-97  08:08                    828 AUTOEXEC.BAK",
                   "     0           DIR   05-19-97   12:56  local",
                   "     0           DIR   05-12-97   16:52  Maintenance Desktop",
  @@ -66,7 +84,7 @@
        */
       protected String[] getGoodListing()
       {
  -        return(goodsamples);
  +        return(goodsamples[0]);
       }
       
       /**
  @@ -82,7 +100,11 @@
        */
       protected FTPFileEntryParser getParser()
       {
  -        return(new NTFTPEntryParser());
  +		return new CompositeFileEntryParser(new FTPFileEntryParser[]
  +		{
  +			new NTFTPEntryParser(),
  +			new UnixFTPEntryParser()
  +		});
       }
       
       /**
  @@ -127,24 +149,43 @@
       /* (non-Javadoc)
   	 * @see org.apache.commons.net.ftp.parser.FTPParseTestFramework#testGoodListing()
   	 */
  -	public void testGoodListing() throws Exception {
  -		String[] goodsamples = getGoodListing();
  +	public void testConsistentListing() throws Exception {
   		for (int i = 0; i < goodsamples.length; i++)
   		{
  -
  -			String test = goodsamples[i];
  -			FTPFile f = getParser().parseFTPEntry(test);
  -			assertNotNull("Failed to parse " + test, 
  -					f);
  -			if (test.indexOf("<DIR>") >= 0) {
  -				assertEquals("directory.type", 
  -						FTPFile.DIRECTORY_TYPE, f.getType());
  -			} else {
  -				assertEquals("file.type", 
  -						FTPFile.FILE_TYPE, f.getType());
  +			FTPFileEntryParser parser = getParser();
  +			for (int j = 0; j < goodsamples[i].length; j++) {
  +				String test = goodsamples[i][j];
  +				FTPFile f = parser.parseFTPEntry(test);
  +				assertNotNull("Failed to parse " + test, 
  +						f);
  +				if (test.indexOf("<DIR>") >= 0) {
  +					assertEquals("directory.type", 
  +							FTPFile.DIRECTORY_TYPE, f.getType());
  +				}
  +				
   			}
  +
   		}
   		
  +	}
  +	
  +	// even though all these listings are good using one parser
  +	// or the other, this tests that a parser that has succeeded
  +	// on one format will fail if another format is substituted.
  +	public void testInconsistentListing() throws Exception {
  +		FTPFileEntryParser parser = getParser();
  +		for (int i = 0; i < 2; i++)
  +		{
  +			String test = inconsistentsamples[i];
  +			FTPFile f = parser.parseFTPEntry(test);
  +			assertNotNull("Failed to parse " + test, f);
  +		}
  +		for (int i = 2; i < inconsistentsamples.length; i++)
  +		{
  +			String test = inconsistentsamples[i];
  +			FTPFile f = parser.parseFTPEntry(test);
  +			assertNull("Should have failed to parse " + test, f);
  +		}
   	}
   	
   
  
  
  
  1.1                  jakarta-commons/net/src/test/org/apache/commons/net/ftp/parser/AllTests.java
  
  Index: AllTests.java
  ===================================================================
  /*
   * Created on Apr 5, 2004
   *
   * To change the template for this generated file go to
   * Window - Preferences - Java - Code Generation - Code and Comments
   */
  package org.apache.commons.net.ftp.parser;
  
  import junit.framework.Test;
  import junit.framework.TestSuite;
  
  /**
   * @author scohen
   *
   * To change the template for this generated type comment go to
   * Window - Preferences - Java - Code Generation - Code and Comments
   */
  public class AllTests {
  
  	public static Test suite() {
  		TestSuite suite =
  			new TestSuite("Test for org.apache.commons.net.ftp.parser");
  		//$JUnit-BEGIN$
  		suite.addTest(OS2FTPEntryParserTest.suite());
  		suite.addTest(VMSFTPEntryParserTest.suite());
  		suite.addTest(UnixFTPEntryParserTest.suite());
  		suite.addTestSuite(DefaultFTPFileEntryParserFactoryTest.class);
  		suite.addTest(EnterpriseUnixFTPEntryParserTest.suite());
  		suite.addTest(OS400FTPEntryParserTest.suite());
  		suite.addTest(NTFTPEntryParserTest.suite());
  		//$JUnit-END$
  		return suite;
  	}
  }
  
  
  
  1.14      +6 -4      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileListParserImpl.java
  
  Index: FTPFileListParserImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileListParserImpl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FTPFileListParserImpl.java	29 Feb 2004 10:26:55 -0000	1.13
  +++ FTPFileListParserImpl.java	6 Apr 2004 04:40:57 -0000	1.14
  @@ -15,22 +15,24 @@
    */
   package org.apache.commons.net.ftp;
   
  +import org.apache.commons.net.ftp.parser.*;
  +
   /**
    * This abstract class implements both the older FTPFileListParser and
    * newer FTPFileEntryParser interfaces with default functionality.
    * All the classes in the parser subpackage inherit from this.
    * 
    * @author Steve Cohen <scohen@apache.org>
  - * @see org.apache.commons.net.ftp.FTPFileEntryParserImpl
  + * @see org.apache.commons.net.ftp.parser.RegexFTPFileEntryParserImpl
    * @deprecated This class is deprecated as of version 1.2 and will be 
    *             removed in version 2.0 -- 
  - *             org.apache.commons.net.ftp.FTPFileEntryParserImpl is its
  + *             org.apache.commons.net.ftp.RegexFTPFileEntryParserImpl is its
    *             designated replacement.  Class has been renamed, entire 
  - *             implemenation is in FTPFileEntryParserImpl.
  + *             implemenation is in RegexFTPFileEntryParserImpl.
    * 
    */
   public abstract class FTPFileListParserImpl 
  -    extends FTPFileEntryParserImpl
  +    extends RegexFTPFileEntryParserImpl
   {
       /**
        * The constructor for a FTPFileListParserImpl object.
  
  
  
  1.6       +4 -123    jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java
  
  Index: FTPFileEntryParserImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileEntryParserImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FTPFileEntryParserImpl.java	29 Feb 2004 10:26:55 -0000	1.5
  +++ FTPFileEntryParserImpl.java	6 Apr 2004 04:40:57 -0000	1.6
  @@ -13,20 +13,13 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -package org.apache.commons.net.ftp;
  +package org.apache.commons.net.ftp;
   import java.io.BufferedReader;
   import java.io.IOException;
   import java.io.InputStream;
   import java.util.Iterator;
   import java.util.List;
   
  -import org.apache.oro.text.regex.MalformedPatternException;
  -import org.apache.oro.text.regex.MatchResult;
  -import org.apache.oro.text.regex.Pattern;
  -import org.apache.oro.text.regex.PatternMatcher;
  -import org.apache.oro.text.regex.Perl5Compiler;
  -import org.apache.oro.text.regex.Perl5Matcher;
  -
   /**
    * This abstract class implements both the older FTPFileListParser and
    * newer FTPFileEntryParser interfaces with default functionality.
  @@ -38,48 +31,10 @@
       implements FTPFileEntryParser, FTPFileListParser
   {
       /**
  -     * internal pattern the matcher tries to match, representing a file 
  -     * entry
  -     */
  -    private Pattern pattern = null;
  -
  -    /**
  -     * internal match result used by the parser
  -     */
  -    private MatchResult result = null;
  -
  -    /**
  -     * Internal PatternMatcher object used by the parser.  It has protected
  -     * scope in case subclasses want to make use of it for their own purposes.
  -     */
  -    protected PatternMatcher _matcher_ = null;
  -
  -    
  -    /**
        * The constructor for a FTPFileEntryParserImpl object.
  -     * 
  -     * @param regex  The regular expression with which this object is 
  -     * initialized.
  -     * 
  -     * @exception IllegalArgumentException
  -     * Thrown if the regular expression is unparseable.  Should not be seen in 
  -     * normal conditions.  It it is seen, this is a sign that a subclass has 
  -     * been created with a bad regular expression.   Since the parser must be 
  -     * created before use, this means that any bad parser subclasses created 
  -     * from this will bomb very quickly,  leading to easy detection.  
        */
  -    public FTPFileEntryParserImpl(String regex) 
  -    {
  -        try 
  -        {
  -            _matcher_ = new Perl5Matcher();
  -            pattern   = new Perl5Compiler().compile(regex);
  -        } 
  -        catch (MalformedPatternException e) 
  +    public FTPFileEntryParserImpl()
           {
  -            throw new IllegalArgumentException (
  -                "Unparseable regex supplied:  " + regex);
  -        }
       }
       
   
  @@ -95,7 +50,7 @@
        * @return The list of file information contained in the given path.  null
        *     if the list could not be obtained or if there are no files in
        *     the directory.
  -     * @exception IOException  If an I/O error occurs reading the listStream.
  +     * @exception java.io.IOException  If an I/O error occurs reading the listStream.
        ***/
       public FTPFile[] parseFileList(InputStream listStream) throws IOException 
       {
  @@ -104,76 +59,6 @@
   
       }
   
  - 
  -    /**
  -     * Convenience method delegates to the internal MatchResult's matches()
  -     * method.
  -     *
  -     * @param s the String to be matched
  -     * @return true if s matches this object's regular expression.
  -     */
  -    public boolean matches(String s)
  -    {
  -        this.result = null;
  -        if (_matcher_.matches(s.trim(), this.pattern))
  -        {
  -            this.result = _matcher_.getMatch();
  -        }
  -        return null != this.result;
  -    }
  -
  -    /**
  -     * Convenience method delegates to the internal MatchResult's groups()
  -     * method.
  -     *
  -     * @return the number of groups() in the internal MatchResult.
  -     */
  -    public int getGroupCnt()
  -    {
  -        if (this.result == null)
  -        {
  -            return 0;
  -        }
  -        return this.result.groups();
  -    }
  -
  -    /**
  -     * Convenience method delegates to the internal MatchResult's group()
  -     * method.
  -     * 
  -     * @param matchnum match group number to be retrieved
  -     * 
  -     * @return the content of the <code>matchnum'th<code> group of the internal
  -     *         match or null if this method is called without a match having 
  -     *         been made.
  -     */
  -    public String group(int matchnum)
  -    {
  -        if (this.result == null)
  -        {
  -            return null;
  -        }
  -        return this.result.group(matchnum);
  -    }
  -
  -    /**
  -     * For debugging purposes - returns a string shows each match group by 
  -     * number.
  -     * 
  -     * @return a string shows each match group by number.
  -     */
  -    public String getGroupsAsString()
  -    {
  -        StringBuffer b = new StringBuffer();
  -        for (int i = 1; i <= this.result.groups(); i++)
  -        {
  -            b.append(i).append(") ").append(this.result.group(i))
  -                .append(System.getProperty("line.separator"));
  -        }
  -        return b.toString();
  -
  -    }
  -
       /**
        * Reads the next entry using the supplied BufferedReader object up to
        * whatever delemits one entry from the next.  This default implementation
  @@ -183,7 +68,7 @@
        * read.
        *
        * @return A string representing the next ftp entry or null if none found.
  -     * @exception IOException thrown on any IO Error reading from the reader.
  +     * @exception java.io.IOException thrown on any IO Error reading from the reader.
        */
       public String readNextEntry(BufferedReader reader) throws IOException 
       {
  @@ -213,10 +98,6 @@
        	 }
            return original;                                
        } 
  -     
  -                                                        
  -
  -
   }
   
   /* Emacs configuration
  
  
  
  1.4       +3 -2      jakarta-commons/net/src/test/org/apache/commons/net/ftp/ListingFunctionalTest.java
  
  Index: ListingFunctionalTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/test/org/apache/commons/net/ftp/ListingFunctionalTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ListingFunctionalTest.java	29 Feb 2004 10:26:57 -0000	1.3
  +++ ListingFunctionalTest.java	6 Apr 2004 04:40:57 -0000	1.4
  @@ -43,7 +43,7 @@
           String[][] testData = 
               {
                   {
  -                    "ftp.ibiblio.org", "unix", "windows",
  +                    "ftp.ibiblio.org", "unix", "vms",
                       "HA!", "javaio.jar",
                       "pub/languages/java/javafaq"
                   },
  @@ -54,6 +54,7 @@
                   {
                       "h71000.www7.hp.com", "vms", "windows",
                       "[.HA!]", "ACLOCAL.M4;1",
  +					
                       "[.FREEWARE50.XTERM]"
                   }
               };
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message