commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r658520 [1/3] - in /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net: ./ ftp/ ftp/parser/ smtp/ telnet/ tftp/ util/
Date Wed, 21 May 2008 01:14:12 GMT
Author: sebb
Date: Tue May 20 18:14:11 2008
New Revision: 658520

URL: http://svn.apache.org/viewvc?rev=658520&view=rev
Log:
Replace tabs

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/SocketClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTP.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/smtp/SMTP.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/smtp/SMTPClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/tftp/TFTPServer.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/util/ListenerList.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/util/SubnetUtils.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/SocketClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/SocketClient.java?rev=658520&r1=658519&r2=658520&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/SocketClient.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/SocketClient.java Tue May 20 18:14:11 2008
@@ -61,10 +61,10 @@
 
     /** The default SocketFactory shared by all SocketClient instances. */
     private static final SocketFactory __DEFAULT_SOCKET_FACTORY =
-    		SocketFactory.getDefault();
+            SocketFactory.getDefault();
     
     private static final ServerSocketFactory __DEFAULT_SERVER_SOCKET_FACTORY = 
-    		ServerSocketFactory.getDefault();
+            ServerSocketFactory.getDefault();
 
     /** The timeout to use after opening a socket. */
     protected int _timeout_;
@@ -149,8 +149,8 @@
     public void connect(InetAddress host, int port)
     throws SocketException, IOException
     {
-    	_socket_ = _socketFactory_.createSocket();
-    	_socket_.connect(new InetSocketAddress(host, port), connectTimeout);
+        _socket_ = _socketFactory_.createSocket();
+        _socket_.connect(new InetSocketAddress(host, port), connectTimeout);
 
         _connectAction_();
     }
@@ -172,9 +172,9 @@
     public void connect(String hostname, int port)
     throws SocketException, IOException
     {
-    	_socket_= _socketFactory_.createSocket();
-    	_socket_.connect(new InetSocketAddress(hostname, port), connectTimeout);
-    	
+        _socket_= _socketFactory_.createSocket();
+        _socket_.connect(new InetSocketAddress(hostname, port), connectTimeout);
+        
         _connectAction_();
     }
 
@@ -198,9 +198,9 @@
                         InetAddress localAddr, int localPort)
     throws SocketException, IOException
     {
-    	_socket_ = _socketFactory_.createSocket();
-    	_socket_.bind(new InetSocketAddress(localAddr, localPort));
-    	_socket_.connect(new InetSocketAddress(host, port), connectTimeout);
+        _socket_ = _socketFactory_.createSocket();
+        _socket_.bind(new InetSocketAddress(localAddr, localPort));
+        _socket_.connect(new InetSocketAddress(host, port), connectTimeout);
         
         _connectAction_();
     }
@@ -299,9 +299,9 @@
     public boolean isConnected()
     {
         if (_socket_ == null)
-        	return false;
+            return false;
         
-    	return _socket_.isConnected();
+        return _socket_.isConnected();
     }
 
 
@@ -383,7 +383,7 @@
      * @since 2.0
      */
     public void setSendBufferSize(int size) throws SocketException {
-    	_socket_.setSendBufferSize(size);
+        _socket_.setSendBufferSize(size);
     }
     
     
@@ -395,7 +395,7 @@
      * @since 2.0
      */
     public void setReceiveBufferSize(int size) throws SocketException  {
-    	_socket_.setReceiveBufferSize(size);
+        _socket_.setReceiveBufferSize(size);
     }
 
 
@@ -554,11 +554,11 @@
      * @since 2.0
      */
     public void setServerSocketFactory(ServerSocketFactory factory) {
-		if (factory == null)
-			_serverSocketFactory_ = __DEFAULT_SERVER_SOCKET_FACTORY;
-		else
-			_serverSocketFactory_ = factory;
-	}
+        if (factory == null)
+            _serverSocketFactory_ = __DEFAULT_SERVER_SOCKET_FACTORY;
+        else
+            _serverSocketFactory_ = factory;
+    }
     
     /**
      * Sets the connection timeout in milliseconds, which will be passed to the {@link Socket} object's
@@ -567,7 +567,7 @@
      * @since 2.0
      */
     public void setConnectTimeout(int connectTimeout) {
-    	this.connectTimeout = connectTimeout;
+        this.connectTimeout = connectTimeout;
     }
     
     /**
@@ -576,7 +576,7 @@
      * @since 2.0
      */
     public int getConnectTimeout() {
-    	return connectTimeout;
+        return connectTimeout;
     }
     
     

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTP.java?rev=658520&r1=658519&r2=658520&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTP.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTP.java Tue May 20 18:14:11 2008
@@ -271,7 +271,7 @@
 
     // The RFC-compliant multiline termination check
     private boolean __strictCheck(String line, String code) {
-    	return (!(line.startsWith(code) && line.charAt(3) == ' '));
+        return (!(line.startsWith(code) && line.charAt(3) == ' '));
     }
     
     // The strict check is too strong a condition because of non-conforming ftp
@@ -280,7 +280,7 @@
     // test that the line starts with a digit rather than starting with
     // the code.
     private boolean __lenientCheck(String line) {
-    	return (!(line.length() >= 4 && line.charAt(3) != '-' &&
+        return (!(line.length() >= 4 && line.charAt(3) != '-' &&
                 Character.isDigit(line.charAt(0))));
     }
     
@@ -468,7 +468,7 @@
         __commandBuffer.append(SocketClient.NETASCII_EOL);
 
         try{
-	    _controlOutput_.write(message = __commandBuffer.toString());
+        _controlOutput_.write(message = __commandBuffer.toString());
             _controlOutput_.flush();
         }
         catch (SocketException e)
@@ -482,7 +482,7 @@
                 throw e;
             }
         }
-	
+    
 
         if (_commandSupport_.getListenerCount() > 0)
             _commandSupport_.fireCommandSent(command, message);
@@ -654,8 +654,8 @@
         buffer = new StringBuilder(256);
         
         for (String line : _replyLines) {
-        		buffer.append(line);
-        		buffer.append(SocketClient.NETASCII_EOL);
+                buffer.append(line);
+                buffer.append(SocketClient.NETASCII_EOL);
         }
         
          _newReplyString = false;
@@ -1154,7 +1154,7 @@
      **/
     public int mdtm(String file) throws IOException 
     {
-    	return sendCommand(FTPCommand.MDTM, file);
+        return sendCommand(FTPCommand.MDTM, file);
     }
 
     /***
@@ -1490,18 +1490,18 @@
      * @return True if strict, false if lenient
      * @since 2.0
      */
-	public boolean isStrictMultilineParsing() {
-		return strictMultilineParsing;
-	}
-
-	/**
-	 * Set strict multiline parsing.
-	 * @param strictMultilineParsing
-	 * @since 2.0
-	 */
-	public void setStrictMultilineParsing(boolean strictMultilineParsing) {
-		this.strictMultilineParsing = strictMultilineParsing;
-	}
+    public boolean isStrictMultilineParsing() {
+        return strictMultilineParsing;
+    }
+
+    /**
+     * Set strict multiline parsing.
+     * @param strictMultilineParsing
+     * @since 2.0
+     */
+    public void setStrictMultilineParsing(boolean strictMultilineParsing) {
+        this.strictMultilineParsing = strictMultilineParsing;
+    }
 }
 
 /* Emacs configuration

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=658520&r1=658519&r2=658520&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClient.java Tue May 20 18:14:11 2008
@@ -324,7 +324,7 @@
         __restartOffset      = 0;
         __systemName         = null;
         __entryParser        = null;
-        __bufferSize 		 = Util.DEFAULT_COPY_BUFFER_SIZE;
+        __bufferSize         = Util.DEFAULT_COPY_BUFFER_SIZE;
     }
     
     private String __parsePathname(String reply)
@@ -1962,7 +1962,7 @@
 
         if (completePendingCommand())
         {
-        	String[] names = new String[ results.size() ];
+            String[] names = new String[ results.size() ];
             return results.toArray(names);
         }
 
@@ -2059,7 +2059,7 @@
      * @return The list of file information contained in the current directory
      *         in the format determined by the autodetection mechanism.  
      *         <p><b> 
-     * 		   NOTE:</b> This array may contain null members if any of the 
+     *         NOTE:</b> This array may contain null members if any of the 
      *         individual file listings failed to parse.  The caller should 
      *         check each entry for null before referencing it.
      * @exception FTPConnectionClosedException
@@ -2247,22 +2247,22 @@
             if (null != parserKey) {
                 // if a parser key was supplied in the parameters, 
                 // use that to create the paraser
-        	    __entryParser = 
-        	        __parserFactory.createFileEntryParser(parserKey);
+                __entryParser = 
+                    __parserFactory.createFileEntryParser(parserKey);
                 
             } else {
-	            // if no parserKey was supplied, check for a configuration
-	        	// in the params, and if non-null, use that.
-            	if (null != __configuration) {
-            	    __entryParser = 
-            	        __parserFactory.createFileEntryParser(__configuration);
-            	} else {
+                // if no parserKey was supplied, check for a configuration
+                // in the params, and if non-null, use that.
+                if (null != __configuration) {
+                    __entryParser = 
+                        __parserFactory.createFileEntryParser(__configuration);
+                } else {
                     // if a parserKey hasn't been supplied, and a configuration
-            	    // hasn't been supplied, then autodetect by calling
+                    // hasn't been supplied, then autodetect by calling
                     // the SYST command and use that to choose the parser.
-            	    __entryParser = 
-            	        __parserFactory.createFileEntryParser(getSystemName());
-             	}
+                    __entryParser = 
+                        __parserFactory.createFileEntryParser(getSystemName());
+                }
             }
         }
 
@@ -2311,19 +2311,19 @@
      * @since 2.0
      */
     protected String getListArguments(String pathname) {
-    	if (getListHiddenFiles())
-    	{
-    		StringBuffer sb = new StringBuffer(pathname.length() + 3);
-    		sb.append("-a ");
-    		sb.append(pathname);
-    		return sb.toString();
-    	}
-    	
-    	return pathname;
-	}
+        if (getListHiddenFiles())
+        {
+            StringBuffer sb = new StringBuffer(pathname.length() + 3);
+            sb.append("-a ");
+            sb.append(pathname);
+            return sb.toString();
+        }
+        
+        return pathname;
+    }
 
 
-	/***
+    /***
      * Issue the FTP STAT command to the server.
      * <p>
      * @return The status information returned by the server.
@@ -2376,9 +2376,9 @@
      * @since 2.0
      */
     public String getModificationTime(String pathname) throws IOException {
-    	if (FTPReply.isPositiveCompletion(mdtm(pathname)))
-    		return getReplyString();
-    	return null;
+        if (FTPReply.isPositiveCompletion(mdtm(pathname)))
+            return getReplyString();
+        return null;
     }
 
 
