Package org.ujmp.jsch

Class JSchUtil

java.lang.Object
org.ujmp.jsch.JSchUtil

public abstract class JSchUtil extends Object
  • Constructor Details

    • JSchUtil

      public JSchUtil()
  • Method Details

    • remoteWget

      public static String remoteWget(String hostname, int port, String username, File keyFile, String passphrase, String url) throws com.jcraft.jsch.JSchException, IOException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
    • forwardLocalPort

      public static com.jcraft.jsch.Session forwardLocalPort(String hostname, int port, String username, File keyFile, String passphrase, int localPortToForward, String remoteHostToForwardTo, int remotePortToForwardTo) throws com.jcraft.jsch.JSchException, IOException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
    • mkdir

      public static void mkdir(String hostname, int port, String username, File keyFile, String passphrase, String destinationFolder) throws com.jcraft.jsch.JSchException, IOException, com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
      com.jcraft.jsch.SftpException
    • installUJMP

      public static void installUJMP(String hostname, int port, String username, File keyFile, String passphrase, String destinationFolder) throws com.jcraft.jsch.JSchException, IOException, com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
      com.jcraft.jsch.SftpException
    • startUJMP

      public static void startUJMP(String hostname, int port, String username, File keyFile, String passphrase, String destinationFolder) throws com.jcraft.jsch.JSchException, IOException, com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
      com.jcraft.jsch.SftpException
    • createSession

      public static com.jcraft.jsch.Session createSession(String hostname, int port, String username, File keyFile, String passphrase) throws com.jcraft.jsch.JSchException
      Throws:
      com.jcraft.jsch.JSchException
    • pwd

      public static String pwd(String hostname, int port, String username, File keyFile, String passphrase) throws com.jcraft.jsch.JSchException, IOException, com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
      com.jcraft.jsch.SftpException
    • ls

      public static List<String> ls(String hostname, int port, String username, File keyFile, String passphrase, String path) throws com.jcraft.jsch.JSchException, IOException, com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
      com.jcraft.jsch.SftpException
    • uploadFile

      public static void uploadFile(String hostname, int port, String username, File keyFile, String passphrase, File file, String destinationFolder) throws com.jcraft.jsch.JSchException, IOException, com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
      com.jcraft.jsch.SftpException
    • uploadFile

      public static void uploadFile(String hostname, int port, String username, File keyFile, String passphrase, byte[] data, String destinationFolder, String destinationFileName) throws com.jcraft.jsch.JSchException, IOException, com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
      com.jcraft.jsch.SftpException
    • remoteExecute

      public static String remoteExecute(String hostname, int port, String username, File keyFile, String passphrase, String command) throws com.jcraft.jsch.JSchException, IOException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
    • createUserInfo

      public static com.jcraft.jsch.UserInfo createUserInfo(String password)
    • startOrInstallUJMP

      public static void startOrInstallUJMP(String hostname, int port, String username, File keyFile, String passphrase, String destinationFolder) throws com.jcraft.jsch.JSchException, IOException, com.jcraft.jsch.SftpException
      Throws:
      com.jcraft.jsch.JSchException
      IOException
      com.jcraft.jsch.SftpException