commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sco...@apache.org
Subject svn commit: r151467 - in jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp: FTPClient.java parser/ConfigurableFTPFileEntryParserImpl.java
Date Sat, 05 Feb 2005 02:04:43 GMT
Author: scohen
Date: Fri Feb  4 18:04:42 2005
New Revision: 151467

URL: http://svn.apache.org/viewcvs?view=rev&rev=151467
Log:
Fix bugs found by W. McDonald Buck having to do with 
faulty passing of configuration.


Modified:
    jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java
    jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java

Modified: jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java?view=diff&r1=151466&r2=151467
==============================================================================
--- jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java (original)
+++ jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/FTPClient.java Fri
Feb  4 18:04:42 2005
@@ -298,6 +298,7 @@
         __dataTimeout = -1;
         __remoteVerificationEnabled = true;
         __parserFactory = new DefaultFTPFileEntryParserFactory();
+        __configuration      = null;
     }
 
 
@@ -311,7 +312,6 @@
         __fileFormat         = FTP.NON_PRINT_TEXT_FORMAT;
         __fileTransferMode   = FTP.STREAM_TRANSFER_MODE;
         __restartOffset      = 0;
-        __configuration      = null;
         __systemName         = null;
         __entryParser        = null;
         __bufferSize 		 = Util.DEFAULT_COPY_BUFFER_SIZE;
@@ -2343,9 +2343,9 @@
                     parserKey = getSystemName();
             	    
             	}
+            } else {
+	            __entryParser =  __parserFactory.createFileEntryParser(parserKey);
             }
-          
-            __entryParser =  __parserFactory.createFileEntryParser(parserKey);
         }
 
         return initiateListParsing(__entryParser, pathname);

Modified: jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java?view=diff&r1=151466&r2=151467
==============================================================================
--- jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java
(original)
+++ jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java
Fri Feb  4 18:04:42 2005
@@ -89,10 +89,17 @@
     public void configure(FTPClientConfig config)
     {
         if (this.timestampParser instanceof Configurable) {
+            FTPClientConfig defaultCfg = getDefaultConfiguration();
 	        if (config != null) {
+	            if (null == config.getDefaultDateFormatStr()) {
+	                config.setDefaultDateFormatStr(defaultCfg.getDefaultDateFormatStr());
+	            }
+	            if (null == config.getRecentDateFormatStr()) {
+	                config.setRecentDateFormatStr(defaultCfg.getRecentDateFormatStr());
+	            }
 	            ((Configurable)this.timestampParser).configure(config);
 	        } else {
-	            ((Configurable)this.timestampParser).configure(getDefaultConfiguration());
+	            ((Configurable)this.timestampParser).configure(defaultCfg);
 	        }
         }
     }



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