@@ -2388,7 +2388,7 @@
      * @param bufSize The size of the buffer
      */
     public void setBufferSize(int bufSize) {
-    	__bufferSize = bufSize;
+        __bufferSize = bufSize;
     }
     
     /**
@@ -2396,7 +2396,7 @@
      * @return The current buffer size.
      */
     public int getBufferSize() {
-    	return __bufferSize;
+        return __bufferSize;
     }
 
 
@@ -2409,7 +2409,7 @@
      * @since 1.4
      */
     public void configure(FTPClientConfig config) {
-    	this.__configuration = config;
+        this.__configuration = config;
     }
 
     /**
@@ -2422,7 +2422,7 @@
      * @since 2.0
      */
     public void setListHiddenFiles(boolean listHiddenFiles) {
-    	this.__listHiddenFiles = listHiddenFiles;
+        this.__listHiddenFiles = listHiddenFiles;
     }
 
     /**
@@ -2431,7 +2431,7 @@
      * @since 2.0
      */
     public boolean getListHiddenFiles() {
-    	return this.__listHiddenFiles;
+        return this.__listHiddenFiles;
     }
 }
 

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java?rev=658520&r1=658519&r2=658520&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java Tue May 20 18:14:11 2008
@@ -141,7 +141,7 @@
  */
 public class FTPClientConfig
 {
-	
+    
     /**
      * Identifier by which a unix-based ftp server is known throughout
      * the commons-net ftp system.
@@ -194,378 +194,378 @@
      *
      * @since 1.5
      */
-	public static final String SYST_NETWARE = "NETWARE";
+    public static final String SYST_NETWARE = "NETWARE";
     
     private final String serverSystemKey;
-	private String defaultDateFormatStr = null;
-	private String recentDateFormatStr = null;
-	private boolean lenientFutureDates = false;
-	private String serverLanguageCode = null;
-	private String shortMonthNames = null;
-	private String serverTimeZoneId = null;
-	
-	
-	/**
-	 * The main constructor for an FTPClientConfig object
-	 * @param systemKey key representing system type of the  server being 
-	 * connected to. See {@link #getServerSystemKey() serverSystemKey}
-	 */
-	public FTPClientConfig(String systemKey) {
-		this.serverSystemKey = systemKey;
-	}
+    private String defaultDateFormatStr = null;
+    private String recentDateFormatStr = null;
+    private boolean lenientFutureDates = false;
+    private String serverLanguageCode = null;
+    private String shortMonthNames = null;
+    private String serverTimeZoneId = null;
+    
+    
+    /**
+     * The main constructor for an FTPClientConfig object
+     * @param systemKey key representing system type of the  server being 
+     * connected to. See {@link #getServerSystemKey() serverSystemKey}
+     */
+    public FTPClientConfig(String systemKey) {
+        this.serverSystemKey = systemKey;
+    }
 
-	/**
-	 * Convenience constructor mainly for use in testing.
-	 * Constructs a UNIX configuration. 
-	 */
-	public FTPClientConfig() {
-	    this(SYST_UNIX);
-	}
+    /**
+     * Convenience constructor mainly for use in testing.
+     * Constructs a UNIX configuration. 
+     */
+    public FTPClientConfig() {
+        this(SYST_UNIX);
+    }
 
-	/**
-	 * Constructor which allows setting of all member fields
-	 * @param systemKey key representing system type of the  server being 
-	 * connected to. See 
-	 *  {@link #getServerSystemKey() serverSystemKey}
-	 * @param defaultDateFormatStr See 
-	 * 	{@link  #setDefaultDateFormatStr(String)  defaultDateFormatStr}
-	 * @param recentDateFormatStr See
-	 * 	{@link  #setRecentDateFormatStr(String)  recentDateFormatStr}
-	 * @param serverLanguageCode See
-	 * 	{@link  #setServerLanguageCode(String)  serverLanguageCode}
-	 * @param shortMonthNames See
-	 * 	{@link  #setShortMonthNames(String)  shortMonthNames}
-	 * @param serverTimeZoneId See
-	 * 	{@link  #setServerTimeZoneId(String)  serverTimeZoneId}
-	 */
-	public FTPClientConfig(String systemKey,
-	        			   String defaultDateFormatStr,
-	        			   String recentDateFormatStr,
-	        			   String serverLanguageCode,
-	        			   String shortMonthNames,
-	        			   String serverTimeZoneId)
-	{
-	    this(systemKey);
-		this.defaultDateFormatStr = defaultDateFormatStr;
-		this.recentDateFormatStr = recentDateFormatStr;
-		this.serverLanguageCode = serverLanguageCode;
-		this.shortMonthNames = shortMonthNames;
-		this.serverTimeZoneId = serverTimeZoneId;
-	}
-	
-	private static Map<String, Object> LANGUAGE_CODE_MAP = new TreeMap<String, Object>();
-	static {
-		
-		// if there are other commonly used month name encodings which
-		// correspond to particular locales, please add them here.
-		
-		
-		
-		// many locales code short names for months as all three letters
-		// these we handle simply.
-		LANGUAGE_CODE_MAP.put("en", Locale.ENGLISH);
-		LANGUAGE_CODE_MAP.put("de",Locale.GERMAN);
-		LANGUAGE_CODE_MAP.put("it",Locale.ITALIAN);
-		LANGUAGE_CODE_MAP.put("es", new Locale("es", "", "")); // spanish
-		LANGUAGE_CODE_MAP.put("pt", new Locale("pt", "", "")); // portuguese
-		LANGUAGE_CODE_MAP.put("da", new Locale("da", "", "")); // danish
-		LANGUAGE_CODE_MAP.put("sv", new Locale("sv", "", "")); // swedish
-		LANGUAGE_CODE_MAP.put("no", new Locale("no", "", "")); // norwegian
-		LANGUAGE_CODE_MAP.put("nl", new Locale("nl", "", "")); // dutch
-		LANGUAGE_CODE_MAP.put("ro", new Locale("ro", "", "")); // romanian
-		LANGUAGE_CODE_MAP.put("sq", new Locale("sq", "", "")); // albanian
-		LANGUAGE_CODE_MAP.put("sh", new Locale("sh", "", "")); // serbo-croatian
-		LANGUAGE_CODE_MAP.put("sk", new Locale("sk", "", "")); // slovak		
-		LANGUAGE_CODE_MAP.put("sl", new Locale("sl", "", "")); // slovenian
+    /**
+     * Constructor which allows setting of all member fields
+     * @param systemKey key representing system type of the  server being 
+     * connected to. See 
+     *  {@link #getServerSystemKey() serverSystemKey}
+     * @param defaultDateFormatStr See 
+     *  {@link  #setDefaultDateFormatStr(String)  defaultDateFormatStr}
+     * @param recentDateFormatStr See
+     *  {@link  #setRecentDateFormatStr(String)  recentDateFormatStr}
+     * @param serverLanguageCode See
+     *  {@link  #setServerLanguageCode(String)  serverLanguageCode}
+     * @param shortMonthNames See
+     *  {@link  #setShortMonthNames(String)  shortMonthNames}
+     * @param serverTimeZoneId See
+     *  {@link  #setServerTimeZoneId(String)  serverTimeZoneId}
+     */
+    public FTPClientConfig(String systemKey,
+                           String defaultDateFormatStr,
+                           String recentDateFormatStr,
+                           String serverLanguageCode,
+                           String shortMonthNames,
+                           String serverTimeZoneId)
+    {
+        this(systemKey);
+        this.defaultDateFormatStr = defaultDateFormatStr;
+        this.recentDateFormatStr = recentDateFormatStr;
+        this.serverLanguageCode = serverLanguageCode;
+        this.shortMonthNames = shortMonthNames;
+        this.serverTimeZoneId = serverTimeZoneId;
+    }
+    
+    private static Map<String, Object> LANGUAGE_CODE_MAP = new TreeMap<String, Object>();
+    static {
+        
+        // if there are other commonly used month name encodings which
+        // correspond to particular locales, please add them here.
+        
+        
+        
+        // many locales code short names for months as all three letters
+        // these we handle simply.
+        LANGUAGE_CODE_MAP.put("en", Locale.ENGLISH);
+        LANGUAGE_CODE_MAP.put("de",Locale.GERMAN);
+        LANGUAGE_CODE_MAP.put("it",Locale.ITALIAN);
+        LANGUAGE_CODE_MAP.put("es", new Locale("es", "", "")); // spanish
+        LANGUAGE_CODE_MAP.put("pt", new Locale("pt", "", "")); // portuguese
+        LANGUAGE_CODE_MAP.put("da", new Locale("da", "", "")); // danish
+        LANGUAGE_CODE_MAP.put("sv", new Locale("sv", "", "")); // swedish
+        LANGUAGE_CODE_MAP.put("no", new Locale("no", "", "")); // norwegian
+        LANGUAGE_CODE_MAP.put("nl", new Locale("nl", "", "")); // dutch
+        LANGUAGE_CODE_MAP.put("ro", new Locale("ro", "", "")); // romanian
+        LANGUAGE_CODE_MAP.put("sq", new Locale("sq", "", "")); // albanian
+        LANGUAGE_CODE_MAP.put("sh", new Locale("sh", "", "")); // serbo-croatian
+        LANGUAGE_CODE_MAP.put("sk", new Locale("sk", "", "")); // slovak
+        LANGUAGE_CODE_MAP.put("sl", new Locale("sl", "", "")); // slovenian
 
 
-		// some don't
-		LANGUAGE_CODE_MAP.put("fr",	
-		        "jan|f\u00e9v|mar|avr|mai|jun|jui|ao\u00fb|sep|oct|nov|d\u00e9c");  //french
-			
-	}
-	
-	/**
-	 * Getter for the serverSystemKey property.  This property
+        // some don't
+        LANGUAGE_CODE_MAP.put("fr",
+                "jan|f\u00e9v|mar|avr|mai|jun|jui|ao\u00fb|sep|oct|nov|d\u00e9c");  //french
+            
+    }
+    
+    /**
+     * Getter for the serverSystemKey property.  This property
      * specifies the general type of server to which the client connects.
      * Should be either one of the <code>FTPClientConfig.SYST_*</code> codes
      * or else the fully qualified class name of a parser implementing both
      * the <code>FTPFileEntryParser</code> and <code>Configurable</code>
      * interfaces.
-	 * @return Returns the serverSystemKey property.
-	 */
-	public String getServerSystemKey() {
-		return serverSystemKey;
-	}
-	
-	/**
-	 * getter for the {@link  #setDefaultDateFormatStr(String)  defaultDateFormatStr} 
-	 * property.  
-	 * @return Returns the defaultDateFormatStr property.
-	 */
-	public String getDefaultDateFormatStr() {
-		return defaultDateFormatStr;
-	}
-	
-	/**
-	 * getter for the {@link  #setRecentDateFormatStr(String)  recentDateFormatStr} property.
-	 * @return Returns the recentDateFormatStr property.
-	 */
+     * @return Returns the serverSystemKey property.
+     */
+    public String getServerSystemKey() {
+        return serverSystemKey;
+    }
+    
+    /**
+     * getter for the {@link  #setDefaultDateFormatStr(String)  defaultDateFormatStr} 
+     * property.  
+     * @return Returns the defaultDateFormatStr property.
+     */
+    public String getDefaultDateFormatStr() {
+        return defaultDateFormatStr;
+    }
+    
+    /**
+     * getter for the {@link  #setRecentDateFormatStr(String)  recentDateFormatStr} property.
+     * @return Returns the recentDateFormatStr property.
+     */
 
-	public String getRecentDateFormatStr() {
-		return recentDateFormatStr;
-	}
-	
-	/**
-	 * getter for the {@link  #setServerTimeZoneId(String)  serverTimeZoneId} property.
-	 * @return Returns the serverTimeZoneId property.
-	 */
-	public String getServerTimeZoneId() {
-		return serverTimeZoneId;
-	}
-	
-	/**
-	 * <p>
-	 * getter for the {@link  #setShortMonthNames(String)  shortMonthNames} 
-	 * property.  
-	 * </p>
-	 * @return Returns the shortMonthNames.
-	 */
-	public String getShortMonthNames() {
-		return shortMonthNames;
-	}
-	
-	/**
-	 * <p>
-	 * getter for the {@link  #setServerLanguageCode(String)  serverLanguageCode} property.
-	 * </p>  
-* 	 * @return Returns the serverLanguageCode property.
-	 */
-	public String getServerLanguageCode() {
-		return serverLanguageCode;
-	}
-	
-    /**
-	 * <p>
-	 * getter for the {@link  #setLenientFutureDates(boolean)  lenientFutureDates} property.
-	 * </p>  
+    public String getRecentDateFormatStr() {
+        return recentDateFormatStr;
+    }
+    
+    /**
+     * getter for the {@link  #setServerTimeZoneId(String)  serverTimeZoneId} property.
+     * @return Returns the serverTimeZoneId property.
+     */
+    public String getServerTimeZoneId() {
+        return serverTimeZoneId;
+    }
+    
+    /**
+     * <p>
+     * getter for the {@link  #setShortMonthNames(String)  shortMonthNames} 
+     * property.  
+     * </p>
+     * @return Returns the shortMonthNames.
+     */
+    public String getShortMonthNames() {
+        return shortMonthNames;
+    }
+    
+    /**
+     * <p>
+     * getter for the {@link  #setServerLanguageCode(String)  serverLanguageCode} property.
+     * </p>  
+     * @return Returns the serverLanguageCode property.
+     */
+    public String getServerLanguageCode() {
+        return serverLanguageCode;
+    }
+    
+    /**
+     * <p>
+     * getter for the {@link  #setLenientFutureDates(boolean)  lenientFutureDates} property.
+     * </p>  
      * @return Returns the lenientFutureDates.
      * @since 1.5
      */
     public boolean isLenientFutureDates() {
         return lenientFutureDates;
     }
-	/**
-	 * <p>
-	 * setter for the defaultDateFormatStr property.  This property
-	 * specifies the main date format that will be used by a parser configured
-	 * by this configuration to parse file timestamps.  If this is not
-	 * specified, such a parser will use as a default value, the most commonly
-	 * used format which will be in as used in <code>en_US</code> locales.
-	 * </p><p>
-	 * This should be in the format described for 
-	 * <code>java.text.SimpleDateFormat</code>. 
-	 * property.
-	 * </p>
-	 * @param defaultDateFormatStr The defaultDateFormatStr to set.
-	 */
-	public void setDefaultDateFormatStr(String defaultDateFormatStr) {
-		this.defaultDateFormatStr = defaultDateFormatStr;
-	}
-	
-	/**
-	 * <p>
-	 * setter for the recentDateFormatStr property.  This property
-	 * specifies a secondary date format that will be used by a parser 
-	 * configured by this configuration to parse file timestamps, typically 
-	 * those less than a year old.  If this is  not specified, such a parser 
-	 * will not attempt to parse using an alternate format.
-	 * </p>
-	 * This is used primarily in unix-based systems.
-	 * </p>
-	 * This should be in the format described for 
-	 * <code>java.text.SimpleDateFormat</code>.
-	 * </p>
-	 * @param recentDateFormatStr The recentDateFormatStr to set.
-	 */
-	public void setRecentDateFormatStr(String recentDateFormatStr) {
-		this.recentDateFormatStr = recentDateFormatStr;
-	}
-	
-	/**
-	 * <p>
-	 * setter for the lenientFutureDates property.  This boolean property
-	 * (default: false) only has meaning when a 
-	 * {@link  #setRecentDateFormatStr(String)  recentDateFormatStr} property
-	 * has been set.  In that case, if this property is set true, then the
-	 * parser, when it encounters a listing parseable with the recent date 
-	 * format, will only consider a date to belong to the previous year if
-	 * it is more than one day in the future.  This will allow all 
-	 * out-of-synch situations (whether based on "slop" - i.e. servers simply 
-	 * out of synch with one another or because of time zone differences - 
-	 * but in the latter case it is highly recommended to use the 
-	 * {@link  #setServerTimeZoneId(String)  serverTimeZoneId} property
-	 * instead) to resolve correctly.
-	 * </p><p>
-	 * This is used primarily in unix-based systems.
-	 * </p>
-	 * @param lenientFutureDates set true to compensate for out-of-synch 
-	 * conditions.
-	 */
+    /**
+     * <p>
+     * setter for the defaultDateFormatStr property.  This property
+     * specifies the main date format that will be used by a parser configured
+     * by this configuration to parse file timestamps.  If this is not
+     * specified, such a parser will use as a default value, the most commonly
+     * used format which will be in as used in <code>en_US</code> locales.
+     * </p><p>
+     * This should be in the format described for 
+     * <code>java.text.SimpleDateFormat</code>. 
+     * property.
+     * </p>
+     * @param defaultDateFormatStr The defaultDateFormatStr to set.
+     */
+    public void setDefaultDateFormatStr(String defaultDateFormatStr) {
+        this.defaultDateFormatStr = defaultDateFormatStr;
+    }
+    
+    /**
+     * <p>
+     * setter for the recentDateFormatStr property.  This property
+     * specifies a secondary date format that will be used by a parser 
+     * configured by this configuration to parse file timestamps, typically 
+     * those less than a year old.  If this is  not specified, such a parser 
+     * will not attempt to parse using an alternate format.
+     * </p>
+     * This is used primarily in unix-based systems.
+     * </p>
+     * This should be in the format described for 
+     * <code>java.text.SimpleDateFormat</code>.
+     * </p>
+     * @param recentDateFormatStr The recentDateFormatStr to set.
+     */
+    public void setRecentDateFormatStr(String recentDateFormatStr) {
+        this.recentDateFormatStr = recentDateFormatStr;
+    }
+    
+    /**
+     * <p>
+     * setter for the lenientFutureDates property.  This boolean property
+     * (default: false) only has meaning when a 
+     * {@link  #setRecentDateFormatStr(String)  recentDateFormatStr} property
+     * has been set.  In that case, if this property is set true, then the
+     * parser, when it encounters a listing parseable with the recent date 
+     * format, will only consider a date to belong to the previous year if
+     * it is more than one day in the future.  This will allow all 
+     * out-of-synch situations (whether based on "slop" - i.e. servers simply 
+     * out of synch with one another or because of time zone differences - 
+     * but in the latter case it is highly recommended to use the 
+     * {@link  #setServerTimeZoneId(String)  serverTimeZoneId} property
+     * instead) to resolve correctly.
+     * </p><p>
+     * This is used primarily in unix-based systems.
+     * </p>
+     * @param lenientFutureDates set true to compensate for out-of-synch 
+     * conditions.
+     */
     public void setLenientFutureDates(boolean lenientFutureDates) {
         this.lenientFutureDates = lenientFutureDates;
     }
-	/**
-	 * <p>
-	 * setter for the serverTimeZoneId property.  This property
-	 * allows a time zone to be specified corresponding to that known to be 
-	 * used by an FTP server in file listings.  This might be particularly 
-	 * useful to clients such as Ant that try to use these timestamps for 
-	 * dependency checking.
-	 * </p><p>
-	 * This should be one of the identifiers used by 
-	 * <code>java.util.TimeZone</code> to refer to time zones, for example, 
-	 * <code>America/Chicago</code> or <code>Asia/Rangoon</code>.
-	 * </p>
-	 * @param serverTimeZoneId The serverTimeZoneId to set.
-	 */
-	public void setServerTimeZoneId(String serverTimeZoneId) {
-		this.serverTimeZoneId = serverTimeZoneId;
-	}
-	
-	/**
-	 * <p>
-	 * setter for the shortMonthNames property.  
-	 * This property allows the user to specify a set of month names
-	 * used by the server that is different from those that may be 
-	 * specified using the {@link  #setServerLanguageCode(String)  serverLanguageCode}
-	 * property.
-	 * </p><p>
-	 * This should be a string containing twelve strings each composed of
-	 * three characters, delimited by pipe (|) characters.  Currently, 
-	 * only 8-bit ASCII characters are known to be supported.  For example,
-	 * a set of month names used by a hypothetical Icelandic FTP server might 
-	 * conceivably be specified as 
-	 * <code>"jan|feb|mar|apr|ma&#xED;|j&#xFA;n|j&#xFA;l|&#xE1;g&#xFA;|sep|okt|n&#xF3;v|des"</code>.  
-	 * </p>
-	 * @param shortMonthNames The value to set to the shortMonthNames property.
-	 */
-	public void setShortMonthNames(String shortMonthNames) {
-		this.shortMonthNames = shortMonthNames;
-	}
-	
-	/**
-	 * <p>
-	 * setter for the serverLanguageCode property.  This property allows
-	 * user to specify a 
-	 * <a href="http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt">
-	 * two-letter ISO-639 language code</a> that will be used to 
-	 * configure the set of month names used by the file timestamp parser.
-	 * If neither this nor the {@link #setShortMonthNames(String) shortMonthNames} 
-	 * is specified, parsing will assume English month names, which may or 
-	 * may not be significant, depending on whether the date format(s) 
-	 * specified via {@link  #setDefaultDateFormatStr(String)  defaultDateFormatStr} 
-	 * and/or {@link  #setRecentDateFormatStr(String)  recentDateFormatStr} are using 
-	 * numeric or alphabetic month names.
-	 * </p>
-	 * <p>If the code supplied is not supported here, <code>en_US</code>
-	 * month names will be used.  We are supporting here those language 
-	 * codes which, when a <code> java.util.Locale</code> is constucted
-	 * using it, and a <code>java.text.SimpleDateFormat</code> is 
-	 * constructed using that Locale, the array returned by the 
-	 * SimpleDateFormat's <code>getShortMonths()</code> method consists
-	 * solely of three 8-bit ASCII character strings.  Additionally, 
-	 * languages which do not meet this requirement are included if a 
-	 * common alternative set of short month names is known to be used.
-	 * This means that users who can tell us of additional such encodings
-	 * may get them added to the list of supported languages by contacting
-	 * the jakarta-commons-net team.
-	 * </p>
-	 * <p><strong>
-	 * Please note that this attribute will NOT be used to determine a 
-	 * locale-based date format for the language.  </strong>  
-	 * Experience has shown that many if not most FTP servers outside the
-	 * United States employ the standard <code>en_US</code> date format 
-	 * orderings of <code>MMM d yyyy</code> and <code>MMM d HH:mm</code> 
-	 * and attempting to deduce this automatically here would cause more
-	 * problems than it would solve.  The date format must be changed 
-	 * via the {@link  #setDefaultDateFormatStr(String)  defaultDateFormatStr} and/or 
-	 * {@link  #setRecentDateFormatStr(String)  recentDateFormatStr} parameters.
-	 * </p>	  
-	 * @param serverLanguageCode The value to set to the serverLanguageCode property.  
-	 */
-	public void setServerLanguageCode(String serverLanguageCode) {
-		this.serverLanguageCode = serverLanguageCode;
-	}
-	
-	/**
-	 * Looks up the supplied language code in the internally maintained table of 
-	 * language codes.  Returns a DateFormatSymbols object configured with 
-	 * short month names corresponding to the code.  If there is no corresponding
-	 * entry in the table, the object returned will be that for 
-	 * <code>Locale.US</code> 
-	 * @param languageCode See {@link  #setServerLanguageCode(String)  serverLanguageCode}
-	 * @return a DateFormatSymbols object configured with short month names 
-	 * corresponding to the supplied code, or with month names for  
-	 * <code>Locale.US</code> if there is no corresponding entry in the internal
-	 * table.
-	 */
-	public static DateFormatSymbols lookupDateFormatSymbols(String languageCode) 
-	{
-		Object lang = LANGUAGE_CODE_MAP.get(languageCode);
-		if (lang != null) {
-			if (lang instanceof Locale) {
-				return new DateFormatSymbols((Locale) lang);
-			} else if (lang instanceof String){
-				return getDateFormatSymbols((String) lang);
-			}
-		}
-		return new DateFormatSymbols(Locale.US);
-	}
-	
-	/**
-	 * Returns a DateFormatSymbols object configured with short month names
-	 * as in the supplied string
-	 * @param shortmonths This  should be as described in 
-	 *  {@link  #setShortMonthNames(String)  shortMonthNames}
-	 * @return a DateFormatSymbols object configured with short month names
-	 * as in the supplied string
-	 */
-	public static DateFormatSymbols getDateFormatSymbols(String shortmonths) 
-	{
-		String[] months = splitShortMonthString(shortmonths);
-		DateFormatSymbols dfs = new DateFormatSymbols(Locale.US);
-		dfs.setShortMonths(months);
-		return dfs;
-	}
-	
-	private static String[] splitShortMonthString(String shortmonths) {
-		StringTokenizer st = new StringTokenizer(shortmonths, "|");
-		int monthcnt = st.countTokens();
-		if (12 != monthcnt) {
-			throw new IllegalArgumentException(
-					"expecting a pipe-delimited string containing 12 tokens");
-		}
-		String[] months = new String[13];
-		int pos = 0;
-		while(st.hasMoreTokens()) {
-			months[pos++] = st.nextToken();
-		}
-		months[pos]="";
-		return months;
-	}
+    /**
+     * <p>
+     * setter for the serverTimeZoneId property.  This property
+     * allows a time zone to be specified corresponding to that known to be 
+     * used by an FTP server in file listings.  This might be particularly 
+     * useful to clients such as Ant that try to use these timestamps for 
+     * dependency checking.
+     * </p><p>
+     * This should be one of the identifiers used by 
+     * <code>java.util.TimeZone</code> to refer to time zones, for example, 
+     * <code>America/Chicago</code> or <code>Asia/Rangoon</code>.
+     * </p>
+     * @param serverTimeZoneId The serverTimeZoneId to set.
+     */
+    public void setServerTimeZoneId(String serverTimeZoneId) {
+        this.serverTimeZoneId = serverTimeZoneId;
+    }
+    
+    /**
+     * <p>
+     * setter for the shortMonthNames property.  
+     * This property allows the user to specify a set of month names
+     * used by the server that is different from those that may be 
+     * specified using the {@link  #setServerLanguageCode(String)  serverLanguageCode}
+     * property.
+     * </p><p>
+     * This should be a string containing twelve strings each composed of
+     * three characters, delimited by pipe (|) characters.  Currently, 
+     * only 8-bit ASCII characters are known to be supported.  For example,
+     * a set of month names used by a hypothetical Icelandic FTP server might 
+     * conceivably be specified as 
+     * <code>"jan|feb|mar|apr|ma&#xED;|j&#xFA;n|j&#xFA;l|&#xE1;g&#xFA;|sep|okt|n&#xF3;v|des"</code>.  
+     * </p>
+     * @param shortMonthNames The value to set to the shortMonthNames property.
+     */
+    public void setShortMonthNames(String shortMonthNames) {
+        this.shortMonthNames = shortMonthNames;
+    }
+    
+    /**
+     * <p>
+     * setter for the serverLanguageCode property.  This property allows
+     * user to specify a 
+     * <a href="http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt">
+     * two-letter ISO-639 language code</a> that will be used to 
+     * configure the set of month names used by the file timestamp parser.
+     * If neither this nor the {@link #setShortMonthNames(String) shortMonthNames} 
+     * is specified, parsing will assume English month names, which may or 
+     * may not be significant, depending on whether the date format(s) 
+     * specified via {@link  #setDefaultDateFormatStr(String)  defaultDateFormatStr} 
+     * and/or {@link  #setRecentDateFormatStr(String)  recentDateFormatStr} are using 
+     * numeric or alphabetic month names.
+     * </p>
+     * <p>If the code supplied is not supported here, <code>en_US</code>
+     * month names will be used.  We are supporting here those language 
+     * codes which, when a <code> java.util.Locale</code> is constucted
+     * using it, and a <code>java.text.SimpleDateFormat</code> is 
+     * constructed using that Locale, the array returned by the 
+     * SimpleDateFormat's <code>getShortMonths()</code> method consists
+     * solely of three 8-bit ASCII character strings.  Additionally, 
+     * languages which do not meet this requirement are included if a 
+     * common alternative set of short month names is known to be used.
+     * This means that users who can tell us of additional such encodings
+     * may get them added to the list of supported languages by contacting
+     * the jakarta-commons-net team.
+     * </p>
+     * <p><strong>
+     * Please note that this attribute will NOT be used to determine a 
+     * locale-based date format for the language.  </strong>  
+     * Experience has shown that many if not most FTP servers outside the
+     * United States employ the standard <code>en_US</code> date format 
+     * orderings of <code>MMM d yyyy</code> and <code>MMM d HH:mm</code> 
+     * and attempting to deduce this automatically here would cause more
+     * problems than it would solve.  The date format must be changed 
+     * via the {@link  #setDefaultDateFormatStr(String)  defaultDateFormatStr} and/or 
+     * {@link  #setRecentDateFormatStr(String)  recentDateFormatStr} parameters.
+     * </p>
+     * @param serverLanguageCode The value to set to the serverLanguageCode property.  
+     */
+    public void setServerLanguageCode(String serverLanguageCode) {
+        this.serverLanguageCode = serverLanguageCode;
+    }
+    
+    /**
+     * Looks up the supplied language code in the internally maintained table of 
+     * language codes.  Returns a DateFormatSymbols object configured with 
+     * short month names corresponding to the code.  If there is no corresponding
+     * entry in the table, the object returned will be that for 
+     * <code>Locale.US</code> 
+     * @param languageCode See {@link  #setServerLanguageCode(String)  serverLanguageCode}
+     * @return a DateFormatSymbols object configured with short month names 
+     * corresponding to the supplied code, or with month names for  
+     * <code>Locale.US</code> if there is no corresponding entry in the internal
+     * table.
+     */
+    public static DateFormatSymbols lookupDateFormatSymbols(String languageCode) 
+    {
+        Object lang = LANGUAGE_CODE_MAP.get(languageCode);
+        if (lang != null) {
+            if (lang instanceof Locale) {
+                return new DateFormatSymbols((Locale) lang);
+            } else if (lang instanceof String){
+                return getDateFormatSymbols((String) lang);
+            }
+        }
+        return new DateFormatSymbols(Locale.US);
+    }
+    
+    /**
+     * Returns a DateFormatSymbols object configured with short month names
+     * as in the supplied string
+     * @param shortmonths This  should be as described in 
+     *  {@link  #setShortMonthNames(String)  shortMonthNames}
+     * @return a DateFormatSymbols object configured with short month names
+     * as in the supplied string
+     */
+    public static DateFormatSymbols getDateFormatSymbols(String shortmonths) 
+    {
+        String[] months = splitShortMonthString(shortmonths);
+        DateFormatSymbols dfs = new DateFormatSymbols(Locale.US);
+        dfs.setShortMonths(months);
+        return dfs;
+    }
+    
+    private static String[] splitShortMonthString(String shortmonths) {
+        StringTokenizer st = new StringTokenizer(shortmonths, "|");
+        int monthcnt = st.countTokens();
+        if (12 != monthcnt) {
+            throw new IllegalArgumentException(
+                    "expecting a pipe-delimited string containing 12 tokens");
+        }
+        String[] months = new String[13];
+        int pos = 0;
+        while(st.hasMoreTokens()) {
+            months[pos++] = st.nextToken();
+        }
+        months[pos]="";
+        return months;
+    }
 
-	/**
-	 * Returns a Collection of all the language codes currently supported
-	 * by this class. See {@link  #setServerLanguageCode(String)  serverLanguageCode}  
-	 * for a functional descrption of language codes within this system. 
-	 * 	
-	 * @return a Collection of all the language codes currently supported
-	 * by this class
-	 */
-	public static Collection<String> getSupportedLanguageCodes() {
-	    return LANGUAGE_CODE_MAP.keySet();
-	}
-	
-	
+    /**
+     * Returns a Collection of all the language codes currently supported
+     * by this class. See {@link  #setServerLanguageCode(String)  serverLanguageCode}  
+     * for a functional descrption of language codes within this system. 
+     *
+     * @return a Collection of all the language codes currently supported
+     * by this class
+     */
+    public static Collection<String> getSupportedLanguageCodes() {
+        return LANGUAGE_CODE_MAP.keySet();
+    }
+    
+    
 }

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSClient.java?rev=658520&r1=658519&r2=658520&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSClient.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSClient.java Tue May 20 18:14:11 2008
@@ -251,8 +251,8 @@
      * @return The {@link KeyManager} instance
      */
     private KeyManager getKeyManager() {
-		return keyManager;
-	}
+        return keyManager;
+    }
     
     /**
     * Set a {@link KeyManager} to use
@@ -260,10 +260,10 @@
     * @param keyManager The KeyManager implementation to set.
     */
     public void setKeyManager(KeyManager keyManager) {
-    	this.keyManager = keyManager;
+        this.keyManager = keyManager;
     }
 
