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/05/26 10:20:27 UTC

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

imario      2004/05/26 01:20:27

  Modified:    vfs/src/java/org/apache/commons/vfs/provider/ftp
                        FtpFileProvider.java
  Log:
  create ftpclient as soon as possible to see if host/credentials are correct
  
  Revision  Changes    Path
  1.8       +13 -5     jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpFileProvider.java
  
  Index: FtpFileProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpFileProvider.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FtpFileProvider.java	19 May 2004 19:34:06 -0000	1.7
  +++ FtpFileProvider.java	26 May 2004 08:20:27 -0000	1.8
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002, 2003,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -15,6 +15,7 @@
    */
   package org.apache.commons.vfs.provider.ftp;
   
  +import org.apache.commons.net.ftp.FTPClient;
   import org.apache.commons.vfs.Capability;
   import org.apache.commons.vfs.FileName;
   import org.apache.commons.vfs.FileSystem;
  @@ -77,7 +78,14 @@
       {
           // Create the file system
           final GenericFileName rootName = (GenericFileName) name;
  -        return new FtpFileSystem(rootName, fileSystemOptions);
  +
  +        FTPClient ftpClient = FtpClientFactory.createConnection(rootName.getHostName(),
  +            rootName.getPort(),
  +            rootName.getUserName(),
  +            rootName.getPassword(),
  +            rootName.getPath());
  +
  +        return new FtpFileSystem(rootName, ftpClient, fileSystemOptions);
       }
   
       public FileSystemConfigBuilder getConfigBuilder()
  
  
  

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