*/
public void export(VaultFile parent, boolean noClose)
throws RepositoryException, IOException {
exportInfo.getEntries().clear();
open();
AggregateManager mgr = parent.getFileSystem().getAggregateManager();
mgr.startTracking(tracker == null ? null : tracker.getListener());
if (!noMetaInf) {
createDirectory(Constants.META_INF);
createDirectory(Constants.META_DIR);
// add some 'fake' tracking
track("A", Constants.META_INF);
track("A", Constants.META_DIR);
track("A", Constants.META_DIR + "/" + Constants.CONFIG_XML);
track("A", Constants.META_DIR + "/" + Constants.FILTER_XML);
track("A", Constants.META_DIR + "/" + Constants.NODETYPES_CND);
track("A", Constants.META_DIR + "/" + Constants.PROPERTIES_XML);
writeFile(mgr.getConfig().getSource(), Constants.META_DIR + "/" + Constants.CONFIG_XML);
// get filter and translate if necessary
WorkspaceFilter filter = mgr.getWorkspaceFilter();
String mountPath = mgr.getRoot().getPath();
String rootPath = parent.getPath();
if (rootPath.equals("/")) {
rootPath = "";
}
if (mountPath.length() > 0 || rootPath.length() > 0) {
filter = filter.translate(new SimplePathMapping(mountPath, rootPath));
}
writeFile(filter.getSource(), Constants.META_DIR + "/" + Constants.FILTER_XML);
}
export(parent, "");
if (!noMetaInf) {
writeFile(getNodeTypes(mgr.getSession(), mgr.getNodeTypes()), Constants.META_DIR + "/" + Constants.NODETYPES_CND);
// update properties
setProperty(MetaInf.CREATED, Calendar.getInstance());
setProperty(MetaInf.CREATED_BY, mgr.getUserId());
setProperty(MetaInf.PACKAGE_FORMAT_VERSION, String.valueOf(MetaInf.FORMAT_VERSION_2));
ByteArrayOutputStream tmpOut = new ByteArrayOutputStream();
properties.storeToXML(tmpOut, "FileVault Package Properties", "utf-8");
writeFile(new ByteArrayInputStream(tmpOut.toByteArray()), Constants.META_DIR + "/" + Constants.PROPERTIES_XML);
}
if (!noClose) {
close();
}
mgr.stopTracking();
}