commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1337634 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
Date Sat, 12 May 2012 20:16:03 GMT
Author: ggregory
Date: Sat May 12 20:16:03 2012
New Revision: 1337634

URL: http://svn.apache.org/viewvc?rev=1337634&view=rev
Log:
Order members alphabetically.

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java?rev=1337634&r1=1337633&r2=1337634&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileSystemConfigBuilder.java
Sat May 12 20:16:03 2012
@@ -30,24 +30,19 @@ public final class FtpFileSystemConfigBu
 
     private static final FtpFileSystemConfigBuilder BUILDER = new FtpFileSystemConfigBuilder();
 
+    private static final String DATA_TIMEOUT = _PREFIX + ".DATA_TIMEOUT";
+    private static final String DEFAULT_DATE_FORMAT = _PREFIX + ".DEFAULT_DATE_FORMAT";
+    private static final String ENCODING = _PREFIX + ".ENCODING";
     private static final String FACTORY_KEY = FTPFileEntryParserFactory.class.getName() +
".KEY";
     private static final String FILE_TYPE = _PREFIX + ".FILE_TYPE";
     private static final String PASSIVE_MODE = _PREFIX + ".PASSIVE";
-    private static final String USER_DIR_IS_ROOT = _PREFIX + ".USER_DIR_IS_ROOT";
-    private static final String DATA_TIMEOUT = _PREFIX + ".DATA_TIMEOUT";
-    private static final String SO_TIMEOUT = _PREFIX + ".SO_TIMEOUT";
 
-    private static final String SERVER_LANGUAGE_CODE = _PREFIX + ".SERVER_LANGUAGE_CODE";
-    private static final String DEFAULT_DATE_FORMAT = _PREFIX + ".DEFAULT_DATE_FORMAT";
     private static final String RECENT_DATE_FORMAT = _PREFIX + ".RECENT_DATE_FORMAT";
+    private static final String SERVER_LANGUAGE_CODE = _PREFIX + ".SERVER_LANGUAGE_CODE";
     private static final String SERVER_TIME_ZONE_ID = _PREFIX + ".SERVER_TIME_ZONE_ID";
     private static final String SHORT_MONTH_NAMES = _PREFIX + ".SHORT_MONTH_NAMES";
-    private static final String ENCODING = _PREFIX + ".ENCODING";
-
-    private FtpFileSystemConfigBuilder()
-    {
-        super("ftp.");
-    }
+    private static final String SO_TIMEOUT = _PREFIX + ".SO_TIMEOUT";
+    private static final String USER_DIR_IS_ROOT = _PREFIX + ".USER_DIR_IS_ROOT";
 
     /**
      * Gets the singleton instance.
@@ -59,27 +54,56 @@ public final class FtpFileSystemConfigBu
         return BUILDER;
     }
 
+    private FtpFileSystemConfigBuilder()
+    {
+        super("ftp.");
+    }
+
+    @Override
+    protected Class<? extends FileSystem> getConfigClass()
+    {
+        return FtpFileSystem.class;
+    }
+
     /**
-     * FTPFileEntryParserFactory which will be used for ftp-entry parsing.
-     *
      * @param opts The FileSystemOptions.
-     * @param factory instance of your factory
+     * @return The encoding.
+     * @since 2.0
+     * */
+    public String getControlEncoding(FileSystemOptions opts)
+    {
+        return (String) getParam(opts, ENCODING);
+    }
+
+    /**
+     * @param opts The FileSystemOptions.
+     * @return The timeout as an Integer.
+     * @see #setDataTimeout
      */
-    public void setEntryParserFactory(FileSystemOptions opts, FTPFileEntryParserFactory factory)
+    public Integer getDataTimeout(FileSystemOptions opts)
     {
-        setParam(opts, FTPFileEntryParserFactory.class.getName(), factory);
+        return getInteger(opts, DATA_TIMEOUT);
+    }
+
+    /**
+     * get the language code used by the server. see {@link org.apache.commons.net.ftp.FTPClientConfig}
+     * for details and examples.
+     * @param opts The FileSystemOptions
+     * @return The default date format.
+     */
+    public String getDefaultDateFormat(FileSystemOptions opts)
+    {
+        return getString(opts, DEFAULT_DATE_FORMAT);
     }
 
     /**
-     * Sets the file type parameter.
-     * 
      * @param opts The FileSystemOptions.
-     * @param ftpFileType A FtpFileType
-     * @since 2.1
+     * @see #setEntryParser
+     * @return the key to the EntryParser.
      */
