FAQ Database Discussion Community


Generating Zip for Download using Zip4j

java,servlets,web,download,zip4j
i try to use Zip4j to generate a zip file for download. But i always get the error: 2015-05-09 15:56:24.306 ERROR 11748 --- [nio-8080-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: getOutputStream() has already been called for...

Is it correct to use while-loop to report progress and completion? [closed]

java,android,zip4j
I have added zip4j library to my Android project. It is very easy to use. ZipFile zipFile = new ZipFile(downloadedFilePath); zipFile.extractAll(context.getFilesDir().getPath()); But there is one feature that I am concerned about. Instead of subscribing to get the progress of unzipping, they use while-loop as follows: while (pm.getState() == ProgressMonitor.STATE_BUSY) {...

Any way to get Compression method in java using zip4j library?

java,compression,zip4j
I want to return boolean to check if my zip file is compressed . Will be an advantage if i can also get what Compression method has been used. For now I am just checking is it is Encrypted and is valid zip. Please help if it is possible using...

Replace specific file inside Zip archive without extracting the whole archive in Java

java,zip4j
I'm trying to get a specific file inside a Zip Archive, extract it, Encrypt it, and then get it back inside the archive replacing the origial one. here's what I've tried so far.. public static boolean encryptXML(File ZipArchive, String key) throws ZipException, IOException, Exception { ZipFile zipFile = new ZipFile(ZipArchive);...

compress file with zip4j on android

android,zip4j
i need to add files on a zip package but on the line code "zipFile.addFiles(filesToAdd, parameters)" the "addFiles()" appears in red, can anyone help me, please? im using: Android Studio 1.2.1.1 RC Java 1.8 update 45 Windows professional zip4j_1.3.2.jar (source: http://www.lingala.net/zip4j/download.php) image reference: https://lh6.googleusercontent.com/HTfDOT1yZBb7k-oxLulCYukhBMv7xksHj2UhK-_YXSAkNmpQKkgdrSCJpa4T3cs1vWMNnHBWPxwkbKM=w1342-h513-rw...