title: Transfer file from SFTP server to the local system using Java
body: <p>I am using the JSch library.</p>
  
  <p>I need three methods:</p>
  
  <ul>
  <li><code>void delete()</code> --- to delete the file with the given name</li>
  <li><code>void copy()</code>   --- to copy the file with the given name into the local system</li>
  <li><code>list copyndelete()</code> --- to copy the file and to delete the  file in the remote system ... and also return the name of the file deleted into the list.</li>
  </ul>
  
  <p>How could I do this?</p>