Search in sources :

Example 71 with ManagedRepositoryConfiguration

use of org.apache.archiva.configuration.model.ManagedRepositoryConfiguration in project archiva by apache.

the class FileMetadataRepository method getBaseDirectory.

private Path getBaseDirectory(String repoId) throws IOException {
    if (!baseDirectory.containsKey(repoId)) {
        Path baseDir;
        ManagedRepositoryConfiguration managedRepositoryConfiguration = configuration.getConfiguration().getManagedRepositoriesAsMap().get(repoId);
        if (managedRepositoryConfiguration == null) {
            baseDir = Files.createTempDirectory(repoId);
        } else {
            baseDir = Paths.get(managedRepositoryConfiguration.getLocation());
        }
        baseDirectory.put(repoId, baseDir.resolve(".archiva"));
    }
    return baseDirectory.get(repoId);
}
Also used : Path(java.nio.file.Path) ManagedRepositoryConfiguration(org.apache.archiva.configuration.model.ManagedRepositoryConfiguration)

Example 72 with ManagedRepositoryConfiguration

use of org.apache.archiva.configuration.model.ManagedRepositoryConfiguration in project archiva by apache.

the class FileMetadataRepositoryTest method createManagedRepository.

private static ManagedRepositoryConfiguration createManagedRepository(String repoId, Path directory) {
    ManagedRepositoryConfiguration managedRepository = new ManagedRepositoryConfiguration();
    managedRepository.setId(repoId);
    managedRepository.setLocation(directory.resolve(repoId).toAbsolutePath().toString());
    return managedRepository;
}
Also used : ManagedRepositoryConfiguration(org.apache.archiva.configuration.model.ManagedRepositoryConfiguration)

Aggregations

ManagedRepositoryConfiguration (org.apache.archiva.configuration.model.ManagedRepositoryConfiguration)72 Configuration (org.apache.archiva.configuration.model.Configuration)27 ManagedRepository (org.apache.archiva.repository.ManagedRepository)18 ContextConfiguration (org.springframework.test.context.ContextConfiguration)18 Path (java.nio.file.Path)17 ProxyConnectorConfiguration (org.apache.archiva.configuration.model.ProxyConnectorConfiguration)14 RemoteRepositoryConfiguration (org.apache.archiva.configuration.model.RemoteRepositoryConfiguration)14 ArchivaConfiguration (org.apache.archiva.configuration.provider.ArchivaConfiguration)14 Test (org.junit.Test)14 StagingRepositoryFeature (org.apache.archiva.repository.features.StagingRepositoryFeature)13 EditableManagedRepository (org.apache.archiva.repository.EditableManagedRepository)11 RepositoryScanningConfiguration (org.apache.archiva.configuration.model.RepositoryScanningConfiguration)10 Test (org.junit.jupiter.api.Test)10 ArrayList (java.util.ArrayList)9 NetworkProxyConfiguration (org.apache.archiva.configuration.model.NetworkProxyConfiguration)9 RepositoryGroupConfiguration (org.apache.archiva.configuration.model.RepositoryGroupConfiguration)9 RepositoryException (org.apache.archiva.repository.RepositoryException)9 Before (org.junit.Before)8 IOException (java.io.IOException)7 ArtifactCleanupFeature (org.apache.archiva.repository.features.ArtifactCleanupFeature)7