-    public void setFileType(FileSystemOptions opts, FtpFileType ftpFileType)
+    public String getEntryParser(FileSystemOptions opts)
     {
-        setParam(opts, FILE_TYPE, ftpFileType);
+        return getString(opts, FACTORY_KEY);
     }
 
     /**
@@ -105,66 +129,65 @@ public final class FtpFileSystemConfigBu
     }
 
     /**
-     * set the FQCN of your FileEntryParser used to parse the directory listing from your
server.<br />
-     * <br />
-     * <i>If you do not use the default commons-net FTPFileEntryParserFactory e.g.
by using
-     * {@link #setEntryParserFactory}
-     * this is the "key" parameter passed as argument into your custom factory</i>
-     *
      * @param opts The FileSystemOptions.
-     * @param key The key.
+     * @return true if passive mode is set.
+     * @see #setPassiveMode
      */
-    public void setEntryParser(FileSystemOptions opts, String key)
+    public Boolean getPassiveMode(FileSystemOptions opts)
     {
-        setParam(opts, FACTORY_KEY, key);
+        return getBoolean(opts, PASSIVE_MODE);
     }
 
     /**
+     * see {@link org.apache.commons.net.ftp.FTPClientConfig} for details and examples.
      * @param opts The FileSystemOptions.
-     * @see #setEntryParser
-     * @return the key to the EntryParser.
+     * @return The recent date format.
      */
-    public String getEntryParser(FileSystemOptions opts)
+    public String getRecentDateFormat(FileSystemOptions opts)
     {
-        return getString(opts, FACTORY_KEY);
+        return getString(opts, RECENT_DATE_FORMAT);
     }
 
-    @Override
-    protected Class<? extends FileSystem> getConfigClass()
+    /**
+     * get the language code used by the server. see {@link org.apache.commons.net.ftp.FTPClientConfig}
+     * for details and examples.
+     * @param opts The FilesystemOptions.
+     * @return The language code of the server.
+     */
+    public String getServerLanguageCode(FileSystemOptions opts)
     {
-        return FtpFileSystem.class;
+        return getString(opts, SERVER_LANGUAGE_CODE);
     }
 
     /**
-     * enter into passive mode.
-     *
+     * see {@link org.apache.commons.net.ftp.FTPClientConfig} for details and examples.
      * @param opts The FileSystemOptions.
-     * @param passiveMode true if passive mode should be used.
+     * @return The server timezone id.
      */
-    public void setPassiveMode(FileSystemOptions opts, boolean passiveMode)
+    public String getServerTimeZoneId(FileSystemOptions opts)
     {
-        setParam(opts, PASSIVE_MODE, passiveMode ? Boolean.TRUE : Boolean.FALSE);
+        return getString(opts, SERVER_TIME_ZONE_ID);
     }
 
     /**
+     * see {@link org.apache.commons.net.ftp.FTPClientConfig} for details and examples.
      * @param opts The FileSystemOptions.
-     * @return true if passive mode is set.
-     * @see #setPassiveMode
+     * @return An array of short month names.
      */
-    public Boolean getPassiveMode(FileSystemOptions opts)
+    public String[] getShortMonthNames(FileSystemOptions opts)
     {
-        return getBoolean(opts, PASSIVE_MODE);
+        return (String[]) getParam(opts, SHORT_MONTH_NAMES);
     }
 
     /**
-     * use user directory as root (do not change to fs root).
-     *
-     * @param opts The FileSystemOptions.
-     * @param userDirIsRoot true if the user directory should be treated as the root.
+     * @param opts The FileSystem options.
+     * @return The timeout value.
+     * @see #getDataTimeout
+     * @since 2.0
      */
