Package org.globus.ftp

Examples of org.globus.ftp.GridFTPClient.authenticate()


      try {
        GridFTPContactInfo contactInfo = new GridFTPContactInfo(dirURI.getHost(), dirURI.getPort());

        srcClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
        srcClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
        srcClient.authenticate(gssCred);
        srcClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
        srcClient.setType(Session.TYPE_ASCII);
        srcClient.changeDir(dirURI.getPath());
              makeExternalConfigurations(srcClient, true);
View Full Code Here


            int tryCount = 0;
            while (true) {
                try {
                    destClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
                    destClient.authenticate(gssCred);
                    destClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
                    makeExternalConfigurations(destClient, false);

                    if (!destClient.exists(destPath)) {
                        destClient.makeDir(destPath);
View Full Code Here

            log.debug("Setup GridFTP Client");

            ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
            ftpClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
            ftpClient.authenticate(gsCredential);
            ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
            makeExternalConfigurations(ftpClient, false);

            log.info("Uploading file");
            if (checkBinaryExtensions(remoteFile)) {
View Full Code Here

            String remoteFile = destURI.getPath();
            log.info("The remote file is " + remoteFile);
            log.debug("Setup GridFTP Client");
            srcClient = new GridFTPClient(srcContactInfo.hostName, srcContactInfo.port);
            srcClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
            srcClient.authenticate(gsCredential);
            srcClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
            makeExternalConfigurations(srcClient, true);

            GridFTPClient destClient = new GridFTPClient(destContactInfo.hostName, destContactInfo.port);
            destClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
View Full Code Here

            srcClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
            makeExternalConfigurations(srcClient, true);

            GridFTPClient destClient = new GridFTPClient(destContactInfo.hostName, destContactInfo.port);
            destClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
            destClient.authenticate(gsCredential);
            destClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
            makeExternalConfigurations(destClient, false);
    log.debug("Uploading file");
            if (checkBinaryExtensions(remoteFile)) {
                log.debug("Transfer mode is set to Binary for a file upload");
View Full Code Here

            log.debug("Setup GridFTP Client");

            ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
            ftpClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
            ftpClient.authenticate(gsCredential);
            ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
            makeExternalConfigurations(ftpClient, false);

            log.debug("Uploading file");
            if (checkBinaryExtensions(remoteFile)) {
View Full Code Here

            log.debug("Setup GridFTP Client");

            ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port);
            ftpClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
            ftpClient.authenticate(gsCredential);
            ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF);
            makeExternalConfigurations(ftpClient, true);

            log.debug("Downloading file");
            if (checkBinaryExtensions(remoteFile)) {
View Full Code Here

                destClient.setType(Session.TYPE_IMAGE);
            }

            srcClient = new GridFTPClient(srchost.getHost(), srchost.getPort());
            srcClient.setAuthorization(new HostAuthorization(GridFtp.HOST));
            srcClient.authenticate(gssCred);
            makeExternalConfigurations(srcClient, true);

            if (checkBinaryExtensions(srchost.getPath())) {
                log.debug("Transfer mode is set to Binary");
                srcClient.setType(Session.TYPE_IMAGE);
View Full Code Here

 
 
  public void upload(File file, String directory, String remoteFile, GSSCredential credential){
    try {
      GridFTPClient gridFTPClient = new GridFTPClient("", 9393);
      gridFTPClient.authenticate(credential);
      DataSource source = new DataSourceStream(new FileInputStream(file));
      if(null != directory){
        gridFTPClient.changeDir(directory);
      }
      gridFTPClient.extendedPut(remoteFile, source, this);
View Full Code Here

 
 
  public void downloadFile(String remoteFileName, String directory, GSSCredential credential, OutputStream out){
    try {
      GridFTPClient gridFTPClient = new GridFTPClient("", 9393);
      gridFTPClient.authenticate(credential);
      gridFTPClient.changeDir(directory);
      DataSink sink = new DataSinkStream(out);
      gridFTPClient.get(remoteFileName,  sink , this);
    } catch (ServerException e) {
      // TODO Auto-generated catch block
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.