You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by im...@apache.org on 2004/12/21 22:55:41 UTC

cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp FtpClientFactory.java FtpFileSystemConfigBuilder.java

imario      2004/12/21 13:55:41

  Modified:    vfs/src/java/org/apache/commons/vfs/provider/ftp
                        FtpClientFactory.java
                        FtpFileSystemConfigBuilder.java
  Log:
  passiveMode configuration
  
  Revision  Changes    Path
  1.4       +7 -1      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpClientFactory.java
  
  Index: FtpClientFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpClientFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FtpClientFactory.java	20 Sep 2004 11:31:53 -0000	1.3
  +++ FtpClientFactory.java	21 Dec 2004 21:55:41 -0000	1.4
  @@ -94,6 +94,12 @@
                           throw new FileSystemException("vfs.provider/get-attributes-no-exist.error", "/");
                       }
                   }
  +
  +                Boolean passiveMode = FtpFileSystemConfigBuilder.getInstance().getPassiveMode(fileSystemOptions);
  +                if (passiveMode != null && passiveMode.booleanValue())
  +                {
  +                    client.enterLocalPassiveMode();
  +                }
               }
               catch (final IOException e)
               {
  
  
  
  1.9       +23 -1     jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpFileSystemConfigBuilder.java
  
  Index: FtpFileSystemConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpFileSystemConfigBuilder.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FtpFileSystemConfigBuilder.java	21 Sep 2004 05:32:56 -0000	1.8
  +++ FtpFileSystemConfigBuilder.java	21 Dec 2004 21:55:41 -0000	1.9
  @@ -30,6 +30,7 @@
       private final static FtpFileSystemConfigBuilder builder = new FtpFileSystemConfigBuilder();
   
       private final static String FACTORY_KEY = FTPFileEntryParserFactory.class.getName() + ".KEY";
  +    private final static String PASSIVE_MODE = FTPFileEntryParserFactory.class.getName() + ".PASSIVE";
   
       public static FtpFileSystemConfigBuilder getInstance()
       {
  @@ -88,5 +89,26 @@
       protected Class getConfigClass()
       {
           return FtpFileSystem.class;
  +    }
  +
  +    /**
  +     * enter into passive mode
  +     *
  +     * @param opts
  +     * @param passiveMode
  +     */
  +    public void setPassiveMode(FileSystemOptions opts, boolean passiveMode)
  +    {
  +        setParam(opts, PASSIVE_MODE, Boolean.valueOf(passiveMode));
  +    }
  +
  +    /**
  +     * @param opts
  +     * @return
  +     * @see #setPassiveMode
  +     */
  +    public Boolean getPassiveMode(FileSystemOptions opts)
  +    {
  +        return (Boolean) getParam(opts, PASSIVE_MODE);
       }
   }
  
  
  

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