use of org.eclipse.rdf4j.repository.http.HTTPRepository in project rdf4j by eclipse.
the class HTTPRepositoryFactory method getRepository.
public Repository getRepository(RepositoryImplConfig config) throws RepositoryConfigException {
HTTPRepository result = null;
if (config instanceof HTTPRepositoryConfig) {
HTTPRepositoryConfig httpConfig = (HTTPRepositoryConfig) config;
result = new HTTPRepository(httpConfig.getURL());
// result.setUsernameAndPassword(httpConfig.getUsername(), httpConfig.getPassword());
} else {
throw new RepositoryConfigException("Invalid configuration class: " + config.getClass());
}
return result;
}
use of org.eclipse.rdf4j.repository.http.HTTPRepository in project rdf4j by eclipse.
the class RemoteRepositoryManager method createRepository.
/**
* Creates and initializes the repository with the specified ID.
*
* @param id
* A repository ID.
* @return The created repository, or <tt>null</tt> if no such repository exists.
* @throws RepositoryConfigException
* If no repository could be created due to invalid or incomplete configuration data.
*/
@Override
protected Repository createRepository(String id) throws RepositoryConfigException, RepositoryException {
HTTPRepository result = null;
if (hasRepositoryConfig(id)) {
result = new HTTPRepository(serverURL, id);
result.setHttpClientSessionManager(getSesameClient());
result.setUsernameAndPassword(username, password);
result.initialize();
}
return result;
}
use of org.eclipse.rdf4j.repository.http.HTTPRepository in project rdf4j by eclipse.
the class RemoteRepositoryManager method createSystemRepository.
@Override
@Deprecated
protected Repository createSystemRepository() throws RepositoryException {
HTTPRepository systemRepository = new HTTPRepository(serverURL, SystemRepository.ID);
systemRepository.setHttpClientSessionManager(getSesameClient());
systemRepository.setUsernameAndPassword(username, password);
systemRepository.initialize();
return systemRepository;
}
Aggregations