I am trying to use a java zip library
http://www.javamex.com/arcmexer/ in my sketch. I put the jar in the libraries folder and I am not getting an error on the import line so I think I have it correct. My final goal is to extract files from a password'd zip file.
I think I need to pass it a java File object but I'm not sure I'm getting one. If I try to use the File.exist() method I get a does not exist error, so I suspect that I'm not really getting a Java file.
I get an IOException at the ArchiveReader line when I try to compile the code:
- import com.javamex.arcmexer.*;
- //import java.io.file;
- File f = new File(sketchPath("test.zip"));
- //InputStream f = createInput("test.zip");
- //if (f.exist()) {
- ArchiveReader r = ArchiveReader.getReader(f);
- //}
- void setup() {
- try {
- ArchiveEntry entry;
- while ( (entry = r.nextEntry ()) != null) {
- String filename = entry.getFilename();
- println(filename);
- //InputStream in = entry.getInputStream();
- // ... read from in
- }
- }
- finally {
- r.close();
- }
- }
- void draw() {
- }
1