title: Downloading a file from ftp server while file is being altered/overwritten
body: <p>We're downloading a file from FTP server. Content of the file changes sometimes. File name is always the same.</p>
  
  <p>Is this scenario possible?</p>
  
  <ol>
  <li>File content is "aaaaaaaaaaaaa"</li>
  <li>We start downloading</li>
  <li>File is overwritten and it looks like "bbbbbbbbbbbbb"</li>
  <li>File content we get is "aaaaabbbbbbb"</li>
  </ol>
  
  <p>Library used for downloading is apache commons-net.</p>
  
  <p>Code used is:</p>
  
  <pre><code>FTPClient ftpClient = new FTPClient();
  //client connecting code...
  //...
  ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
  ftpClient.retrieveFile(path, outputStream);
  outputStream.writeTo(new FileOutputStream(new File("myFile.txt")));
  </code></pre>