commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject cvs commit: jakarta-commons/net/src/test/org/apache/commons/net/ftp ListingFunctionalTest.java
Date Tue, 06 Apr 2004 13:31:59 GMT
brekke      2004/04/06 06:31:59

  Modified:    net/src/java/org/apache/commons/net/ftp
                        DefaultFTPFileListParser.java FTP.java
                        FTPClient.java FTPConnectionClosedException.java
                        FTPFile.java FTPFileEntryParser.java
                        FTPFileIterator.java FTPFileList.java
                        FTPFileListParser.java
               net/src/java/org/apache/commons/net/ftp/parser
                        CompositeFileEntryParser.java
                        DefaultFTPFileEntryParserFactory.java
                        FTPFileEntryParserFactory.java
                        NTFTPEntryParser.java
                        RegexFTPFileEntryParserImpl.java
               net/src/test/org/apache/commons/net/ftp
                        ListingFunctionalTest.java
  Log:
  Some reformatting and removing of ^M's
  
  Revision  Changes    Path
  1.13      +1 -1      jakarta-commons/net/src/java/org/apache/commons/net/ftp/DefaultFTPFileListParser.java
  
  Index: DefaultFTPFileListParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/DefaultFTPFileListParser.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultFTPFileListParser.java	29 Feb 2004 10:26:54 -0000	1.12
  +++ DefaultFTPFileListParser.java	6 Apr 2004 13:31:58 -0000	1.13
  @@ -13,7 +13,7 @@
    * 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 org.apache.commons.net.ftp.parser.UnixFTPEntryParser;
   
   /**
  
  
  
  1.10      +1 -1      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTP.java
  
  Index: FTP.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTP.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FTP.java	29 Feb 2004 10:26:55 -0000	1.9
  +++ FTP.java	6 Apr 2004 13:31:59 -0000	1.10
  @@ -13,7 +13,7 @@
    * 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.BufferedWriter;
   import java.io.IOException;
  
  
  
  1.33      +1 -1      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPClient.java
  
  Index: FTPClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPClient.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- FTPClient.java	29 Feb 2004 10:26:55 -0000	1.32
  +++ FTPClient.java	6 Apr 2004 13:31:59 -0000	1.33
  @@ -13,7 +13,7 @@
    * 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.BufferedInputStream;
   import java.io.BufferedOutputStream;
   import java.io.BufferedReader;
  
  
  
  1.7       +1 -1      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPConnectionClosedException.java
  
  Index: FTPConnectionClosedException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPConnectionClosedException.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FTPConnectionClosedException.java	29 Feb 2004 10:26:55 -0000	1.6
  +++ FTPConnectionClosedException.java	6 Apr 2004 13:31:59 -0000	1.7
  @@ -13,7 +13,7 @@
    * 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.IOException;
   
   /***
  
  
  
  1.8       +1 -1      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFile.java
  
  Index: FTPFile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFile.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FTPFile.java	29 Feb 2004 10:26:55 -0000	1.7
  +++ FTPFile.java	6 Apr 2004 13:31:59 -0000	1.8
  @@ -13,7 +13,7 @@
    * 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.Serializable;
   import java.util.Calendar;
   
  
  
  
  1.18      +2 -2      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileEntryParser.java
  
  Index: FTPFileEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileEntryParser.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- FTPFileEntryParser.java	29 Feb 2004 10:26:55 -0000	1.17
  +++ FTPFileEntryParser.java	6 Apr 2004 13:31:59 -0000	1.18
  @@ -13,7 +13,7 @@
    * 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.util.List;
  
  
  
  1.11      +2 -2      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileIterator.java
  
  Index: FTPFileIterator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileIterator.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FTPFileIterator.java	29 Feb 2004 10:26:55 -0000	1.10
  +++ FTPFileIterator.java	6 Apr 2004 13:31:59 -0000	1.11
  @@ -13,7 +13,7 @@
    * 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.util.List;
   
   /**
  
  
  
  1.12      +2 -2      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileList.java
  
  Index: FTPFileList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileList.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FTPFileList.java	29 Feb 2004 10:26:55 -0000	1.11
  +++ FTPFileList.java	6 Apr 2004 13:31:59 -0000	1.12
  @@ -13,7 +13,7 @@
    * 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;
  
  
  
  1.10      +1 -1      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileListParser.java
  
  Index: FTPFileListParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPFileListParser.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FTPFileListParser.java	29 Feb 2004 10:26:55 -0000	1.9
  +++ FTPFileListParser.java	6 Apr 2004 13:31:59 -0000	1.10
  @@ -13,7 +13,7 @@
    * 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.IOException;
   import java.io.InputStream;
   
  
  
  
  1.2       +31 -31    jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/CompositeFileEntryParser.java
  
  Index: CompositeFileEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/CompositeFileEntryParser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CompositeFileEntryParser.java	6 Apr 2004 04:40:57 -0000	1.1
  +++ CompositeFileEntryParser.java	6 Apr 2004 13:31:59 -0000	1.2
  @@ -30,41 +30,41 @@
    */
   public class CompositeFileEntryParser extends FTPFileEntryParserImpl
   {
  -	private final FTPFileEntryParser[] ftpFileEntryParsers;
  -	private FTPFileEntryParser cachedFtpFileEntryParser;
  +    private final FTPFileEntryParser[] ftpFileEntryParsers;
  +    private FTPFileEntryParser cachedFtpFileEntryParser;
   
  -	public CompositeFileEntryParser(FTPFileEntryParser[] ftpFileEntryParsers)
  -	{
  -		super();
  +    public CompositeFileEntryParser(FTPFileEntryParser[] ftpFileEntryParsers)
  +    {
  +        super();
   
  -		this.cachedFtpFileEntryParser = null;
  -		this.ftpFileEntryParsers = ftpFileEntryParsers;
  -	}
  +        this.cachedFtpFileEntryParser = null;
  +        this.ftpFileEntryParsers = ftpFileEntryParsers;
  +    }
   
  -	public FTPFile parseFTPEntry(String listEntry)
  -	{
  +    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 = 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;
  -				}
  -			}
  -		}
  +                FTPFile matched = ftpFileEntryParser.parseFTPEntry(listEntry);
  +                if (matched != null)
  +                {
  +                    cachedFtpFileEntryParser = ftpFileEntryParser;
  +                    return matched;
  +                }
  +            }
  +        }
           return null;
  -	}
  +    }
   }
  
  
  
  1.11      +70 -70    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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultFTPFileEntryParserFactory.java	6 Apr 2004 04:40:57 -0000	1.10
  +++ DefaultFTPFileEntryParserFactory.java	6 Apr 2004 13:31:59 -0000	1.11
  @@ -28,7 +28,7 @@
    * @see org.apache.commons.net.ftp.FTPClient#setParserFactory
    */
   public class DefaultFTPFileEntryParserFactory 
  -implements FTPFileEntryParserFactory 
  +    implements FTPFileEntryParserFactory 
   {
       /**
        * This default implementation of the FTPFileEntryParserFactory
  @@ -37,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
  @@ -47,7 +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/>
  @@ -60,89 +60,89 @@
        *               <li><code>vms</code></li>
        *               </ul>
        * @return the FTPFileEntryParser corresponding to the supplied key.
  -	 * @throws 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)
  -			{
  -				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);
  -		}
  -	}
  +            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();
  -	}
  +    public FTPFileEntryParser createUnixFTPEntryParser()
  +    {
  +        return new UnixFTPEntryParser();
  +    }
   
  -	public FTPFileEntryParser createVMSVersioningFTPEntryParser()
  -	{
  -                return new VMSVersioningFTPEntryParser();
  -	}
  +    public FTPFileEntryParser createVMSVersioningFTPEntryParser()
  +    {
  +        return new VMSVersioningFTPEntryParser();
  +    }
   
  -	public FTPFileEntryParser createNTFTPEntryParser()
  -	{
  -		return new CompositeFileEntryParser(new FTPFileEntryParser[]
  -		{
  -			new NTFTPEntryParser(),
  -			new UnixFTPEntryParser()
  -		});
  -	}
  +    public FTPFileEntryParser createNTFTPEntryParser()
  +    {
  +        return new CompositeFileEntryParser(new FTPFileEntryParser[]
  +            {
  +                new NTFTPEntryParser(),
  +                new UnixFTPEntryParser()
  +            });
  +    }
   
  -	public FTPFileEntryParser createOS2FTPEntryParser()
  -	{
  -                return new OS2FTPEntryParser();
  -        }
  +    public FTPFileEntryParser createOS2FTPEntryParser()
  +    {
  +        return new OS2FTPEntryParser();
  +    }
   
  -	public FTPFileEntryParser createOS400FTPEntryParser()
  -	{
  -		return new OS400FTPEntryParser();
  +    public FTPFileEntryParser createOS400FTPEntryParser()
  +    {
  +        return new OS400FTPEntryParser();
       }
   }
   
  
  
  
  1.3       +3 -3      jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java
  
  Index: FTPFileEntryParserFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FTPFileEntryParserFactory.java	29 Feb 2004 10:26:56 -0000	1.2
  +++ FTPFileEntryParserFactory.java	6 Apr 2004 13:31:59 -0000	1.3
  @@ -13,13 +13,14 @@
    * 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;
   
   /**
    * The interface describes a factory for creating FTPFileEntryParsers
    */
  -public interface FTPFileEntryParserFactory {
  +public interface FTPFileEntryParserFactory
  +{
       /**
        * Implementation should be a method that decodes the
        * supplied key and creates an object implementing the
  @@ -35,6 +36,5 @@
        */
       public FTPFileEntryParser createFileEntryParser(String key) 
           throws ParserInitializationException;
  -
   
   }
  
  
  
  1.14      +4 -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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- NTFTPEntryParser.java	6 Apr 2004 04:40:57 -0000	1.13
  +++ NTFTPEntryParser.java	6 Apr 2004 13:31:59 -0000	1.14
  @@ -113,10 +113,10 @@
               {
                   ap = Calendar.PM;
                   if (hour != 12) {
  -                	hour += 12;
  +                    hour += 12;
                   }
               } else if (hour == 12) {
  -           		hour = 0;
  +                hour = 0;
               }
   
               cal.set(Calendar.SECOND, 0);
  @@ -126,7 +126,7 @@
               // since the latter has proven to be unreliable.
               // see bug 27085
               
  -//          cal.set(Calendar.AM_PM, ap);
  +            //          cal.set(Calendar.AM_PM, ap);
               cal.set(Calendar.HOUR_OF_DAY, hour);
               
               cal.getTimeInMillis();
  
  
  
  1.2       +2 -2      jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
  
  Index: RegexFTPFileEntryParserImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegexFTPFileEntryParserImpl.java	6 Apr 2004 04:40:57 -0000	1.1
  +++ RegexFTPFileEntryParserImpl.java	6 Apr 2004 13:31:59 -0000	1.2
  @@ -67,7 +67,7 @@
        */
       public RegexFTPFileEntryParserImpl(String regex)
       {
  -		super();
  +        super();
   
           try
           {
  @@ -77,7 +77,7 @@
           catch (MalformedPatternException e) 
           {
               throw new IllegalArgumentException (
  -                "Unparseable regex supplied:  " + regex);
  +                                                "Unparseable regex supplied:  " + regex);
           }
       }
   
  
  
  
  1.5       +2 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ListingFunctionalTest.java	6 Apr 2004 04:40:57 -0000	1.4
  +++ ListingFunctionalTest.java	6 Apr 2004 13:31:59 -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;
  +package org.apache.commons.net.ftp;
   import java.io.IOException;
   import java.lang.reflect.Method;
   import java.util.Arrays;
  
  
  

---------------------------------------------------------------------
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