How to open password protected/encrypted ZIP compress file

Is there a way to read CSV files from a password protected/encrypted ZIP file?

For example, I would like to read the data from foo.zip, and foo.zip is encrypted by the following command.

7z a -tzip -p foo.zip foo.csv

or

zip -e fil_capital_balance.zip fil_capital_balance.csv

We are reading the file over SFTP from the “CSV Reader” component.

Hi alee,

currently this is not supported. Workaround may be to use SystemExec to unpack file and then use plain readers.

I created https://bug.javlin.eu/browse/CL-2430 for improvement.

Is it possible to provide some guideline how to implement this in Java as a work around?

So basically, I need the following information to implement it in Java.

1. Set the password in the workspace.prm or some property file, but I prefer workspace.prm since this is the default property file to will accompany the project.

2. How to read the property in the Java code? what might be the possible syntax? (I know the property file will be exported in to some variables on the system in the same JVM, but I’m not sure if it will be a -Dxxxxxx in the configuration or a system variable, etc)

3. Import 3rd party Zip library in the Java code (http://truezip.java.net/ or http://www.lingala.net/zip4j/), where should I store the library in the project so we can get it into the right classpath during JVM initialization. (In addition to this, if the Java libs implements JNI with some .dll/Windows or .so/*Nix, what might be the folders to put these)

4. Create a binary reader (not sure which component to use) that reads the stream from the password protected file and apply the password from step 2.

5. An edge (metadata) that supports binary stream in and out

6. A binary writer with Charset settings, we will need to convert the output into ISO-8859-1 or UTF-8. I don’t care about other charset so far, but I can also make this an option or apply the default charset from workspace.prm if specified.

Hi alee,

this would be the hard way. I would really recommend to use SystemExecute and external utility.