title: Adding files to ZIP file
body: <p>I am trying to add some files to a ZIP file, it creates the file but does not add anything into it.
  Code 1:</p>
  
  <pre><code>String fulldate = year + "-" + month + "-" + day + "-" + min;
  
  File dateFolder = new File("F:\\" + compname + "\\" + fulldate);
  dateFolder.mkdir();
  
  String zipName = "F:\\" + compname + "\\" + fulldate + "\\" + fulldate + ".zip";
  
  zipFolder(tobackup, zipName);
  </code></pre>
  
  <p>My function:</p>
  
  <pre><code>public static void zipFolder(File folder, String name) throws Exception {
      byte[] buffer = new byte[18024];
  
      ZipOutputStream out = new ZipOutputStream(new FileOutputStream(name));
      FileInputStream in = new FileInputStream(folder);
  
      out.putNextEntry(new ZipEntry(name));
  
      int len;
  
      while((len = in.read(buffer)) &gt; 0) {
          out.write(buffer, 0, len);
      }
  
      out.closeEntry();
      in.close();
      out.close();
  }
  </code></pre>
  
  <p><strong>Edit:</strong> I found the problem, it was just having trouble writing files from the C:\ drive into a ZIP in the F:\ drive</p>