paulushcgcj
11/8/2016 - 9:35 PM

SSHUtils.java

public static void renameFile(String usuario,String senha, String host, int porta, String dirArquivoOriginal, String dirArquivoNovo) {
		ShellConnectionStream ssh = new ShellConnectionStream(usuario, senha, host, porta);
		try{
			ssh.connect();
			if(ssh.isReady()) {
				dirArquivoOriginal =  dirArquivoOriginal.replace(" ", "\\ ");
				ssh.write("mv " + dirArquivoOriginal + " " + dirArquivoNovo);
				ssh.close();
			}
		}catch(Exception e){ e.printStackTrace(); }		
		
	}