title: Handling "Connection reset by peer" error in an FTP client
body: <p>I have a Java program that calculates some stats daily and uploads the file on a server through FTP. However, I get "Connection reset by peer" errors way too often.</p>
  
  <p>Since I cannot change the server configurations, what are the recommended ways to handle such types of errors? How can I make sure that the whole file is transferred to the server?</p>