te a temporary file File file = File.createTempFile("file", ".zip"); System.out.println("Temporary file: " + file.getAbsolutePath()); // Create the ZIP OutputStream outputStream = new FileOutputStream(file); ZipFiles zipFiles = new ZipFiles(outputStream); // Add files zipFiles.addTextFile("firstFile.txt", "Hello World 1"); zipFiles.addTextFile("test/file inside a dir.txt", "see me inside"); zipFiles.addTextFile("test/secondInDir.txt", "see me inside 2"); // Close the ZIP zipFiles.close();
@author Simon Levesque
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.