NameFactory nameFactory,
PathFactory pathFactory,
QValueFactory qValueFactory,
int itemInfoCacheSize) throws RepositoryException {
if (uri == null || "".equals(uri)) {
throw new RepositoryException("Invalid repository uri '" + uri + "'.");
}
if (idFactory == null || qValueFactory == null) {
throw new RepositoryException("IdFactory and QValueFactory may not be null.");
}
this.idFactory = idFactory;
this.nameFactory = nameFactory;
this.pathFactory = pathFactory;
this.qValueFactory = qValueFactory;
this.itemInfoCacheSize = itemInfoCacheSize;
try {
domFactory = DomUtil.createDocument();
} catch (ParserConfigurationException e) {
throw new RepositoryException(e);
}
try {
URI repositoryUri = new URI((uri.endsWith("/")) ? uri : uri+"/", true);
hostConfig = new HostConfiguration();
hostConfig.setHost(repositoryUri);
nsCache = new NamespaceCache();
uriResolver = new URIResolverImpl(repositoryUri, this, domFactory);
NamePathResolver resolver = new NamePathResolverImpl(nsCache);
valueFactory = new ValueFactoryQImpl(qValueFactory, resolver);
} catch (URIException e) {
throw new RepositoryException(e);
}
connectionManager = new MultiThreadedHttpConnectionManager();
}