예제 #1
0
  private File createSignedZipArchive(
      File tempDir, File toAdd, String exportFileName, byte[] signature, String comment)
      throws FileNotFoundException, IOException {

    File archive = new File(tempDir, exportFileName);
    ZipOutputStream out = null;
    try {
      out = new ZipOutputStream(new FileOutputStream(archive));
      out.setComment(comment);
      addFileToArchive(out, toAdd.getParent().length() + 1, toAdd);
      addSignatureToArchive(out, signature);
    } finally {
      if (out != null) {
        out.close();
      }
    }
    return archive;
  }