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 2004/02/19 03:17:20 UTC

cvs commit: jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser VMSFTPEntryParser.java

scohen      2004/02/18 18:17:20

  Modified:    net/src/java/org/apache/commons/net/ftp FTPClient.java
                        FTPListParseEngine.java
               net/src/test/org/apache/commons/net/ftp
                        ListingFunctionalTest.java
               net/src/test/org/apache/commons/net/ftp/parser
                        VMSFTPEntryParserTest.java
               net/src/java/org/apache/commons/net/ftp/parser
                        VMSFTPEntryParser.java
  Log:
  Fix VMSFTPEntryParser so that it passes Jeff Brekke's new
  functional test.
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.31      +6 -6      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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- FTPClient.java	17 Jan 2004 18:36:17 -0000	1.30
  +++ FTPClient.java	19 Feb 2004 02:17:19 -0000	1.31
  @@ -2183,7 +2183,7 @@
       public FTPFile[] listFiles() 
       throws IOException    
       {
  -        return listFiles(".");
  +        return listFiles("");
       }
   
       /**
  @@ -2222,7 +2222,7 @@
       public FTPListParseEngine initiateListParsing()
   	throws IOException
   	{
  -    	return initiateListParsing(".");
  +    	return initiateListParsing("");
       }
   	
       /**
  @@ -2371,14 +2371,14 @@
   	{
       	Socket socket;
   
  +    	FTPListParseEngine engine = new FTPListParseEngine(parser);
       	if ((socket = _openDataConnection_(FTPCommand.LIST, pathname)) == null)
       	{
  -    		return null;
  +    		return engine;
       	}
       	
       	
  -    	FTPListParseEngine engine = new FTPListParseEngine(parser);
  -    	engine.readServerList(socket.getInputStream());
  +     	engine.readServerList(socket.getInputStream());
   
       	socket.close();
   
  @@ -2463,7 +2463,7 @@
       	FTPFile[] results;
   
       	if ((socket = _openDataConnection_(FTPCommand.LIST, pathname)) == null)
  -    		return null;
  +    		return new FTPFile[0];
   
       	results = parser.parseFileList(socket.getInputStream());
   
  
  
  
  1.4       +2 -2      jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPListParseEngine.java
  
  Index: FTPListParseEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPListParseEngine.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FTPListParseEngine.java	17 Jan 2004 18:48:36 -0000	1.3
  +++ FTPListParseEngine.java	19 Feb 2004 02:17:19 -0000	1.4
  @@ -111,7 +111,7 @@
    */
   public class FTPListParseEngine {
   	private List entries = new LinkedList();
  -	private ListIterator _internalIterator; 
  +	private ListIterator _internalIterator = entries.listIterator(); 
   	
   	FTPFileEntryParser parser = null;
   	
  
  
  
  1.2       +4 -4      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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ListingFunctionalTest.java	17 Feb 2004 05:14:02 -0000	1.1
  +++ ListingFunctionalTest.java	19 Feb 2004 02:17:19 -0000	1.2
  @@ -90,12 +90,12 @@
                   {
                       "ftp.wacom.com", "windows", "VMS", "HA!",
                       "wacom97.zip", "pub\\ftp\\drivers"
  -                }/*,
  +                },
                   {
                       "h71000.www7.hp.com", "vms", "windows",
  -                    "[.HA!]", "XTERM.EXE;1",
  +                    "[.HA!]", "ACLOCAL.M4;1",
                       "[.FREEWARE50.XTERM]"
  -                }*/
  +                }
               };
           Class clasz = ListingFunctionalTest.class;
           Method[] methods = clasz.getDeclaredMethods();
  
  
  
  1.12      +3 -2      jakarta-commons/net/src/test/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java
  
  Index: VMSFTPEntryParserTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/test/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- VMSFTPEntryParserTest.java	17 Jan 2004 17:20:26 -0000	1.11
  +++ VMSFTPEntryParserTest.java	19 Feb 2004 02:17:19 -0000	1.12
  @@ -100,7 +100,8 @@
           "UNXMERGE.COM;15          1/15         20-AUG-1996 13:59:50  [POSTWARE,LP]    (RWE,RWE,RWE,RE)",
           "UNXTEMP.COM;7            1/15         15-AUG-1996 14:10:38  [POSTWARE,LP]    (RWE,RWE,RWE,RE)",
           "UNZIP_AND_ATTACH_FILES.COM;12\r\n                        14/15         24-JUL-2002 14:35:40  [TRANSLATED]    (RWE,RWE,RWE,RE)",
  -        "UNZIP_AND_ATTACH_FILES.SAV;1\r\n                        14/15         17-JAN-2002 11:13:53  [POSTWARE,LP]    (RWE,RWED,RWE,RE)"        
  +        "UNZIP_AND_ATTACH_FILES.SAV;1\r\n                        14/15         17-JAN-2002 11:13:53  [POSTWARE,LP]    (RWE,RWED,RWE,RE)",       
  +        "FREEWARE40.DIR;1        27/36         16-FEB-1999 10:01:46  [AP_HTTPD,APACHE$WWW                               (RWE,RWE,RE,RE)"
       };
       
       private static final String fullListing = "Directory USER1:[TEMP]\r\n\r\n"+
  
  
  
  1.19      +2 -2      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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- VMSFTPEntryParser.java	17 Jan 2004 17:20:26 -0000	1.18
  +++ VMSFTPEntryParser.java	19 Feb 2004 02:17:19 -0000	1.19
  @@ -107,7 +107,7 @@
           + MONTHS 
           + "-([0-9]{4})\\s*"
           + "((?:[01]\\d)|(?:2[0-3])):([012345]\\d):([012345]\\d)\\s*"
  -        + "\\[(([0-9$A-Za-z_]+)|([0-9$A-Za-z_]+),([0-9$a-zA-Z_]+))\\]\\s*" 
  +        + "\\[(([0-9$A-Za-z_]+)|([0-9$A-Za-z_]+),([0-9$a-zA-Z_]+))\\]?\\s*" 
           + "\\([a-zA-Z]*,[a-zA-Z]*,[a-zA-Z]*,[a-zA-Z]*\\)";
   
   
  
  
  

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