{
String flag = getOptions().get(VFSUtils.USE_COPY_QUERY);
useCopyMode = Boolean.valueOf(flag);
}
DelegatingHandler delegator;
if (useCopyMode)
{
// extract it to temp dir
File dest = new File(getTempDir() + "/" + getTempFileName(ent.getName()));
dest.deleteOnExit();
// ensure parent exists
dest.getParentFile().mkdirs();
InputStream is = zipSource.openStream(ent);
OutputStream os = new BufferedOutputStream(new FileOutputStream(dest));
VFSUtils.copyStreamAndClose(is, os);
// mount another instance of ZipEntryContext
delegator = mountZipFile(parent, name, dest);
}
else
{
// mount another instance of ZipEntryContext
delegator = mountZipStream(parent, name, zipSource.openStream(ent));
}
entries.put(delegator.getLocalPathName(), new EntryInfo(delegator, ent));
addChild(parent, delegator);
}
else
{
ZipEntryHandler wrapper = new ZipEntryHandler(this, parent, name, ent.isDirectory() == false);