title: Java - How to move a file into a zip file?
body: <p>That's it. I have a text file, and I need to move it to a (existing) Zip File in a given directory.</p>
  
  <pre><code>    File file = new File("C:\\afolder\\test.txt");
      File dir = new File(directoryToGo+"existingzipfile.zip");
      boolean success = file.renameTo(new File(dir, file.getName()));
  </code></pre>
  
  <p>But it does not work. Is there a way to move a file into a existing Zip File?
  Thank you.</p>