import org.apache.jackrabbit.core.config.RepositoryConfig;
import org.apache.jackrabbit.core.config.RepositoryConfigurationParser;
import org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory;
-import org.argeo.ArgeoException;
import org.argeo.jcr.ArgeoJcrConstants;
import org.argeo.jcr.ArgeoJcrException;
import org.springframework.core.io.ClassPathResource;
params.put(JcrUtils.REPOSITORY_URI, uri);
Repository repository = new Jcr2davRepositoryFactory().getRepository(params);
if (repository == null)
- throw new ArgeoException("Remote Davex repository " + uri + " not found");
+ throw new ArgeoJcrException("Remote Davex repository " + uri + " not found");
log.info("Initialized remote Jackrabbit repository from uri " + uri);
return repository;
}
String dirPath = uri.substring("file:".length());
File homeDir = new File(dirPath);
if (homeDir.exists() && !homeDir.isDirectory())
- throw new ArgeoException("Repository home " + dirPath + " is not a directory");
+ throw new ArgeoJcrException("Repository home " + dirPath + " is not a directory");
if (!homeDir.exists())
homeDir.mkdirs();
configurationIn = fileRepositoryConfiguration.getInputStream();
log.info("Initialized file Jackrabbit repository from uri " + uri);
return repository;
} catch (Exception e) {
- throw new ArgeoException("Cannot create repository " + uri, e);
+ throw new ArgeoJcrException("Cannot create repository " + uri, e);
} finally {
IOUtils.closeQuietly(configurationIn);
}
alias = alias.substring(0, alias.length() - 1);
return alias;
} catch (URISyntaxException e) {
- throw new ArgeoException("Cannot interpret URI " + uri, e);
+ throw new ArgeoJcrException("Cannot interpret URI " + uri, e);
}
}