title: How to move file from directory A to directory B in remote server?
body: <p>I am using JSch to connect to SFTP in a website which is made from GWT.
  I had read a little example of <code>sftpChannel.get()</code>, <code>sftpChannel.rename()</code>, <code>sftpChannel.rm()</code></p>
  
  <p>But I didn't find a solution that copy a file from remote server <code>a</code> directory to remote server <code>b</code> directory.</p>
  
  <p>For example, I want to copy file from <code>/appl/user/home/test/temp</code> to <code>/appl/user/home/test/</code>. Filename = <code>abc.jpg</code>.</p>
  
  <p>I stunned here for few hours since most of the solution from network is getting file from remote server to local, or uploading file from local to remote server.</p>
  
  <pre><code>String existingfile = "abc.jpg";
  String newfile = "123.jpg";
  FileDirectory = "/appl/user/home/test/";
  sftp.cd(FileDirectory+"temp/");
  sftp.rename(newfile, FileDirectory+newfile);
  </code></pre>
  
  <p>Let's say, <code>abc.jpg</code> is existing in <code>/appl/user/home/test/</code></p>
  
  <p>And I upload a <code>123.jpg</code> in <code>/appl/user/home/test/temp/</code>.</p>
  
  <p>Now, I want to move <code>123.jpg</code> to <code>/appl/user/home/test/</code> and remove <code>abc.jpg</code> in <code>/appl/user/home/test/</code>.</p>
  
  <p>What should I do?</p>