Search in sources :

Example 1 with VaultFsConfig

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);
}
Also used : DefaultWorkspaceFilter(org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter) VaultFsConfig(org.apache.jackrabbit.vault.fs.api.VaultFsConfig) AbstractVaultFsConfig(org.apache.jackrabbit.vault.fs.config.AbstractVaultFsConfig) File(java.io.File)

Aggregations

File (java.io.File)1 VaultFsConfig (org.apache.jackrabbit.vault.fs.api.VaultFsConfig)1 AbstractVaultFsConfig (org.apache.jackrabbit.vault.fs.config.AbstractVaultFsConfig)1 DefaultWorkspaceFilter (org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter)1