View Javadoc

1   package fr.in2p3.jsaga.adaptor.data;
2   
3   import org.globus.ftp.DataChannelAuthentication;
4   import org.globus.ftp.exception.ServerException;
5   import org.ogf.saga.error.*;
6   
7   import fr.in2p3.jsaga.adaptor.security.GlobusSecurityCredential;
8   import fr.in2p3.jsaga.adaptor.security.MyProxySecurityCredential;
9   
10  import java.io.IOException;
11  import java.util.Map;
12  
13  /* ***************************************************
14  * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
15  * ***             http://cc.in2p3.fr/             ***
16  * ***************************************************
17  * File:   GsiftpWinDataAdaptor
18  * Author: Sylvain Reynaud (sreynaud@in2p3.fr)
19  * Date:   20 aout 2007
20  * ***************************************************
21  * Description:                                      */
22  /**
23   *
24   */
25  public class GsiftpWinDataAdaptor extends Gsiftp2DataAdaptor {
26      /** override super.getType() */
27      public String getType() {
28          return "gsiftp-win";
29      }
30  
31      /** override super.getSupportedSecurityAdaptorClasses() because VOMS context type is not supported */
32      public Class[] getSupportedSecurityCredentialClasses() {
33          return new Class[]{GlobusSecurityCredential.class, MyProxySecurityCredential.class};
34      }
35  
36      /** override super.connect() because settings data channel authentication is not supported */
37      public void connect(String userInfo, String host, int port, String basePath, Map attributes) throws AuthenticationFailedException, AuthorizationFailedException, BadParameterException, TimeoutException, NoSuccessException {
38          // connect
39          super.connect(userInfo, host, port, basePath, attributes);
40  
41          // not yet supported on windows implementation of gsiftp server
42          try {
43              m_client.setDataChannelAuthentication(DataChannelAuthentication.NONE);
44          } catch (IOException e) {
45              throw new TimeoutException(e);
46          } catch (ServerException e) {
47              throw new AuthenticationFailedException(e);
48          }
49      }
50  }