Package net.schmizz.sshj.xfer.scp

Examples of net.schmizz.sshj.xfer.scp.SCPFileTransfer.upload()


     SSHSecurityContext securityContext = (SSHSecurityContext)context.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT);
     SCPFileTransfer fileTransfer = securityContext.getSSHClient().newSCPFileTransfer();
     String remoteFile = app.getInputDataDirectory() + File.separatorChar + paramValue;

     File inputFile = new File(paramValue);
     fileTransfer.upload(inputFile.getAbsolutePath(), remoteFile);
     return remoteFile;
   }
}
View Full Code Here


    String remoteFile = app.getStaticWorkingDirectory() + File.separatorChar + Constants.EXECUTABLE_NAME;
    log.info(remoteFile);
    try {
      File runscript = createShellScript(jobExecutionContext);
      SCPFileTransfer fileTransfer = securityContext.getSSHClient().newSCPFileTransfer();
      fileTransfer.upload(runscript.getAbsolutePath(), remoteFile);
    } catch (IOException e) {
      throw new GFacProviderException(e.getLocalizedMessage(), e);
    }
  }
View Full Code Here

     SSHSecurityContext securityContext = (SSHSecurityContext)context.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT);
     SCPFileTransfer fileTransfer = securityContext.getSSHClient().newSCPFileTransfer();
     String remoteFile = app.getInputDataDirectory() + File.separatorChar + paramValue;

     File inputFile = new File(paramValue);
     fileTransfer.upload(inputFile.getAbsolutePath(), remoteFile);
     return remoteFile;
   }

    public void initProperties(Map<String, String> properties) throws GFacHandlerException, GFacException {
View Full Code Here

    log.info(remoteFile);
    try {
      File runscript = createShellScript(jobExecutionContext);
      SCPFileTransfer fileTransfer = securityContext.getSSHClient().newSCPFileTransfer();
      GFacUtils.updateApplicationJobStatus(jobExecutionContext, jobID, ApplicationJobStatus.STAGING);
      fileTransfer.upload(runscript.getAbsolutePath(), remoteFile);
    } catch (IOException e) {
      throw new GFacProviderException(e.getLocalizedMessage(), e);
    }
  }
View Full Code Here

     SSHSecurityContext securityContext = (SSHSecurityContext)context.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT);
     SCPFileTransfer fileTransfer = securityContext.getSSHClient().newSCPFileTransfer();
     String remoteFile = app.getInputDataDirectory() + File.separatorChar + paramValue;

     File inputFile = new File(paramValue);
     fileTransfer.upload(inputFile.getAbsolutePath(), remoteFile);
     return remoteFile;
   }

    public void initProperties(Map<String, String> properties) throws GFacHandlerException, GFacException {
View Full Code Here

    log.info(remoteFile);
    try {
      File runscript = createShellScript(jobExecutionContext);
      SCPFileTransfer fileTransfer = securityContext.getSSHClient().newSCPFileTransfer();
      GFacUtils.updateApplicationJobStatus(jobExecutionContext, jobID, ApplicationJobStatus.STAGING);
      fileTransfer.upload(runscript.getAbsolutePath(), remoteFile);
    } catch (IOException e) {
      throw new GFacProviderException(e.getLocalizedMessage(), e);
    }
  }
View Full Code Here

            log.info(remoteFile);
            try {
                File runscript = createShellScript(jobExecutionContext);
                SCPFileTransfer fileTransfer = securityContext.getSSHClient().newSCPFileTransfer();
                GFacUtils.updateApplicationJobStatus(jobExecutionContext, jobID, ApplicationJobStatus.STAGING);
                fileTransfer.upload(runscript.getAbsolutePath(), remoteFile);
            } catch (IOException e) {
                throw new GFacProviderException(e.getLocalizedMessage(), e);
            }
        }else{
           gsiSshProvider = new GSISSHProvider();
View Full Code Here

        try {

            if (files.length == 1) {
                logger.info("transferring {} to {}", files[0], dest);

                transfer.upload(new FileSystemFile(files[0]), dest);
            } else {
                for (File file : files) {
                    logger.info("transferring {} to {}", file, dest);

                    transfer.upload(new FileSystemFile(file), dest + "/" + file.getName());
View Full Code Here

                transfer.upload(new FileSystemFile(files[0]), dest);
            } else {
                for (File file : files) {
                    logger.info("transferring {} to {}", file, dest);

                    transfer.upload(new FileSystemFile(file), dest + "/" + file.getName());
                }
            }

            return Result.OK;
        } catch (IOException e) {
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.