VaultFile vaultFile = vCtx.getFileSystem(addr).getFile(jcrPath);
VaultFsApp.log.info("Importing {} to {}", localFile.getCanonicalPath(), vaultFile.getPath());
Archive archive;
if (localFile.isFile()) {
archive = new ZipArchive(localFile);
} else {
if (cl.hasOption(optSync)) {
VaultFsApp.log.warn("--sync is not supported yet");
}
archive = new FileArchive(localFile);
}
archive.open(false);
try {
Importer importer = new Importer();
if (verbose) {
importer.getOptions().setListener(new DefaultProgressListener());
}
Session s = vaultFile.getFileSystem().getAggregateManager().getSession();
Node importRoot = s.getNode(vaultFile.getPath());
importer.run(archive, importRoot);
} finally {
archive.close();
}
VaultFsApp.log.info("Importing done.");
}