if (jcrPath == null) {
jcrPath = "/";
}
File localFile = app.getPlatformFile(localPath, false);
VltContext vCtx = app.createVaultContext(localFile);
vCtx.setVerbose(cl.hasOption(OPT_VERBOSE));
if (cl.hasOption(optSysView)) {
if (!localFile.isFile()) {
VaultFsApp.log.error("--sysview specified but local path does not point to a file.");
return;
}
// todo: move to another location
InputStream ins = FileUtils.openInputStream(localFile);
try {
Session session = vCtx.getFileSystem(addr).getAggregateManager().getSession();
session.getWorkspace().importXML(jcrPath, ins, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING);
return;
} finally {
IOUtils.closeQuietly(ins);
}
}
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);