@Test public void cp() throws Exception { SSH2Util.copy(machine, "/home/hadoop/jay/redis.conf", DockerNodeOperation.DOCKER_INSTALL_BASE_PATH + port, true); }
public static String copy(Machine machine, String originalPath, String targetPath, boolean sudo) throws Exception { StringBuilder command = new StringBuilder(); if (sudo) { command.append("sudo "); } String template = "cp %s %s"; command.append(String.format(template, originalPath, targetPath)); return execute(machine, command.toString()); }
SSH2Util { public static String copy(Machine machine, String originalPath, String targetPath, boolean sudo) throws Exception { StringBuilder command = new StringBuilder(); if (sudo) { command.append("sudo "); } String template = "cp %s %s"; command.append(String.format(template, originalPath, targetPath)); return execute(machine, command.toString()); } }
SSH2Util { public static String copy(Machine machine, String originalPath, String targetPath, boolean sudo) throws Exception { StringBuilder command = new StringBuilder(); if (sudo) { command.append("sudo "); } String template = "cp %s %s"; command.append(String.format(template, originalPath, targetPath)); return execute(machine, command.toString()); } private  SSH2Util(); }
SSH2Util { public static String copy(Machine machine, String originalPath, String targetPath, boolean sudo) throws Exception { StringBuilder command = new StringBuilder(); if (sudo) { command.append("sudo "); } String template = "cp %s %s"; command.append(String.format(template, originalPath, targetPath)); return execute(machine, command.toString()); } private  SSH2Util(); static void wget(Machine machine, String targetPath, String fileName, String remoteUrl, boolean sudo); static String copy(Machine machine, String originalPath, String targetPath, boolean sudo); static String copy2(Machine machine, String originalPath, String targetPath, boolean sudo); static String copyFileToRemote(Machine machine, String tempPath, String url, boolean sudo); static String rm(Machine machine, String filePath, boolean sudo); static String unzipToTargetPath(Machine machine, String filePath, String targetPath, boolean sudo); static String mkdir(Machine machine, String path, boolean sudo); static String execute(Machine machine, String commands); @Deprecated static String localExecute(String command); static Connection getConnection(Machine machine); }
SSH2Util { public static String copy(Machine machine, String originalPath, String targetPath, boolean sudo) throws Exception { StringBuilder command = new StringBuilder(); if (sudo) { command.append("sudo "); } String template = "cp %s %s"; command.append(String.format(template, originalPath, targetPath)); return execute(machine, command.toString()); } private  SSH2Util(); static void wget(Machine machine, String targetPath, String fileName, String remoteUrl, boolean sudo); static String copy(Machine machine, String originalPath, String targetPath, boolean sudo); static String copy2(Machine machine, String originalPath, String targetPath, boolean sudo); static String copyFileToRemote(Machine machine, String tempPath, String url, boolean sudo); static String rm(Machine machine, String filePath, boolean sudo); static String unzipToTargetPath(Machine machine, String filePath, String targetPath, boolean sudo); static String mkdir(Machine machine, String path, boolean sudo); static String execute(Machine machine, String commands); @Deprecated static String localExecute(String command); static Connection getConnection(Machine machine);  }