-    public void setUserDirIsRoot(FileSystemOptions opts, boolean userDirIsRoot)
+    public Integer getSoTimeout(FileSystemOptions opts)
     {
-        setParam(opts, USER_DIR_IS_ROOT, userDirIsRoot ? Boolean.TRUE : Boolean.FALSE);
+        return (Integer) getParam(opts, SO_TIMEOUT);
     }
 
     /**
@@ -178,13 +201,14 @@ public final class FtpFileSystemConfigBu
     }
 
     /**
+     * see {@link org.apache.commons.net.ftp.FTP#setControlEncoding} for details and examples.
      * @param opts The FileSystemOptions.
-     * @return The timeout as an Integer.
-     * @see #setDataTimeout
+     * @param encoding the encoding to use
+     * @since 2.0
      */
-    public Integer getDataTimeout(FileSystemOptions opts)
+    public void setControlEncoding(FileSystemOptions opts, String encoding)
     {
-        return getInteger(opts, DATA_TIMEOUT);
+        setParam(opts, ENCODING, encoding);
     }
 
     /**
@@ -201,82 +225,63 @@ public final class FtpFileSystemConfigBu
     }
 
     /**
-     * @param opts The FileSystem options.
-     * @return The timeout value.
-     * @see #getDataTimeout
-     * @since 2.0
-     */
-    public Integer getSoTimeout(FileSystemOptions opts)
-    {
-        return (Integer) getParam(opts, SO_TIMEOUT);
-    }
-
-    /**
-     * set the socket timeout for the ftp client.<br />
-     * If you set the socketTimeout to <code>null</code> no socketTimeout will
be set on the
-     * ftp client.
-     *
-     * @param opts The FileSystem options.
-     * @param soTimeout The timeout value.
-     * @since 2.0
-     */
-    public void setSoTimeout(FileSystemOptions opts, Integer soTimeout)
-    {
-        setParam(opts, SO_TIMEOUT, soTimeout);
-    }
-
-    /**
-     * get the language code used by the server. see {@link org.apache.commons.net.ftp.FTPClientConfig}
+     * set the language code used by the server. see {@link org.apache.commons.net.ftp.FTPClientConfig}
      * for details and examples.
-     * @param opts The FilesystemOptions.
-     * @return The language code of the server.
+     * @param opts The FileSystemOptions.
+     * @param defaultDateFormat The default date format.
      */
-    public String getServerLanguageCode(FileSystemOptions opts)
+    public void setDefaultDateFormat(FileSystemOptions opts, String defaultDateFormat)
     {
-        return getString(opts, SERVER_LANGUAGE_CODE);
+        setParam(opts, DEFAULT_DATE_FORMAT, defaultDateFormat);
     }
 
     /**
-     * set the language code used by the server. see {@link org.apache.commons.net.ftp.FTPClientConfig}
-     * for details and examples.
+     * set the FQCN of your FileEntryParser used to parse the directory listing from your
server.<br />
+     * <br />
+     * <i>If you do not use the default commons-net FTPFileEntryParserFactory e.g.
by using
+     * {@link #setEntryParserFactory}
+     * this is the "key" parameter passed as argument into your custom factory</i>
+     *
      * @param opts The FileSystemOptions.
-     * @param serverLanguageCode The servers language code.
+     * @param key The key.
      */
-    public void setServerLanguageCode(FileSystemOptions opts, String serverLanguageCode)
+    public void setEntryParser(FileSystemOptions opts, String key)
     {
-        setParam(opts, SERVER_LANGUAGE_CODE, serverLanguageCode);
+        setParam(opts, FACTORY_KEY, key);
     }
 
     /**
-     * get the language code used by the server. see {@link org.apache.commons.net.ftp.FTPClientConfig}
-     * for details and examples.
-     * @param opts The FileSystemOptions
-     * @return The default date format.
+     * FTPFileEntryParserFactory which will be used for ftp-entry parsing.
+     *
+     * @param opts The FileSystemOptions.
+     * @param factory instance of your factory
      */
-    public String getDefaultDateFormat(FileSystemOptions opts)
+    public void setEntryParserFactory(FileSystemOptions opts, FTPFileEntryParserFactory factory)
     {
-        return getString(opts, DEFAULT_DATE_FORMAT);
+        setParam(opts, FTPFileEntryParserFactory.class.getName(), factory);
     }
 
     /**
-     * set the language code used by the server. see {@link org.apache.commons.net.ftp.FTPClientConfig}
-     * for details and examples.
+     * Sets the file type parameter.
+     * 
      * @param opts The FileSystemOptions.
-     * @param defaultDateFormat The default date format.
+     * @param ftpFileType A FtpFileType
+     * @since 2.1
      */
