allora ti confermo che si possono inserire quanti file vuoi, magari quel post su stackoverflow era relativo ad una vecchia release.
Ho fatto questo programmino di test:
codice:
package test;
import de.idyl.winzipaes.impl.*;
import de.idyl.winzipaes.*;
import java.io.*;
/**
*
* @author Andrea
*/
public class Main {
private static final String BASE_PATH = "C:/Users/Andrea/Desktop/zip/";
private static final String OUTPUT = BASE_PATH + "passwordprotected.zip";
private static final String[] INPUT_FILES = new String[] {
BASE_PATH + "cover.pdf",
BASE_PATH + "tim.docx",
BASE_PATH + "stored_procedures.txt"
};
private static final String PASSWORD = "password";
public static void main (String[] args) throws Exception {
AESEncrypterJCA encrypter = new AESEncrypterJCA();
encrypter.init(PASSWORD, 256);
AesZipFileEncrypter zipFile = new AesZipFileEncrypter (OUTPUT, encrypter);
File f;
for (String s : INPUT_FILES) {
f = new File(s);
zipFile.add(f, f.getName(), PASSWORD);
}
zipFile.close();
}
}
e zippa tutto a meraviglia. Accortezza: vuole Bouncy Castle nel classpath (anche se poi come vedi io non lo uso, usando la standard JCA), però ho visto che le classi che usano BC sono state divise da quelle che usano la standard e quindi probabilmente te ne puoi sbarazzare.
[EDIT]
e ti confermo anche che rinominando / eliminando i file *BC.java nel package impl, non ti serve più Bouncy Castle nel path per farla andare.