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/java/org/apache/commons/net/ftp/parser VMSVersioningFTPEntryParser.java
Date Sat, 10 Jan 2004 23:19:52 GMT
scohen      2004/01/10 15:19:52

  Modified:    net/src/java/org/apache/commons/net/ftp FTPClient.java
                        FTPFileEntryParser.java FTPFileEntryParserImpl.java
                        FTPFileList.java
               net/src/java/org/apache/commons/net/ftp/parser
                        VMSVersioningFTPEntryParser.java
  Log:
  Rename FTPFileEntryParser.removeDuplicates() to preParse() to allow more generic
  uses.
  
  Revision  Changes    Path
  1.27      +0 -2      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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- FTPClient.java	10 Jan 2004 15:36:40 -0000	1.26
  +++ FTPClient.java	10 Jan 2004 23:19:51 -0000	1.27
  @@ -2338,8 +2338,6 @@
           socket.close();
   
           completePendingCommand();
  -
  -//        return parser.removeDuplicates(list);
           return list;
       }
   
  
  
  
  1.14      +8 -8      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FTPFileEntryParser.java	10 Jan 2004 15:36:40 -0000	1.13
  +++ FTPFileEntryParser.java	10 Jan 2004 23:19:52 -0000	1.14
  @@ -164,18 +164,18 @@
   
       
       /**
  -     * This method is a hook for those implementers (such as 
  -     * VMSVersioningFTPEntryParser, and possibly others) which return
  -     * multiple files with the same name to remove the duplicates.
  +     * This method is a hook for those implementors (such as
  +     * VMSVersioningFTPEntryParser, and possibly others) which need to
  +     * perform some action upon the FTPFileList after it has been created
  +     * from the server stream, but before any clients see the list.
        * 
  -     * Implementations for systems that do not allow duplicates will
  -     * implement a NO-OP here.
  +     * The default implementation can be a no-op.
        * 
  -     * @param original Original list which may contain duplicates
  +     * @param original Original list after it has been created from the server stream
        * 
  -     * @return Original list purged of duplicates
  +     * @return Original list as processed by this method.
        */
  -    FTPFileList removeDuplicates(FTPFileList original);
  +    FTPFileList preParse(FTPFileList original);
   
   
   }
  
  
  
  1.2       +13 -11    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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FTPFileEntryParserImpl.java	10 Jan 2004 16:01:48 -0000	1.1
  +++ FTPFileEntryParserImpl.java	10 Jan 2004 23:19:52 -0000	1.2
  @@ -230,20 +230,22 @@
           return reader.readLine();
       }
       /**
  -     * Implement hook provided for those implementers (such as
  -     * VMSVersioningFTPEntryParser, and possibly others) which return
  -     * multiple files with the same name to remove the duplicates by
  -     * defining a no-op method which simply returns the original
  -     * FTPFileList.  This method should not be overridden except in 
  -     * parsers that really have to remove duplicates.
  +     * This method is a hook for those implementors (such as
  +     * VMSVersioningFTPEntryParser, and possibly others) which need to
  +     * perform some action upon the FTPFileList after it has been created
  +     * from the server stream, but before any clients see the list.
        *
  -     * @param original Original list 
  +     * This default implementation is a no-op.
        *
  -     * @return Original list
  +     * @param original Original list after it has been created from the server stream
  +     *
  +     * @return <code>original</code> unmodified.
        */
  -    public FTPFileList removeDuplicates(FTPFileList original) {
  -        return original;
  -    }
  +     public FTPFileList preParse(FTPFileList original) { 
  +         return original;                                
  +     } 
  +      
  +                                                        
   
       /**
        * return a ListIterator to the internal Vector of lines of <code>list</code>,

  
  
  
  1.9       +1 -1      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FTPFileList.java	10 Jan 2004 15:36:40 -0000	1.8
  +++ FTPFileList.java	10 Jan 2004 23:19:52 -0000	1.9
  @@ -132,7 +132,7 @@
       {
           FTPFileList list = new FTPFileList(parser);
           list.readStream(stream);
  -        return parser.removeDuplicates(list);
  +        return parser.preParse(list);
       } 
   
       /**
  
  
  
  1.3       +2 -2      jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/VMSVersioningFTPEntryParser.java
  
  Index: VMSVersioningFTPEntryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/VMSVersioningFTPEntryParser.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- VMSVersioningFTPEntryParser.java	10 Jan 2004 16:01:49 -0000	1.2
  +++ VMSVersioningFTPEntryParser.java	10 Jan 2004 23:19:52 -0000	1.3
  @@ -147,7 +147,7 @@
        *
        * @return Original list purged of duplicates
        */
  -    public FTPFileList removeDuplicates(FTPFileList original) {
  +    public FTPFileList preParse(FTPFileList original) {
           HashMap existingEntries = new HashMap();
           ListIterator iter = getInternalIteratorForFtpFileList(original);
           while (iter.hasNext()) {
  
  
  

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