-    public void setDefaultDateFormat(FileSystemOptions opts, String defaultDateFormat)
+    public void setFileType(FileSystemOptions opts, FtpFileType ftpFileType)
     {
-        setParam(opts, DEFAULT_DATE_FORMAT, defaultDateFormat);
+        setParam(opts, FILE_TYPE, ftpFileType);
     }
 
     /**
-     * see {@link org.apache.commons.net.ftp.FTPClientConfig} for details and examples.
+     * enter into passive mode.
+     *
      * @param opts The FileSystemOptions.
-     * @return The recent date format.
+     * @param passiveMode true if passive mode should be used.
      */
-    public String getRecentDateFormat(FileSystemOptions opts)
+    public void setPassiveMode(FileSystemOptions opts, boolean passiveMode)
     {
-        return getString(opts, RECENT_DATE_FORMAT);
+        setParam(opts, PASSIVE_MODE, passiveMode ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
@@ -290,13 +295,14 @@ public final class FtpFileSystemConfigBu
     }
 
     /**
-     * see {@link org.apache.commons.net.ftp.FTPClientConfig} for details and examples.
+     * set the language code used by the server. see {@link org.apache.commons.net.ftp.FTPClientConfig}
+     * for details and examples.
      * @param opts The FileSystemOptions.
-     * @return The server timezone id.
+     * @param serverLanguageCode The servers language code.
      */
-    public String getServerTimeZoneId(FileSystemOptions opts)
+    public void setServerLanguageCode(FileSystemOptions opts, String serverLanguageCode)
     {
-        return getString(opts, SERVER_TIME_ZONE_ID);
+        setParam(opts, SERVER_LANGUAGE_CODE, serverLanguageCode);
     }
 
     /**
@@ -312,16 +318,6 @@ public final class FtpFileSystemConfigBu
     /**
      * see {@link org.apache.commons.net.ftp.FTPClientConfig} for details and examples.
      * @param opts The FileSystemOptions.
-     * @return An array of short month names.
-     */
-    public String[] getShortMonthNames(FileSystemOptions opts)
-    {
-        return (String[]) getParam(opts, SHORT_MONTH_NAMES);
-    }
-
-    /**
-     * see {@link org.apache.commons.net.ftp.FTPClientConfig} for details and examples.
-     * @param opts The FileSystemOptions.
      * @param shortMonthNames an array of short month name Strings.
      */
     public void setShortMonthNames(FileSystemOptions opts, String[] shortMonthNames)
@@ -337,24 +333,28 @@ public final class FtpFileSystemConfigBu
     }
 
     /**
-     * see {@link org.apache.commons.net.ftp.FTP#setControlEncoding} for details and examples.
-     * @param opts The FileSystemOptions.
-     * @param encoding the encoding to use
+     * set the socket timeout for the ftp client.<br />
+     * If you set the socketTimeout to <code>null</code> no socketTimeout will
be set on the
+     * ftp client.
+     *
+     * @param opts The FileSystem options.
+     * @param soTimeout The timeout value.
      * @since 2.0
      */
-    public void setControlEncoding(FileSystemOptions opts, String encoding)
+    public void setSoTimeout(FileSystemOptions opts, Integer soTimeout)
     {
-        setParam(opts, ENCODING, encoding);
+        setParam(opts, SO_TIMEOUT, soTimeout);
     }
 
     /**
+     * use user directory as root (do not change to fs root).
+     *
      * @param opts The FileSystemOptions.
-     * @return The encoding.
-     * @since 2.0
-     * */
-    public String getControlEncoding(FileSystemOptions opts)
+     * @param userDirIsRoot true if the user directory should be treated as the root.
+     */
+    public void setUserDirIsRoot(FileSystemOptions opts, boolean userDirIsRoot)
     {
-        return (String) getParam(opts, ENCODING);
+        setParam(opts, USER_DIR_IS_ROOT, userDirIsRoot ? Boolean.TRUE : Boolean.FALSE);
     }
 
 }



Mime
View raw message