use of org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator in project archiva by apache.
the class RepositoryServlet method initServers.
public synchronized void initServers(ServletConfig servletConfig) throws RepositoryAdminException {
long start = System.currentTimeMillis();
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletConfig.getServletContext());
configuration = wac.getBean("archivaConfiguration#default", ArchivaConfiguration.class);
configuration.addListener(this);
managedRepositoryAdmin = wac.getBean(ManagedRepositoryAdmin.class);
repositoryMap = managedRepositoryAdmin.getManagedRepositoriesAsMap();
for (ManagedRepository repo : repositoryMap.values()) {
Path repoDir = Paths.get(repo.getLocation());
if (!Files.exists(repoDir)) {
try {
Files.createDirectories(repoDir);
} catch (IOException e) {
log.info("Unable to create missing directory for {}", repo.getLocation());
continue;
}
}
}
resourceFactory = wac.getBean("davResourceFactory#archiva", DavResourceFactory.class);
locatorFactory = new ArchivaDavLocatorFactory();
ServletAuthenticator servletAuth = wac.getBean(ServletAuthenticator.class);
HttpAuthenticator httpAuth = wac.getBean("httpAuthenticator#basic", HttpAuthenticator.class);
sessionProvider = new ArchivaDavSessionProvider(servletAuth, httpAuth);
long end = System.currentTimeMillis();
log.debug("initServers done in {} ms", (end - start));
}
Aggregations