Search in sources :

Example 1 with ConfigurationException

use of org.apache.jackrabbit.vault.fs.config.ConfigurationException in project sling by apache.

the class FileVaultResourceMapper method getWorkspaceFilter.

/**
     * @return Workspace filter or null if none found.
     */
private WorkspaceFilter getWorkspaceFilter() {
    if (filterXmlFile != null && filterXmlFile.exists()) {
        try {
            DefaultWorkspaceFilter workspaceFilter = new DefaultWorkspaceFilter();
            workspaceFilter.load(filterXmlFile);
            return workspaceFilter;
        } catch (IOException | ConfigurationException ex) {
            log.error("Unable to parse workspace filter: " + filterXmlFile.getPath(), ex);
        }
    } else {
        log.debug("Workspace filter not found: " + filterXmlFile.getPath());
    }
    return null;
}
Also used : DefaultWorkspaceFilter(org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter) ConfigurationException(org.apache.jackrabbit.vault.fs.config.ConfigurationException) IOException(java.io.IOException)

Example 2 with ConfigurationException

use of org.apache.jackrabbit.vault.fs.config.ConfigurationException in project sling by apache.

the class VltSerializationDataBuilder method init.

public void init(org.apache.sling.ide.transport.Repository repository, File contentSyncRoot) throws SerializationException {
    this.repo = repository;
    try {
        this.skm = new SerializationKindManager();
        this.skm.init(repository);
        if (!contentSyncRoot.exists()) {
            throw new IllegalArgumentException("contentSyncRoot does not exist: " + contentSyncRoot);
        }
        Repository jcrRepo = RepositoryUtils.getRepository(repo.getRepositoryInfo());
        Credentials credentials = RepositoryUtils.getCredentials(repo.getRepositoryInfo());
        session = jcrRepo.login(credentials);
        RepositoryAddress address = RepositoryUtils.getRepositoryAddress(repo.getRepositoryInfo());
        fs = fsLocator.getFileSystem(address, contentSyncRoot, session);
    } catch (org.apache.sling.ide.transport.RepositoryException e) {
        throw new SerializationException(e);
    } catch (RepositoryException e) {
        throw new SerializationException(e);
    } catch (IOException e) {
        throw new SerializationException(e);
    } catch (ConfigurationException e) {
        throw new SerializationException(e);
    }
}
Also used : RepositoryAddress(org.apache.jackrabbit.vault.fs.api.RepositoryAddress) SerializationException(org.apache.sling.ide.serialization.SerializationException) RepositoryException(javax.jcr.RepositoryException) IOException(java.io.IOException) SerializationKindManager(org.apache.sling.ide.serialization.SerializationKindManager) Repository(javax.jcr.Repository) ConfigurationException(org.apache.jackrabbit.vault.fs.config.ConfigurationException) Credentials(javax.jcr.Credentials)

Example 3 with ConfigurationException

use of org.apache.jackrabbit.vault.fs.config.ConfigurationException in project sling by apache.

the class FileVaultXmlMounter method getWorkspaceFilter.

private WorkspaceFilter getWorkspaceFilter(final File filterXmlFile) throws MojoExecutionException {
    try {
        DefaultWorkspaceFilter workspaceFilter = new DefaultWorkspaceFilter();
        workspaceFilter.load(filterXmlFile);
        return workspaceFilter;
    } catch (IOException | ConfigurationException ex) {
        throw new MojoExecutionException("Unable to parse workspace filter: " + filterXmlFile.getPath(), ex);
    }
}
Also used : DefaultWorkspaceFilter(org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) ConfigurationException(org.apache.jackrabbit.vault.fs.config.ConfigurationException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)3 ConfigurationException (org.apache.jackrabbit.vault.fs.config.ConfigurationException)3 DefaultWorkspaceFilter (org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter)2 Credentials (javax.jcr.Credentials)1 Repository (javax.jcr.Repository)1 RepositoryException (javax.jcr.RepositoryException)1 RepositoryAddress (org.apache.jackrabbit.vault.fs.api.RepositoryAddress)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 SerializationException (org.apache.sling.ide.serialization.SerializationException)1 SerializationKindManager (org.apache.sling.ide.serialization.SerializationKindManager)1