Search in sources :

Example 1 with WorkspaceImporter

use of org.apache.jackrabbit.core.xml.WorkspaceImporter in project jackrabbit by apache.

the class WorkspaceImpl method getImportContentHandler.

/**
 * {@inheritDoc}
 */
public ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException {
    // check state of this instance
    sanityCheck();
    Path parentPath;
    try {
        parentPath = context.getQPath(parentAbsPath).getNormalizedPath();
    } catch (NameException e) {
        String msg = "invalid path: " + parentAbsPath;
        log.debug(msg);
        throw new RepositoryException(msg, e);
    }
    if (!parentPath.isAbsolute()) {
        throw new RepositoryException("not an absolute path: " + parentAbsPath);
    }
    Importer importer = new WorkspaceImporter(parentPath, this, context, uuidBehavior, wspConfig.getImportConfig());
    return new ImportHandler(importer, getSession());
}
Also used : Path(org.apache.jackrabbit.spi.Path) NameException(org.apache.jackrabbit.spi.commons.conversion.NameException) WorkspaceImporter(org.apache.jackrabbit.core.xml.WorkspaceImporter) ImportHandler(org.apache.jackrabbit.core.xml.ImportHandler) RepositoryException(javax.jcr.RepositoryException) Importer(org.apache.jackrabbit.core.xml.Importer) WorkspaceImporter(org.apache.jackrabbit.core.xml.WorkspaceImporter)

Aggregations

RepositoryException (javax.jcr.RepositoryException)1 ImportHandler (org.apache.jackrabbit.core.xml.ImportHandler)1 Importer (org.apache.jackrabbit.core.xml.Importer)1 WorkspaceImporter (org.apache.jackrabbit.core.xml.WorkspaceImporter)1 Path (org.apache.jackrabbit.spi.Path)1 NameException (org.apache.jackrabbit.spi.commons.conversion.NameException)1