public void open()

in vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/ZipStreamArchive.java [130:193]


    public void open(boolean strict) throws IOException {
        if (raf != null || decompressed != null) {
            return;
        }

        decompressed = new byte[maxBufferSize];
        pos = 0;
        root = new EntryImpl("");
        inf = new DefaultMetaInf();

        // scan the zip and copy data to temporary file
        try (ZipInputStream zin = new ZipInputStream(in)) {
            ZipEntry entry;
            while ((entry = zin.getNextEntry()) != null) {
                String name = entry.getName();
                String[] names = Text.explode(name, '/');
                EntryImpl je = root;
                if (names.length > 0) {
                    for (int i=0; i<names.length; i++) {
                        if (i == names.length -1 && !entry.isDirectory()) {
                            // copy stream
                            long pos = getPosition();
                            long len = copy(zin);
                            je = je.add(new EntryImpl(names[i], safeGetTime(entry), pos, len));
                        } else {
                            je = je.add(names[i]);
                        }
                    }
                    if (log.isDebugEnabled()) {
                        log.debug("scanning jar: {}", name);
                    }
                }
                // extract meta information
                if (name.startsWith(Constants.META_DIR + "/")) {
                    try (InputStream input = createInputStream(je)) {
                        // load from previous entryImpl
                        inf.load(input, "inputstream:" + name);
                    } catch (ConfigurationException e) {
                        throw new IOException(e);
                    }
                }
            }
            if (inf.getFilter() == null) {
                log.debug("Zip stream does not contain filter definition.");
            }
            if (inf.getConfig() == null) {
                log.debug("Zip stream does not contain vault config.");
            }
            if (inf.getSettings() == null) {
                log.debug("Zip stream does not contain vault settings. using default.");
                VaultSettings settings = new VaultSettings();
                settings.getIgnoredNames().add(".svn");
                inf.setSettings(settings);
            }
            if (inf.getProperties() == null) {
                log.debug("Zip stream does not contain properties.");
            }
            if (inf.getNodeTypes().isEmpty()) {
                log.debug("Zip stream does not contain nodetypes.");
            }
        }
        dumpUnclosedArchives();
        watcher = CloseWatcher.register(this, new NullInputStream(0), SHOULD_CREATE_STACK_TRACE);
    }