Skip to content

Instantly share code, notes, and snippets.

@toomasr
Created July 21, 2014 12:27
Show Gist options
  • Save toomasr/e150382248378d626a2a to your computer and use it in GitHub Desktop.
Save toomasr/e150382248378d626a2a to your computer and use it in GitHub Desktop.
import java.io.File;
import org.zeroturnaround.zip.NameMapper;
import org.zeroturnaround.zip.ZipUtil;
public class ZipUtilTest {
public static void main(String[] args) {
// file to unpack
File input = new File("/Users/toomasr/tmp/zipTest.zip");
// folder to store the unpacked files
File output = new File("/tmp");
ZipUtil.unpack(input, output, new NameMapper() {
public String map(String name) {
if (name.contains("/dir"))
return name;
else
return null;
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment