in vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/MemoryArchive.java [74:117]
public void run(InputStream in) throws Exception {
// scan the zip and copy data to temporary file
ZipInputStream zin = new ZipInputStream(
new BufferedInputStream(in)
);
ZipEntry entry;
boolean hasRoot = false;
while ((entry = zin.getNextEntry()) != null) {
String name = entry.getName();
boolean isMeta = name.startsWith(Constants.META_DIR + "/");
if (!hasRoot && name.startsWith(Constants.ROOT_DIR + "/")) {
hasRoot = true;
}
if (isMeta || !cacheMetaOnly) {
String[] names = Text.explode(name, '/');
byte[] data = entry.isDirectory() ? null : IOUtils.toByteArray(zin);
if (names.length > 0) {
VirtualEntry je = root;
for (int i=0; i<names.length; i++) {
if (i == names.length -1 && !entry.isDirectory()) {
je = je.add(names[i], safeGetTime(entry), data);
} else {
je = je.add(names[i], 0, null);
}
}
if (log.isDebugEnabled()) {
log.debug("scanning jar: {}", name);
}
}
if (isMeta) {
inf.load(data == null ? null : new ByteArrayInputStream(data), "inputstream://" + name);
}
}
}
// ensure that root directory is present, even if we are not caching non-meta-inf stuff
if (hasRoot && !root.children.containsKey(Constants.ROOT_DIR)) {
root.add(Constants.ROOT_DIR, 0, null);
}
if (inf.getSettings() == null) {
VaultSettings settings = new VaultSettings();
settings.getIgnoredNames().add(".svn");
inf.setSettings(settings);
}
}