use of org.apache.jackrabbit.vault.fs.api.VaultFsConfig in project sling by apache.
the class VaultFsLocatorImpl method getFileSystem.
@Override
public VaultFileSystem getFileSystem(RepositoryAddress repositoryAddress, File contentSyncRoot, Session session) throws RepositoryException, IOException, ConfigurationException {
// TODO - should not use File to read from FS, rather input streams
VaultFsConfig config = null;
DefaultWorkspaceFilter filter = null;
File filterFile = findFilterFile(contentSyncRoot);
if (filterFile != null) {
filter = new DefaultWorkspaceFilter();
filter.load(filterFile);
}
File metaInfDir = new File(contentSyncRoot.getParent(), Constants.META_INF);
if (metaInfDir.isDirectory()) {
File vaultDir = new File(metaInfDir, Constants.VAULT_DIR);
if (vaultDir.isDirectory()) {
File configFile = new File(vaultDir, Constants.CONFIG_XML);
if (configFile.exists()) {
config = AbstractVaultFsConfig.load(configFile);
}
}
}
return Mounter.mount(config, filter, repositoryAddress, "/", session);
}
Aggregations