-	/**
+    /**
      * Controls whether new a SSL session may be established by this socket.
      * @param isCreation The established socket flag.
      */
@@ -465,7 +465,7 @@
         int repCode = super.sendCommand(command, args);
         if (FTPSCommand._commands[FTPSCommand.CCC].equals(command)) {
             if (FTPReply.COMMAND_OK == repCode) {
-            		// TODO Check this - is this necessary at all?
+                    // TODO Check this - is this necessary at all?
                 _socket_ = planeSocket;
                 setSocketFactory(null);
             } else {
@@ -515,18 +515,18 @@
      * 
      * @return A TrustManager instance.
      */
-	public TrustManager getTrustManager() {
-		return trustManager;
-	}
-
-	/**
-	 * Override the default {@link TrustManager} to use.
-	 * 
-	 * @param trustManager The TrustManager implementation to set.
-	 */
-	public void setTrustManager(TrustManager trustManager) {
-		this.trustManager = trustManager;
-	}
+    public TrustManager getTrustManager() {
+        return trustManager;
+    }
+
+    /**
+     * Override the default {@link TrustManager} to use.
+     * 
+     * @param trustManager The TrustManager implementation to set.
+     */
+    public void setTrustManager(TrustManager trustManager) {
+        this.trustManager = trustManager;
+    }
     
     
     

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java?rev=658520&r1=658519&r2=658520&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java Tue May 20 18:14:11 2008
@@ -31,24 +31,24 @@
  */
 public class FTPSTrustManager implements X509TrustManager
 {
-	/**
-	 * No-op
-	 */
-	public void checkClientTrusted(X509Certificate[] certificates, String authType)
-	{
-		return;
-	}
+    /**
+     * No-op
+     */
+    public void checkClientTrusted(X509Certificate[] certificates, String authType)
+    {
+        return;
+    }
 
-	public void checkServerTrusted(X509Certificate[] certificates, String authType) throws CertificateException
-	{
-		for (int i = 0; i < certificates.length; ++i)
-		{
-			certificates[i].checkValidity();
-		}
-	}
+    public void checkServerTrusted(X509Certificate[] certificates, String authType) throws CertificateException
+    {
+        for (int i = 0; i < certificates.length; ++i)
+        {
+            certificates[i].checkValidity();
+        }
+    }
 
-	public X509Certificate[] getAcceptedIssuers()
-	{
-		return null;
-	}
+    public X509Certificate[] getAcceptedIssuers()
+    {
+        return null;
+    }
 }

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java?rev=658520&r1=658519&r2=658520&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java Tue May 20 18:14:11 2008
@@ -35,9 +35,9 @@
 public class DefaultFTPFileEntryParserFactory
     implements FTPFileEntryParserFactory
 {
-	private FTPClientConfig config = null;
+    private FTPClientConfig config = null;
 
-	/**
+    /**
      * This default implementation of the FTPFileEntryParserFactory
      * interface works according to the following logic:
      * First it attempts to interpret the supplied key as a fully
@@ -78,9 +78,9 @@
      */
     public FTPFileEntryParser createFileEntryParser(String key)
     {
-    	if (key == null)
-    		throw new ParserInitializationException("Parser key cannot be null");
-    		
+        if (key == null)
+            throw new ParserInitializationException("Parser key cannot be null");
+            
         Class<?> parserClass = null;
         FTPFileEntryParser parser = null;
         try
@@ -92,44 +92,44 @@
         {
             try 
             {
-	            String ukey = null;
-	            if (null != key)
-	            {
-	                ukey = key.toUpperCase(java.util.Locale.ENGLISH);
-	            }
-	            if ((ukey.indexOf(FTPClientConfig.SYST_UNIX) >= 0) 
-	            		|| (ukey.indexOf(FTPClientConfig.SYST_L8) >= 0))
-	            {
-	                parser = createUnixFTPEntryParser();
-	            }
-	            else if (ukey.indexOf(FTPClientConfig.SYST_VMS) >= 0)
-	            {
-	                parser = createVMSVersioningFTPEntryParser();
-	            }
-	            else if (ukey.indexOf(FTPClientConfig.SYST_NT) >= 0)
-	            {
-	                parser = createNTFTPEntryParser();
-	            }
-	            else if (ukey.indexOf(FTPClientConfig.SYST_OS2) >= 0)
-	            {
-	                parser = createOS2FTPEntryParser();
-	            }
-	            else if (ukey.indexOf(FTPClientConfig.SYST_OS400) >= 0)
-	            {
-	                parser = createOS400FTPEntryParser();
-	            }
-	            else if (ukey.indexOf(FTPClientConfig.SYST_MVS) >= 0)
-	            {
-	                parser = createMVSEntryParser();
-	        	}
-	            else if (ukey.indexOf(FTPClientConfig.SYST_NETWARE) >= 0) 
-	            {
-	            	parser = createNetwareFTPEntryParser();
-	            }
-	            else
-	            {
-	                throw new ParserInitializationException("Unknown parser type: " + key);
-	            }
+                String ukey = null;
+                if (null != key)
+                {
+                    ukey = key.toUpperCase(java.util.Locale.ENGLISH);
+                }
+                if ((ukey.indexOf(FTPClientConfig.SYST_UNIX) >= 0) 
+                        || (ukey.indexOf(FTPClientConfig.SYST_L8) >= 0))
+                {
+                    parser = createUnixFTPEntryParser();
+                }
+                else if (ukey.indexOf(FTPClientConfig.SYST_VMS) >= 0)
+                {
+                    parser = createVMSVersioningFTPEntryParser();
+                }
+                else if (ukey.indexOf(FTPClientConfig.SYST_NT) >= 0)
+                {
+                    parser = createNTFTPEntryParser();
+                }
+                else if (ukey.indexOf(FTPClientConfig.SYST_OS2) >= 0)
+                {
+                    parser = createOS2FTPEntryParser();
+                }
+                else if (ukey.indexOf(FTPClientConfig.SYST_OS400) >= 0)
+                {
+                    parser = createOS400FTPEntryParser();
+                }
+                else if (ukey.indexOf(FTPClientConfig.SYST_MVS) >= 0)
+                {
+                    parser = createMVSEntryParser();
+                }
+                else if (ukey.indexOf(FTPClientConfig.SYST_NETWARE) >= 0) 
+                {
+                    parser = createNetwareFTPEntryParser();
+                }
+                else
+                {
+                    throw new ParserInitializationException("Unknown parser type: " + key);
+                }
             } 
             catch (NoClassDefFoundError nf) {
                     throw new ParserInitializationException("Error initializing parser", nf);
@@ -137,7 +137,7 @@
 
         }
         catch (NoClassDefFoundError e)
-        { 	
+        {
             throw new ParserInitializationException("Error initializing parser", e);
         }
         catch (ClassCastException e)
@@ -177,13 +177,13 @@
      *                   Thrown on any exception in instantiation
      * @since 1.4
      */
-	public FTPFileEntryParser createFileEntryParser(FTPClientConfig config) 
-	throws ParserInitializationException 
-	{
-	    this.config = config;
-		String key = config.getServerSystemKey();
-		return createFileEntryParser(key);
-	}
+    public FTPFileEntryParser createFileEntryParser(FTPClientConfig config) 
+    throws ParserInitializationException 
+    {
+        this.config = config;
+        String key = config.getServerSystemKey();
+        return createFileEntryParser(key);
+    }
 
 
     public FTPFileEntryParser createUnixFTPEntryParser()
@@ -200,22 +200,22 @@
      * @since 1.5
      */
     public FTPFileEntryParser createNetwareFTPEntryParser() {
-    	return new NetwareFTPEntryParser();
+        return new NetwareFTPEntryParser();
     }
 
     public FTPFileEntryParser createNTFTPEntryParser()
     {
-    	if (config != null && FTPClientConfig.SYST_NT.equals(
-    	        config.getServerSystemKey())) 
-    	{
+        if (config != null && FTPClientConfig.SYST_NT.equals(
+                config.getServerSystemKey())) 
+        {
             return new NTFTPEntryParser();
-    	} else {
+        } else {
             return new CompositeFileEntryParser(new FTPFileEntryParser[]
-	   	        {
-	   	            new NTFTPEntryParser(),
-	   	            new UnixFTPEntryParser()
-	   	        });
-    	}
+                {
+                    new NTFTPEntryParser(),
+                    new UnixFTPEntryParser()
+                });
+        }
     }
     
      public FTPFileEntryParser createOS2FTPEntryParser()
@@ -225,17 +225,17 @@
 
     public FTPFileEntryParser createOS400FTPEntryParser()
     {
-    	if (config != null && 
-    	        FTPClientConfig.SYST_OS400.equals(config.getServerSystemKey())) 
-    	{
+        if (config != null && 
+                FTPClientConfig.SYST_OS400.equals(config.getServerSystemKey())) 
+        {
             return new OS400FTPEntryParser();
-    	} else {
-	        return new CompositeFileEntryParser(new FTPFileEntryParser[]
-	            {
-	                new OS400FTPEntryParser(),
-	                new UnixFTPEntryParser()
-	            });
-    	}
+        } else {
+            return new CompositeFileEntryParser(new FTPFileEntryParser[]
+                {
+                    new OS400FTPEntryParser(),
+                    new UnixFTPEntryParser()
+                });
+        }
     }
 
     public FTPFileEntryParser createMVSEntryParser()
@@ -244,6 +244,6 @@
     }
 
 
-	
+    
 }
 

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java?rev=658520&r1=658519&r2=658520&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Tue May 20 18:14:11 2008
@@ -37,255 +37,255 @@
  * @since 1.4
  */
 public class FTPTimestampParserImpl implements
-		FTPTimestampParser, Configurable 
+        FTPTimestampParser, Configurable 
 {
 
-	
-	private SimpleDateFormat defaultDateFormat;
-	private SimpleDateFormat recentDateFormat;
-	private boolean lenientFutureDates = false;
-	
-	
-	/**
-	 * The only constructor for this class. 
-	 */
-	public FTPTimestampParserImpl() {
-		setDefaultDateFormat(DEFAULT_SDF);
-		setRecentDateFormat(DEFAULT_RECENT_SDF);
-	}
-	
-	/** 
-	 * Implements the one {@link  FTPTimestampParser#parseTimestamp(String)  method}
-	 * in the {@link  FTPTimestampParser  FTPTimestampParser} interface 
-	 * according to this algorithm:
-	 * 
-	 * If the recentDateFormat member has been defined, try to parse the 
-	 * supplied string with that.  If that parse fails, or if the recentDateFormat
-	 * member has not been defined, attempt to parse with the defaultDateFormat
-	 * member.  If that fails, throw a ParseException.
-	 * 
-	 * This method allows a {@link Calendar} instance to be passed in which represents the
-	 * current (system) time.
-	 * 
-	 * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String)
-	 * 
-	 * @param timestampStr The timestamp to be parsed	 
-	 */
-	public Calendar parseTimestamp(String timestampStr) throws ParseException {
-		Calendar now = Calendar.getInstance();
-		return parseTimestamp(timestampStr, now);
-	}
-	
-	/** 
-	 * Implements the one {@link  FTPTimestampParser#parseTimestamp(String)  method}
-	 * in the {@link  FTPTimestampParser  FTPTimestampParser} interface 
-	 * according to this algorithm:
-	 * 
-	 * If the recentDateFormat member has been defined, try to parse the 
-	 * supplied string with that.  If that parse fails, or if the recentDateFormat
-	 * member has not been defined, attempt to parse with the defaultDateFormat
-	 * member.  If that fails, throw a ParseException. 
-	 * 
-	 * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String)
-	 * @param timestampStr The timestamp to be parsed
-	 * @param serverTime The current time for the server
-	 * @since 1.5
-	 */
-	public Calendar parseTimestamp(String timestampStr, Calendar serverTime) throws ParseException {
+    
+    private SimpleDateFormat defaultDateFormat;
+    private SimpleDateFormat recentDateFormat;
+    private boolean lenientFutureDates = false;
+    
+    
+    /**
+     * The only constructor for this class. 
+     */
+    public FTPTimestampParserImpl() {
+        setDefaultDateFormat(DEFAULT_SDF);
+        setRecentDateFormat(DEFAULT_RECENT_SDF);
+    }
+    
+    /** 
+     * Implements the one {@link  FTPTimestampParser#parseTimestamp(String)  method}
+     * in the {@link  FTPTimestampParser  FTPTimestampParser} interface 
+     * according to this algorithm:
+     * 
+     * If the recentDateFormat member has been defined, try to parse the 
+     * supplied string with that.  If that parse fails, or if the recentDateFormat
+     * member has not been defined, attempt to parse with the defaultDateFormat
+     * member.  If that fails, throw a ParseException.
+     * 
+     * This method allows a {@link Calendar} instance to be passed in which represents the
+     * current (system) time.
+     * 
+     * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String)
+     * 
+     * @param timestampStr The timestamp to be parsed
+     */
+    public Calendar parseTimestamp(String timestampStr) throws ParseException {
+        Calendar now = Calendar.getInstance();
+        return parseTimestamp(timestampStr, now);
+    }
+    
+    /** 
+     * Implements the one {@link  FTPTimestampParser#parseTimestamp(String)  method}
+     * in the {@link  FTPTimestampParser  FTPTimestampParser} interface 
+     * according to this algorithm:
+     * 
+     * If the recentDateFormat member has been defined, try to parse the 
+     * supplied string with that.  If that parse fails, or if the recentDateFormat
+     * member has not been defined, attempt to parse with the defaultDateFormat
+     * member.  If that fails, throw a ParseException. 
+     * 
+     * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String)
+     * @param timestampStr The timestamp to be parsed
+     * @param serverTime The current time for the server
+     * @since 1.5
+     */
+    public Calendar parseTimestamp(String timestampStr, Calendar serverTime) throws ParseException {
         Calendar now = (Calendar) serverTime.clone();// Copy this, because we may change it
-		now.setTimeZone(this.getServerTimeZone());
-		Calendar working = (Calendar) now.clone();
-		working.setTimeZone(getServerTimeZone());
-		ParsePosition pp = new ParsePosition(0);
+        now.setTimeZone(this.getServerTimeZone());
+        Calendar working = (Calendar) now.clone();
+        working.setTimeZone(getServerTimeZone());
+        ParsePosition pp = new ParsePosition(0);
 
-		Date parsed = null;
-		if (recentDateFormat != null) {
+        Date parsed = null;
+        if (recentDateFormat != null) {
             if (lenientFutureDates) {
                 // add a day to "now" so that "slop" doesn't cause a date 
                 // slightly in the future to roll back a full year.  (Bug 35181)
                 now.add(Calendar.DATE, 1);
             }    
-			parsed = recentDateFormat.parse(timestampStr, pp);
-		}
-		if (parsed != null && pp.getIndex() == timestampStr.length()) 
-		{
-			working.setTime(parsed);
-			working.set(Calendar.YEAR, now.get(Calendar.YEAR));
+            parsed = recentDateFormat.parse(timestampStr, pp);
+        }
+        if (parsed != null && pp.getIndex() == timestampStr.length()) 
+        {
+            working.setTime(parsed);
+            working.set(Calendar.YEAR, now.get(Calendar.YEAR));
 
-			if (working.after(now)) {
-				working.add(Calendar.YEAR, -1);
-			}
-		} else {
-			// Temporarily add the current year to the short date time
-			// to cope with short-date leap year strings.
-			// e.g. Java's DateFormatter will assume that "Feb 29 12:00" refers to 
-			// Feb 29 1970 (an invalid date) rather than a potentially valid leap year date.
-			// This is pretty bad hack to work around the deficiencies of the JDK date/time classes.
-			if (recentDateFormat != null) {
-				pp = new ParsePosition(0);
-				int year = now.get(Calendar.YEAR);
-				String timeStampStrPlusYear = timestampStr + " " + year;
-				SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + " yyyy", 
-						recentDateFormat.getDateFormatSymbols());
-				hackFormatter.setLenient(false);
-				hackFormatter.setTimeZone(recentDateFormat.getTimeZone());
-				parsed = hackFormatter.parse(timeStampStrPlusYear, pp);
-			}
-			if (parsed != null && pp.getIndex() == timestampStr.length() + 5) {
-				working.setTime(parsed);
-			}
-			else {
-				pp = new ParsePosition(0);
-				parsed = defaultDateFormat.parse(timestampStr, pp);
-				// note, length checks are mandatory for us since
-				// SimpleDateFormat methods will succeed if less than
-				// full string is matched.  They will also accept, 
-				// despite "leniency" setting, a two-digit number as
-				// a valid year (e.g. 22:04 will parse as 22 A.D.) 
-				// so could mistakenly confuse an hour with a year, 
-				// if we don't insist on full length parsing.
-				if (parsed != null && pp.getIndex() == timestampStr.length()) {
-					working.setTime(parsed);
-				} else {
-					throw new ParseException(
-							"Timestamp could not be parsed with older or recent DateFormat", 
-							pp.getIndex());
-				}
-			}
-		}
-		return working;
-	}
+            if (working.after(now)) {
+                working.add(Calendar.YEAR, -1);
+            }
+        } else {
+            // Temporarily add the current year to the short date time
+            // to cope with short-date leap year strings.
+            // e.g. Java's DateFormatter will assume that "Feb 29 12:00" refers to 
+            // Feb 29 1970 (an invalid date) rather than a potentially valid leap year date.
+            // This is pretty bad hack to work around the deficiencies of the JDK date/time classes.
+            if (recentDateFormat != null) {
+                pp = new ParsePosition(0);
+                int year = now.get(Calendar.YEAR);
+                String timeStampStrPlusYear = timestampStr + " " + year;
+                SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + " yyyy", 
+                        recentDateFormat.getDateFormatSymbols());
+                hackFormatter.setLenient(false);
+                hackFormatter.setTimeZone(recentDateFormat.getTimeZone());
+                parsed = hackFormatter.parse(timeStampStrPlusYear, pp);
+            }
+            if (parsed != null && pp.getIndex() == timestampStr.length() + 5) {
+                working.setTime(parsed);
+            }
+            else {
+                pp = new ParsePosition(0);
+                parsed = defaultDateFormat.parse(timestampStr, pp);
+                // note, length checks are mandatory for us since
+                // SimpleDateFormat methods will succeed if less than
+                // full string is matched.  They will also accept, 
+                // despite "leniency" setting, a two-digit number as
+                // a valid year (e.g. 22:04 will parse as 22 A.D.) 
+                // so could mistakenly confuse an hour with a year, 
+                // if we don't insist on full length parsing.
+                if (parsed != null && pp.getIndex() == timestampStr.length()) {
+                    working.setTime(parsed);
+                } else {
+                    throw new ParseException(
+                            "Timestamp could not be parsed with older or recent DateFormat", 
+                            pp.getIndex());
+                }
+            }
+        }
+        return working;
+    }
 
-	/**
-	 * @return Returns the defaultDateFormat.
-	 */
-	public SimpleDateFormat getDefaultDateFormat() {
-		return defaultDateFormat;
-	}
-	/**
-	 * @return Returns the defaultDateFormat pattern string.
-	 */
-	public String getDefaultDateFormatString() {
-		return defaultDateFormat.toPattern();
-	}
-	/**
-	 * @param defaultDateFormat The defaultDateFormat to be set.
-	 */
-	private void setDefaultDateFormat(String format) {
-		if (format != null) {
-			this.defaultDateFormat = new SimpleDateFormat(format);
-			this.defaultDateFormat.setLenient(false);
-		}
-	} 
-	/**
-	 * @return Returns the recentDateFormat.
-	 */
-	public SimpleDateFormat getRecentDateFormat() {
-		return recentDateFormat;
-	}
-	/**
-	 * @return Returns the recentDateFormat.
-	 */
-	public String getRecentDateFormatString() {
-		return recentDateFormat.toPattern();
-	}
-	/**
-	 * @param recentDateFormat The recentDateFormat to set.
-	 */
-	private void setRecentDateFormat(String format) {
-		if (format != null) {
-			this.recentDateFormat = new SimpleDateFormat(format);
-			this.recentDateFormat.setLenient(false);
-		}
-	}
-	
-	/**
-	 * @return returns an array of 12 strings representing the short
-	 * month names used by this parse.
-	 */
-	public String[] getShortMonths() {
-		return defaultDateFormat.getDateFormatSymbols().getShortMonths();
-	}
-	
-	
-	/**
-	 * @return Returns the serverTimeZone used by this parser.
-	 */
-	public TimeZone getServerTimeZone() {
-		return this.defaultDateFormat.getTimeZone();
-	}
-	/**
-	 * sets a TimeZone represented by the supplied ID string into all
-	 * of the parsers used by this server.
-	 * @param serverTimeZone Time Id java.util.TimeZone id used by
-	 * the ftp server.  If null the client's local time zone is assumed.
-	 */
-	private void setServerTimeZone(String serverTimeZoneId) {
-		TimeZone serverTimeZone = TimeZone.getDefault();
-		if (serverTimeZoneId != null) {
-			serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId);
-		}
-		this.defaultDateFormat.setTimeZone(serverTimeZone);
-		if (this.recentDateFormat != null) {
-			this.recentDateFormat.setTimeZone(serverTimeZone);
-		}			
-	}
-	
-	/**
-	 * Implementation of the {@link  Configurable  Configurable}
-	 * interface. Configures this <code>FTPTimestampParser</code> according
-	 * to the following logic:
-	 * <p>
-	 * Set up the {@link  FTPClientConfig#setDefaultDateFormatStr(java.lang.String) defaultDateFormat}
-	 * and optionally the {@link  FTPClientConfig#setRecentDateFormatStr(String) recentDateFormat}
-	 * to values supplied in the config based on month names configured as follows:
-	 * </p><p><ul>
-	 * <li>If a {@link  FTPClientConfig#setShortMonthNames(String) shortMonthString}
-	 * has been supplied in the <code>config</code>, use that to parse  parse timestamps.</li> 
-	 * <li>Otherwise, if a {@link  FTPClientConfig#setServerLanguageCode(String) serverLanguageCode}
-	 * has been supplied in the <code>config</code>, use the month names represented 
-	 * by that {@link  FTPClientConfig#lookupDateFormatSymbols(String) language}
-	 * to parse timestamps.</li>
-	 * <li>otherwise use default English month names</li>
-	 * </ul></p><p>
-	 * Finally if a {@link  org.apache.commons.net.ftp.FTPClientConfig#setServerTimeZoneId(String) serverTimeZoneId}
-	 * has been supplied via the config, set that into all date formats that have 
-	 * been configured.  
-	 * </p> 
-	 */
-	public void configure(FTPClientConfig config) {
-		DateFormatSymbols dfs = null;
-		
-		String languageCode = config.getServerLanguageCode();
-		String shortmonths = config.getShortMonthNames();
-		if (shortmonths != null) {
-			dfs = FTPClientConfig.getDateFormatSymbols(shortmonths);
-		} else if (languageCode != null) {
-			dfs = FTPClientConfig.lookupDateFormatSymbols(languageCode);
-		} else {
-			dfs = FTPClientConfig.lookupDateFormatSymbols("en");
-		}
-		
-		
-		String recentFormatString = config.getRecentDateFormatStr();
-		if (recentFormatString == null) {
-		    this.recentDateFormat = null;
-		} else {
-			this.recentDateFormat = new SimpleDateFormat(recentFormatString, dfs);
-			this.recentDateFormat.setLenient(false);
-		}
-			
-		String defaultFormatString = config.getDefaultDateFormatStr();
-		if (defaultFormatString == null) {
-			throw new IllegalArgumentException("defaultFormatString cannot be null");
-		}
-		this.defaultDateFormat = new SimpleDateFormat(defaultFormatString, dfs);
-		this.defaultDateFormat.setLenient(false);
-		
-		setServerTimeZone(config.getServerTimeZoneId());
-		
-		this.lenientFutureDates = config.isLenientFutureDates();
-	}
+    /**
+     * @return Returns the defaultDateFormat.
+     */
+    public SimpleDateFormat getDefaultDateFormat() {
+        return defaultDateFormat;
+    }
+    /**
+     * @return Returns the defaultDateFormat pattern string.
+     */
+    public String getDefaultDateFormatString() {
+        return defaultDateFormat.toPattern();
+    }
+    /**
+     * @param defaultDateFormat The defaultDateFormat to be set.
+     */
+    private void setDefaultDateFormat(String format) {
+        if (format != null) {
+            this.defaultDateFormat = new SimpleDateFormat(format);
+            this.defaultDateFormat.setLenient(false);
+        }
+    } 
+    /**
+     * @return Returns the recentDateFormat.
+     */
+    public SimpleDateFormat getRecentDateFormat() {
+        return recentDateFormat;
+    }
+    /**
+     * @return Returns the recentDateFormat.
+     */
+    public String getRecentDateFormatString() {
+        return recentDateFormat.toPattern();
+    }
+    /**
+     * @param recentDateFormat The recentDateFormat to set.
+     */
+    private void setRecentDateFormat(String format) {
+        if (format != null) {
+            this.recentDateFormat = new SimpleDateFormat(format);
+            this.recentDateFormat.setLenient(false);
+        }
+    }
+    
+    /**
+     * @return returns an array of 12 strings representing the short
+     * month names used by this parse.
+     */
+    public String[] getShortMonths() {
+        return defaultDateFormat.getDateFormatSymbols().getShortMonths();
+    }
+    
+    
+    /**
+     * @return Returns the serverTimeZone used by this parser.
+     */
+    public TimeZone getServerTimeZone() {
+        return this.defaultDateFormat.getTimeZone();
+    }
+    /**
+     * sets a TimeZone represented by the supplied ID string into all
+     * of the parsers used by this server.
+     * @param serverTimeZone Time Id java.util.TimeZone id used by
+     * the ftp server.  If null the client's local time zone is assumed.
+     */
+    private void setServerTimeZone(String serverTimeZoneId) {
+        TimeZone serverTimeZone = TimeZone.getDefault();
+        if (serverTimeZoneId != null) {
+            serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId);
+        }
+        this.defaultDateFormat.setTimeZone(serverTimeZone);
+        if (this.recentDateFormat != null) {
+            this.recentDateFormat.setTimeZone(serverTimeZone);
+        }
+    }
+    
+    /**
+     * Implementation of the {@link  Configurable  Configurable}
+     * interface. Configures this <code>FTPTimestampParser</code> according
+     * to the following logic:
+     * <p>
+     * Set up the {@link  FTPClientConfig#setDefaultDateFormatStr(java.lang.String) defaultDateFormat}
+     * and optionally the {@link  FTPClientConfig#setRecentDateFormatStr(String) recentDateFormat}
+     * to values supplied in the config based on month names configured as follows:
+     * </p><p><ul>
+     * <li>If a {@link  FTPClientConfig#setShortMonthNames(String) shortMonthString}
+     * has been supplied in the <code>config</code>, use that to parse  parse timestamps.</li> 
+     * <li>Otherwise, if a {@link  FTPClientConfig#setServerLanguageCode(String) serverLanguageCode}
+     * has been supplied in the <code>config</code>, use the month names represented 
+     * by that {@link  FTPClientConfig#lookupDateFormatSymbols(String) language}
+     * to parse timestamps.</li>
+     * <li>otherwise use default English month names</li>
+     * </ul></p><p>
+     * Finally if a {@link  org.apache.commons.net.ftp.FTPClientConfig#setServerTimeZoneId(String) serverTimeZoneId}
+     * has been supplied via the config, set that into all date formats that have 
+     * been configured.  
+     * </p> 
+     */
+    public void configure(FTPClientConfig config) {
+        DateFormatSymbols dfs = null;
+        
+        String languageCode = config.getServerLanguageCode();
+        String shortmonths = config.getShortMonthNames();
+        if (shortmonths != null) {
+            dfs = FTPClientConfig.getDateFormatSymbols(shortmonths);
+        } else if (languageCode != null) {
+            dfs = FTPClientConfig.lookupDateFormatSymbols(languageCode);
+        } else {
+            dfs = FTPClientConfig.lookupDateFormatSymbols("en");
+        }
+        
+        
+        String recentFormatString = config.getRecentDateFormatStr();
+        if (recentFormatString == null) {
+            this.recentDateFormat = null;
+        } else {
+            this.recentDateFormat = new SimpleDateFormat(recentFormatString, dfs);
+            this.recentDateFormat.setLenient(false);
+        }
+            
+        String defaultFormatString = config.getDefaultDateFormatStr();
+        if (defaultFormatString == null) {
+            throw new IllegalArgumentException("defaultFormatString cannot be null");
+        }
+        this.defaultDateFormat = new SimpleDateFormat(defaultFormatString, dfs);
+        this.defaultDateFormat.setLenient(false);
+        
+        setServerTimeZone(config.getServerTimeZoneId());
+        
+        this.lenientFutureDates = config.isLenientFutureDates();
+    }
     /**
      * @return Returns the lenientFutureDates.
      */



Mime
View raw message