public ZipReader(InputStream in) throws IOException { this.in = new ZipInputStream(in); initialize(); }
private void initialize() throws IOException { ZipEntry entry = in.getNextEntry(); if (NuxeoArchiveReader.isMarkerEntry(entry)) { delegate = new NuxeoArchiveReader(in, false); } else { // not a nuxeo archive file File root = null; try { root = Framework.createTempFile("nuxeo-import-", ".unzip"); Framework.trackFile(root, root); root.delete(); root.mkdirs(); extract(in, entry, root); while ((entry = in.getNextEntry()) != null) { extract(in, entry, root); } } finally { in.close(); } delegate = new XMLDirectoryReader(root); } }