]> source.dussan.org Git - archiva.git/commitdiff
Splitting configuration module. Adding mapper interface.
authorMartin Schreier <martin_s@apache.org>
Sun, 9 Jan 2022 22:14:44 +0000 (23:14 +0100)
committerMartin Schreier <martin_s@apache.org>
Sun, 9 Jan 2022 22:14:44 +0000 (23:14 +0100)
321 files changed:
archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/ModelMapper.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/ModelMapperFactory.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/pom.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/AbstractRepositoryConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/AbstractRepositoryConnectorConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ArchivaDefaultConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ArchivaRuntimeConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/CacheConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/Configuration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ConfigurationModel.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ConfigurationNames.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/FileLockConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/FileType.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LdapConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LdapGroupMapping.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LegacyArtifactPath.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ManagedRepositoryConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/NetworkConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/NetworkProxyConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/OrganisationInformation.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ProxyConnectorConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ProxyConnectorRuleConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RedbackRuntimeConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RemoteRepositoryConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryCheckPath.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryGroupConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryScanningConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/SyncConnectorConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/UserInterfaceOptions.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/WebappConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/FiletypeSelectionPredicate.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/FiletypeToMapClosure.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/NetworkProxyComparator.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/NetworkProxySelectionPredicate.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/ProxyConnectorConfigurationOrderComparator.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/ProxyConnectorSelectionPredicate.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/RepositoryConfigurationComparator.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/pom.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ArchivaConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationEvent.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationListener.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationRuntimeException.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/DefaultArchivaConfiguration.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/FileTypes.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/IndeterminateConfigurationException.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/InvalidConfigurationException.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/MavenProxyPropertyLoader.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/io/registry/ConfigurationRegistryReader.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/io/registry/ConfigurationRegistryWriter.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/util/ConfigMapper.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/resources/META-INF/spring-context.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/resources/org/apache/archiva/configuration/default-archiva.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-0.9.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-1.3.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-v1.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/autodetect-v1.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-base.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-single-list-elements.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-user.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/corrupt.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/escape-cron-expressions.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/maven-proxy-complete.conf [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/repository-manager.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ArchivaConfigurationMRM789Test.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ArchivaConfigurationTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ConfigurationTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/FileTypesTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/LegacyArtifactPathTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/MavenProxyPropertyLoaderTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/functors/ProxyConnectorConfigurationOrderComparatorTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/functors/RepositoryConfigurationComparatorTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/log4j2-test.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml [new file with mode: 0755]
archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/spring-context.xml [new file with mode: 0755]
archiva-modules/archiva-base/archiva-configuration/pom.xml
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConnectorConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaDefaultConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaRuntimeConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/CacheConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/Configuration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationEvent.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationListener.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationNames.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationRuntimeException.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileLockConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileType.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileTypes.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/IndeterminateConfigurationException.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/InvalidConfigurationException.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapGroupMapping.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LegacyArtifactPath.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ManagedRepositoryConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/MavenProxyPropertyLoader.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkProxyConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/OrganisationInformation.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorRuleConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RedbackRuntimeConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RemoteRepositoryConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryCheckPath.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryGroupConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryScanningConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/SyncConnectorConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/UserInterfaceOptions.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/WebappConfiguration.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeSelectionPredicate.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeToMapClosure.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/NetworkProxyComparator.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/NetworkProxySelectionPredicate.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparator.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/ProxyConnectorSelectionPredicate.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/RepositoryConfigurationComparator.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryReader.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryWriter.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/util/ConfigMapper.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
archiva-modules/archiva-base/archiva-configuration/src/main/resources/META-INF/spring-context.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/archiva/configuration/default-archiva.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-1.3.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-v1.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-base.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-user.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/corrupt.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/escape-cron-expressions.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/maven-proxy-complete.conf [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationMRM789Test.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ConfigurationTest.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/FileTypesTest.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/LegacyArtifactPathTest.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/MavenProxyPropertyLoaderTest.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/RepositoryConfigurationComparatorTest.java [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/resources/log4j2-test.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml [deleted file]
archiva-modules/archiva-base/archiva-configuration/src/test/resources/spring-context.xml [deleted file]
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/test/java/RepositoryProviderMock.java
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resourcesstatic/archetype-resources/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/AbstractArtifactConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/mock/repository/RepositoryProviderMock.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-cleanup-released-snapshots.xml
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-purge-consumer-test.xml
archiva-modules/archiva-base/archiva-consumers/archiva-indexer-consumers/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-indexer-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-indexer-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java
archiva-modules/archiva-base/archiva-proxy/pom.xml
archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/base/ArchivaProxyRegistry.java
archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/base/DefaultRepositoryProxyHandler.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/DefaultRepositoryCommonValidator.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnectorrule/DefaultProxyConnectorRuleAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultArchivaRuntimeConfigurationAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/ArchivaIndexManagerMock.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java
archiva-modules/archiva-base/archiva-repository-api/pom.xml
archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryContentFactory.java
archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryHandler.java
archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryHandlerManager.java
archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryProvider.java
archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryRegistry.java
archiva-modules/archiva-base/archiva-repository-layer/pom.xml
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/AbstractRepositoryHandler.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/ArchivaRepositoryRegistry.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/ConfigurationHandler.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/group/RepositoryGroupHandler.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/managed/ManagedRepositoryHandler.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/base/remote/RemoteRepositoryHandler.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/base/MetadataTools.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/base/ArchivaRepositoryRegistryTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/base/group/RepositoryGroupHandlerTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/base/managed/BasicManagedRepositoryValidatorTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/base/managed/ManagedRepositoryHandlerTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/base/remote/RemoteRepositoryHandlerTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/RepositoryProviderMock.java
archiva-modules/archiva-base/archiva-repository-scanner/pom.xml
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java
archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/ArchivaAdministrationStub.java
archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryContentConsumersTest.java
archiva-modules/archiva-base/archiva-repository-scanner/src/test/resources/spring-context.xml
archiva-modules/archiva-maven/archiva-maven-indexer/pom.xml
archiva-modules/archiva-maven/archiva-maven-indexer/src/main/java/org/apache/archiva/maven/indexer/MavenIndexManager.java
archiva-modules/archiva-maven/archiva-maven-indexer/src/test/java/org/apache/archiva/maven/indexer/search/AbstractMavenRepositorySearch.java
archiva-modules/archiva-maven/archiva-maven-proxy/pom.xml
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/maven/proxy/AbstractProxyTestCase.java
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/maven/proxy/HttpProxyTransferTest.java
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/maven/proxy/MetadataTransferTest.java
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/maven/proxy/MockConfiguration.java
archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/maven/proxy/mock/repository/RepositoryProviderMock.java
archiva-modules/archiva-maven/archiva-maven-repository/pom.xml
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/maven/repository/MavenRepositoryProvider.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/maven/repository/content/ManagedDefaultRepositoryContent.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/maven/repository/content/MavenContentProvider.java
archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/maven/repository/merge/Maven2RepositoryMerger.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/MavenRepositoryProviderTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/content/ManagedDefaultRepositoryContentTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/content/MavenRepositoryRequestInfoTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/dependency/tree/DependencyTreeBuilderTestMaven3.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/merge/Maven2RepositoryMergerTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/metadata/MetadataToolsTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/metadata/storage/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/metadata/storage/Maven2RepositoryMetadataResolverMRM1411Test.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/metadata/storage/Maven2RepositoryMetadataResolverTest.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/metadata/storage/mock/MockConfiguration.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/mock/ArchivaIndexManagerMock.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/mock/configuration/MockRepoAdmin.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/mock/configuration/StubConfiguration.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/maven/repository/mock/configuration/TestConfiguration.java
archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-repo-request-test.xml
archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-storage.xml
archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context.xml
archiva-modules/archiva-maven/archiva-maven-scheduler/pom.xml
archiva-modules/archiva-maven/archiva-maven-scheduler/src/main/java/org/apache/archiva/maven/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java
archiva-modules/archiva-maven/archiva-maven-scheduler/src/test/resources/spring-context.xml
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-repository-api/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/AbstractArchivaRepositoryScanningTaskExecutorTest.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/mock/ArchivaIndexManagerMock.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/mock/MockArchivaAdministration.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/mock/MockRemoteRepositoryAdmin.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/resources/spring-context.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/Artifact.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/ArtifactTransferRequest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/BeanInformation.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/CacheConfiguration.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/FileInfo.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/IndexingTask.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/LdapConfiguration.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/MergeConfiguration.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/Repository.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RepositoryGroup.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RepositoryStatistics.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RestModel.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/ScanStatus.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/ScanTask.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/SecurityConfiguration.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/ValidationError.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/MavenRepositoryMapper.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/RestMapper.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/ServiceMapperFactory.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/v2/svc/DefaultRepositoryGroupService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/v2/svc/maven/DefaultMavenManagedRepositoryService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/v2/svc/maven/NativeMavenManagedRepositoryServiceTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-native-test.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/META-INF/spring-context-test.xml
archiva-modules/archiva-web/archiva-security/pom.xml
archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/archiva/security/AbstractSecurityTest.java
archiva-modules/archiva-web/archiva-security/src/test/resources/spring-context.xml
archiva-modules/archiva-web/archiva-web-common/pom.xml
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/RssFeedServletTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/upload/UploadArtifactsTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-rss-servlet.xml
archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-common.xml
archiva-modules/archiva-web/archiva-web-common/src/test/resources/spring-context-test-upload.xml
archiva-modules/archiva-web/archiva-webapp/pom.xml
archiva-modules/archiva-web/archiva-webdav/pom.xml
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/RepositoryServlet.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletTestCase.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletDeployTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletNoProxyTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletProxiedPluginSnapshotPolicyTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletProxiedReleasePolicyTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletProxiedSnapshotPolicyTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletRepositoryGroupTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletSecurityTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/UnauthenticatedDavResourceFactory.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/util/ReinitServlet.java
archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-servlet-simple.xml
archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context-servlet-security-test.xml
archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/pom.xml
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java
archiva-modules/metadata/metadata-store-provider/metadata-store-file/pom.xml
archiva-modules/metadata/metadata-store-provider/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
archiva-modules/metadata/metadata-store-provider/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java
archiva-modules/metadata/metadata-store-provider/metadata-store-file/src/test/java/org/apache/archiva/metadata/repository/file/FileMetadataRepositoryTest.java
archiva-modules/metadata/metadata-store-provider/oak-jcr/oak-jcr-lucene/pom.xml
archiva-modules/plugins/audit/pom.xml
archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java
archiva-modules/plugins/problem-reports/pom.xml
archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java
pom.xml

diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/ModelMapper.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/ModelMapper.java
new file mode 100644 (file)
index 0000000..1f7fda9
--- /dev/null
@@ -0,0 +1,78 @@
+package org.apache.archiva.common;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Generic interface for mapping DTOs
+ *
+ * @author Martin Schreier <martin_s@apache.org>
+ */
+public interface ModelMapper<S,T>
+{
+    /**
+     * Converts the source instance to a new instance of the target type.
+     * @param source the source instance
+     * @return a new instance of the target type
+     */
+    T map(S source);
+
+    /**
+     * Updates the target instance based on the source instance
+     * @param source the source instance
+     * @param target the target instance
+     */
+    void update( S source, T target );
+
+
+    /**
+     * Converts the target instance back to the source type
+     * @param target the target instance
+     * @return a new instance of the source type
+     */
+    S reverseMap(T target);
+
+    /**
+     * Updates the source instance based on the target instance
+     * @param target the target instance
+     * @param source the source instance
+     */
+    void reverseUpdate( T target, S source);
+
+    /**
+     * Returns the class name of the source type
+     * @return the source type
+     */
+    Class<S> getSourceType();
+
+    /**
+     * Returns the class name of the target type
+     * @return the target type
+     */
+    Class<T> getTargetType();
+
+    /**
+     * Returns <code>true</code>, if the given type are the same or supertype of the mapping types.
+     * @param sourceType
+     * @param targetType
+     * @param <S>
+     * @param <T>
+     * @return
+     */
+    <S, T> boolean supports( Class<S> sourceType, Class<T> targetType );
+
+}
diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/ModelMapperFactory.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/ModelMapperFactory.java
new file mode 100644 (file)
index 0000000..30ee0c4
--- /dev/null
@@ -0,0 +1,40 @@
+package org.apache.archiva.common;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Interface that returns a given DTO mapper.
+ *
+ * @author Martin Schreier <martin_s@apache.org>
+ *
+ * @param <SB> The base source type for the model mapper
+ * @param <TB> The base target type for the model mapper
+ */
+public interface ModelMapperFactory<SB,TB>
+{
+    /**
+     * Returns a mapper for the given source and target type. If no mapper is registered for this combination,
+     * it will throw a {@link IllegalArgumentException}
+     * @param sourceType the source type for the mapping
+     * @param targetType the destination type
+     * @param <S> source type
+     * @param <T> destination type
+     * @return the mapper instance
+     */
+    <S extends SB, T extends TB> ModelMapper<S, T> getMapper( Class<S> sourceType, Class<T> targetType ) throws IllegalArgumentException;
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/pom.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/pom.xml
new file mode 100644 (file)
index 0000000..bd25917
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>archiva-configuration</artifactId>
+    <groupId>org.apache.archiva.configuration</groupId>
+    <version>3.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>archiva-configuration-model</artifactId>
+  <name>Archiva Base :: Configuration :: Model</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+    </dependency>
+  </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/AbstractRepositoryConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/AbstractRepositoryConfiguration.java
new file mode 100644 (file)
index 0000000..36c1f4e
--- /dev/null
@@ -0,0 +1,261 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class AbstractRepositoryConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class AbstractRepositoryConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The repository identifier.
+     *           
+     */
+    private String id;
+
+    /**
+     * 
+     *             The repository type. Currently only MAVEN type
+     * is known.
+     *           
+     */
+    private String type = "MAVEN";
+
+    /**
+     * 
+     *             The descriptive name of the repository.
+     *           
+     */
+    private String name;
+
+    /**
+     * 
+     *             The layout of the repository. Valid values are
+     * "default" and "legacy".
+     *           
+     */
+    private String layout = "default";
+
+    /**
+     * 
+     *             The directory for the indexes of this
+     * repository.
+     *           
+     */
+    private String indexDir = "";
+
+    /**
+     * 
+     *             The directory for the packed indexes of this
+     * repository.
+     *           
+     */
+    private String packedIndexDir = "";
+
+    /**
+     * 
+     *             The description of this repository.
+     *           
+     */
+    private String description = "";
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get the description of this repository.
+     * 
+     * @return String
+     */
+    public String getDescription()
+    {
+        return this.description;
+    } //-- String getDescription()
+
+    /**
+     * Get the repository identifier.
+     * 
+     * @return String
+     */
+    public String getId()
+    {
+        return this.id;
+    } //-- String getId()
+
+    /**
+     * Get the directory for the indexes of this repository.
+     * 
+     * @return String
+     */
+    public String getIndexDir()
+    {
+        return this.indexDir;
+    } //-- String getIndexDir()
+
+    /**
+     * Get the layout of the repository. Valid values are "default"
+     * and "legacy".
+     * 
+     * @return String
+     */
+    public String getLayout()
+    {
+        return this.layout;
+    } //-- String getLayout()
+
+    /**
+     * Get the descriptive name of the repository.
+     * 
+     * @return String
+     */
+    public String getName()
+    {
+        return this.name;
+    } //-- String getName()
+
+    /**
+     * Get the directory for the packed indexes of this repository.
+     * 
+     * @return String
+     */
+    public String getPackedIndexDir()
+    {
+        return this.packedIndexDir;
+    } //-- String getPackedIndexDir()
+
+    /**
+     * Get the repository type. Currently only MAVEN type is known.
+     * 
+     * @return String
+     */
+    public String getType()
+    {
+        return this.type;
+    } //-- String getType()
+
+    /**
+     * Set the description of this repository.
+     * 
+     * @param description
+     */
+    public void setDescription( String description )
+    {
+        this.description = description;
+    } //-- void setDescription( String )
+
+    /**
+     * Set the repository identifier.
+     * 
+     * @param id
+     */
+    public void setId( String id )
+    {
+        this.id = id;
+    } //-- void setId( String )
+
+    /**
+     * Set the directory for the indexes of this repository.
+     * 
+     * @param indexDir
+     */
+    public void setIndexDir( String indexDir )
+    {
+        this.indexDir = indexDir;
+    } //-- void setIndexDir( String )
+
+    /**
+     * Set the layout of the repository. Valid values are "default"
+     * and "legacy".
+     * 
+     * @param layout
+     */
+    public void setLayout( String layout )
+    {
+        this.layout = layout;
+    } //-- void setLayout( String )
+
+    /**
+     * Set the descriptive name of the repository.
+     * 
+     * @param name
+     */
+    public void setName( String name )
+    {
+        this.name = name;
+    } //-- void setName( String )
+
+    /**
+     * Set the directory for the packed indexes of this repository.
+     * 
+     * @param packedIndexDir
+     */
+    public void setPackedIndexDir( String packedIndexDir )
+    {
+        this.packedIndexDir = packedIndexDir;
+    } //-- void setPackedIndexDir( String )
+
+    /**
+     * Set the repository type. Currently only MAVEN type is known.
+     * 
+     * @param type
+     */
+    public void setType( String type )
+    {
+        this.type = type;
+    } //-- void setType( String )
+
+    
+            public int hashCode()
+            {
+                int result = 17;
+                result = 37 * result + ( id != null ? id.hashCode() : 0 );
+                return result;
+            }
+
+            public boolean equals( Object other )
+            {
+                if ( this == other )
+                {
+                    return true;
+                }
+
+                if ( !( other instanceof AbstractRepositoryConfiguration ) )
+                {
+                    return false;
+                }
+
+                AbstractRepositoryConfiguration that = (AbstractRepositoryConfiguration) other;
+                boolean result = true;
+                result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
+                return result;
+            }
+       
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/AbstractRepositoryConnectorConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/AbstractRepositoryConnectorConfiguration.java
new file mode 100644 (file)
index 0000000..aed4995
--- /dev/null
@@ -0,0 +1,358 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class AbstractRepositoryConnectorConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class AbstractRepositoryConnectorConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The Repository Source for this connector.
+     *           
+     */
+    private String sourceRepoId;
+
+    /**
+     * 
+     *             The Repository Target for this connector.
+     *           
+     */
+    private String targetRepoId;
+
+    /**
+     * 
+     *             The network proxy ID to use for this connector.
+     *           
+     */
+    private String proxyId;
+
+    /**
+     * Field blackListPatterns.
+     */
+    private java.util.List<String> blackListPatterns;
+
+    /**
+     * Field whiteListPatterns.
+     */
+    private java.util.List<String> whiteListPatterns;
+
+    /**
+     * Field policies.
+     */
+    private java.util.Map policies;
+
+    /**
+     * Field properties.
+     */
+    private java.util.Map properties;
+
+    /**
+     * 
+     *             If the the repository proxy connector is
+     * disabled or not
+     *           .
+     */
+    private boolean disabled = false;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addBlackListPattern.
+     * 
+     * @param string
+     */
+    public void addBlackListPattern( String string )
+    {
+        getBlackListPatterns().add( string );
+    } //-- void addBlackListPattern( String )
+
+    /**
+     * Method addPolicy.
+     * 
+     * @param key
+     * @param value
+     */
+    public void addPolicy( String key, String value )
+    {
+        getPolicies().put( key, value );
+    } //-- void addPolicy( Object, String )
+
+    /**
+     * Method addProperty.
+     * 
+     * @param key
+     * @param value
+     */
+    public void addProperty( String key, String value )
+    {
+        getProperties().put( key, value );
+    } //-- void addProperty( Object, String )
+
+    /**
+     * Method addWhiteListPattern.
+     * 
+     * @param string
+     */
+    public void addWhiteListPattern( String string )
+    {
+        getWhiteListPatterns().add( string );
+    } //-- void addWhiteListPattern( String )
+
+    /**
+     * Method getBlackListPatterns.
+     * 
+     * @return List
+     */
+    public java.util.List<String> getBlackListPatterns()
+    {
+        if ( this.blackListPatterns == null )
+        {
+            this.blackListPatterns = new java.util.ArrayList<String>();
+        }
+
+        return this.blackListPatterns;
+    } //-- java.util.List<String> getBlackListPatterns()
+
+    /**
+     * Method getPolicies.
+     * 
+     * @return Map
+     */
+    public java.util.Map<String, String> getPolicies()
+    {
+        if ( this.policies == null )
+        {
+            this.policies = new java.util.HashMap();
+        }
+
+        return this.policies;
+    } //-- java.util.Map getPolicies()
+
+    /**
+     * Method getProperties.
+     * 
+     * @return Map
+     */
+    public java.util.Map<String, String> getProperties()
+    {
+        if ( this.properties == null )
+        {
+            this.properties = new java.util.HashMap();
+        }
+
+        return this.properties;
+    } //-- java.util.Map getProperties()
+
+    /**
+     * Get the network proxy ID to use for this connector.
+     * 
+     * @return String
+     */
+    public String getProxyId()
+    {
+        return this.proxyId;
+    } //-- String getProxyId()
+
+    /**
+     * Get the Repository Source for this connector.
+     * 
+     * @return String
+     */
+    public String getSourceRepoId()
+    {
+        return this.sourceRepoId;
+    } //-- String getSourceRepoId()
+
+    /**
+     * Get the Repository Target for this connector.
+     * 
+     * @return String
+     */
+    public String getTargetRepoId()
+    {
+        return this.targetRepoId;
+    } //-- String getTargetRepoId()
+
+    /**
+     * Method getWhiteListPatterns.
+     * 
+     * @return List
+     */
+    public java.util.List<String> getWhiteListPatterns()
+    {
+        if ( this.whiteListPatterns == null )
+        {
+            this.whiteListPatterns = new java.util.ArrayList<String>();
+        }
+
+        return this.whiteListPatterns;
+    } //-- java.util.List<String> getWhiteListPatterns()
+
+    /**
+     * Get if the the repository proxy connector is disabled or
+     * not.
+     * 
+     * @return boolean
+     */
+    public boolean isDisabled()
+    {
+        return this.disabled;
+    } //-- boolean isDisabled()
+
+    /**
+     * Method removeBlackListPattern.
+     * 
+     * @param string
+     */
+    public void removeBlackListPattern( String string )
+    {
+        getBlackListPatterns().remove( string );
+    } //-- void removeBlackListPattern( String )
+
+    /**
+     * Method removeWhiteListPattern.
+     * 
+     * @param string
+     */
+    public void removeWhiteListPattern( String string )
+    {
+        getWhiteListPatterns().remove( string );
+    } //-- void removeWhiteListPattern( String )
+
+    /**
+     * Set the list of blacklisted patterns for this connector.
+     * 
+     * @param blackListPatterns
+     */
+    public void setBlackListPatterns( java.util.List<String> blackListPatterns )
+    {
+        this.blackListPatterns = blackListPatterns;
+    } //-- void setBlackListPatterns( java.util.List )
+
+    /**
+     * Set if the the repository proxy connector is disabled or
+     * not.
+     * 
+     * @param disabled
+     */
+    public void setDisabled( boolean disabled )
+    {
+        this.disabled = disabled;
+    } //-- void setDisabled( boolean )
+
+    /**
+     * Set policy configuration for the connector.
+     * 
+     * @param policies
+     */
+    public void setPolicies( java.util.Map policies )
+    {
+        this.policies = policies;
+    } //-- void setPolicies( java.util.Map )
+
+    /**
+     * Set configuration for the connector.
+     * 
+     * @param properties
+     */
+    public void setProperties( java.util.Map properties )
+    {
+        this.properties = properties;
+    } //-- void setProperties( java.util.Map )
+
+    /**
+     * Set the network proxy ID to use for this connector.
+     * 
+     * @param proxyId
+     */
+    public void setProxyId( String proxyId )
+    {
+        this.proxyId = proxyId;
+    } //-- void setProxyId( String )
+
+    /**
+     * Set the Repository Source for this connector.
+     * 
+     * @param sourceRepoId
+     */
+    public void setSourceRepoId( String sourceRepoId )
+    {
+        this.sourceRepoId = sourceRepoId;
+    } //-- void setSourceRepoId( String )
+
+    /**
+     * Set the Repository Target for this connector.
+     * 
+     * @param targetRepoId
+     */
+    public void setTargetRepoId( String targetRepoId )
+    {
+        this.targetRepoId = targetRepoId;
+    } //-- void setTargetRepoId( String )
+
+    /**
+     * Set the list of whitelisted patterns for this connector.
+     * 
+     * @param whiteListPatterns
+     */
+    public void setWhiteListPatterns( java.util.List<String> whiteListPatterns )
+    {
+        this.whiteListPatterns = whiteListPatterns;
+    } //-- void setWhiteListPatterns( java.util.List )
+
+    
+    /**
+     * Obtain a specific policy from the underlying connector.
+     *
+     * @param policyId the policy id to fetch.
+     * @param defaultValue the default value for the policy id.
+     * @return the configured policy value (or default value if not found).
+     */
+    public String getPolicy( String policyId, String defaultValue )
+    {
+        if ( this.getPolicies() == null )
+        {
+            return null;
+        }
+
+        Object value = this.getPolicies().get( policyId );
+
+        if ( value == null )
+        {
+            return defaultValue;
+        }
+
+        return (String) value;
+    }
+          
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ArchivaDefaultConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ArchivaDefaultConfiguration.java
new file mode 100644 (file)
index 0000000..c7a613b
--- /dev/null
@@ -0,0 +1,92 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * 
+ *       Archiva default settings.
+ *     
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class ArchivaDefaultConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field defaultCheckPaths.
+     */
+    private java.util.List<RepositoryCheckPath> defaultCheckPaths;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addDefaultCheckPath.
+     * 
+     * @param repositoryCheckPath
+     */
+    public void addDefaultCheckPath( RepositoryCheckPath repositoryCheckPath )
+    {
+        getDefaultCheckPaths().add( repositoryCheckPath );
+    } //-- void addDefaultCheckPath( RepositoryCheckPath )
+
+    /**
+     * Method getDefaultCheckPaths.
+     * 
+     * @return List
+     */
+    public java.util.List<RepositoryCheckPath> getDefaultCheckPaths()
+    {
+        if ( this.defaultCheckPaths == null )
+        {
+            this.defaultCheckPaths = new java.util.ArrayList<RepositoryCheckPath>();
+        }
+
+        return this.defaultCheckPaths;
+    } //-- java.util.List<RepositoryCheckPath> getDefaultCheckPaths()
+
+    /**
+     * Method removeDefaultCheckPath.
+     * 
+     * @param repositoryCheckPath
+     */
+    public void removeDefaultCheckPath( RepositoryCheckPath repositoryCheckPath )
+    {
+        getDefaultCheckPaths().remove( repositoryCheckPath );
+    } //-- void removeDefaultCheckPath( RepositoryCheckPath )
+
+    /**
+     * Set the default check paths for certain remote repositories.
+     * 
+     * @param defaultCheckPaths
+     */
+    public void setDefaultCheckPaths( java.util.List<RepositoryCheckPath> defaultCheckPaths )
+    {
+        this.defaultCheckPaths = defaultCheckPaths;
+    } //-- void setDefaultCheckPaths( java.util.List )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ArchivaRuntimeConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ArchivaRuntimeConfiguration.java
new file mode 100644 (file)
index 0000000..85f20bf
--- /dev/null
@@ -0,0 +1,311 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 
+ *         The runtime configuration.
+ *       
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class ArchivaRuntimeConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * the url failure cache configuration.
+     */
+    private CacheConfiguration urlFailureCacheConfiguration;
+
+    /**
+     * the FileLocking configuration.
+     */
+    private FileLockConfiguration fileLockConfiguration;
+
+    /**
+     * The base directory where the archiva data is stored. If not
+     * set, the appserver.base is used.
+     */
+    private String dataDirectory;
+
+    /**
+     * The base directory for local storage of repository data. If
+     * not set, it's ${dataDirectory}/repositories.
+     */
+    private String repositoryBaseDirectory;
+
+    /**
+     * The base directory for local storage of remote repository
+     * data. If not set, it's ${dataDirectory}/remotes.
+     */
+    private String remoteRepositoryBaseDirectory;
+
+    /**
+     * The base directory for local storage of repository group files.
+     * If not set, it's ${dataDirectory}/groups
+     */
+    private String repositoryGroupBaseDirectory;
+
+    /**
+     * The default language used for setting internationalized
+     * strings.
+     */
+    private String defaultLanguage = "en-US";
+
+    /**
+     * Comma separated list of language patterns. Sorted by
+     * priority descending. Used for display of internationalized
+     * strings.
+     */
+    private String languageRange = "en,fr,de";
+
+    /**
+     * List of checksum types (algorithms) that should be applied to repository artifacts.
+     */
+    private List<String> checksumTypes = new ArrayList(Arrays.asList("MD5","SHA1","SHA256"));
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get the base directory where the archiva data is stored. If
+     * not set, the appserver.base is used.
+     * 
+     * @return String
+     */
+    public String getDataDirectory()
+    {
+        return this.dataDirectory;
+    } //-- String getDataDirectory()
+
+    /**
+     * Get the default language used for setting internationalized
+     * strings.
+     * 
+     * @return String
+     */
+    public String getDefaultLanguage()
+    {
+        return this.defaultLanguage;
+    } //-- String getDefaultLanguage()
+
+    /**
+     * Get the FileLocking configuration.
+     * 
+     * @return FileLockConfiguration
+     */
+    public FileLockConfiguration getFileLockConfiguration()
+    {
+        return this.fileLockConfiguration;
+    } //-- FileLockConfiguration getFileLockConfiguration()
+
+    /**
+     * Get comma separated list of language patterns. Sorted by
+     * priority descending. Used for display of internationalized
+     * strings.
+     * 
+     * @return String
+     */
+    public String getLanguageRange()
+    {
+        return this.languageRange;
+    } //-- String getLanguageRange()
+
+    /**
+     * Get the base directory for local storage of remote
+     * repository data. If not set, it's ${dataDirectory}/remotes.
+     * 
+     * @return String
+     */
+    public String getRemoteRepositoryBaseDirectory()
+    {
+        return this.remoteRepositoryBaseDirectory;
+    } //-- String getRemoteRepositoryBaseDirectory()
+
+    /**
+     * Get the base directory for local storage of repository data.
+     * If not set, it's ${dataDirectory}/repositories.
+     * 
+     * @return String
+     */
+    public String getRepositoryBaseDirectory()
+    {
+        return this.repositoryBaseDirectory;
+    } //-- String getRepositoryBaseDirectory()
+
+    /**
+     * Get the base directory for local storage of repository group data.
+     * If not set it's ${dataDirectory}/groups
+     *
+     * @return The path to the directory. Either a absolute path, or a path
+     * relative to ${dataDirectory}
+     */
+    public String getRepositoryGroupBaseDirectory() {
+        return this.repositoryGroupBaseDirectory;
+    }
+
+    /**
+     * Get the url failure cache configuration.
+     * 
+     * @return CacheConfiguration
+     */
+    public CacheConfiguration getUrlFailureCacheConfiguration()
+    {
+        return this.urlFailureCacheConfiguration;
+    } //-- CacheConfiguration getUrlFailureCacheConfiguration()
+
+    /**
+     * Set the base directory where the archiva data is stored. If
+     * not set, the appserver.base is used.
+     * 
+     * @param dataDirectory
+     */
+    public void setDataDirectory( String dataDirectory )
+    {
+        this.dataDirectory = dataDirectory;
+    } //-- void setDataDirectory( String )
+
+    /**
+     * Set the default language used for setting internationalized
+     * strings.
+     * 
+     * @param defaultLanguage
+     */
+    public void setDefaultLanguage( String defaultLanguage )
+    {
+        this.defaultLanguage = defaultLanguage;
+    } //-- void setDefaultLanguage( String )
+
+    /**
+     * Set the FileLocking configuration.
+     * 
+     * @param fileLockConfiguration
+     */
+    public void setFileLockConfiguration( FileLockConfiguration fileLockConfiguration )
+    {
+        this.fileLockConfiguration = fileLockConfiguration;
+    } //-- void setFileLockConfiguration( FileLockConfiguration )
+
+    /**
+     * Set comma separated list of language patterns. Sorted by
+     * priority descending. Used for display of internationalized
+     * strings.
+     * 
+     * @param languageRange
+     */
+    public void setLanguageRange( String languageRange )
+    {
+        this.languageRange = languageRange;
+    } //-- void setLanguageRange( String )
+
+    /**
+     * Set the base directory for local storage of remote
+     * repository data. If not set, it's ${dataDirectory}/remotes.
+     * 
+     * @param remoteRepositoryBaseDirectory
+     */
+    public void setRemoteRepositoryBaseDirectory( String remoteRepositoryBaseDirectory )
+    {
+        this.remoteRepositoryBaseDirectory = remoteRepositoryBaseDirectory;
+    } //-- void setRemoteRepositoryBaseDirectory( String )
+
+    /**
+     * Set the base directory for local storage of repository data.
+     * If not set, it's ${dataDirectory}/repositories.
+     * 
+     * @param repositoryBaseDirectory
+     */
+    public void setRepositoryBaseDirectory( String repositoryBaseDirectory )
+    {
+        this.repositoryBaseDirectory = repositoryBaseDirectory;
+    } //-- void setRepositoryBaseDirectory( String )
+
+
+    public void setRepositoryGroupBaseDirectory(String repositoryGroupBaseDirectory) {
+        this.repositoryGroupBaseDirectory = repositoryGroupBaseDirectory;
+    }
+
+    /**
+     * Set the url failure cache configuration.
+     * 
+     * @param urlFailureCacheConfiguration
+     */
+    public void setUrlFailureCacheConfiguration( CacheConfiguration urlFailureCacheConfiguration )
+    {
+        this.urlFailureCacheConfiguration = urlFailureCacheConfiguration;
+    } //-- void setUrlFailureCacheConfiguration( CacheConfiguration )
+
+
+    /**
+     * Returns the list of checksum types to generate
+     * @return
+     */
+    public List<String> getChecksumTypes()
+    {
+        if ( this.checksumTypes == null )
+        {
+            this.checksumTypes = new java.util.ArrayList<String>();
+        }
+
+        return this.checksumTypes;
+    }
+
+    /**
+     * Adds a checksum type
+     * @param type
+     */
+    public void addChecksumType(String type) {
+
+        if (!getChecksumTypes().contains(type)) {
+            getChecksumTypes().add(type);
+        }
+    }
+
+    /**
+     * Removes a checksum type
+     * @param type
+     */
+    public void removeChecksumType(String type) {
+        getChecksumTypes().remove(type);
+    }
+
+    /**
+     * Set all checksum types
+     * @param checksumTypes
+     */
+    public void setChecksumTypes(List<String> checksumTypes) {
+        if (checksumTypes!=null) {
+            getChecksumTypes().clear();
+            getChecksumTypes().addAll(checksumTypes);
+        }
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/CacheConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/CacheConfiguration.java
new file mode 100644 (file)
index 0000000..d14a886
--- /dev/null
@@ -0,0 +1,140 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Cache configuration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class CacheConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * TimeToIdleSeconds.
+     */
+    private int timeToIdleSeconds = -1;
+
+    /**
+     * TimeToLiveSeconds.
+     */
+    private int timeToLiveSeconds = -1;
+
+    /**
+     * max elements in memory.
+     */
+    private int maxElementsInMemory = -1;
+
+    /**
+     * max elements on disk.
+     */
+    private int maxElementsOnDisk = -1;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get max elements in memory.
+     * 
+     * @return int
+     */
+    public int getMaxElementsInMemory()
+    {
+        return this.maxElementsInMemory;
+    } //-- int getMaxElementsInMemory()
+
+    /**
+     * Get max elements on disk.
+     * 
+     * @return int
+     */
+    public int getMaxElementsOnDisk()
+    {
+        return this.maxElementsOnDisk;
+    } //-- int getMaxElementsOnDisk()
+
+    /**
+     * Get timeToIdleSeconds.
+     * 
+     * @return int
+     */
+    public int getTimeToIdleSeconds()
+    {
+        return this.timeToIdleSeconds;
+    } //-- int getTimeToIdleSeconds()
+
+    /**
+     * Get timeToLiveSeconds.
+     * 
+     * @return int
+     */
+    public int getTimeToLiveSeconds()
+    {
+        return this.timeToLiveSeconds;
+    } //-- int getTimeToLiveSeconds()
+
+    /**
+     * Set max elements in memory.
+     * 
+     * @param maxElementsInMemory
+     */
+    public void setMaxElementsInMemory( int maxElementsInMemory )
+    {
+        this.maxElementsInMemory = maxElementsInMemory;
+    } //-- void setMaxElementsInMemory( int )
+
+    /**
+     * Set max elements on disk.
+     * 
+     * @param maxElementsOnDisk
+     */
+    public void setMaxElementsOnDisk( int maxElementsOnDisk )
+    {
+        this.maxElementsOnDisk = maxElementsOnDisk;
+    } //-- void setMaxElementsOnDisk( int )
+
+    /**
+     * Set timeToIdleSeconds.
+     * 
+     * @param timeToIdleSeconds
+     */
+    public void setTimeToIdleSeconds( int timeToIdleSeconds )
+    {
+        this.timeToIdleSeconds = timeToIdleSeconds;
+    } //-- void setTimeToIdleSeconds( int )
+
+    /**
+     * Set timeToLiveSeconds.
+     * 
+     * @param timeToLiveSeconds
+     */
+    public void setTimeToLiveSeconds( int timeToLiveSeconds )
+    {
+        this.timeToLiveSeconds = timeToLiveSeconds;
+    } //-- void setTimeToLiveSeconds( int )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/Configuration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/Configuration.java
new file mode 100644 (file)
index 0000000..8909868
--- /dev/null
@@ -0,0 +1,839 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+/**
+ * Class Configuration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class Configuration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * This is the version of the configuration format.
+     */
+    private String version = "3.0.0";
+
+    /**
+     * The type of the metadata storage. Allowed values: jcr, file,
+     * cassandra.
+     */
+    private String metadataStore = "jcr";
+
+    /**
+     * Field repositoryGroups.
+     */
+    private java.util.List<RepositoryGroupConfiguration> repositoryGroups;
+
+    /**
+     * Field managedRepositories.
+     */
+    private java.util.List<ManagedRepositoryConfiguration> managedRepositories;
+
+    /**
+     * Field remoteRepositories.
+     */
+    private java.util.List<RemoteRepositoryConfiguration> remoteRepositories;
+
+    /**
+     * Field proxyConnectors.
+     */
+    private java.util.List<ProxyConnectorConfiguration> proxyConnectors;
+
+    /**
+     * Field networkProxies.
+     */
+    private java.util.List<NetworkProxyConfiguration> networkProxies;
+
+    /**
+     * Field legacyArtifactPaths.
+     */
+    private java.util.List<LegacyArtifactPath> legacyArtifactPaths;
+
+    /**
+     * 
+     *             The repository scanning configuration.
+     *           
+     */
+    private RepositoryScanningConfiguration repositoryScanning;
+
+    /**
+     * 
+     *             The webapp configuration.
+     *           
+     */
+    private WebappConfiguration webapp;
+
+    /**
+     * 
+     *             The organisation info.
+     *           
+     */
+    private OrganisationInformation organisationInfo;
+
+    /**
+     * 
+     *             The NetworkConfiguration .
+     *           
+     */
+    private NetworkConfiguration networkConfiguration;
+
+    /**
+     * The RedbackRuntimeConfiguration.
+     */
+    private RedbackRuntimeConfiguration redbackRuntimeConfiguration;
+
+    /**
+     * The ArchivaRuntimeConfiguration.
+     */
+    private ArchivaRuntimeConfiguration archivaRuntimeConfiguration;
+
+    /**
+     * Field proxyConnectorRuleConfigurations.
+     */
+    private java.util.List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations;
+
+    /**
+     * Archiva default settings.
+     */
+    private ArchivaDefaultConfiguration archivaDefaultConfiguration;
+
+    /**
+     * Field modelEncoding.
+     */
+    private String modelEncoding = "UTF-8";
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addLegacyArtifactPath.
+     * 
+     * @param legacyArtifactPath
+     */
+    public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
+    {
+        getLegacyArtifactPaths().add( legacyArtifactPath );
+    } //-- void addLegacyArtifactPath( LegacyArtifactPath )
+
+    /**
+     * Method addManagedRepository.
+     * 
+     * @param managedRepositoryConfiguration
+     */
+    public void addManagedRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration )
+    {
+        getManagedRepositories().add( managedRepositoryConfiguration );
+    } //-- void addManagedRepository( ManagedRepositoryConfiguration )
+
+    /**
+     * Method addNetworkProxy.
+     * 
+     * @param networkProxyConfiguration
+     */
+    public void addNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
+    {
+        getNetworkProxies().add( networkProxyConfiguration );
+    } //-- void addNetworkProxy( NetworkProxyConfiguration )
+
+    /**
+     * Method addProxyConnector.
+     * 
+     * @param proxyConnectorConfiguration
+     */
+    public void addProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
+    {
+        getProxyConnectors().add( proxyConnectorConfiguration );
+    } //-- void addProxyConnector( ProxyConnectorConfiguration )
+
+    /**
+     * Method addProxyConnectorRuleConfiguration.
+     * 
+     * @param proxyConnectorRuleConfiguration
+     */
+    public void addProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration )
+    {
+        getProxyConnectorRuleConfigurations().add( proxyConnectorRuleConfiguration );
+    } //-- void addProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration )
+
+    /**
+     * Method addRemoteRepository.
+     * 
+     * @param remoteRepositoryConfiguration
+     */
+    public void addRemoteRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration )
+    {
+        getRemoteRepositories().add( remoteRepositoryConfiguration );
+    } //-- void addRemoteRepository( RemoteRepositoryConfiguration )
+
+    /**
+     * Method addRepositoryGroup.
+     * 
+     * @param repositoryGroupConfiguration
+     */
+    public void addRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration )
+    {
+        getRepositoryGroups().add( repositoryGroupConfiguration );
+    } //-- void addRepositoryGroup( RepositoryGroupConfiguration )
+
+    /**
+     * Get archiva default settings.
+     * 
+     * @return ArchivaDefaultConfiguration
+     */
+    public ArchivaDefaultConfiguration getArchivaDefaultConfiguration()
+    {
+        return this.archivaDefaultConfiguration;
+    } //-- ArchivaDefaultConfiguration getArchivaDefaultConfiguration()
+
+    /**
+     * Get the ArchivaRuntimeConfiguration.
+     * 
+     * @return ArchivaRuntimeConfiguration
+     */
+    public ArchivaRuntimeConfiguration getArchivaRuntimeConfiguration()
+    {
+        return this.archivaRuntimeConfiguration;
+    } //-- ArchivaRuntimeConfiguration getArchivaRuntimeConfiguration()
+
+    /**
+     * Method getLegacyArtifactPaths.
+     * 
+     * @return List
+     */
+    public java.util.List<LegacyArtifactPath> getLegacyArtifactPaths()
+    {
+        if ( this.legacyArtifactPaths == null )
+        {
+            this.legacyArtifactPaths = new java.util.ArrayList<LegacyArtifactPath>();
+        }
+
+        return this.legacyArtifactPaths;
+    } //-- java.util.List<LegacyArtifactPath> getLegacyArtifactPaths()
+
+    /**
+     * Method getManagedRepositories.
+     * 
+     * @return List
+     */
+    public java.util.List<ManagedRepositoryConfiguration> getManagedRepositories()
+    {
+        if ( this.managedRepositories == null )
+        {
+            this.managedRepositories = new java.util.ArrayList<ManagedRepositoryConfiguration>();
+        }
+
+        return this.managedRepositories;
+    } //-- java.util.List<ManagedRepositoryConfiguration> getManagedRepositories()
+
+    /**
+     * Get the type of the metadata storage. Allowed values: jcr,
+     * file, cassandra.
+     * 
+     * @return String
+     */
+    public String getMetadataStore()
+    {
+        return this.metadataStore;
+    } //-- String getMetadataStore()
+
+    /**
+     * Get the modelEncoding field.
+     * 
+     * @return String
+     */
+    public String getModelEncoding()
+    {
+        return this.modelEncoding;
+    } //-- String getModelEncoding()
+
+    /**
+     * Get the NetworkConfiguration .
+     * 
+     * @return NetworkConfiguration
+     */
+    public NetworkConfiguration getNetworkConfiguration()
+    {
+        return this.networkConfiguration;
+    } //-- NetworkConfiguration getNetworkConfiguration()
+
+    /**
+     * Method getNetworkProxies.
+     * 
+     * @return List
+     */
+    public java.util.List<NetworkProxyConfiguration> getNetworkProxies()
+    {
+        if ( this.networkProxies == null )
+        {
+            this.networkProxies = new java.util.ArrayList<NetworkProxyConfiguration>();
+        }
+
+        return this.networkProxies;
+    } //-- java.util.List<NetworkProxyConfiguration> getNetworkProxies()
+
+    /**
+     * Get the organisation info.
+     * 
+     * @return OrganisationInformation
+     */
+    public OrganisationInformation getOrganisationInfo()
+    {
+        return this.organisationInfo;
+    } //-- OrganisationInformation getOrganisationInfo()
+
+    /**
+     * Method getProxyConnectorRuleConfigurations.
+     * 
+     * @return List
+     */
+    public java.util.List<ProxyConnectorRuleConfiguration> getProxyConnectorRuleConfigurations()
+    {
+        if ( this.proxyConnectorRuleConfigurations == null )
+        {
+            this.proxyConnectorRuleConfigurations = new java.util.ArrayList<ProxyConnectorRuleConfiguration>();
+        }
+
+        return this.proxyConnectorRuleConfigurations;
+    } //-- java.util.List<ProxyConnectorRuleConfiguration> getProxyConnectorRuleConfigurations()
+
+    /**
+     * Method getProxyConnectors.
+     * 
+     * @return List
+     */
+    public java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
+    {
+        if ( this.proxyConnectors == null )
+        {
+            this.proxyConnectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
+        }
+
+        return this.proxyConnectors;
+    } //-- java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
+
+    /**
+     * Get the RedbackRuntimeConfiguration.
+     * 
+     * @return RedbackRuntimeConfiguration
+     */
+    public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
+    {
+        return this.redbackRuntimeConfiguration;
+    } //-- RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
+
+    /**
+     * Method getRemoteRepositories.
+     * 
+     * @return List
+     */
+    public java.util.List<RemoteRepositoryConfiguration> getRemoteRepositories()
+    {
+        if ( this.remoteRepositories == null )
+        {
+            this.remoteRepositories = new java.util.ArrayList<RemoteRepositoryConfiguration>();
+        }
+
+        return this.remoteRepositories;
+    } //-- java.util.List<RemoteRepositoryConfiguration> getRemoteRepositories()
+
+    /**
+     * Method getRepositoryGroups.
+     * 
+     * @return List
+     */
+    public java.util.List<RepositoryGroupConfiguration> getRepositoryGroups()
+    {
+        if ( this.repositoryGroups == null )
+        {
+            this.repositoryGroups = new java.util.ArrayList<RepositoryGroupConfiguration>();
+        }
+
+        return this.repositoryGroups;
+    } //-- java.util.List<RepositoryGroupConfiguration> getRepositoryGroups()
+
+    /**
+     * Get the repository scanning configuration.
+     * 
+     * @return RepositoryScanningConfiguration
+     */
+    public RepositoryScanningConfiguration getRepositoryScanning()
+    {
+        return this.repositoryScanning;
+    } //-- RepositoryScanningConfiguration getRepositoryScanning()
+
+    /**
+     * Get this is the version of the configuration format.
+     * 
+     * @return String
+     */
+    public String getVersion()
+    {
+        return this.version;
+    } //-- String getVersion()
+
+    /**
+     * Get the webapp configuration.
+     * 
+     * @return WebappConfiguration
+     */
+    public WebappConfiguration getWebapp()
+    {
+        return this.webapp;
+    } //-- WebappConfiguration getWebapp()
+
+    /**
+     * Method removeLegacyArtifactPath.
+     * 
+     * @param legacyArtifactPath
+     */
+    public void removeLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
+    {
+        getLegacyArtifactPaths().remove( legacyArtifactPath );
+    } //-- void removeLegacyArtifactPath( LegacyArtifactPath )
+
+    /**
+     * Method removeManagedRepository.
+     * 
+     * @param managedRepositoryConfiguration
+     */
+    public void removeManagedRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration )
+    {
+        getManagedRepositories().remove( managedRepositoryConfiguration );
+    } //-- void removeManagedRepository( ManagedRepositoryConfiguration )
+
+    /**
+     * Method removeNetworkProxy.
+     * 
+     * @param networkProxyConfiguration
+     */
+    public void removeNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
+    {
+        getNetworkProxies().remove( networkProxyConfiguration );
+    } //-- void removeNetworkProxy( NetworkProxyConfiguration )
+
+    /**
+     * Method removeProxyConnector.
+     * 
+     * @param proxyConnectorConfiguration
+     */
+    public void removeProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
+    {
+        getProxyConnectors().remove( proxyConnectorConfiguration );
+    } //-- void removeProxyConnector( ProxyConnectorConfiguration )
+
+    /**
+     * Method removeProxyConnectorRuleConfiguration.
+     * 
+     * @param proxyConnectorRuleConfiguration
+     */
+    public void removeProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration )
+    {
+        getProxyConnectorRuleConfigurations().remove( proxyConnectorRuleConfiguration );
+    } //-- void removeProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration )
+
+    /**
+     * Method removeRemoteRepository.
+     * 
+     * @param remoteRepositoryConfiguration
+     */
+    public void removeRemoteRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration )
+    {
+        getRemoteRepositories().remove( remoteRepositoryConfiguration );
+    } //-- void removeRemoteRepository( RemoteRepositoryConfiguration )
+
+    /**
+     * Method removeRepositoryGroup.
+     * 
+     * @param repositoryGroupConfiguration
+     */
+    public void removeRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration )
+    {
+        getRepositoryGroups().remove( repositoryGroupConfiguration );
+    } //-- void removeRepositoryGroup( RepositoryGroupConfiguration )
+
+    /**
+     * Set archiva default settings.
+     * 
+     * @param archivaDefaultConfiguration
+     */
+    public void setArchivaDefaultConfiguration( ArchivaDefaultConfiguration archivaDefaultConfiguration )
+    {
+        this.archivaDefaultConfiguration = archivaDefaultConfiguration;
+    } //-- void setArchivaDefaultConfiguration( ArchivaDefaultConfiguration )
+
+    /**
+     * Set the ArchivaRuntimeConfiguration.
+     * 
+     * @param archivaRuntimeConfiguration
+     */
+    public void setArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
+    {
+        this.archivaRuntimeConfiguration = archivaRuntimeConfiguration;
+    } //-- void setArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration )
+
+    /**
+     * Set the list of custom legacy path to artifact.
+     * 
+     * @param legacyArtifactPaths
+     */
+    public void setLegacyArtifactPaths( java.util.List<LegacyArtifactPath> legacyArtifactPaths )
+    {
+        this.legacyArtifactPaths = legacyArtifactPaths;
+    } //-- void setLegacyArtifactPaths( java.util.List )
+
+    /**
+     * Set the list of repositories that this archiva instance
+     * uses.
+     * 
+     * @param managedRepositories
+     */
+    public void setManagedRepositories( java.util.List<ManagedRepositoryConfiguration> managedRepositories )
+    {
+        this.managedRepositories = managedRepositories;
+    } //-- void setManagedRepositories( java.util.List )
+
+    /**
+     * Set the type of the metadata storage. Allowed values: jcr,
+     * file, cassandra.
+     * 
+     * @param metadataStore
+     */
+    public void setMetadataStore( String metadataStore )
+    {
+        this.metadataStore = metadataStore;
+    } //-- void setMetadataStore( String )
+
+    /**
+     * Set the modelEncoding field.
+     * 
+     * @param modelEncoding
+     */
+    public void setModelEncoding( String modelEncoding )
+    {
+        this.modelEncoding = modelEncoding;
+    } //-- void setModelEncoding( String )
+
+    /**
+     * Set the NetworkConfiguration .
+     * 
+     * @param networkConfiguration
+     */
+    public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
+    {
+        this.networkConfiguration = networkConfiguration;
+    } //-- void setNetworkConfiguration( NetworkConfiguration )
+
+    /**
+     * Set the list of network proxies to use for outgoing
+     * requests.
+     * 
+     * @param networkProxies
+     */
+    public void setNetworkProxies( java.util.List<NetworkProxyConfiguration> networkProxies )
+    {
+        this.networkProxies = networkProxies;
+    } //-- void setNetworkProxies( java.util.List )
+
+    /**
+     * Set the organisation info.
+     * 
+     * @param organisationInfo
+     */
+    public void setOrganisationInfo( OrganisationInformation organisationInfo )
+    {
+        this.organisationInfo = organisationInfo;
+    } //-- void setOrganisationInfo( OrganisationInformation )
+
+    /**
+     * Set the list of ProxyConnectorRuleConfigurations.
+     * 
+     * @param proxyConnectorRuleConfigurations
+     */
+    public void setProxyConnectorRuleConfigurations( java.util.List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations )
+    {
+        this.proxyConnectorRuleConfigurations = proxyConnectorRuleConfigurations;
+    } //-- void setProxyConnectorRuleConfigurations( java.util.List )
+
+    /**
+     * Set the list of proxy connectors for this archiva instance.
+     * 
+     * @param proxyConnectors
+     */
+    public void setProxyConnectors( java.util.List<ProxyConnectorConfiguration> proxyConnectors )
+    {
+        this.proxyConnectors = proxyConnectors;
+    } //-- void setProxyConnectors( java.util.List )
+
+    /**
+     * Set the RedbackRuntimeConfiguration.
+     * 
+     * @param redbackRuntimeConfiguration
+     */
+    public void setRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
+    {
+        this.redbackRuntimeConfiguration = redbackRuntimeConfiguration;
+    } //-- void setRedbackRuntimeConfiguration( RedbackRuntimeConfiguration )
+
+    /**
+     * Set the list of repositories that this archiva can retrieve
+     * from or publish to.
+     * 
+     * @param remoteRepositories
+     */
+    public void setRemoteRepositories( java.util.List<RemoteRepositoryConfiguration> remoteRepositories )
+    {
+        this.remoteRepositories = remoteRepositories;
+    } //-- void setRemoteRepositories( java.util.List )
+
+    /**
+     * Set the list of repository groups.
+     * 
+     * @param repositoryGroups
+     */
+    public void setRepositoryGroups( java.util.List<RepositoryGroupConfiguration> repositoryGroups )
+    {
+        this.repositoryGroups = repositoryGroups;
+    } //-- void setRepositoryGroups( java.util.List )
+
+    /**
+     * Set the repository scanning configuration.
+     * 
+     * @param repositoryScanning
+     */
+    public void setRepositoryScanning( RepositoryScanningConfiguration repositoryScanning )
+    {
+        this.repositoryScanning = repositoryScanning;
+    } //-- void setRepositoryScanning( RepositoryScanningConfiguration )
+
+    /**
+     * Set this is the version of the configuration format.
+     * 
+     * @param version
+     */
+    public void setVersion( String version )
+    {
+        this.version = version;
+    } //-- void setVersion( String )
+
+    /**
+     * Set the webapp configuration.
+     * 
+     * @param webapp
+     */
+    public void setWebapp( WebappConfiguration webapp )
+    {
+        this.webapp = webapp;
+    } //-- void setWebapp( WebappConfiguration )
+
+    
+    private java.util.Map<String, java.util.List<String>> repositoryToGroupMap; 
+    
+    public java.util.Map<String, java.util.List<String>> getRepositoryToGroupMap()
+    {
+        if ( repositoryGroups != null )
+        {
+            java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>();
+            
+            for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
+            {
+                for ( String repositoryId : (java.util.List<String>) group.getRepositories() )
+                {
+                    java.util.List<String> groups = map.get( repositoryId );
+                    if ( groups == null )
+                    {
+                        groups = new java.util.ArrayList<String>();
+                        map.put( repositoryId, groups );
+                    }
+                    groups.add( group.getId() );
+                }
+            }
+            
+            repositoryToGroupMap = map;
+        }
+        return repositoryToGroupMap;
+    }
+    
+    public java.util.Map<String, RepositoryGroupConfiguration> getRepositoryGroupsAsMap()
+    {
+        java.util.Map<String, RepositoryGroupConfiguration> map = new java.util.HashMap<String, RepositoryGroupConfiguration>();
+        if ( repositoryGroups != null )
+        {
+            for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
+            {
+                map.put( group.getId(), group );
+            }
+        }
+        return map;
+    }
+    
+    public RepositoryGroupConfiguration findRepositoryGroupById( String id )
+    {
+        if ( repositoryGroups != null && id!=null)
+        {
+            return ( (java.util.List<RepositoryGroupConfiguration>) repositoryGroups ).stream( ).filter( g -> g != null && id.equals( g.getId( ) ) ).findFirst( ).orElse( null );
+        }
+        return null;
+    }
+
+    private java.util.Map<String, java.util.List<String>> groupToRepositoryMap;
+
+    public java.util.Map<String, java.util.List<String>> getGroupToRepositoryMap()
+    {
+        if ( repositoryGroups != null && managedRepositories != null )
+        {
+            java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>();
+            
+            for ( ManagedRepositoryConfiguration repo : (java.util.List<ManagedRepositoryConfiguration>) managedRepositories )
+            {
+                for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
+                {
+                    if ( !group.getRepositories().contains( repo.getId() ) )
+                    {
+                        String groupId = group.getId();
+                        java.util.List<String> repos = map.get( groupId );
+                        if ( repos == null )
+                        {
+                            repos = new java.util.ArrayList<String>();
+                            map.put( groupId, repos );
+                        }
+                        repos.add( repo.getId() );
+                    }
+                }
+            }
+            groupToRepositoryMap = map;
+        }
+        return groupToRepositoryMap;
+    }
+          
+    
+    public java.util.Map<String, NetworkProxyConfiguration> getNetworkProxiesAsMap()
+    {
+        java.util.Map<String, NetworkProxyConfiguration> map = new java.util.HashMap<String, NetworkProxyConfiguration>();
+        if ( networkProxies != null )
+        {
+            for ( java.util.Iterator<NetworkProxyConfiguration> i = networkProxies.iterator(); i.hasNext(); )
+            {
+                NetworkProxyConfiguration proxy = i.next();
+                map.put( proxy.getId(), proxy );
+            }
+        }
+        return map;
+    }
+
+    public java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> getProxyConnectorAsMap()
+    {
+        java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap =
+            new java.util.HashMap<String, java.util.List<ProxyConnectorConfiguration>>();
+
+        if( proxyConnectors != null )
+        {
+            java.util.Iterator<ProxyConnectorConfiguration> it = proxyConnectors.iterator();
+            while ( it.hasNext() )
+            {
+                ProxyConnectorConfiguration proxyConfig = it.next();
+                String key = proxyConfig.getSourceRepoId();
+
+                java.util.List<ProxyConnectorConfiguration> connectors = proxyConnectorMap.get( key );
+                if ( connectors == null )
+                {
+                    connectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
+                    proxyConnectorMap.put( key, connectors );
+                }
+
+                connectors.add( proxyConfig );
+                java.util.Collections.sort( connectors,
+                    org.apache.archiva.configuration.model.functors.ProxyConnectorConfigurationOrderComparator.getInstance() );
+            }
+        }
+
+        return proxyConnectorMap;
+    }
+
+    public java.util.Map<String, RemoteRepositoryConfiguration> getRemoteRepositoriesAsMap()
+    {
+        java.util.Map<String, RemoteRepositoryConfiguration> map = new java.util.HashMap<String, RemoteRepositoryConfiguration>();
+        if ( remoteRepositories != null )
+        {
+            for ( java.util.Iterator<RemoteRepositoryConfiguration> i = remoteRepositories.iterator(); i.hasNext(); )
+            {
+                RemoteRepositoryConfiguration repo = i.next();
+                map.put( repo.getId(), repo );
+            }
+        }
+        return map;
+    }
+
+    public RemoteRepositoryConfiguration findRemoteRepositoryById( String id )
+    {
+        if ( remoteRepositories != null )
+        {
+            for ( java.util.Iterator<RemoteRepositoryConfiguration> i = remoteRepositories.iterator(); i.hasNext(); )
+            {
+                RemoteRepositoryConfiguration repo = i.next();
+                if ( repo.getId().equals( id ) )
+                {
+                    return repo;
+                }
+            }
+        }
+        return null;
+    }
+
+    public java.util.Map<String, ManagedRepositoryConfiguration> getManagedRepositoriesAsMap()
+    {
+        java.util.Map<String, ManagedRepositoryConfiguration> map = new java.util.HashMap<String, ManagedRepositoryConfiguration>();
+        if ( managedRepositories != null )
+        {
+            for ( java.util.Iterator<ManagedRepositoryConfiguration> i = managedRepositories.iterator(); i.hasNext(); )
+            {
+                ManagedRepositoryConfiguration repo = i.next();
+                map.put( repo.getId(), repo );
+            }
+        }
+        return map;
+    }
+
+    public ManagedRepositoryConfiguration findManagedRepositoryById( String id )
+    {
+        if ( managedRepositories != null )
+        {
+            for ( java.util.Iterator<ManagedRepositoryConfiguration> i = managedRepositories.iterator(); i.hasNext(); )
+            {
+                ManagedRepositoryConfiguration repo = i.next();
+                if ( repo.getId().equals( id ) )
+                {
+                    return repo;
+                }
+            }
+        }
+        return null;
+    }
+          
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ConfigurationModel.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ConfigurationModel.java
new file mode 100644 (file)
index 0000000..6a9520a
--- /dev/null
@@ -0,0 +1,25 @@
+package org.apache.archiva.configuration.model;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author Martin Schreier <martin_s@apache.org>
+ */
+public interface ConfigurationModel
+{
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ConfigurationNames.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ConfigurationNames.java
new file mode 100644 (file)
index 0000000..8a1a03f
--- /dev/null
@@ -0,0 +1,67 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Utility methods for testing the configuration property name.
+ *
+ *
+ */
+public class ConfigurationNames
+{
+    public static boolean isNetworkProxy( String propertyName )
+    {
+        return startsWith( "networkProxies.", propertyName );
+    }
+
+    public static boolean isRepositoryScanning( String propertyName )
+    {
+        return startsWith( "repositoryScanning.", propertyName );
+    }
+
+    public static boolean isManagedRepositories( String propertyName )
+    {
+        return startsWith( "managedRepositories.", propertyName );
+    }
+
+    public static boolean isRemoteRepositories( String propertyName )
+    {
+        return startsWith( "remoteRepositories.", propertyName );
+    }
+
+    public static boolean isProxyConnector( String propertyName )
+    {
+        return startsWith( "proxyConnectors.", propertyName );
+    }
+
+    private static boolean startsWith( String prefix, String name )
+    {
+        if ( name == null )
+        {
+            return false;
+        }
+
+        if ( name.length() <= 0 )
+        {
+            return false;
+        }
+
+        return name.startsWith( prefix );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/FileLockConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/FileLockConfiguration.java
new file mode 100644 (file)
index 0000000..acac6d7
--- /dev/null
@@ -0,0 +1,90 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * File Locking configuration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class FileLockConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * skipping the locking mechanism.
+     */
+    private boolean skipLocking = true;
+
+    /**
+     * maximum time to wait to get the file lock (0 infinite).
+     */
+    private int lockingTimeout = 0;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get maximum time to wait to get the file lock (0 infinite).
+     * 
+     * @return int
+     */
+    public int getLockingTimeout()
+    {
+        return this.lockingTimeout;
+    } //-- int getLockingTimeout()
+
+    /**
+     * Get skipping the locking mechanism.
+     * 
+     * @return boolean
+     */
+    public boolean isSkipLocking()
+    {
+        return this.skipLocking;
+    } //-- boolean isSkipLocking()
+
+    /**
+     * Set maximum time to wait to get the file lock (0 infinite).
+     * 
+     * @param lockingTimeout
+     */
+    public void setLockingTimeout( int lockingTimeout )
+    {
+        this.lockingTimeout = lockingTimeout;
+    } //-- void setLockingTimeout( int )
+
+    /**
+     * Set skipping the locking mechanism.
+     * 
+     * @param skipLocking
+     */
+    public void setSkipLocking( boolean skipLocking )
+    {
+        this.skipLocking = skipLocking;
+    } //-- void setSkipLocking( boolean )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/FileType.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/FileType.java
new file mode 100644 (file)
index 0000000..7f0ec57
--- /dev/null
@@ -0,0 +1,145 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * The FileType object.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class FileType
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field id.
+     */
+    private String id;
+
+    /**
+     * Field patterns.
+     */
+    private java.util.List<String> patterns;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addPattern.
+     * 
+     * @param string
+     */
+    public void addPattern( String string )
+    {
+        getPatterns().add( string );
+    } //-- void addPattern( String )
+
+    /**
+     * Get the id field.
+     * 
+     * @return String
+     */
+    public String getId()
+    {
+        return this.id;
+    } //-- String getId()
+
+    /**
+     * Method getPatterns.
+     * 
+     * @return List
+     */
+    public java.util.List<String> getPatterns()
+    {
+        if ( this.patterns == null )
+        {
+            this.patterns = new java.util.ArrayList<String>();
+        }
+
+        return this.patterns;
+    } //-- java.util.List<String> getPatterns()
+
+    /**
+     * Method removePattern.
+     * 
+     * @param string
+     */
+    public void removePattern( String string )
+    {
+        getPatterns().remove( string );
+    } //-- void removePattern( String )
+
+    /**
+     * Set the id field.
+     * 
+     * @param id
+     */
+    public void setId( String id )
+    {
+        this.id = id;
+    } //-- void setId( String )
+
+    /**
+     * Set the patterns field.
+     * 
+     * @param patterns
+     */
+    public void setPatterns( java.util.List<String> patterns )
+    {
+        this.patterns = patterns;
+    } //-- void setPatterns( java.util.List )
+
+    
+
+            @Override
+            public boolean equals( Object o )
+            {
+                if ( this == o )
+                {
+                    return true;
+                }
+                if ( o == null || getClass() != o.getClass() )
+                {
+                    return false;
+                }
+
+                FileType fileType = (FileType) o;
+
+                if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
+                {
+                    return false;
+                }
+
+                return true;
+            }
+
+            @Override
+            public int hashCode()
+            {
+                return id != null ? 37 + id.hashCode() : 0;
+            }
+          
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LdapConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LdapConfiguration.java
new file mode 100644 (file)
index 0000000..abed037
--- /dev/null
@@ -0,0 +1,383 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * 
+ *         The LDAP configuration.
+ *       
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class LdapConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * The LDAP host.
+     */
+    private String hostName;
+
+    /**
+     * The LDAP port.
+     */
+    private int port = 0;
+
+    /**
+     * ssl LDAP connection.
+     */
+    private boolean ssl = false;
+
+    /**
+     * The LDAP base dn.
+     */
+    private String baseDn;
+
+    /**
+     * The LDAP base dn for groups (if empty baseDn is used).
+     */
+    private String baseGroupsDn;
+
+    /**
+     * contextFactory to use.
+     */
+    private String contextFactory;
+
+    /**
+     * The LDAP bind dn.
+     */
+    private String bindDn;
+
+    /**
+     * The LDAP password.
+     */
+    private String password;
+
+    /**
+     * The LDAP authenticationMethod.
+     */
+    private String authenticationMethod;
+
+    /**
+     * The LDAP authenticator enabled.
+     */
+    private boolean bindAuthenticatorEnabled = false;
+
+    /**
+     * LDAP writable.
+     */
+    private boolean writable = false;
+
+    /**
+     * Will use role name as LDAP group.
+     */
+    private boolean useRoleNameAsGroup = false;
+
+    /**
+     * Field extraProperties.
+     */
+    private java.util.Map extraProperties;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addExtraProperty.
+     * 
+     * @param key
+     * @param value
+     */
+    public void addExtraProperty( Object key, String value )
+    {
+        getExtraProperties().put( key, value );
+    } //-- void addExtraProperty( Object, String )
+
+    /**
+     * Get the LDAP authenticationMethod.
+     * 
+     * @return String
+     */
+    public String getAuthenticationMethod()
+    {
+        return this.authenticationMethod;
+    } //-- String getAuthenticationMethod()
+
+    /**
+     * Get the LDAP base dn.
+     * 
+     * @return String
+     */
+    public String getBaseDn()
+    {
+        return this.baseDn;
+    } //-- String getBaseDn()
+
+    /**
+     * Get the LDAP base dn for groups (if empty baseDn is used).
+     * 
+     * @return String
+     */
+    public String getBaseGroupsDn()
+    {
+        return this.baseGroupsDn;
+    } //-- String getBaseGroupsDn()
+
+    /**
+     * Get the LDAP bind dn.
+     * 
+     * @return String
+     */
+    public String getBindDn()
+    {
+        return this.bindDn;
+    } //-- String getBindDn()
+
+    /**
+     * Get contextFactory to use.
+     * 
+     * @return String
+     */
+    public String getContextFactory()
+    {
+        return this.contextFactory;
+    } //-- String getContextFactory()
+
+    /**
+     * Method getExtraProperties.
+     * 
+     * @return Map
+     */
+    public java.util.Map getExtraProperties()
+    {
+        if ( this.extraProperties == null )
+        {
+            this.extraProperties = new java.util.HashMap();
+        }
+
+        return this.extraProperties;
+    } //-- java.util.Map getExtraProperties()
+
+    /**
+     * Get the LDAP host.
+     * 
+     * @return String
+     */
+    public String getHostName()
+    {
+        return this.hostName;
+    } //-- String getHostName()
+
+    /**
+     * Get the LDAP password.
+     * 
+     * @return String
+     */
+    public String getPassword()
+    {
+        return this.password;
+    } //-- String getPassword()
+
+    /**
+     * Get the LDAP port.
+     * 
+     * @return int
+     */
+    public int getPort()
+    {
+        return this.port;
+    } //-- int getPort()
+
+    /**
+     * Get the LDAP authenticator enabled.
+     * 
+     * @return boolean
+     */
+    public boolean isBindAuthenticatorEnabled()
+    {
+        return this.bindAuthenticatorEnabled;
+    } //-- boolean isBindAuthenticatorEnabled()
+
+    /**
+     * Get ssl LDAP connection.
+     * 
+     * @return boolean
+     */
+    public boolean isSsl()
+    {
+        return this.ssl;
+    } //-- boolean isSsl()
+
+    /**
+     * Get will use role name as LDAP group.
+     * 
+     * @return boolean
+     */
+    public boolean isUseRoleNameAsGroup()
+    {
+        return this.useRoleNameAsGroup;
+    } //-- boolean isUseRoleNameAsGroup()
+
+    /**
+     * Get lDAP writable.
+     * 
+     * @return boolean
+     */
+    public boolean isWritable()
+    {
+        return this.writable;
+    } //-- boolean isWritable()
+
+    /**
+     * Set the LDAP authenticationMethod.
+     * 
+     * @param authenticationMethod
+     */
+    public void setAuthenticationMethod( String authenticationMethod )
+    {
+        this.authenticationMethod = authenticationMethod;
+    } //-- void setAuthenticationMethod( String )
+
+    /**
+     * Set the LDAP base dn.
+     * 
+     * @param baseDn
+     */
+    public void setBaseDn( String baseDn )
+    {
+        this.baseDn = baseDn;
+    } //-- void setBaseDn( String )
+
+    /**
+     * Set the LDAP base dn for groups (if empty baseDn is used).
+     * 
+     * @param baseGroupsDn
+     */
+    public void setBaseGroupsDn( String baseGroupsDn )
+    {
+        this.baseGroupsDn = baseGroupsDn;
+    } //-- void setBaseGroupsDn( String )
+
+    /**
+     * Set the LDAP authenticator enabled.
+     * 
+     * @param bindAuthenticatorEnabled
+     */
+    public void setBindAuthenticatorEnabled( boolean bindAuthenticatorEnabled )
+    {
+        this.bindAuthenticatorEnabled = bindAuthenticatorEnabled;
+    } //-- void setBindAuthenticatorEnabled( boolean )
+
+    /**
+     * Set the LDAP bind dn.
+     * 
+     * @param bindDn
+     */
+    public void setBindDn( String bindDn )
+    {
+        this.bindDn = bindDn;
+    } //-- void setBindDn( String )
+
+    /**
+     * Set contextFactory to use.
+     * 
+     * @param contextFactory
+     */
+    public void setContextFactory( String contextFactory )
+    {
+        this.contextFactory = contextFactory;
+    } //-- void setContextFactory( String )
+
+    /**
+     * Set additional properties to use for ldap connection.
+     * 
+     * @param extraProperties
+     */
+    public void setExtraProperties( java.util.Map extraProperties )
+    {
+        this.extraProperties = extraProperties;
+    } //-- void setExtraProperties( java.util.Map )
+
+    /**
+     * Set the LDAP host.
+     * 
+     * @param hostName
+     */
+    public void setHostName( String hostName )
+    {
+        this.hostName = hostName;
+    } //-- void setHostName( String )
+
+    /**
+     * Set the LDAP password.
+     * 
+     * @param password
+     */
+    public void setPassword( String password )
+    {
+        this.password = password;
+    } //-- void setPassword( String )
+
+    /**
+     * Set the LDAP port.
+     * 
+     * @param port
+     */
+    public void setPort( int port )
+    {
+        this.port = port;
+    } //-- void setPort( int )
+
+    /**
+     * Set ssl LDAP connection.
+     * 
+     * @param ssl
+     */
+    public void setSsl( boolean ssl )
+    {
+        this.ssl = ssl;
+    } //-- void setSsl( boolean )
+
+    /**
+     * Set will use role name as LDAP group.
+     * 
+     * @param useRoleNameAsGroup
+     */
+    public void setUseRoleNameAsGroup( boolean useRoleNameAsGroup )
+    {
+        this.useRoleNameAsGroup = useRoleNameAsGroup;
+    } //-- void setUseRoleNameAsGroup( boolean )
+
+    /**
+     * Set lDAP writable.
+     * 
+     * @param writable
+     */
+    public void setWritable( boolean writable )
+    {
+        this.writable = writable;
+    } //-- void setWritable( boolean )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LdapGroupMapping.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LdapGroupMapping.java
new file mode 100644 (file)
index 0000000..c899d40
--- /dev/null
@@ -0,0 +1,115 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * configuration of a LDAP group to Archiva roles.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class LdapGroupMapping
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * LDAP Group.
+     */
+    private String group;
+
+    /**
+     * Field roleNames.
+     */
+    private java.util.List<String> roleNames;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addRoleName.
+     * 
+     * @param string
+     */
+    public void addRoleName( String string )
+    {
+        getRoleNames().add( string );
+    } //-- void addRoleName( String )
+
+    /**
+     * Get lDAP Group.
+     * 
+     * @return String
+     */
+    public String getGroup()
+    {
+        return this.group;
+    } //-- String getGroup()
+
+    /**
+     * Method getRoleNames.
+     * 
+     * @return List
+     */
+    public java.util.List<String> getRoleNames()
+    {
+        if ( this.roleNames == null )
+        {
+            this.roleNames = new java.util.ArrayList<String>();
+        }
+
+        return this.roleNames;
+    } //-- java.util.List<String> getRoleNames()
+
+    /**
+     * Method removeRoleName.
+     * 
+     * @param string
+     */
+    public void removeRoleName( String string )
+    {
+        getRoleNames().remove( string );
+    } //-- void removeRoleName( String )
+
+    /**
+     * Set lDAP Group.
+     * 
+     * @param group
+     */
+    public void setGroup( String group )
+    {
+        this.group = group;
+    } //-- void setGroup( String )
+
+    /**
+     * Set archiva roles.
+     * 
+     * @param roleNames
+     */
+    public void setRoleNames( java.util.List<String> roleNames )
+    {
+        this.roleNames = roleNames;
+    } //-- void setRoleNames( java.util.List )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LegacyArtifactPath.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/LegacyArtifactPath.java
new file mode 100644 (file)
index 0000000..6c70133
--- /dev/null
@@ -0,0 +1,157 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class LegacyArtifactPath.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class LegacyArtifactPath
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The legacy path.
+     *           
+     */
+    private String path;
+
+    /**
+     * 
+     *             The artifact reference, as " [groupId] :
+     * [artifactId] : [version] : [classifier] : [type] ".
+     *           
+     */
+    private String artifact;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get the artifact reference, as " [groupId] : [artifactId] :
+     * [version] : [classifier] : [type] ".
+     * 
+     * @return String
+     */
+    public String getArtifact()
+    {
+        return this.artifact;
+    } //-- String getArtifact()
+
+    /**
+     * Get the legacy path.
+     * 
+     * @return String
+     */
+    public String getPath()
+    {
+        return this.path;
+    } //-- String getPath()
+
+    /**
+     * Set the artifact reference, as " [groupId] : [artifactId] :
+     * [version] : [classifier] : [type] ".
+     * 
+     * @param artifact
+     */
+    public void setArtifact( String artifact )
+    {
+        this.artifact = artifact;
+    } //-- void setArtifact( String )
+
+    /**
+     * Set the legacy path.
+     * 
+     * @param path
+     */
+    public void setPath( String path )
+    {
+        this.path = path;
+    } //-- void setPath( String )
+
+    
+    public boolean match( String path )
+    {
+        return path.equals( this.path );
+    }
+
+    public String getGroupId()
+    {
+        return artifact.split( ":" )[0];
+    }
+
+    public String getArtifactId()
+    {
+        return artifact.split( ":" )[1];
+    }
+        
+    public String getVersion()
+    {
+        return artifact.split( ":" )[2];
+    }
+    
+    public String getClassifier()
+    {
+        String classifier = artifact.split( ":" )[3];
+        return classifier.length() > 0 ? classifier : null;
+    }
+    
+    public String getType()
+    {
+        return artifact.split( ":" )[4];
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        LegacyArtifactPath that = (LegacyArtifactPath) o;
+
+        if ( path != null ? !path.equals( that.path ) : that.path != null )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return path != null ? 37 + path.hashCode() : 0;
+    }
+       
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ManagedRepositoryConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ManagedRepositoryConfiguration.java
new file mode 100644 (file)
index 0000000..64c84b9
--- /dev/null
@@ -0,0 +1,352 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class ManagedRepositoryConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class ManagedRepositoryConfiguration
+    extends AbstractRepositoryConfiguration
+    implements java.io.Serializable, ConfigurationModel
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The file system location for this repository.
+     *           
+     */
+    private String location;
+
+    /**
+     * True if this repository contains release versioned artifacts.
+     */
+    private boolean releases = true;
+
+    /**
+     * True if re-deployment of artifacts already in the repository
+     * will be blocked.
+     */
+    private boolean blockRedeployments = false;
+
+    /**
+     * True if this repository contains snapshot versioned artifacts
+     */
+    private boolean snapshots = false;
+
+    /**
+     * True if this repository should be scanned and processed.
+     */
+    private boolean scanned = true;
+
+    /**
+     * 
+     *             When to run the refresh task.
+     *             Default is every hour
+     *           .
+     */
+    private String refreshCronExpression = "0 0 * * * ?";
+
+    /**
+     * 
+     *             The total count of the artifact to be retained
+     * for each snapshot.
+     *           
+     */
+    private int retentionCount = 2;
+
+    /**
+     * 
+     *             The number of days after which snapshots will be
+     * removed.
+     *           
+     */
+    private int retentionPeriod = 100;
+
+    /**
+     * 
+     *             True if the released snapshots are to be removed
+     * from the repo during repository purge.
+     *           
+     */
+    private boolean deleteReleasedSnapshots = false;
+
+    /**
+     * 
+     *             True to not generate packed index (note you
+     * won't be able to export your index.
+     *           
+     */
+    private boolean skipPackedIndexCreation = false;
+
+    /**
+     * 
+     *             Need a staging repository
+     *           .
+     */
+    private boolean stageRepoNeeded = false;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get the file system location for this repository.
+     * 
+     * @return String
+     */
+    public String getLocation()
+    {
+        return this.location;
+    } //-- String getLocation()
+
+    /**
+     * Get when to run the refresh task.
+     *             Default is every hour.
+     * 
+     * @return String
+     */
+    public String getRefreshCronExpression()
+    {
+        return this.refreshCronExpression;
+    } //-- String getRefreshCronExpression()
+
+    /**
+     * Get the total count of the artifact to be retained for each
+     * snapshot.
+     * 
+     * @return int
+     */
+    public int getRetentionCount()
+    {
+        return this.retentionCount;
+    } //-- int getRetentionCount()
+
+    /**
+     * Get the number of days after which snapshots will be
+     * removed.
+     * 
+     * @return int
+     */
+    public int getRetentionPeriod()
+    {
+        return this.retentionPeriod;
+    } //-- int getRetentionPeriod()
+
+    /**
+     * Get true if re-deployment of artifacts already in the
+     * repository will be blocked.
+     * 
+     * @return boolean
+     */
+    public boolean isBlockRedeployments()
+    {
+        return this.blockRedeployments;
+    } //-- boolean isBlockRedeployments()
+
+    /**
+     * Get true if the released snapshots are to be removed from
+     * the repo during repository purge.
+     * 
+     * @return boolean
+     */
+    public boolean isDeleteReleasedSnapshots()
+    {
+        return this.deleteReleasedSnapshots;
+    } //-- boolean isDeleteReleasedSnapshots()
+
+    /**
+     * Get true if this repository contains release versioned
+     * artifacts.
+     * 
+     * @return boolean
+     */
+    public boolean isReleases()
+    {
+        return this.releases;
+    } //-- boolean isReleases()
+
+    /**
+     * Get true if this repository should be scanned and processed.
+     * 
+     * @return boolean
+     */
+    public boolean isScanned()
+    {
+        return this.scanned;
+    } //-- boolean isScanned()
+
+    /**
+     * Get true to not generate packed index (note you won't be
+     * able to export your index.
+     * 
+     * @return boolean
+     */
+    public boolean isSkipPackedIndexCreation()
+    {
+        return this.skipPackedIndexCreation;
+    } //-- boolean isSkipPackedIndexCreation()
+
+    /**
+     * Get true if this repository contains snapshot versioned
+     * artifacts.
+     * 
+     * @return boolean
+     */
+    public boolean isSnapshots()
+    {
+        return this.snapshots;
+    } //-- boolean isSnapshots()
+
+    /**
+     * Get need a staging repository.
+     * 
+     * @return boolean
+     */
+    public boolean isStageRepoNeeded()
+    {
+        return this.stageRepoNeeded;
+    } //-- boolean isStageRepoNeeded()
+
+    /**
+     * Set true if re-deployment of artifacts already in the
+     * repository will be blocked.
+     * 
+     * @param blockRedeployments
+     */
+    public void setBlockRedeployments( boolean blockRedeployments )
+    {
+        this.blockRedeployments = blockRedeployments;
+    } //-- void setBlockRedeployments( boolean )
+
+    /**
+     * Set true if the released snapshots are to be removed from
+     * the repo during repository purge.
+     * 
+     * @param deleteReleasedSnapshots
+     */
+    public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
+    {
+        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
+    } //-- void setDeleteReleasedSnapshots( boolean )
+
+    /**
+     * Set the file system location for this repository.
+     * 
+     * @param location
+     */
+    public void setLocation( String location )
+    {
+        this.location = location;
+    } //-- void setLocation( String )
+
+    /**
+     * Set when to run the refresh task.
+     *             Default is every hour.
+     * 
+     * @param refreshCronExpression
+     */
+    public void setRefreshCronExpression( String refreshCronExpression )
+    {
+        this.refreshCronExpression = refreshCronExpression;
+    } //-- void setRefreshCronExpression( String )
+
+    /**
+     * Set true if this repository contains release versioned
+     * artifacts.
+     * 
+     * @param releases
+     */
+    public void setReleases( boolean releases )
+    {
+        this.releases = releases;
+    } //-- void setReleases( boolean )
+
+    /**
+     * Set the total count of the artifact to be retained for each
+     * snapshot.
+     * 
+     * @param retentionCount
+     */
+    public void setRetentionCount( int retentionCount )
+    {
+        this.retentionCount = retentionCount;
+    } //-- void setRetentionCount( int )
+
+    /**
+     * Set the number of days after which snapshots will be
+     * removed.
+     * 
+     * @param retentionPeriod
+     */
+    public void setRetentionPeriod( int retentionPeriod )
+    {
+        this.retentionPeriod = retentionPeriod;
+    } //-- void setRetentionPeriod( int )
+
+    /**
+     * Set true if this repository should be scanned and processed.
+     * 
+     * @param scanned
+     */
+    public void setScanned( boolean scanned )
+    {
+        this.scanned = scanned;
+    } //-- void setScanned( boolean )
+
+    /**
+     * Set true to not generate packed index (note you won't be
+     * able to export your index.
+     * 
+     * @param skipPackedIndexCreation
+     */
+    public void setSkipPackedIndexCreation( boolean skipPackedIndexCreation )
+    {
+        this.skipPackedIndexCreation = skipPackedIndexCreation;
+    } //-- void setSkipPackedIndexCreation( boolean )
+
+    /**
+     * Set true if this repository contains snapshot versioned
+     * artifacts.
+     * 
+     * @param snapshots
+     */
+    public void setSnapshots( boolean snapshots )
+    {
+        this.snapshots = snapshots;
+    } //-- void setSnapshots( boolean )
+
+    /**
+     * Set need a staging repository.
+     * 
+     * @param stageRepoNeeded
+     */
+    public void setStageRepoNeeded( boolean stageRepoNeeded )
+    {
+        this.stageRepoNeeded = stageRepoNeeded;
+    } //-- void setStageRepoNeeded( boolean )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/NetworkConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/NetworkConfiguration.java
new file mode 100644 (file)
index 0000000..dd1b2de
--- /dev/null
@@ -0,0 +1,118 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * 
+ *         The network configuration for external http request to
+ * repositories.
+ *       
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class NetworkConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * maximum total external http connections.
+     */
+    private int maxTotal = 30;
+
+    /**
+     * maximum total external http connections per host.
+     */
+    private int maxTotalPerHost = 30;
+
+    /**
+     * use or not http connection pooling default true.
+     */
+    private boolean usePooling = true;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get maximum total external http connections.
+     * 
+     * @return int
+     */
+    public int getMaxTotal()
+    {
+        return this.maxTotal;
+    } //-- int getMaxTotal()
+
+    /**
+     * Get maximum total external http connections per host.
+     * 
+     * @return int
+     */
+    public int getMaxTotalPerHost()
+    {
+        return this.maxTotalPerHost;
+    } //-- int getMaxTotalPerHost()
+
+    /**
+     * Get use or not http connection pooling default true.
+     * 
+     * @return boolean
+     */
+    public boolean isUsePooling()
+    {
+        return this.usePooling;
+    } //-- boolean isUsePooling()
+
+    /**
+     * Set maximum total external http connections.
+     * 
+     * @param maxTotal
+     */
+    public void setMaxTotal( int maxTotal )
+    {
+        this.maxTotal = maxTotal;
+    } //-- void setMaxTotal( int )
+
+    /**
+     * Set maximum total external http connections per host.
+     * 
+     * @param maxTotalPerHost
+     */
+    public void setMaxTotalPerHost( int maxTotalPerHost )
+    {
+        this.maxTotalPerHost = maxTotalPerHost;
+    } //-- void setMaxTotalPerHost( int )
+
+    /**
+     * Set use or not http connection pooling default true.
+     * 
+     * @param usePooling
+     */
+    public void setUsePooling( boolean usePooling )
+    {
+        this.usePooling = usePooling;
+    } //-- void setUsePooling( boolean )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/NetworkProxyConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/NetworkProxyConfiguration.java
new file mode 100644 (file)
index 0000000..e18fe05
--- /dev/null
@@ -0,0 +1,258 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class NetworkProxyConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class NetworkProxyConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The ID for this proxy.
+     *           
+     */
+    private String id;
+
+    /**
+     * 
+     *             The network protocol to use with this proxy:
+     * "http", "socks-4"
+     *           .
+     */
+    private String protocol = "http";
+
+    /**
+     * 
+     *             The proxy host.
+     *           
+     */
+    private String host;
+
+    /**
+     * 
+     *             The proxy port.
+     *           
+     */
+    private int port = 8080;
+
+    /**
+     * 
+     *             The proxy user.
+     *           
+     */
+    private String username;
+
+    /**
+     * 
+     *             The proxy password.
+     *           
+     */
+    private String password;
+
+    /**
+     * 
+     *             Use ntlm authentification.
+     *           
+     */
+    private boolean useNtlm = false;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get the proxy host.
+     * 
+     * @return String
+     */
+    public String getHost()
+    {
+        return this.host;
+    } //-- String getHost()
+
+    /**
+     * Get the ID for this proxy.
+     * 
+     * @return String
+     */
+    public String getId()
+    {
+        return this.id;
+    } //-- String getId()
+
+    /**
+     * Get the proxy password.
+     * 
+     * @return String
+     */
+    public String getPassword()
+    {
+        return this.password;
+    } //-- String getPassword()
+
+    /**
+     * Get the proxy port.
+     * 
+     * @return int
+     */
+    public int getPort()
+    {
+        return this.port;
+    } //-- int getPort()
+
+    /**
+     * Get the network protocol to use with this proxy: "http",
+     * "socks-4".
+     * 
+     * @return String
+     */
+    public String getProtocol()
+    {
+        return this.protocol;
+    } //-- String getProtocol()
+
+    /**
+     * Get the proxy user.
+     * 
+     * @return String
+     */
+    public String getUsername()
+    {
+        return this.username;
+    } //-- String getUsername()
+
+    /**
+     * Get use ntlm authentification.
+     * 
+     * @return boolean
+     */
+    public boolean isUseNtlm()
+    {
+        return this.useNtlm;
+    } //-- boolean isUseNtlm()
+
+    /**
+     * Set the proxy host.
+     * 
+     * @param host
+     */
+    public void setHost( String host )
+    {
+        this.host = host;
+    } //-- void setHost( String )
+
+    /**
+     * Set the ID for this proxy.
+     * 
+     * @param id
+     */
+    public void setId( String id )
+    {
+        this.id = id;
+    } //-- void setId( String )
+
+    /**
+     * Set the proxy password.
+     * 
+     * @param password
+     */
+    public void setPassword( String password )
+    {
+        this.password = password;
+    } //-- void setPassword( String )
+
+    /**
+     * Set the proxy port.
+     * 
+     * @param port
+     */
+    public void setPort( int port )
+    {
+        this.port = port;
+    } //-- void setPort( int )
+
+    /**
+     * Set the network protocol to use with this proxy: "http",
+     * "socks-4".
+     * 
+     * @param protocol
+     */
+    public void setProtocol( String protocol )
+    {
+        this.protocol = protocol;
+    } //-- void setProtocol( String )
+
+    /**
+     * Set use ntlm authentification.
+     * 
+     * @param useNtlm
+     */
+    public void setUseNtlm( boolean useNtlm )
+    {
+        this.useNtlm = useNtlm;
+    } //-- void setUseNtlm( boolean )
+
+    /**
+     * Set the proxy user.
+     * 
+     * @param username
+     */
+    public void setUsername( String username )
+    {
+        this.username = username;
+    } //-- void setUsername( String )
+
+    
+            public int hashCode()
+            {
+                int result = 17;
+                result = 37 * result + ( id != null ? id.hashCode() : 0 );
+                return result;
+            }
+
+            public boolean equals( Object other )
+            {
+                if ( this == other )
+                {
+                    return true;
+                }
+
+                if ( !( other instanceof NetworkProxyConfiguration ) )
+                {
+                    return false;
+                }
+
+                NetworkProxyConfiguration that = (NetworkProxyConfiguration) other;
+                boolean result = true;
+                result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
+                return result;
+            }
+          
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/OrganisationInformation.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/OrganisationInformation.java
new file mode 100644 (file)
index 0000000..5e892ae
--- /dev/null
@@ -0,0 +1,117 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * 
+ *         The organisation information settings.
+ *       
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class OrganisationInformation
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * name of the organisation.
+     */
+    private String name;
+
+    /**
+     * name of the organisation.
+     */
+    private String url;
+
+    /**
+     * name of the organisation.
+     */
+    private String logoLocation;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get name of the organisation.
+     * 
+     * @return String
+     */
+    public String getLogoLocation()
+    {
+        return this.logoLocation;
+    } //-- String getLogoLocation()
+
+    /**
+     * Get name of the organisation.
+     * 
+     * @return String
+     */
+    public String getName()
+    {
+        return this.name;
+    } //-- String getName()
+
+    /**
+     * Get name of the organisation.
+     * 
+     * @return String
+     */
+    public String getUrl()
+    {
+        return this.url;
+    } //-- String getUrl()
+
+    /**
+     * Set name of the organisation.
+     * 
+     * @param logoLocation
+     */
+    public void setLogoLocation( String logoLocation )
+    {
+        this.logoLocation = logoLocation;
+    } //-- void setLogoLocation( String )
+
+    /**
+     * Set name of the organisation.
+     * 
+     * @param name
+     */
+    public void setName( String name )
+    {
+        this.name = name;
+    } //-- void setName( String )
+
+    /**
+     * Set name of the organisation.
+     * 
+     * @param url
+     */
+    public void setUrl( String url )
+    {
+        this.url = url;
+    } //-- void setUrl( String )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ProxyConnectorConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ProxyConnectorConfiguration.java
new file mode 100644 (file)
index 0000000..637808a
--- /dev/null
@@ -0,0 +1,119 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class ProxyConnectorConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class ProxyConnectorConfiguration
+    extends AbstractRepositoryConnectorConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The order of the proxy connectors. (0 means no
+     * order specified)
+     *           .
+     */
+    private int order = 0;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get the order of the proxy connectors. (0 means no order
+     * specified).
+     * 
+     * @return int
+     */
+    public int getOrder()
+    {
+        return this.order;
+    } //-- int getOrder()
+
+    /**
+     * Set the order of the proxy connectors. (0 means no order
+     * specified).
+     * 
+     * @param order
+     */
+    public void setOrder( int order )
+    {
+        this.order = order;
+    } //-- void setOrder( int )
+
+    
+    /**
+     * The order id for UNORDERED
+     */
+    public static final int UNORDERED = 0;
+
+    /**
+     * The policy key {@link #getPolicies()} for error handling.
+     * See {@link org.apache.archiva.policies.DownloadErrorPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_PROPAGATE_ERRORS = "propagate-errors";
+
+    /**
+     * The policy key {@link #getPolicies()} for error handling when an artifact is present.
+     * See {@link org.apache.archiva.policies.DownloadErrorPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_PROPAGATE_ERRORS_ON_UPDATE = "propagate-errors-on-update";
+
+    /**
+     * The policy key {@link #getPolicies()} for snapshot handling.
+     * See {@link org.apache.archiva.policies.SnapshotsPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_SNAPSHOTS = "snapshots";
+
+    /**
+     * The policy key {@link #getPolicies()} for releases handling.
+     * See {@link org.apache.archiva.policies.ReleasesPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_RELEASES = "releases";
+
+    /**
+     * The policy key {@link #getPolicies()} for checksum handling.
+     * See {@link org.apache.archiva.policies.ChecksumPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_CHECKSUM = "checksum";
+
+    /**
+     * The policy key {@link #getPolicies()} for cache-failures handling.
+     * See {@link org.apache.archiva.policies.CachedFailuresPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_CACHE_FAILURES = "cache-failures";
+          
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ProxyConnectorRuleConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/ProxyConnectorRuleConfiguration.java
new file mode 100644 (file)
index 0000000..f555d9a
--- /dev/null
@@ -0,0 +1,146 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class ProxyConnectorRuleConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class ProxyConnectorRuleConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The type if this rule: whiteList, blackList
+     * etc..
+     *           
+     */
+    private String ruleType;
+
+    /**
+     * 
+     *             The pattern for this rule: whiteList, blackList
+     * etc..
+     *           
+     */
+    private String pattern;
+
+    /**
+     * Field proxyConnectors.
+     */
+    private java.util.List<ProxyConnectorConfiguration> proxyConnectors;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addProxyConnector.
+     * 
+     * @param proxyConnectorConfiguration
+     */
+    public void addProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
+    {
+        getProxyConnectors().add( proxyConnectorConfiguration );
+    } //-- void addProxyConnector( ProxyConnectorConfiguration )
+
+    /**
+     * Get the pattern for this rule: whiteList, blackList etc..
+     * 
+     * @return String
+     */
+    public String getPattern()
+    {
+        return this.pattern;
+    } //-- String getPattern()
+
+    /**
+     * Method getProxyConnectors.
+     * 
+     * @return List
+     */
+    public java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
+    {
+        if ( this.proxyConnectors == null )
+        {
+            this.proxyConnectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
+        }
+
+        return this.proxyConnectors;
+    } //-- java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
+
+    /**
+     * Get the type if this rule: whiteList, blackList etc..
+     * 
+     * @return String
+     */
+    public String getRuleType()
+    {
+        return this.ruleType;
+    } //-- String getRuleType()
+
+    /**
+     * Method removeProxyConnector.
+     * 
+     * @param proxyConnectorConfiguration
+     */
+    public void removeProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
+    {
+        getProxyConnectors().remove( proxyConnectorConfiguration );
+    } //-- void removeProxyConnector( ProxyConnectorConfiguration )
+
+    /**
+     * Set the pattern for this rule: whiteList, blackList etc..
+     * 
+     * @param pattern
+     */
+    public void setPattern( String pattern )
+    {
+        this.pattern = pattern;
+    } //-- void setPattern( String )
+
+    /**
+     * Set associated proxyConnectors configuration.
+     * 
+     * @param proxyConnectors
+     */
+    public void setProxyConnectors( java.util.List<ProxyConnectorConfiguration> proxyConnectors )
+    {
+        this.proxyConnectors = proxyConnectors;
+    } //-- void setProxyConnectors( java.util.List )
+
+    /**
+     * Set the type if this rule: whiteList, blackList etc..
+     * 
+     * @param ruleType
+     */
+    public void setRuleType( String ruleType )
+    {
+        this.ruleType = ruleType;
+    } //-- void setRuleType( String )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RedbackRuntimeConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RedbackRuntimeConfiguration.java
new file mode 100644 (file)
index 0000000..10a4d7f
--- /dev/null
@@ -0,0 +1,340 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * 
+ *         The redback runtime configuration.
+ *       
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class RedbackRuntimeConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * flag to know if redback configuration has been
+     * checked/migrated.
+     */
+    private boolean migratedFromRedbackConfiguration = false;
+
+    /**
+     * Field userManagerImpls.
+     */
+    private java.util.List<String> userManagerImpls;
+
+    /**
+     * Field rbacManagerImpls.
+     */
+    private java.util.List<String> rbacManagerImpls;
+
+    /**
+     * the ldap configuration.
+     */
+    private LdapConfiguration ldapConfiguration;
+
+    /**
+     * Field ldapGroupMappings.
+     */
+    private java.util.List<LdapGroupMapping> ldapGroupMappings;
+
+    /**
+     * Field configurationProperties.
+     */
+    private java.util.Map configurationProperties;
+
+    /**
+     * flag to know if redback will use a cache to prevent
+     * searching users already found.
+     */
+    private boolean useUsersCache = true;
+
+    /**
+     * the users cache configuration.
+     */
+    private CacheConfiguration usersCacheConfiguration;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addConfigurationProperty.
+     * 
+     * @param key
+     * @param value
+     */
+    public void addConfigurationProperty( Object key, String value )
+    {
+        getConfigurationProperties().put( key, value );
+    } //-- void addConfigurationProperty( Object, String )
+
+    /**
+     * Method addLdapGroupMapping.
+     * 
+     * @param ldapGroupMapping
+     */
+    public void addLdapGroupMapping( LdapGroupMapping ldapGroupMapping )
+    {
+        getLdapGroupMappings().add( ldapGroupMapping );
+    } //-- void addLdapGroupMapping( LdapGroupMapping )
+
+    /**
+     * Method addRbacManagerImpl.
+     * 
+     * @param string
+     */
+    public void addRbacManagerImpl( String string )
+    {
+        getRbacManagerImpls().add( string );
+    } //-- void addRbacManagerImpl( String )
+
+    /**
+     * Method addUserManagerImpl.
+     * 
+     * @param string
+     */
+    public void addUserManagerImpl( String string )
+    {
+        getUserManagerImpls().add( string );
+    } //-- void addUserManagerImpl( String )
+
+    /**
+     * Method getConfigurationProperties.
+     * 
+     * @return Map
+     */
+    public java.util.Map getConfigurationProperties()
+    {
+        if ( this.configurationProperties == null )
+        {
+            this.configurationProperties = new java.util.HashMap();
+        }
+
+        return this.configurationProperties;
+    } //-- java.util.Map getConfigurationProperties()
+
+    /**
+     * Get the ldap configuration.
+     * 
+     * @return LdapConfiguration
+     */
+    public LdapConfiguration getLdapConfiguration()
+    {
+        return this.ldapConfiguration;
+    } //-- LdapConfiguration getLdapConfiguration()
+
+    /**
+     * Method getLdapGroupMappings.
+     * 
+     * @return List
+     */
+    public java.util.List<LdapGroupMapping> getLdapGroupMappings()
+    {
+        if ( this.ldapGroupMappings == null )
+        {
+            this.ldapGroupMappings = new java.util.ArrayList<LdapGroupMapping>();
+        }
+
+        return this.ldapGroupMappings;
+    } //-- java.util.List<LdapGroupMapping> getLdapGroupMappings()
+
+    /**
+     * Method getRbacManagerImpls.
+     * 
+     * @return List
+     */
+    public java.util.List<String> getRbacManagerImpls()
+    {
+        if ( this.rbacManagerImpls == null )
+        {
+            this.rbacManagerImpls = new java.util.ArrayList<String>();
+        }
+
+        return this.rbacManagerImpls;
+    } //-- java.util.List<String> getRbacManagerImpls()
+
+    /**
+     * Method getUserManagerImpls.
+     * 
+     * @return List
+     */
+    public java.util.List<String> getUserManagerImpls()
+    {
+        if ( this.userManagerImpls == null )
+        {
+            this.userManagerImpls = new java.util.ArrayList<String>();
+        }
+
+        return this.userManagerImpls;
+    } //-- java.util.List<String> getUserManagerImpls()
+
+    /**
+     * Get the users cache configuration.
+     * 
+     * @return CacheConfiguration
+     */
+    public CacheConfiguration getUsersCacheConfiguration()
+    {
+        return this.usersCacheConfiguration;
+    } //-- CacheConfiguration getUsersCacheConfiguration()
+
+    /**
+     * Get flag to know if redback configuration has been
+     * checked/migrated.
+     * 
+     * @return boolean
+     */
+    public boolean isMigratedFromRedbackConfiguration()
+    {
+        return this.migratedFromRedbackConfiguration;
+    } //-- boolean isMigratedFromRedbackConfiguration()
+
+    /**
+     * Get flag to know if redback will use a cache to prevent
+     * searching users already found.
+     * 
+     * @return boolean
+     */
+    public boolean isUseUsersCache()
+    {
+        return this.useUsersCache;
+    } //-- boolean isUseUsersCache()
+
+    /**
+     * Method removeLdapGroupMapping.
+     * 
+     * @param ldapGroupMapping
+     */
+    public void removeLdapGroupMapping( LdapGroupMapping ldapGroupMapping )
+    {
+        getLdapGroupMappings().remove( ldapGroupMapping );
+    } //-- void removeLdapGroupMapping( LdapGroupMapping )
+
+    /**
+     * Method removeRbacManagerImpl.
+     * 
+     * @param string
+     */
+    public void removeRbacManagerImpl( String string )
+    {
+        getRbacManagerImpls().remove( string );
+    } //-- void removeRbacManagerImpl( String )
+
+    /**
+     * Method removeUserManagerImpl.
+     * 
+     * @param string
+     */
+    public void removeUserManagerImpl( String string )
+    {
+        getUserManagerImpls().remove( string );
+    } //-- void removeUserManagerImpl( String )
+
+    /**
+     * Set extra properties for redback configuration.
+     * String/String.
+     * 
+     * @param configurationProperties
+     */
+    public void setConfigurationProperties( java.util.Map configurationProperties )
+    {
+        this.configurationProperties = configurationProperties;
+    } //-- void setConfigurationProperties( java.util.Map )
+
+    /**
+     * Set the ldap configuration.
+     * 
+     * @param ldapConfiguration
+     */
+    public void setLdapConfiguration( LdapConfiguration ldapConfiguration )
+    {
+        this.ldapConfiguration = ldapConfiguration;
+    } //-- void setLdapConfiguration( LdapConfiguration )
+
+    /**
+     * Set ldapGroupMappings.
+     * 
+     * @param ldapGroupMappings
+     */
+    public void setLdapGroupMappings( java.util.List<LdapGroupMapping> ldapGroupMappings )
+    {
+        this.ldapGroupMappings = ldapGroupMappings;
+    } //-- void setLdapGroupMappings( java.util.List )
+
+    /**
+     * Set flag to know if redback configuration has been
+     * checked/migrated.
+     * 
+     * @param migratedFromRedbackConfiguration
+     */
+    public void setMigratedFromRedbackConfiguration( boolean migratedFromRedbackConfiguration )
+    {
+        this.migratedFromRedbackConfiguration = migratedFromRedbackConfiguration;
+    } //-- void setMigratedFromRedbackConfiguration( boolean )
+
+    /**
+     * Set the RBAC Manager impls to use.
+     * 
+     * @param rbacManagerImpls
+     */
+    public void setRbacManagerImpls( java.util.List<String> rbacManagerImpls )
+    {
+        this.rbacManagerImpls = rbacManagerImpls;
+    } //-- void setRbacManagerImpls( java.util.List )
+
+    /**
+     * Set flag to know if redback will use a cache to prevent
+     * searching users already found.
+     * 
+     * @param useUsersCache
+     */
+    public void setUseUsersCache( boolean useUsersCache )
+    {
+        this.useUsersCache = useUsersCache;
+    } //-- void setUseUsersCache( boolean )
+
+    /**
+     * Set the user manager impls to use.
+     * 
+     * @param userManagerImpls
+     */
+    public void setUserManagerImpls( java.util.List<String> userManagerImpls )
+    {
+        this.userManagerImpls = userManagerImpls;
+    } //-- void setUserManagerImpls( java.util.List )
+
+    /**
+     * Set the users cache configuration.
+     * 
+     * @param usersCacheConfiguration
+     */
+    public void setUsersCacheConfiguration( CacheConfiguration usersCacheConfiguration )
+    {
+        this.usersCacheConfiguration = usersCacheConfiguration;
+    } //-- void setUsersCacheConfiguration( CacheConfiguration )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RemoteRepositoryConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RemoteRepositoryConfiguration.java
new file mode 100644 (file)
index 0000000..37ff862
--- /dev/null
@@ -0,0 +1,451 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class RemoteRepositoryConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class RemoteRepositoryConfiguration
+    extends AbstractRepositoryConfiguration
+    implements java.io.Serializable, ConfigurationModel
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The URL for this repository.
+     *           
+     */
+    private String url;
+
+    /**
+     * 
+     *             The Username for this repository.
+     *           
+     */
+    private String username;
+
+    /**
+     * 
+     *             The Password for this repository.
+     *           
+     */
+    private String password;
+
+    /**
+     * 
+     *             Timeout in seconds for connections to this
+     * repository
+     *           .
+     */
+    private int timeout = 60;
+
+    /**
+     * 
+     *             When to run the refresh task.
+     *             Default is every sunday at 8H00.
+     *           
+     */
+    private String refreshCronExpression = "0 0 08 ? * SUN";
+
+    /**
+     * 
+     *             Activate download of remote index if
+     * remoteIndexUrl is set too.
+     *           
+     */
+    private boolean downloadRemoteIndex = false;
+
+    /**
+     * 
+     *             Remote Index Url : if not starting with http
+     * will be relative to the remote repository url.
+     *           
+     */
+    private String remoteIndexUrl;
+
+    /**
+     * 
+     *             Id of the networkProxy to use when downloading
+     * remote index.
+     *           
+     */
+    private String remoteDownloadNetworkProxyId;
+
+    /**
+     * 
+     *             Timeout in seconds for download remote index.
+     * Default is more long than artifact download.
+     *           
+     */
+    private int remoteDownloadTimeout = 300;
+
+    /**
+     * 
+     *             Schedule download of remote index when archiva
+     * start
+     *           .
+     */
+    private boolean downloadRemoteIndexOnStartup = false;
+
+    /**
+     * Field extraParameters.
+     */
+    private java.util.Map extraParameters;
+
+    /**
+     * Field extraHeaders.
+     */
+    private java.util.Map extraHeaders;
+
+    /**
+     * The path to check the repository availability (relative to
+     * the repository URL). Some repositories do not allow
+     * browsing, so a certain artifact must be checked.
+     */
+    private String checkPath;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addExtraHeader.
+     * 
+     * @param key
+     * @param value
+     */
+    public void addExtraHeader( Object key, String value )
+    {
+        getExtraHeaders().put( key, value );
+    } //-- void addExtraHeader( Object, String )
+
+    /**
+     * Method addExtraParameter.
+     * 
+     * @param key
+     * @param value
+     */
+    public void addExtraParameter( Object key, String value )
+    {
+        getExtraParameters().put( key, value );
+    } //-- void addExtraParameter( Object, String )
+
+    /**
+     * Get the path to check the repository availability (relative
+     * to the repository URL). Some repositories do not allow
+     * browsing, so a certain artifact must be checked.
+     * 
+     * @return String
+     */
+    public String getCheckPath()
+    {
+        return this.checkPath;
+    } //-- String getCheckPath()
+
+    /**
+     * Method getExtraHeaders.
+     * 
+     * @return Map
+     */
+    public java.util.Map getExtraHeaders()
+    {
+        if ( this.extraHeaders == null )
+        {
+            this.extraHeaders = new java.util.HashMap();
+        }
+
+        return this.extraHeaders;
+    } //-- java.util.Map getExtraHeaders()
+
+    /**
+     * Method getExtraParameters.
+     * 
+     * @return Map
+     */
+    public java.util.Map getExtraParameters()
+    {
+        if ( this.extraParameters == null )
+        {
+            this.extraParameters = new java.util.HashMap();
+        }
+
+        return this.extraParameters;
+    } //-- java.util.Map getExtraParameters()
+
+    /**
+     * Get the Password for this repository.
+     * 
+     * @return String
+     */
+    public String getPassword()
+    {
+        return this.password;
+    } //-- String getPassword()
+
+    /**
+     * Get when to run the refresh task.
+     *             Default is every sunday at 8H00.
+     * 
+     * @return String
+     */
+    public String getRefreshCronExpression()
+    {
+        return this.refreshCronExpression;
+    } //-- String getRefreshCronExpression()
+
+    /**
+     * Get id of the networkProxy to use when downloading remote
+     * index.
+     * 
+     * @return String
+     */
+    public String getRemoteDownloadNetworkProxyId()
+    {
+        return this.remoteDownloadNetworkProxyId;
+    } //-- String getRemoteDownloadNetworkProxyId()
+
+    /**
+     * Get timeout in seconds for download remote index. Default is
+     * more long than artifact download.
+     * 
+     * @return int
+     */
+    public int getRemoteDownloadTimeout()
+    {
+        return this.remoteDownloadTimeout;
+    } //-- int getRemoteDownloadTimeout()
+
+    /**
+     * Get remote Index Url : if not starting with http will be
+     * relative to the remote repository url.
+     * 
+     * @return String
+     */
+    public String getRemoteIndexUrl()
+    {
+        return this.remoteIndexUrl;
+    } //-- String getRemoteIndexUrl()
+
+    /**
+     * Get timeout in seconds for connections to this repository.
+     * 
+     * @return int
+     */
+    public int getTimeout()
+    {
+        return this.timeout;
+    } //-- int getTimeout()
+
+    /**
+     * Get the URL for this repository.
+     * 
+     * @return String
+     */
+    public String getUrl()
+    {
+        return this.url;
+    } //-- String getUrl()
+
+    /**
+     * Get the Username for this repository.
+     * 
+     * @return String
+     */
+    public String getUsername()
+    {
+        return this.username;
+    } //-- String getUsername()
+
+    /**
+     * Get activate download of remote index if remoteIndexUrl is
+     * set too.
+     * 
+     * @return boolean
+     */
+    public boolean isDownloadRemoteIndex()
+    {
+        return this.downloadRemoteIndex;
+    } //-- boolean isDownloadRemoteIndex()
+
+    /**
+     * Get schedule download of remote index when archiva start.
+     * 
+     * @return boolean
+     */
+    public boolean isDownloadRemoteIndexOnStartup()
+    {
+        return this.downloadRemoteIndexOnStartup;
+    } //-- boolean isDownloadRemoteIndexOnStartup()
+
+    /**
+     * Set the path to check the repository availability (relative
+     * to the repository URL). Some repositories do not allow
+     * browsing, so a certain artifact must be checked.
+     * 
+     * @param checkPath
+     */
+    public void setCheckPath( String checkPath )
+    {
+        this.checkPath = checkPath;
+    } //-- void setCheckPath( String )
+
+    /**
+     * Set activate download of remote index if remoteIndexUrl is
+     * set too.
+     * 
+     * @param downloadRemoteIndex
+     */
+    public void setDownloadRemoteIndex( boolean downloadRemoteIndex )
+    {
+        this.downloadRemoteIndex = downloadRemoteIndex;
+    } //-- void setDownloadRemoteIndex( boolean )
+
+    /**
+     * Set schedule download of remote index when archiva start.
+     * 
+     * @param downloadRemoteIndexOnStartup
+     */
+    public void setDownloadRemoteIndexOnStartup( boolean downloadRemoteIndexOnStartup )
+    {
+        this.downloadRemoteIndexOnStartup = downloadRemoteIndexOnStartup;
+    } //-- void setDownloadRemoteIndexOnStartup( boolean )
+
+    /**
+     * Set additional http headers to add to url when requesting
+     * remote repositories.
+     * 
+     * @param extraHeaders
+     */
+    public void setExtraHeaders( java.util.Map extraHeaders )
+    {
+        this.extraHeaders = extraHeaders;
+    } //-- void setExtraHeaders( java.util.Map )
+
+    /**
+     * Set additionnal request parameters to add to url when
+     * requesting remote repositories.
+     * 
+     * @param extraParameters
+     */
+    public void setExtraParameters( java.util.Map extraParameters )
+    {
+        this.extraParameters = extraParameters;
+    } //-- void setExtraParameters( java.util.Map )
+
+    /**
+     * Set the Password for this repository.
+     * 
+     * @param password
+     */
+    public void setPassword( String password )
+    {
+        this.password = password;
+    } //-- void setPassword( String )
+
+    /**
+     * Set when to run the refresh task.
+     *             Default is every sunday at 8H00.
+     * 
+     * @param refreshCronExpression
+     */
+    public void setRefreshCronExpression( String refreshCronExpression )
+    {
+        this.refreshCronExpression = refreshCronExpression;
+    } //-- void setRefreshCronExpression( String )
+
+    /**
+     * Set id of the networkProxy to use when downloading remote
+     * index.
+     * 
+     * @param remoteDownloadNetworkProxyId
+     */
+    public void setRemoteDownloadNetworkProxyId( String remoteDownloadNetworkProxyId )
+    {
+        this.remoteDownloadNetworkProxyId = remoteDownloadNetworkProxyId;
+    } //-- void setRemoteDownloadNetworkProxyId( String )
+
+    /**
+     * Set timeout in seconds for download remote index. Default is
+     * more long than artifact download.
+     * 
+     * @param remoteDownloadTimeout
+     */
+    public void setRemoteDownloadTimeout( int remoteDownloadTimeout )
+    {
+        this.remoteDownloadTimeout = remoteDownloadTimeout;
+    } //-- void setRemoteDownloadTimeout( int )
+
+    /**
+     * Set remote Index Url : if not starting with http will be
+     * relative to the remote repository url.
+     * 
+     * @param remoteIndexUrl
+     */
+    public void setRemoteIndexUrl( String remoteIndexUrl )
+    {
+        this.remoteIndexUrl = remoteIndexUrl;
+    } //-- void setRemoteIndexUrl( String )
+
+    /**
+     * Set timeout in seconds for connections to this repository.
+     * 
+     * @param timeout
+     */
+    public void setTimeout( int timeout )
+    {
+        this.timeout = timeout;
+    } //-- void setTimeout( int )
+
+    /**
+     * Set the URL for this repository.
+     * 
+     * @param url
+     */
+    public void setUrl( String url )
+    {
+        this.url = url;
+    } //-- void setUrl( String )
+
+    /**
+     * Set the Username for this repository.
+     * 
+     * @param username
+     */
+    public void setUsername( String username )
+    {
+        this.username = username;
+    } //-- void setUsername( String )
+
+    
+            public String toString()
+            {
+                return "RemoteRepositoryConfiguration id:'" + getId() + "',name:'" + getName() +"'";
+            }
+
+
+       
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryCheckPath.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryCheckPath.java
new file mode 100644 (file)
index 0000000..6fcdd0c
--- /dev/null
@@ -0,0 +1,95 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class RepositoryCheckPath.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class RepositoryCheckPath
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * 
+     *             The URL for which this path should be used
+     *           .
+     */
+    private String url;
+
+    /**
+     * 
+     *             The path to use for checking the repository
+     * connection.
+     *           
+     */
+    private String path;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get the path to use for checking the repository connection.
+     * 
+     * @return String
+     */
+    public String getPath()
+    {
+        return this.path;
+    } //-- String getPath()
+
+    /**
+     * Get the URL for which this path should be used.
+     * 
+     * @return String
+     */
+    public String getUrl()
+    {
+        return this.url;
+    } //-- String getUrl()
+
+    /**
+     * Set the path to use for checking the repository connection.
+     * 
+     * @param path
+     */
+    public void setPath( String path )
+    {
+        this.path = path;
+    } //-- void setPath( String )
+
+    /**
+     * Set the URL for which this path should be used.
+     * 
+     * @param url
+     */
+    public void setUrl( String url )
+    {
+        this.url = url;
+    } //-- void setUrl( String )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryGroupConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryGroupConfiguration.java
new file mode 100644 (file)
index 0000000..904a931
--- /dev/null
@@ -0,0 +1,255 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Class RepositoryGroupConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class RepositoryGroupConfiguration extends AbstractRepositoryConfiguration
+    implements Serializable, ConfigurationModel
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * The id of the repository group.
+     */
+    private String id;
+
+    /**
+     * The name of the repository group
+     */
+    private String name;
+
+    /**
+     *
+     *             The repository type. Currently only MAVEN type
+     * is known.
+     *
+     */
+    private String type = "MAVEN";
+
+
+    /**
+     * The path of the merged index.
+     */
+    private String mergedIndexPath = ".indexer";
+
+    /**
+     * The time to live of the merged index of the repository group.
+     */
+    private int mergedIndexTtl = 30;
+
+    /**
+     * 
+     *           When to run the index merging for this group.
+     *
+     */
+    private String cronExpression = "";
+
+    /**
+     * Field repositories.
+     */
+    private List<String> repositories;
+
+    /**
+     * The path for local data
+     */
+    private String location;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+
+    /**
+     * Return the local path for group data. If the merged index property is set to a non absolute path,
+     * it is relative to this location.
+     *
+     * @return the path for group data storage
+     */
+    public String getLocation( )
+    {
+        return location;
+    }
+
+    /**
+     * Set the local path for group data
+     * @param location
+     */
+    public void setLocation( String location )
+    {
+        this.location = location;
+    }
+
+    /**
+     * Method addRepository.
+     * 
+     * @param string
+     */
+    public void addRepository( String string )
+    {
+        getRepositories().add( string );
+    } //-- void addRepository( String )
+
+    /**
+     * Get when to run the index merging for this group.
+     *           No default value.
+     * 
+     * @return String
+     */
+    public String getCronExpression()
+    {
+        return this.cronExpression;
+    } //-- String getCronExpression()
+
+    /**
+     * Get the id of the repository group.
+     * 
+     * @return String
+     */
+    public String getId()
+    {
+        return this.id;
+    } //-- String getId()
+
+    /**
+     * Get the path of the merged index.
+     * 
+     * @return String
+     */
+    public String getMergedIndexPath()
+    {
+        return this.mergedIndexPath;
+    } //-- String getMergedIndexPath()
+
+    /**
+     * Get the time to live of the merged index of the repository
+     * group.
+     * 
+     * @return int
+     */
+    public int getMergedIndexTtl()
+    {
+        return this.mergedIndexTtl;
+    } //-- int getMergedIndexTtl()
+
+    /**
+     * Method getRepositories.
+     * 
+     * @return List
+     */
+    public List<String> getRepositories()
+    {
+        if ( this.repositories == null )
+        {
+            this.repositories = new ArrayList<String>();
+        }
+
+        return this.repositories;
+    } //-- java.util.List<String> getRepositories()
+
+    /**
+     * Method removeRepository.
+     * 
+     * @param string
+     */
+    public void removeRepository( String string )
+    {
+        getRepositories().remove( string );
+    } //-- void removeRepository( String )
+
+    /**
+     * Set when to run the index merging for this group.
+     *           No default value.
+     * 
+     * @param cronExpression
+     */
+    public void setCronExpression( String cronExpression )
+    {
+        this.cronExpression = cronExpression;
+    } //-- void setCronExpression( String )
+
+    /**
+     * Set the id of the repository group.
+     * 
+     * @param id
+     */
+    public void setId( String id )
+    {
+        this.id = id;
+    } //-- void setId( String )
+
+    /**
+     * Set the path of the merged index.
+     * 
+     * @param mergedIndexPath
+     */
+    public void setMergedIndexPath( String mergedIndexPath )
+    {
+        this.mergedIndexPath = mergedIndexPath;
+    } //-- void setMergedIndexPath( String )
+
+    /**
+     * Set the time to live of the merged index of the repository
+     * group.
+     * 
+     * @param mergedIndexTtl
+     */
+    public void setMergedIndexTtl( int mergedIndexTtl )
+    {
+        this.mergedIndexTtl = mergedIndexTtl;
+    } //-- void setMergedIndexTtl( int )
+
+    /**
+     * Set the list of repository ids under the group.
+     * 
+     * @param repositories
+     */
+    public void setRepositories( List<String> repositories )
+    {
+        this.repositories = repositories;
+    } //-- void setRepositories( java.util.List )
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryScanningConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/RepositoryScanningConfiguration.java
new file mode 100644 (file)
index 0000000..02b4d0a
--- /dev/null
@@ -0,0 +1,190 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class RepositoryScanningConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class RepositoryScanningConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field fileTypes.
+     */
+    private java.util.List<FileType> fileTypes;
+
+    /**
+     * Field knownContentConsumers.
+     */
+    private java.util.List<String> knownContentConsumers;
+
+    /**
+     * Field invalidContentConsumers.
+     */
+    private java.util.List<String> invalidContentConsumers;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addFileType.
+     * 
+     * @param fileType
+     */
+    public void addFileType( FileType fileType )
+    {
+        getFileTypes().add( fileType );
+    } //-- void addFileType( FileType )
+
+    /**
+     * Method addInvalidContentConsumer.
+     * 
+     * @param string
+     */
+    public void addInvalidContentConsumer( String string )
+    {
+        getInvalidContentConsumers().add( string );
+    } //-- void addInvalidContentConsumer( String )
+
+    /**
+     * Method addKnownContentConsumer.
+     * 
+     * @param string
+     */
+    public void addKnownContentConsumer( String string )
+    {
+        getKnownContentConsumers().add( string );
+    } //-- void addKnownContentConsumer( String )
+
+    /**
+     * Method getFileTypes.
+     * 
+     * @return List
+     */
+    public java.util.List<FileType> getFileTypes()
+    {
+        if ( this.fileTypes == null )
+        {
+            this.fileTypes = new java.util.ArrayList<FileType>();
+        }
+
+        return this.fileTypes;
+    } //-- java.util.List<FileType> getFileTypes()
+
+    /**
+     * Method getInvalidContentConsumers.
+     * 
+     * @return List
+     */
+    public java.util.List<String> getInvalidContentConsumers()
+    {
+        if ( this.invalidContentConsumers == null )
+        {
+            this.invalidContentConsumers = new java.util.ArrayList<String>();
+        }
+
+        return this.invalidContentConsumers;
+    } //-- java.util.List<String> getInvalidContentConsumers()
+
+    /**
+     * Method getKnownContentConsumers.
+     * 
+     * @return List
+     */
+    public java.util.List<String> getKnownContentConsumers()
+    {
+        if ( this.knownContentConsumers == null )
+        {
+            this.knownContentConsumers = new java.util.ArrayList<String>();
+        }
+
+        return this.knownContentConsumers;
+    } //-- java.util.List<String> getKnownContentConsumers()
+
+    /**
+     * Method removeFileType.
+     * 
+     * @param fileType
+     */
+    public void removeFileType( FileType fileType )
+    {
+        getFileTypes().remove( fileType );
+    } //-- void removeFileType( FileType )
+
+    /**
+     * Method removeInvalidContentConsumer.
+     * 
+     * @param string
+     */
+    public void removeInvalidContentConsumer( String string )
+    {
+        getInvalidContentConsumers().remove( string );
+    } //-- void removeInvalidContentConsumer( String )
+
+    /**
+     * Method removeKnownContentConsumer.
+     * 
+     * @param string
+     */
+    public void removeKnownContentConsumer( String string )
+    {
+        getKnownContentConsumers().remove( string );
+    } //-- void removeKnownContentConsumer( String )
+
+    /**
+     * Set the FileTypes for the repository scanning configuration.
+     * 
+     * @param fileTypes
+     */
+    public void setFileTypes( java.util.List<FileType> fileTypes )
+    {
+        this.fileTypes = fileTypes;
+    } //-- void setFileTypes( java.util.List )
+
+    /**
+     * Set the list of active consumer IDs for invalid content.
+     * 
+     * @param invalidContentConsumers
+     */
+    public void setInvalidContentConsumers( java.util.List<String> invalidContentConsumers )
+    {
+        this.invalidContentConsumers = invalidContentConsumers;
+    } //-- void setInvalidContentConsumers( java.util.List )
+
+    /**
+     * Set the list of active consumers IDs for known content.
+     * 
+     * @param knownContentConsumers
+     */
+    public void setKnownContentConsumers( java.util.List<String> knownContentConsumers )
+    {
+        this.knownContentConsumers = knownContentConsumers;
+    } //-- void setKnownContentConsumers( java.util.List )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/SyncConnectorConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/SyncConnectorConfiguration.java
new file mode 100644 (file)
index 0000000..f92bcbf
--- /dev/null
@@ -0,0 +1,94 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Class SyncConnectorConfiguration.
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class SyncConnectorConfiguration
+    extends AbstractRepositoryConnectorConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * When to run the sync mechanism. Default is every hour on the
+     * hour.
+     */
+    private String cronExpression = "0 0 * * * ?";
+
+    /**
+     * The type of synchronization to use.
+     */
+    private String method = "rsync";
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get when to run the sync mechanism. Default is every hour on
+     * the hour.
+     * 
+     * @return String
+     */
+    public String getCronExpression()
+    {
+        return this.cronExpression;
+    } //-- String getCronExpression()
+
+    /**
+     * Get the type of synchronization to use.
+     * 
+     * @return String
+     */
+    public String getMethod()
+    {
+        return this.method;
+    } //-- String getMethod()
+
+    /**
+     * Set when to run the sync mechanism. Default is every hour on
+     * the hour.
+     * 
+     * @param cronExpression
+     */
+    public void setCronExpression( String cronExpression )
+    {
+        this.cronExpression = cronExpression;
+    } //-- void setCronExpression( String )
+
+    /**
+     * Set the type of synchronization to use.
+     * 
+     * @param method
+     */
+    public void setMethod( String method )
+    {
+        this.method = method;
+    } //-- void setMethod( String )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/UserInterfaceOptions.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/UserInterfaceOptions.java
new file mode 100644 (file)
index 0000000..df740e7
--- /dev/null
@@ -0,0 +1,169 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * 
+ *         The user interface configuration settings.
+ *       
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class UserInterfaceOptions
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * true if find artifacts should be enabled.
+     */
+    private boolean showFindArtifacts = true;
+
+    /**
+     * true if applet behavior for find artifacts should be enabled.
+     */
+    private boolean appletFindEnabled = true;
+
+    /**
+     * Field disableEasterEggs.
+     */
+    private boolean disableEasterEggs = false;
+
+    /**
+     * Field applicationUrl.
+     */
+    private String applicationUrl;
+
+    /**
+     * Field disableRegistration.
+     */
+    private boolean disableRegistration = false;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get the applicationUrl field.
+     * 
+     * @return String
+     */
+    public String getApplicationUrl()
+    {
+        return this.applicationUrl;
+    } //-- String getApplicationUrl()
+
+    /**
+     * Get true if applet behavior for find artifacts should be
+     * enabled.
+     * 
+     * @return boolean
+     */
+    public boolean isAppletFindEnabled()
+    {
+        return this.appletFindEnabled;
+    } //-- boolean isAppletFindEnabled()
+
+    /**
+     * Get the disableEasterEggs field.
+     * 
+     * @return boolean
+     */
+    public boolean isDisableEasterEggs()
+    {
+        return this.disableEasterEggs;
+    } //-- boolean isDisableEasterEggs()
+
+    /**
+     * Get the disableRegistration field.
+     * 
+     * @return boolean
+     */
+    public boolean isDisableRegistration()
+    {
+        return this.disableRegistration;
+    } //-- boolean isDisableRegistration()
+
+    /**
+     * Get true if find artifacts should be enabled.
+     * 
+     * @return boolean
+     */
+    public boolean isShowFindArtifacts()
+    {
+        return this.showFindArtifacts;
+    } //-- boolean isShowFindArtifacts()
+
+    /**
+     * Set true if applet behavior for find artifacts should be
+     * enabled.
+     * 
+     * @param appletFindEnabled
+     */
+    public void setAppletFindEnabled( boolean appletFindEnabled )
+    {
+        this.appletFindEnabled = appletFindEnabled;
+    } //-- void setAppletFindEnabled( boolean )
+
+    /**
+     * Set the applicationUrl field.
+     * 
+     * @param applicationUrl
+     */
+    public void setApplicationUrl( String applicationUrl )
+    {
+        this.applicationUrl = applicationUrl;
+    } //-- void setApplicationUrl( String )
+
+    /**
+     * Set the disableEasterEggs field.
+     * 
+     * @param disableEasterEggs
+     */
+    public void setDisableEasterEggs( boolean disableEasterEggs )
+    {
+        this.disableEasterEggs = disableEasterEggs;
+    } //-- void setDisableEasterEggs( boolean )
+
+    /**
+     * Set the disableRegistration field.
+     * 
+     * @param disableRegistration
+     */
+    public void setDisableRegistration( boolean disableRegistration )
+    {
+        this.disableRegistration = disableRegistration;
+    } //-- void setDisableRegistration( boolean )
+
+    /**
+     * Set true if find artifacts should be enabled.
+     * 
+     * @param showFindArtifacts
+     */
+    public void setShowFindArtifacts( boolean showFindArtifacts )
+    {
+        this.showFindArtifacts = showFindArtifacts;
+    } //-- void setShowFindArtifacts( boolean )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/WebappConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/WebappConfiguration.java
new file mode 100644 (file)
index 0000000..372cf00
--- /dev/null
@@ -0,0 +1,67 @@
+package org.apache.archiva.configuration.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * 
+ *         The webapp configuration settings.
+ *       
+ * 
+ * @version $Revision$ $Date$
+ */
+@SuppressWarnings( "all" )
+public class WebappConfiguration
+    implements java.io.Serializable
+{
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * options for altering the ui presentation.
+     */
+    private UserInterfaceOptions ui;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Get options for altering the ui presentation.
+     * 
+     * @return UserInterfaceOptions
+     */
+    public UserInterfaceOptions getUi()
+    {
+        return this.ui;
+    } //-- UserInterfaceOptions getUi()
+
+    /**
+     * Set options for altering the ui presentation.
+     * 
+     * @param ui
+     */
+    public void setUi( UserInterfaceOptions ui )
+    {
+        this.ui = ui;
+    } //-- void setUi( UserInterfaceOptions )
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/FiletypeSelectionPredicate.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/FiletypeSelectionPredicate.java
new file mode 100644 (file)
index 0000000..7bb422c
--- /dev/null
@@ -0,0 +1,54 @@
+package org.apache.archiva.configuration.model.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.commons.collections4.Predicate;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * FiletypeSelectionPredicate
+ *
+ *
+ */
+public class FiletypeSelectionPredicate
+    implements Predicate
+{
+    private String filetypeId;
+
+    public FiletypeSelectionPredicate( String id )
+    {
+        this.filetypeId = id;
+    }
+
+    @Override
+    public boolean evaluate( Object object )
+    {
+        boolean satisfies = false;
+
+        if ( object instanceof FileType )
+        {
+            FileType filetype = (FileType) object;
+            return ( StringUtils.equals( filetypeId, filetype.getId() ) );
+        }
+
+        return satisfies;
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/FiletypeToMapClosure.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/FiletypeToMapClosure.java
new file mode 100644 (file)
index 0000000..5b2f132
--- /dev/null
@@ -0,0 +1,51 @@
+package org.apache.archiva.configuration.model.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.commons.collections4.Closure;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * FiletypeToMapClosure
+ *
+ *
+ */
+public class FiletypeToMapClosure
+    implements Closure
+{
+    private Map<String, FileType> map = new HashMap<>();
+
+    @Override
+    public void execute( Object input )
+    {
+        if ( input instanceof FileType )
+        {
+            FileType filetype = (FileType) input;
+            map.put( filetype.getId(), filetype );
+        }
+    }
+
+    public Map<String, FileType> getMap()
+    {
+        return map;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/NetworkProxyComparator.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/NetworkProxyComparator.java
new file mode 100644 (file)
index 0000000..ae8f96b
--- /dev/null
@@ -0,0 +1,55 @@
+package org.apache.archiva.configuration.model.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+
+import java.util.Comparator;
+
+/**
+ * NetworkProxyComparator
+ *
+ *
+ */
+public class NetworkProxyComparator
+    implements Comparator<NetworkProxyConfiguration>
+{
+    @Override
+    public int compare( NetworkProxyConfiguration o1, NetworkProxyConfiguration o2 )
+    {
+        if ( o1 == null && o2 == null )
+        {
+            return 0;
+        }
+
+        if ( o1 == null && o2 != null )
+        {
+            return 1;
+        }
+
+        if ( o1 != null && o2 == null )
+        {
+            return -1;
+        }
+
+        String id1 = o1.getId();
+        String id2 = o2.getId();
+        return id1.compareToIgnoreCase( id2 );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/NetworkProxySelectionPredicate.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/NetworkProxySelectionPredicate.java
new file mode 100644 (file)
index 0000000..b3534f2
--- /dev/null
@@ -0,0 +1,53 @@
+package org.apache.archiva.configuration.model.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.commons.collections4.Predicate;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * NetworkProxySelectionPredicate
+ *
+ *
+ */
+public class NetworkProxySelectionPredicate
+    implements Predicate
+{
+    private String proxyId;
+
+    public NetworkProxySelectionPredicate( String id )
+    {
+        this.proxyId = id;
+    }
+
+    @Override
+    public boolean evaluate( Object object )
+    {
+        boolean satisfies = false;
+
+        if ( object instanceof NetworkProxyConfiguration )
+        {
+            NetworkProxyConfiguration proxy = (NetworkProxyConfiguration) object;
+            return ( StringUtils.equals( proxyId, proxy.getId() ) );
+        }
+
+        return satisfies;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/ProxyConnectorConfigurationOrderComparator.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/ProxyConnectorConfigurationOrderComparator.java
new file mode 100644 (file)
index 0000000..28d2460
--- /dev/null
@@ -0,0 +1,73 @@
+package org.apache.archiva.configuration.model.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+
+import java.util.Comparator;
+
+/**
+ *
+ * Was marked as deprecated before, but is still used.
+ *
+ */
+public class ProxyConnectorConfigurationOrderComparator
+    implements Comparator<ProxyConnectorConfiguration>
+{
+    private static ProxyConnectorConfigurationOrderComparator INSTANCE =
+        new ProxyConnectorConfigurationOrderComparator();
+
+    @Override
+    public int compare( ProxyConnectorConfiguration o1, ProxyConnectorConfiguration o2 )
+    {
+        if ( o1 == null && o2 == null )
+        {
+            return 0;
+        }
+
+        // Ensure null goes to end of list.
+        if ( o1 == null && o2 != null )
+        {
+            return 1;
+        }
+
+        if ( o1 != null && o2 == null )
+        {
+            return -1;
+        }
+
+        // Ensure 0 (unordered) goes to end of list.
+        if ( o1.getOrder() == 0 && o2.getOrder() != 0 )
+        {
+            return 1;
+        }
+
+        if ( o1.getOrder() != 0 && o2.getOrder() == 0 )
+        {
+            return -1;
+        }
+
+        return o1.getOrder() - o2.getOrder();
+    }
+
+    public static ProxyConnectorConfigurationOrderComparator getInstance()
+    {
+        return INSTANCE;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/ProxyConnectorSelectionPredicate.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/ProxyConnectorSelectionPredicate.java
new file mode 100644 (file)
index 0000000..99a723f
--- /dev/null
@@ -0,0 +1,58 @@
+package org.apache.archiva.configuration.model.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.commons.collections4.Predicate;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * ProxyConnectorPredicate
+ *
+ *
+ */
+public class ProxyConnectorSelectionPredicate
+    implements Predicate<ProxyConnectorConfiguration>
+{
+    private String sourceId;
+
+    private String targetId;
+
+    public ProxyConnectorSelectionPredicate( String sourceId, String targetId )
+    {
+        this.sourceId = sourceId;
+        this.targetId = targetId;
+    }
+
+    @Override
+    public boolean evaluate( ProxyConnectorConfiguration object )
+    {
+        boolean satisfies = false;
+
+        if ( object != null )
+        {
+            ProxyConnectorConfiguration connector = object;
+            return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
+                                                                                                        connector.getTargetRepoId() ) );
+        }
+
+        return satisfies;
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/RepositoryConfigurationComparator.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-model/src/main/java/org/apache/archiva/configuration/model/functors/RepositoryConfigurationComparator.java
new file mode 100644 (file)
index 0000000..0af59d7
--- /dev/null
@@ -0,0 +1,53 @@
+package org.apache.archiva.configuration.model.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+
+import java.util.Comparator;
+
+/**
+ * RepositoryConfigurationComparator
+ *
+ *
+ */
+public class RepositoryConfigurationComparator
+    implements Comparator<AbstractRepositoryConfiguration>
+{
+    @Override
+    public int compare( AbstractRepositoryConfiguration o1, AbstractRepositoryConfiguration o2 )
+    {
+        if ( o1 == null && o2 == null )
+        {
+            return 0;
+        }
+
+        if ( o1 == null )
+        {
+            return -1;
+        }
+
+        if ( o2 == null )
+        {
+            return 1;
+        }
+
+        return o1.getId().compareToIgnoreCase( o2.getId() );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/pom.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/pom.xml
new file mode 100644 (file)
index 0000000..5404763
--- /dev/null
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>archiva-configuration</artifactId>
+    <groupId>org.apache.archiva.configuration</groupId>
+    <version>3.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>archiva-configuration-provider</artifactId>
+  <name>Archiva Base :: Configuration :: Provider</name>
+
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-model</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-policies</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva.components.registry</groupId>
+      <artifactId>archiva-components-spring-registry-api</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework</groupId>
+          <artifactId>spring-test</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva.components.registry</groupId>
+      <artifactId>archiva-components-spring-registry-commons</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework</groupId>
+          <artifactId>spring-test</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva.components</groupId>
+      <artifactId>archiva-components-expression-evaluator</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>jakarta.annotation</groupId>
+      <artifactId>jakarta.annotation-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>jakarta.inject</groupId>
+      <artifactId>jakarta.inject-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-configuration2</artifactId>
+      <scope>runtime</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+    </dependency>
+
+
+    <!-- Test scope -->
+
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-test-utils</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-jcl</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <systemPropertyVariables>
+            <basedir>${basedir}</basedir>
+          </systemPropertyVariables>
+          <trimStackTrace>false</trimStackTrace>
+        </configuration>
+      </plugin>
+    </plugins>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.rat</groupId>
+          <artifactId>apache-rat-plugin</artifactId>
+          <configuration>
+            <excludes>
+              <exclude>src/main/resources/org/apache/archiva/configuration/default-archiva.xml</exclude>
+              <exclude>src/test/conf/maven-proxy-complete.conf</exclude>
+              <exclude>src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml</exclude>
+              <exclude>nbactions.xml</exclude>
+            </excludes>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ArchivaConfiguration.java
new file mode 100644 (file)
index 0000000..b71d26b
--- /dev/null
@@ -0,0 +1,149 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.components.registry.Registry;
+import org.apache.archiva.components.registry.RegistryException;
+import org.apache.archiva.components.registry.RegistryListener;
+import org.apache.archiva.configuration.model.Configuration;
+
+import java.nio.file.Path;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Configuration holder for the model read from the registry.
+ */
+public interface ArchivaConfiguration
+{
+
+
+    String USER_CONFIG_PROPERTY = "archiva.user.configFileName";
+    String USER_CONFIG_ENVVAR = "ARCHIVA_USER_CONFIG_FILE";
+
+    /**
+     * Get the configuration.
+     *
+     * @return the configuration
+     */
+    Configuration getConfiguration();
+
+    /**
+     * Save any updated configuration.
+     *
+     * @param configuration the configuration to save
+     * @throws org.apache.archiva.components.registry.RegistryException
+     *          if there is a problem saving the registry data
+     * @throws IndeterminateConfigurationException
+     *          if the configuration cannot be saved because it was read from two sources
+     */
+    void save( Configuration configuration )
+        throws RegistryException, IndeterminateConfigurationException;
+
+    /**
+     * Save any updated configuration. This method allows to add a tag to the thrown event.
+     * This allows to verify the origin if the caller is the same as the listener.
+     *
+     * @param configuration the configuration to save
+     * @param eventTag the tag to add to the thrown event
+     * @throws org.apache.archiva.components.registry.RegistryException
+     *          if there is a problem saving the registry data
+     * @throws IndeterminateConfigurationException
+     *          if the configuration cannot be saved because it was read from two sources
+     */
+    void save( Configuration configuration, String eventTag )
+        throws RegistryException, IndeterminateConfigurationException;
+
+    /**
+     * Determines if the configuration in use was as a result of a defaulted configuration.
+     *
+     * @return true if the configuration was created from the default-archiva.xml as opposed
+     *         to being loaded from the usual locations of ${user.home}/.m2/archiva.xml or
+     *         ${appserver.base}/conf/archiva.xml
+     */
+    boolean isDefaulted();
+
+    /**
+     * Add a configuration listener to notify of changes to the configuration.
+     *
+     * @param listener the listener
+     */
+    void addListener( ConfigurationListener listener );
+
+    /**
+     * Remove a configuration listener to stop notifications of changes to the configuration.
+     *
+     * @param listener the listener
+     */
+    void removeListener( ConfigurationListener listener );
+
+    /**
+     * Add a registry listener to notify of events in spring-registry.
+     *
+     * @param listener the listener
+     *                 TODO: Remove in future.
+     */
+    void addChangeListener( RegistryListener listener );
+
+    void removeChangeListener( RegistryListener listener );
+
+    /**
+     * reload configuration from file included registry
+     *
+     * @since 1.4-M1
+     */
+    void reload();
+
+    public Locale getDefaultLocale();
+
+    public List<Locale.LanguageRange> getLanguagePriorities();
+
+    public Path getAppServerBaseDir();
+
+    /**
+     * Returns the base directory for repositories that have a relative location path set.
+     * @return
+     */
+    public Path getRepositoryBaseDir();
+
+    /**
+     * Returns the base directory for remote repositories
+     * @return
+     */
+    public Path getRemoteRepositoryBaseDir();
+
+    /**
+     * Returns the base directory for repository group files.
+     * @return
+     */
+    public Path getRepositoryGroupBaseDir();
+
+    /**
+     * Returns the data directory where repositories and metadata reside
+     * @return
+     */
+    public Path getDataDirectory();
+
+    /**
+     * Return the used configuration registry
+     * @return
+     */
+    Registry getRegistry( );
+}
+
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationEvent.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationEvent.java
new file mode 100644 (file)
index 0000000..5ad758c
--- /dev/null
@@ -0,0 +1,81 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * ConfigurationEvent
+ *
+ *
+ */
+public class ConfigurationEvent
+{
+    public static final int SAVED = 1;
+
+    public static final int CHANGED = 2;
+
+    private int type;
+
+    private String tag;
+
+    public ConfigurationEvent( int type )
+    {
+        this.type = type;
+        tag = "";
+    }
+
+    public ConfigurationEvent(int type, String tag) {
+        this.type = type;
+        this.tag = tag;
+    }
+
+    public int getType()
+    {
+        return type;
+    }
+
+    public String getTag( )
+    {
+        return tag;
+    }
+
+    public void setTag( String tag )
+    {
+        this.tag = tag;
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o ) return true;
+        if ( o == null || getClass( ) != o.getClass( ) ) return false;
+
+        ConfigurationEvent that = (ConfigurationEvent) o;
+
+        if ( type != that.type ) return false;
+        return tag.equals( that.tag );
+    }
+
+    @Override
+    public int hashCode( )
+    {
+        int result = type;
+        result = 31 * result + tag.hashCode( );
+        return result;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationListener.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationListener.java
new file mode 100644 (file)
index 0000000..370c61c
--- /dev/null
@@ -0,0 +1,32 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * ConfigurationListener
+ *
+ *
+ */
+public interface ConfigurationListener
+{
+    /**
+     * Generic event point to notify components that something has happend in the configuration.
+     */
+    void configurationEvent( ConfigurationEvent event );
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationRuntimeException.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/ConfigurationRuntimeException.java
new file mode 100644 (file)
index 0000000..abf2b70
--- /dev/null
@@ -0,0 +1,31 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Unrecoverable exception in the configuration mechanism that is the result of a programming error.
+ */
+public class ConfigurationRuntimeException
+    extends RuntimeException
+{
+    public ConfigurationRuntimeException( String msg, Throwable cause )
+    {
+        super( msg, cause );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/DefaultArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/DefaultArchivaConfiguration.java
new file mode 100644 (file)
index 0000000..88efcf9
--- /dev/null
@@ -0,0 +1,908 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.components.evaluator.DefaultExpressionEvaluator;
+import org.apache.archiva.components.evaluator.EvaluatorException;
+import org.apache.archiva.components.evaluator.ExpressionEvaluator;
+import org.apache.archiva.components.evaluator.sources.SystemPropertyExpressionSource;
+import org.apache.archiva.components.registry.Registry;
+import org.apache.archiva.components.registry.RegistryException;
+import org.apache.archiva.components.registry.RegistryListener;
+import org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryCheckPath;
+import org.apache.archiva.configuration.model.functors.ProxyConnectorConfigurationOrderComparator;
+import org.apache.archiva.configuration.provider.io.registry.ConfigurationRegistryReader;
+import org.apache.archiva.configuration.provider.io.registry.ConfigurationRegistryWriter;
+import org.apache.archiva.policies.AbstractUpdatePolicy;
+import org.apache.archiva.policies.CachedFailuresPolicy;
+import org.apache.archiva.policies.ChecksumPolicy;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.ListUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.InvalidPathException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * <p>
+ * Implementation of configuration holder that retrieves it from the registry.
+ * </p>
+ * <p>
+ * The registry layers and merges the 2 configuration files: user, and application server.
+ * </p>
+ * <p>
+ * Instead of relying on the model defaults, if the registry is empty a default configuration file is loaded and
+ * applied from a resource. The defaults are not loaded into the registry as the lists (eg repositories) could no longer
+ * be removed if that was the case.
+ * </p>
+ * <p>
+ * When saving the configuration, it is saved to the location it was read from. If it was read from the defaults, it
+ * will be saved to the user location.
+ * However, if the configuration contains information from both sources, an exception is raised as this is currently
+ * unsupported. The reason for this is that it is not possible to identify where to re-save elements, and can result
+ * in list configurations (eg repositories) becoming inconsistent.
+ * </p>
+ * <p>
+ * If the configuration is outdated, it will be upgraded when it is loaded. This is done by checking the version flag
+ * before reading it from the registry.
+ * <p>
+ * FIXME: The synchronization must be improved, the current impl may lead to inconsistent data or multiple getConfiguration() calls (martin_s@apache.org)
+ * </p>
+ */
+@Service("archivaConfiguration#default")
+public class DefaultArchivaConfiguration
+        implements ArchivaConfiguration, RegistryListener {
+    private final Logger log = LoggerFactory.getLogger(DefaultArchivaConfiguration.class);
+
+    private static String FILE_ENCODING = "UTF-8";
+
+    /**
+     * Plexus registry to read the configuration from.
+     */
+    @Inject
+    @Named(value = "commons-configuration")
+    private Registry registry;
+
+    /**
+     * The configuration that has been converted.
+     */
+    private Configuration configuration;
+
+    /**
+     * see #initialize
+     * default-value="${user.home}/.m2/archiva.xml"
+     */
+    private String userConfigFilename = "${user.home}/.m2/archiva.xml";
+
+    /**
+     * see #initialize
+     * default-value="${appserver.base}/conf/archiva.xml"
+     */
+    private String altConfigFilename = "${appserver.base}/conf/archiva.xml";
+
+    /**
+     * Configuration Listeners we've registered.
+     */
+    private Set<ConfigurationListener> listeners = new HashSet<>();
+
+    /**
+     * Registry Listeners we've registered.
+     */
+    private Set<RegistryListener> registryListeners = new HashSet<>();
+
+    /**
+     * Boolean to help determine if the configuration exists as a result of pulling in
+     * the default-archiva.xml
+     */
+    private boolean isConfigurationDefaulted = false;
+
+    private static final String KEY = "org.apache.archiva";
+
+    // Section used for default only configuration
+    private static final String KEY_DEFAULT_ONLY = "org.apache.archiva_default";
+
+    private Locale defaultLocale = Locale.getDefault();
+
+    private List<Locale.LanguageRange> languagePriorities = new ArrayList<>();
+
+    private volatile Path dataDirectory;
+    private volatile Path repositoryBaseDirectory;
+    private volatile Path remoteRepositoryBaseDirectory;
+    private volatile Path repositoryGroupBaseDirectory;
+
+    @PostConstruct
+    private void init() {
+        languagePriorities = Locale.LanguageRange.parse("en,fr,de");
+    }
+
+
+    @Override
+    public Configuration getConfiguration() {
+        return loadConfiguration();
+    }
+
+    private synchronized Configuration loadConfiguration() {
+        if (configuration == null) {
+            configuration = load();
+            configuration = unescapeExpressions(configuration);
+            if (isConfigurationDefaulted) {
+                configuration = checkRepositoryLocations(configuration);
+            }
+        }
+
+        return configuration;
+    }
+
+    private boolean hasConfigVersionChanged(Configuration current, Registry defaultOnlyConfiguration) {
+        return current == null || current.getVersion() == null ||
+                !current.getVersion().trim().equals(defaultOnlyConfiguration.getString("version", "").trim());
+    }
+
+    @SuppressWarnings("unchecked")
+    private Configuration load() {
+        // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties)
+        Registry subset = registry.getSubset(KEY);
+        if (subset.getString("version") == null) {
+            if (subset.getSubset("repositoryScanning").isEmpty()) {
+                // only for empty
+                subset = readDefaultConfiguration();
+            } else {
+                throw new RuntimeException("No version tag found in configuration. Archiva configuration version 1.x is not longer supported.");
+            }
+        }
+
+        Configuration config = new ConfigurationRegistryReader().read(subset);
+
+        // Resolving data and repositories directories
+        // If the config entries are absolute, the path is used as it is
+        // if the config entries are empty, they are resolved:
+        //   dataDirectory = ${appserver.base}/data
+        //   repositoryDirectory = ${dataDirectory}/repositories
+        // If the entries are relative they are resolved
+        //   relative to the appserver.base, for dataDirectory
+        //   relative to dataDirectory for repositoryBase
+        String dataDir = config.getArchivaRuntimeConfiguration().getDataDirectory();
+        if (StringUtils.isEmpty(dataDir)) {
+            dataDirectory = getAppServerBaseDir().resolve("data");
+        } else {
+            Path tmpDataDir = Paths.get(dataDir);
+            if (tmpDataDir.isAbsolute()) {
+                dataDirectory = tmpDataDir;
+            } else {
+                dataDirectory = getAppServerBaseDir().resolve(tmpDataDir);
+            }
+        }
+        config.getArchivaRuntimeConfiguration().setDataDirectory(dataDirectory.normalize().toString());
+        String repoBaseDir = config.getArchivaRuntimeConfiguration().getRepositoryBaseDirectory();
+        if (StringUtils.isEmpty(repoBaseDir)) {
+            repositoryBaseDirectory = dataDirectory.resolve("repositories");
+
+        } else {
+            Path tmpRepoBaseDir = Paths.get(repoBaseDir);
+            if (tmpRepoBaseDir.isAbsolute()) {
+                repositoryBaseDirectory = tmpRepoBaseDir;
+            } else {
+                dataDirectory.resolve(tmpRepoBaseDir);
+            }
+        }
+
+        String remoteRepoBaseDir = config.getArchivaRuntimeConfiguration().getRemoteRepositoryBaseDirectory();
+        if (StringUtils.isEmpty(remoteRepoBaseDir)) {
+            remoteRepositoryBaseDirectory = dataDirectory.resolve("remotes");
+        } else {
+            Path tmpRemoteRepoDir = Paths.get(remoteRepoBaseDir);
+            if (tmpRemoteRepoDir.isAbsolute()) {
+                remoteRepositoryBaseDirectory = tmpRemoteRepoDir;
+            } else {
+                dataDirectory.resolve(tmpRemoteRepoDir);
+            }
+        }
+
+        String repositoryGroupBaseDir = config.getArchivaRuntimeConfiguration().getRepositoryGroupBaseDirectory();
+        if (StringUtils.isEmpty(repositoryGroupBaseDir)) {
+            repositoryGroupBaseDirectory = dataDirectory.resolve("groups");
+        } else {
+            Path tmpGroupDir = Paths.get(repositoryGroupBaseDir);
+            if (tmpGroupDir.isAbsolute()) {
+                repositoryGroupBaseDirectory = tmpGroupDir;
+            } else {
+                dataDirectory.resolve(tmpGroupDir);
+            }
+        }
+
+
+        config.getRepositoryGroups();
+        config.getRepositoryGroupsAsMap();
+        if (!CollectionUtils.isEmpty(config.getRemoteRepositories())) {
+            List<RemoteRepositoryConfiguration> remoteRepos = config.getRemoteRepositories();
+            for (RemoteRepositoryConfiguration repo : remoteRepos) {
+                // [MRM-582] Remote Repositories with empty <username> and <password> fields shouldn't be created in configuration.
+                if (StringUtils.isBlank(repo.getUsername())) {
+                    repo.setUsername(null);
+                }
+
+                if (StringUtils.isBlank(repo.getPassword())) {
+                    repo.setPassword(null);
+                }
+            }
+        }
+
+        if (!config.getProxyConnectors().isEmpty()) {
+            // Fix Proxy Connector Settings.
+
+            // Create a copy of the list to read from (to prevent concurrent modification exceptions)
+            List<ProxyConnectorConfiguration> proxyConnectorList = new ArrayList<>(config.getProxyConnectors());
+            // Remove the old connector list.
+            config.getProxyConnectors().clear();
+
+            for (ProxyConnectorConfiguration connector : proxyConnectorList) {
+                // Fix policies
+                boolean connectorValid = true;
+
+                Map<String, String> policies = new HashMap<>();
+                // Make copy of policies
+                policies.putAll(connector.getPolicies());
+                // Clear out policies
+                connector.getPolicies().clear();
+
+                // Work thru policies. cleaning them up.
+                for (Entry<String, String> entry : policies.entrySet()) {
+                    String policyId = entry.getKey();
+                    String setting = entry.getValue();
+
+                    // Upgrade old policy settings.
+                    if ("releases".equals(policyId) || "snapshots".equals(policyId)) {
+                        if ("ignored".equals(setting)) {
+                            setting = AbstractUpdatePolicy.ALWAYS.getId();
+                        } else if ("disabled".equals(setting)) {
+                            setting = AbstractUpdatePolicy.NEVER.getId();
+                        }
+                    } else if ("cache-failures".equals(policyId)) {
+                        if ("ignored".equals(setting)) {
+                            setting = CachedFailuresPolicy.NO.getId();
+                        } else if ("cached".equals(setting)) {
+                            setting = CachedFailuresPolicy.YES.getId();
+                        }
+                    } else if ("checksum".equals(policyId)) {
+                        if ("ignored".equals(setting)) {
+                            setting = ChecksumPolicy.IGNORE.getId();
+                        }
+                    }
+
+                    // Validate existance of policy key.
+                    connector.addPolicy(policyId, setting);
+                }
+
+                if (connectorValid) {
+                    config.addProxyConnector(connector);
+                }
+            }
+
+            // Normalize the order fields in the proxy connectors.
+            Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap =
+                    config.getProxyConnectorAsMap();
+
+            for (List<ProxyConnectorConfiguration> connectors : proxyConnectorMap.values()) {
+                // Sort connectors by order field.
+                Collections.sort(connectors, ProxyConnectorConfigurationOrderComparator.getInstance());
+
+                // Normalize the order field values.
+                int order = 1;
+                for (ProxyConnectorConfiguration connector : connectors) {
+                    connector.setOrder(order++);
+                }
+            }
+        }
+
+        this.defaultLocale = Locale.forLanguageTag(config.getArchivaRuntimeConfiguration().getDefaultLanguage());
+        this.languagePriorities = Locale.LanguageRange.parse(config.getArchivaRuntimeConfiguration().getLanguageRange());
+        return config;
+    }
+
+    /*
+     * Updates the checkpath list for repositories.
+     *
+     * We are replacing existing ones and adding new ones. This allows to update the list with new releases.
+     *
+     * We are also updating existing remote repositories, if they exist already.
+     *
+     * This update method should only be called, if the config version changes to avoid overwriting
+     * user repository settings all the time.
+     */
+    private void updateCheckPathDefaults(Configuration config, Registry defaultConfiguration) {
+        List<RepositoryCheckPath> existingCheckPathList = config.getArchivaDefaultConfiguration().getDefaultCheckPaths();
+        HashMap<String, RepositoryCheckPath> existingCheckPaths = new HashMap<>();
+        HashMap<String, RepositoryCheckPath> newCheckPaths = new HashMap<>();
+        for (RepositoryCheckPath path : config.getArchivaDefaultConfiguration().getDefaultCheckPaths()) {
+            existingCheckPaths.put(path.getUrl(), path);
+        }
+        List defaultCheckPathsSubsets = defaultConfiguration.getSubsetList("archivaDefaultConfiguration.defaultCheckPaths.defaultCheckPath");
+        for (Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); ) {
+            RepositoryCheckPath v = readRepositoryCheckPath((Registry) i.next());
+            if (existingCheckPaths.containsKey(v.getUrl())) {
+                existingCheckPathList.remove(existingCheckPaths.get(v.getUrl()));
+            }
+            existingCheckPathList.add(v);
+            newCheckPaths.put(v.getUrl(), v);
+        }
+        // Remote repositories update
+        for (RemoteRepositoryConfiguration remoteRepositoryConfiguration : config.getRemoteRepositories()) {
+            String url = remoteRepositoryConfiguration.getUrl().toLowerCase();
+            if (newCheckPaths.containsKey(url)) {
+                String currentPath = remoteRepositoryConfiguration.getCheckPath();
+                String newPath = newCheckPaths.get(url).getPath();
+                log.info("Updating connection check path for repository {}, from '{}' to '{}'.", remoteRepositoryConfiguration.getId(),
+                        currentPath, newPath);
+                remoteRepositoryConfiguration.setCheckPath(newPath);
+            }
+        }
+    }
+
+    private RepositoryCheckPath readRepositoryCheckPath(Registry registry) {
+        RepositoryCheckPath value = new RepositoryCheckPath();
+
+        String url = registry.getString("url", value.getUrl());
+
+        value.setUrl(url);
+        String path = registry.getString("path", value.getPath());
+        value.setPath(path);
+        return value;
+    }
+
+
+    private Registry readDefaultConfiguration() {
+        // if it contains some old configuration, remove it (Archiva 0.9)
+        registry.removeSubset(KEY);
+
+        try {
+            registry.addConfigurationFromResource("org/apache/archiva/configuration/default-archiva.xml", KEY);
+            this.isConfigurationDefaulted = true;
+        } catch (RegistryException e) {
+            throw new ConfigurationRuntimeException(
+                    "Fatal error: Unable to find the built-in default configuration and load it into the registry", e);
+        }
+        return registry.getSubset(KEY);
+    }
+
+    /*
+     * Reads the default only configuration into a special prefix. This allows to check for changes
+     * of the default configuration.
+     */
+    private Registry readDefaultOnlyConfiguration() {
+        registry.removeSubset(KEY_DEFAULT_ONLY);
+        try {
+            registry.addConfigurationFromResource("org/apache/archiva/configuration/default-archiva.xml", KEY_DEFAULT_ONLY);
+        } catch (RegistryException e) {
+            throw new ConfigurationRuntimeException(
+                    "Fatal error: Unable to find the built-in default configuration and load it into the registry", e);
+        }
+        return registry.getSubset(KEY_DEFAULT_ONLY);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public synchronized void save(Configuration configuration) throws IndeterminateConfigurationException, RegistryException
+    {
+        save( configuration, "" );
+    }
+
+    /**
+     * Saves the configuration and adds the given tag to the event.
+     * @param configuration the configuration to save
+     * @param eventTag the tag to add to the configuration saved event
+     * @throws IndeterminateConfigurationException if the
+     * @throws RegistryException
+     */
+    @Override
+    public synchronized void save(Configuration configuration, String eventTag)
+            throws IndeterminateConfigurationException, RegistryException {
+        Registry section = registry.getSection(KEY + ".user");
+        Registry baseSection = registry.getSection(KEY + ".base");
+        if (section == null) {
+            section = baseSection;
+            if (section == null) {
+                section = createDefaultConfigurationFile(eventTag);
+            }
+        } else if (baseSection != null) {
+            Collection<String> keys = baseSection.getKeys();
+            boolean foundList = false;
+            for (Iterator<String> i = keys.iterator(); i.hasNext() && !foundList; ) {
+                String key = i.next();
+
+                // a little aggressive with the repositoryScanning and databaseScanning - should be no need to split
+                // that configuration
+                if (key.startsWith("repositories") //
+                        || key.startsWith("proxyConnectors") //
+                        || key.startsWith("networkProxies") //
+                        || key.startsWith("repositoryScanning") //
+                        || key.startsWith("remoteRepositories") //
+                        || key.startsWith("managedRepositories") //
+                        || key.startsWith("repositoryGroups")) //
+                {
+                    foundList = true;
+                }
+            }
+
+            if (foundList) {
+                this.configuration = null;
+
+                throw new IndeterminateConfigurationException(
+                        "Configuration can not be saved when it is loaded from two sources");
+            }
+        }
+
+        // escape all cron expressions to handle ','
+        escapeCronExpressions(configuration);
+
+        // [MRM-661] Due to a bug in the modello registry writer, we need to take these out by hand. They'll be put back by the writer.
+        if (section != null) {
+            if (configuration.getManagedRepositories().isEmpty()) {
+                section.removeSubset("managedRepositories");
+            }
+            if (configuration.getRemoteRepositories().isEmpty()) {
+                section.removeSubset("remoteRepositories");
+
+            }
+            if (configuration.getProxyConnectors().isEmpty()) {
+                section.removeSubset("proxyConnectors");
+            }
+            if (configuration.getNetworkProxies().isEmpty()) {
+                section.removeSubset("networkProxies");
+            }
+            if (configuration.getLegacyArtifactPaths().isEmpty()) {
+                section.removeSubset("legacyArtifactPaths");
+            }
+            if (configuration.getRepositoryGroups().isEmpty()) {
+                section.removeSubset("repositoryGroups");
+            }
+            if (configuration.getRepositoryScanning() != null) {
+                if (configuration.getRepositoryScanning().getKnownContentConsumers().isEmpty()) {
+                    section.removeSubset("repositoryScanning.knownContentConsumers");
+                }
+                if (configuration.getRepositoryScanning().getInvalidContentConsumers().isEmpty()) {
+                    section.removeSubset("repositoryScanning.invalidContentConsumers");
+                }
+            }
+            if (configuration.getArchivaRuntimeConfiguration() != null) {
+                section.removeSubset("archivaRuntimeConfiguration.defaultCheckPaths");
+            }
+
+            new ConfigurationRegistryWriter().write(configuration, section);
+            section.save();
+        }
+
+
+        this.configuration = unescapeExpressions(configuration);
+        isConfigurationDefaulted = false;
+
+        triggerEvent(ConfigurationEvent.SAVED, eventTag);
+    }
+
+    private void escapeCronExpressions(Configuration configuration) {
+        for ( ManagedRepositoryConfiguration c : configuration.getManagedRepositories()) {
+            c.setRefreshCronExpression(escapeCronExpression(c.getRefreshCronExpression()));
+        }
+    }
+
+    private Registry createDefaultConfigurationFile(String eventTag)
+            throws RegistryException {
+        // TODO: may not be needed under commons-configuration 1.4 - check
+
+        String contents = "<configuration />";
+
+        String fileLocation = userConfigFilename;
+
+        if (!writeFile("user configuration", userConfigFilename, contents)) {
+            fileLocation = altConfigFilename;
+            if (!writeFile("alternative configuration", altConfigFilename, contents, true)) {
+                throw new RegistryException(
+                        "Unable to create configuration file in either user [" + userConfigFilename + "] or alternative ["
+                                + altConfigFilename
+                                + "] locations on disk, usually happens when not allowed to write to those locations.");
+            }
+        }
+
+        // olamy hackish I know :-)
+        contents = "<configuration><xml fileName=\"" + fileLocation
+                + "\" config-forceCreate=\"true\" config-name=\"org.apache.archiva.user\"/>" + "</configuration>";
+
+        ((CommonsConfigurationRegistry) registry).setInitialConfiguration(contents);
+
+        registry.initialize();
+
+        for (RegistryListener regListener : registryListeners) {
+            addRegistryChangeListener(regListener);
+        }
+
+        triggerEvent(ConfigurationEvent.SAVED, eventTag==null?"default-file":eventTag);
+
+        Registry section = registry.getSection(KEY + ".user");
+        if (section == null) {
+            return new CommonsConfigurationRegistry( );
+        } else {
+            return section;
+        }
+    }
+
+    private boolean writeFile(String filetype, String path, String contents) {
+        return writeFile( filetype, path, contents, false );
+    }
+
+    /**
+     * Attempts to write the contents to a file, if an IOException occurs, return false.
+     * <p/>
+     * The file will be created if the directory to the file exists, otherwise this will return false.
+     *
+     * @param filetype the filetype (freeform text) to use in logging messages when failure to write.
+     * @param path     the path to write to.
+     * @param contents the contents to write.
+     * @return true if write successful.
+     */
+    private boolean writeFile(String filetype, String path, String contents, boolean createDirs) {                
+        try {
+            Path file = Paths.get(path);
+            // Check parent directory (if it is declared)
+            final Path parent = file.getParent();
+            if (parent != null) {
+                // Check that directory exists
+                if (!Files.exists( parent ) && createDirs) {
+                    Files.createDirectories( parent );
+                }
+                if (!Files.isDirectory(parent)) {
+                    // Directory to file must exist for file to be created
+                    return false;
+                }
+            }
+            FileUtils.writeStringToFile(file.toFile(), contents, FILE_ENCODING);
+            return true;
+        } catch (IOException e) {
+            log.error("Unable to create {} file: {}", filetype, e.getMessage(), e);
+            return false;
+        } catch (InvalidPathException ipe) {
+            log.error("Unable to read {} file: {}", path, ipe.getMessage(), ipe);
+            return false;
+        }
+    }
+
+    private void triggerEvent(int type, String eventTag) {
+        ConfigurationEvent evt = new ConfigurationEvent(type, eventTag);
+        for (ConfigurationListener listener : listeners) {
+            listener.configurationEvent(evt);
+        }
+    }
+
+    @Override
+    public void addListener(ConfigurationListener listener) {
+        if (listener == null) {
+            return;
+        }
+
+        listeners.add(listener);
+    }
+
+    @Override
+    public void removeListener(ConfigurationListener listener) {
+        if (listener == null) {
+            return;
+        }
+
+        listeners.remove(listener);
+    }
+
+
+    @Override
+    public void addChangeListener(RegistryListener listener) {
+        addRegistryChangeListener(listener);
+
+        // keep track for later
+        registryListeners.add(listener);
+    }
+
+    private void addRegistryChangeListener(RegistryListener listener) {
+        Registry section = registry.getSection(KEY + ".user");
+        if (section != null) {
+            section.addChangeListener(listener);
+        }
+        section = registry.getSection(KEY + ".base");
+        if (section != null) {
+            section.addChangeListener(listener);
+        }
+    }
+
+    @Override
+    public void removeChangeListener(RegistryListener listener) {
+        boolean removed = registryListeners.remove(listener);
+        log.debug("RegistryListener: '{}' removed {}", listener, removed);
+
+        Registry section = registry.getSection(KEY + ".user");
+        if (section != null) {
+            section.removeChangeListener(listener);
+        }
+        section = registry.getSection(KEY + ".base");
+        if (section != null) {
+            section.removeChangeListener(listener);
+        }
+
+    }
+
+    @PostConstruct
+    public void initialize() {
+
+        // Resolve expressions in the userConfigFilename and altConfigFilename
+        try {
+            ExpressionEvaluator expressionEvaluator = new DefaultExpressionEvaluator();
+            expressionEvaluator.addExpressionSource(new SystemPropertyExpressionSource());
+            String userConfigFileNameSysProps = System.getProperty(USER_CONFIG_PROPERTY);
+            if (StringUtils.isNotBlank(userConfigFileNameSysProps)) {
+                userConfigFilename = userConfigFileNameSysProps;
+            } else {
+                String userConfigFileNameEnv = System.getenv(USER_CONFIG_ENVVAR);
+                if (StringUtils.isNotBlank(userConfigFileNameEnv)) {
+                    userConfigFilename = userConfigFileNameEnv;
+                } else {
+                    userConfigFilename = expressionEvaluator.expand(userConfigFilename);
+                }
+            }
+            altConfigFilename = expressionEvaluator.expand(altConfigFilename);
+            loadConfiguration();
+            handleUpgradeConfiguration();
+        } catch (IndeterminateConfigurationException | RegistryException e) {
+            throw new RuntimeException("failed during upgrade from previous version" + e.getMessage(), e);
+        } catch (EvaluatorException e) {
+            throw new RuntimeException(
+                    "Unable to evaluate expressions found in " + "userConfigFilename or altConfigFilename.", e);
+        }
+        registry.addChangeListener(this);
+    }
+
+    /**
+     * Handle upgrade to newer version
+     */
+    private void handleUpgradeConfiguration()
+            throws RegistryException, IndeterminateConfigurationException {
+
+        List<String> dbConsumers = Arrays.asList("update-db-artifact", "update-db-repository-metadata");
+
+        // remove database consumers if here
+        List<String> intersec =
+                ListUtils.intersection(dbConsumers, configuration.getRepositoryScanning().getKnownContentConsumers());
+
+        if (!intersec.isEmpty()) {
+
+            List<String> knowContentConsumers =
+                    new ArrayList<>(configuration.getRepositoryScanning().getKnownContentConsumers().size());
+            for (String knowContentConsumer : configuration.getRepositoryScanning().getKnownContentConsumers()) {
+                if (!dbConsumers.contains(knowContentConsumer)) {
+                    knowContentConsumers.add(knowContentConsumer);
+                }
+            }
+
+            configuration.getRepositoryScanning().setKnownContentConsumers(knowContentConsumers);
+        }
+
+        // ensure create-archiva-metadata is here
+        if (!configuration.getRepositoryScanning().getKnownContentConsumers().contains("create-archiva-metadata")) {
+            List<String> knowContentConsumers =
+                    new ArrayList<>(configuration.getRepositoryScanning().getKnownContentConsumers());
+            knowContentConsumers.add("create-archiva-metadata");
+            configuration.getRepositoryScanning().setKnownContentConsumers(knowContentConsumers);
+        }
+
+        // ensure duplicate-artifacts is here
+        if (!configuration.getRepositoryScanning().getKnownContentConsumers().contains("duplicate-artifacts")) {
+            List<String> knowContentConsumers =
+                    new ArrayList<>(configuration.getRepositoryScanning().getKnownContentConsumers());
+            knowContentConsumers.add("duplicate-artifacts");
+            configuration.getRepositoryScanning().setKnownContentConsumers(knowContentConsumers);
+        }
+
+        Registry defaultOnlyConfiguration = readDefaultOnlyConfiguration();
+        // Currently we check only for configuration version change, not certain version numbers.
+        if (hasConfigVersionChanged(configuration, defaultOnlyConfiguration)) {
+            updateCheckPathDefaults(configuration, defaultOnlyConfiguration);
+            String newVersion = defaultOnlyConfiguration.getString("version");
+            if (newVersion == null) {
+                throw new IndeterminateConfigurationException("The default configuration has no version information!");
+            }
+            configuration.setVersion(newVersion);
+            try {
+                save(configuration);
+            } catch (IndeterminateConfigurationException e) {
+                log.error("Error occured during configuration update to new version: {}", e.getMessage());
+            } catch (RegistryException e) {
+                log.error("Error occured during configuration update to new version: {}", e.getMessage());
+            }
+        }
+    }
+
+    @Override
+    public void reload() {
+        this.configuration = null;
+        try {
+            this.registry.initialize();
+        } catch (RegistryException e) {
+            throw new ConfigurationRuntimeException(e.getMessage(), e);
+        }
+        this.initialize();
+    }
+
+    @Override
+    public Locale getDefaultLocale() {
+        return defaultLocale;
+    }
+
+    @Override
+    public List<Locale.LanguageRange> getLanguagePriorities() {
+        return languagePriorities;
+    }
+
+    @Override
+    public Path getAppServerBaseDir() {
+        String basePath = registry.getString("appserver.base");
+        if (!StringUtils.isEmpty(basePath)) {
+            return Paths.get(basePath);
+        } else {
+            return Paths.get("");
+        }
+    }
+
+    @Override
+    public Path getRepositoryBaseDir() {
+        if (repositoryBaseDirectory == null) {
+            getConfiguration();
+        }
+        return repositoryBaseDirectory;
+
+    }
+
+    @Override
+    public Path getRemoteRepositoryBaseDir() {
+        if (remoteRepositoryBaseDirectory == null) {
+            getConfiguration();
+        }
+        return remoteRepositoryBaseDirectory;
+    }
+
+    @Override
+    public Path getRepositoryGroupBaseDir() {
+        if (repositoryGroupBaseDirectory == null) {
+            getConfiguration();
+        }
+        return repositoryGroupBaseDirectory;
+    }
+
+    @Override
+    public Path getDataDirectory() {
+        if (dataDirectory == null) {
+            getConfiguration();
+        }
+        return dataDirectory;
+    }
+
+    @Override
+    public void beforeConfigurationChange(Registry registry, String propertyName, Object propertyValue) {
+        // nothing to do here
+    }
+
+    @Override
+    public synchronized void afterConfigurationChange(Registry registry, String propertyName, Object propertyValue) {
+        // configuration = null;
+        // this.dataDirectory = null;
+        // this.repositoryBaseDirectory = null;
+    }
+
+    private String removeExpressions(String directory) {
+        String value = StringUtils.replace(directory, "${appserver.base}",
+                registry.getString("appserver.base", "${appserver.base}"));
+        value = StringUtils.replace(value, "${appserver.home}",
+                registry.getString("appserver.home", "${appserver.home}"));
+        return value;
+    }
+
+    private String unescapeCronExpression(String cronExpression) {
+        return StringUtils.replace(cronExpression, "\\,", ",");
+    }
+
+    private String escapeCronExpression(String cronExpression) {
+        return StringUtils.replace(cronExpression, ",", "\\,");
+    }
+
+    private Configuration unescapeExpressions(Configuration config) {
+        // TODO: for commons-configuration 1.3 only
+        for (ManagedRepositoryConfiguration c : config.getManagedRepositories()) {
+            c.setLocation(removeExpressions(c.getLocation()));
+            c.setRefreshCronExpression(unescapeCronExpression(c.getRefreshCronExpression()));
+        }
+
+        return config;
+    }
+
+    private Configuration checkRepositoryLocations(Configuration config) {
+        // additional check for [MRM-789], ensure that the location of the default repositories 
+        // are not installed in the server installation        
+        for (ManagedRepositoryConfiguration repo : (List<ManagedRepositoryConfiguration>) config.getManagedRepositories()) {
+            String repoPath = repo.getLocation();
+            Path repoLocation = Paths.get(repoPath);
+
+            if (Files.exists(repoLocation) && Files.isDirectory(repoLocation) && !repoPath.endsWith(
+                    "/repositories/" + repo.getId())) {
+                repo.setLocation(repoPath + "/data/repositories/" + repo.getId());
+            }
+        }
+
+        return config;
+    }
+
+    public String getUserConfigFilename() {
+        return userConfigFilename;
+    }
+
+    public String getAltConfigFilename() {
+        return altConfigFilename;
+    }
+
+    @Override
+    public boolean isDefaulted() {
+        return this.isConfigurationDefaulted;
+    }
+
+    public Registry getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(Registry registry) {
+        this.registry = registry;
+    }
+
+
+    public void setUserConfigFilename(String userConfigFilename) {
+        this.userConfigFilename = userConfigFilename;
+    }
+
+    public void setAltConfigFilename(String altConfigFilename) {
+        this.altConfigFilename = altConfigFilename;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/FileTypes.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/FileTypes.java
new file mode 100644 (file)
index 0000000..a08e4bf
--- /dev/null
@@ -0,0 +1,210 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.common.FileTypeUtils;
+import org.apache.archiva.components.registry.Registry;
+import org.apache.archiva.components.registry.RegistryListener;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.model.functors.FiletypeSelectionPredicate;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
+import org.apache.commons.collections4.Predicate;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.nio.file.FileSystems;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * FileTypes
+ */
+@Service("fileTypes")
+public class FileTypes
+    implements RegistryListener
+{
+    public static final String ARTIFACTS = "artifacts";
+
+    public static final String AUTO_REMOVE = "auto-remove";
+
+    public static final String INDEXABLE_CONTENT = "indexable-content";
+
+    public static final String IGNORED = "ignored";
+
+    @Inject
+    @Named(value = "archivaConfiguration#default")
+    private ArchivaConfiguration archivaConfiguration;
+
+
+    public FileTypes() {
+
+    }
+
+    /**
+     * Map of default values for the file types.
+     */
+    private Map<String, List<String>> defaultTypeMap = new HashMap<>();
+
+    private List<String> artifactPatterns;
+
+    /**
+     * Default exclusions from artifact consumers that are using the file types. Note that this is simplistic in the
+     * case of the support files (based on extension) as it is elsewhere - it may be better to match these to actual
+     * artifacts and exclude later during scanning.
+     *
+     * @deprecated
+     */
+    public static final List<String> DEFAULT_EXCLUSIONS = FileTypeUtils.DEFAULT_EXCLUSIONS;
+
+    public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
+    {
+        this.archivaConfiguration = archivaConfiguration;
+    }
+
+    /**
+     * Get the list of patterns for a specified filetype.
+     * You will always get a list.  In this order.
+     * <ul>
+     * <li>The Configured List</li>
+     * <li>The Default List</li>
+     * <li>A single item list of <code>&quot;**&#47;*&quot;</code></li>
+     * </ul>
+     *
+     * @param id the id to lookup.
+     * @return the list of patterns.
+     */
+    public List<String> getFileTypePatterns( String id )
+    {
+        Configuration config = archivaConfiguration.getConfiguration();
+        Predicate selectedFiletype = new FiletypeSelectionPredicate( id );
+        RepositoryScanningConfiguration repositoryScanningConfiguration = config.getRepositoryScanning();
+        if ( repositoryScanningConfiguration != null )
+        {
+            FileType filetype =
+                IterableUtils.find( config.getRepositoryScanning().getFileTypes(), selectedFiletype );
+
+            if ( ( filetype != null ) && CollectionUtils.isNotEmpty( filetype.getPatterns() ) )
+            {
+                return filetype.getPatterns();
+            }
+        }
+        List<String> defaultPatterns = defaultTypeMap.get( id );
+
+        if ( CollectionUtils.isEmpty( defaultPatterns ) )
+        {
+            return Collections.singletonList( "**/*" );
+        }
+
+        return defaultPatterns;
+    }
+
+    public synchronized boolean matchesArtifactPattern( String relativePath )
+    {
+        // Correct the slash pattern.
+        relativePath = relativePath.replace( '\\', '/' );
+
+        if ( artifactPatterns == null )
+        {
+            artifactPatterns = getFileTypePatterns( ARTIFACTS );
+        }
+
+        for ( String pattern : artifactPatterns )
+        {
+            if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) )
+            {
+                // Found match
+                return true;
+            }
+        }
+
+        // No match.
+        return false;
+    }
+
+    public boolean matchesDefaultExclusions( String relativePath )
+    {
+        // Correct the slash pattern.
+        relativePath = relativePath.replace( '\\', '/' );
+
+        for ( String pattern : DEFAULT_EXCLUSIONS )
+        {
+            if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) )
+            {
+                // Found match
+                return true;
+            }
+        }
+
+        // No match.
+        return false;
+    }
+
+    @PostConstruct
+    public void initialize()
+    {
+        initialiseTypeMap( this.archivaConfiguration.getConfiguration() );
+
+        this.archivaConfiguration.addChangeListener( this );
+    }
+
+    private void initialiseTypeMap( Configuration configuration )
+    {
+        defaultTypeMap.clear();
+
+        // Store the default file type declaration.
+        List<FileType> filetypes = configuration.getRepositoryScanning().getFileTypes();
+        for ( FileType filetype : filetypes )
+        {
+            List<String> patterns = defaultTypeMap.get( filetype.getId() );
+            if ( patterns == null )
+            {
+                patterns = new ArrayList<>( filetype.getPatterns().size() );
+            }
+            patterns.addAll( filetype.getPatterns() );
+
+            defaultTypeMap.put( filetype.getId(), patterns );
+        }
+    }
+
+    @Override
+    public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
+    {
+        if ( propertyName.contains( "fileType" ) )
+        {
+            artifactPatterns = null;
+
+            initialiseTypeMap( archivaConfiguration.getConfiguration() );
+        }
+    }
+
+    @Override
+    public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue )
+    {
+        /* nothing to do */
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/IndeterminateConfigurationException.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/IndeterminateConfigurationException.java
new file mode 100644 (file)
index 0000000..39054ce
--- /dev/null
@@ -0,0 +1,31 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Occurs when the configuration is stored in two locations and the save location can not be determined.
+ */
+public class IndeterminateConfigurationException
+    extends Exception
+{
+    public IndeterminateConfigurationException( String message )
+    {
+        super( message );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/InvalidConfigurationException.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/InvalidConfigurationException.java
new file mode 100644 (file)
index 0000000..f65aa7d
--- /dev/null
@@ -0,0 +1,46 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * An error in the configuration.
+ */
+public class InvalidConfigurationException
+    extends Exception
+{
+    private final String name;
+
+    public InvalidConfigurationException( String name, String message )
+    {
+        super( message );
+        this.name = name;
+    }
+
+    public InvalidConfigurationException( String name, String message, Throwable cause )
+    {
+        super( message, cause );
+
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/MavenProxyPropertyLoader.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/MavenProxyPropertyLoader.java
new file mode 100644 (file)
index 0000000..7f657f9
--- /dev/null
@@ -0,0 +1,156 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.policies.ReleasesPolicy;
+import org.apache.archiva.policies.SnapshotsPolicy;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+/**
+ */
+public class MavenProxyPropertyLoader
+{
+    private static final String REPO_LOCAL_STORE = "repo.local.store";
+
+    private static final String PROXY_LIST = "proxy.list";
+
+    private static final String REPO_LIST = "repo.list";
+
+    public void load( Properties props, Configuration configuration )
+        throws InvalidConfigurationException
+    {
+        // set up the managed repository
+        String localCachePath = getMandatoryProperty( props, REPO_LOCAL_STORE );
+
+        ManagedRepositoryConfiguration config = new ManagedRepositoryConfiguration();
+        config.setLocation( localCachePath );
+        config.setName( "Imported Maven-Proxy Cache" );
+        config.setId( "maven-proxy" );
+        config.setScanned( false );
+        config.setReleases( true );
+        config.setSnapshots( false );
+        configuration.addManagedRepository( config );
+
+        // Add the network proxies.
+        String propertyList = props.getProperty( PROXY_LIST );
+        if ( propertyList != null )
+        {
+            StringTokenizer tok = new StringTokenizer( propertyList, "," );
+            while ( tok.hasMoreTokens() )
+            {
+                String key = tok.nextToken();
+                if ( StringUtils.isNotEmpty( key ) )
+                {
+                    NetworkProxyConfiguration proxy = new NetworkProxyConfiguration();
+                    proxy.setHost( getMandatoryProperty( props, "proxy." + key + ".host" ) );
+                    proxy.setPort( Integer.parseInt( getMandatoryProperty( props, "proxy." + key + ".port" ) ) );
+
+                    // the username and password isn't required
+                    proxy.setUsername( props.getProperty( "proxy." + key + ".username" ) );
+                    proxy.setPassword( props.getProperty( "proxy." + key + ".password" ) );
+
+                    configuration.addNetworkProxy( proxy );
+                }
+            }
+        }
+
+        // Add the remote repository list
+        String repoList = getMandatoryProperty( props, REPO_LIST );
+
+        StringTokenizer tok = new StringTokenizer( repoList, "," );
+        while ( tok.hasMoreTokens() )
+        {
+            String key = tok.nextToken();
+
+            Properties repoProps = getSubset( props, "repo." + key + "." );
+            String url = getMandatoryProperty( props, "repo." + key + ".url" );
+            String proxyKey = repoProps.getProperty( "proxy" );
+
+//            int cachePeriod = Integer.parseInt( repoProps.getProperty( "cache.period", "60" ) );
+
+            RemoteRepositoryConfiguration repository = new RemoteRepositoryConfiguration();
+            repository.setId( key );
+            repository.setName( "Imported Maven-Proxy Remote Proxy" );
+            repository.setUrl( url );
+            repository.setLayout( "legacy" );
+
+            configuration.addRemoteRepository( repository );
+
+            ProxyConnectorConfiguration proxyConnector = new ProxyConnectorConfiguration();
+            proxyConnector.setSourceRepoId( "maven-proxy" );
+            proxyConnector.setTargetRepoId( key );
+            proxyConnector.setProxyId( proxyKey );
+            // TODO: convert cachePeriod to closest "daily" or "hourly"
+            proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.DAILY.getId() );
+            proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS.getId() );
+
+            configuration.addProxyConnector( proxyConnector );
+        }
+    }
+
+    @SuppressWarnings( "unchecked" )
+    private Properties getSubset( Properties props, String prefix )
+    {
+        Enumeration keys = props.keys();
+        Properties result = new Properties();
+        while ( keys.hasMoreElements() )
+        {
+            String key = (String) keys.nextElement();
+            String value = props.getProperty( key );
+            if ( key.startsWith( prefix ) )
+            {
+                String newKey = key.substring( prefix.length() );
+                result.setProperty( newKey, value );
+            }
+        }
+        return result;
+    }
+
+    public void load( InputStream is, Configuration configuration )
+        throws IOException, InvalidConfigurationException
+    {
+        Properties props = new Properties();
+        props.load( is );
+        load( props, configuration );
+    }
+
+    private String getMandatoryProperty( Properties props, String key )
+        throws InvalidConfigurationException
+    {
+        String value = props.getProperty( key );
+
+        if ( value == null )
+        {
+            throw new InvalidConfigurationException( key, "Missing required field: " + key );
+        }
+
+        return value;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/io/registry/ConfigurationRegistryReader.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/io/registry/ConfigurationRegistryReader.java
new file mode 100644 (file)
index 0000000..6a89e1c
--- /dev/null
@@ -0,0 +1,1704 @@
+
+package org.apache.archiva.configuration.provider.io.registry;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.components.registry.Registry;
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.model.AbstractRepositoryConnectorConfiguration;
+import org.apache.archiva.configuration.model.ArchivaDefaultConfiguration;
+import org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration;
+import org.apache.archiva.configuration.model.CacheConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.FileLockConfiguration;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.model.LdapConfiguration;
+import org.apache.archiva.configuration.model.LdapGroupMapping;
+import org.apache.archiva.configuration.model.LegacyArtifactPath;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.NetworkConfiguration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.OrganisationInformation;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorRuleConfiguration;
+import org.apache.archiva.configuration.model.RedbackRuntimeConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryCheckPath;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.model.SyncConnectorConfiguration;
+import org.apache.archiva.configuration.model.UserInterfaceOptions;
+import org.apache.archiva.configuration.model.WebappConfiguration;
+
+import java.util.Iterator;
+import java.util.List;
+
+// Util imports
+// Model class imports
+
+
+/**
+ * Generate Redback Registry input mechanism for model 'Configuration'.
+ */
+public class ConfigurationRegistryReader {
+    public Configuration read( Registry registry) {
+        return readConfiguration("", registry);
+    }
+
+    private Configuration readConfiguration(String prefix, Registry registry) {
+        Configuration value = new Configuration();
+
+        //String version = registry.getString( prefix + "version", value.getVersion() );
+
+        List<String> versionList = registry.getList(prefix + "version");
+        String version = value.getVersion();
+        if (versionList != null && !versionList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = versionList.size(); i < size; i++) {
+                sb.append(versionList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            version = sb.toString();
+        }
+
+        value.setVersion(version);
+        //String metadataStore = registry.getString( prefix + "metadataStore", value.getMetadataStore() );
+
+        List<String> metadataStoreList = registry.getList(prefix + "metadataStore");
+        String metadataStore = value.getMetadataStore();
+        if (metadataStoreList != null && !metadataStoreList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = metadataStoreList.size(); i < size; i++) {
+                sb.append(metadataStoreList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            metadataStore = sb.toString();
+        }
+
+        value.setMetadataStore(metadataStore);
+        java.util.List repositoryGroups = new java.util.ArrayList/*<RepositoryGroupConfiguration>*/();
+        List repositoryGroupsSubsets = registry.getSubsetList(prefix + "repositoryGroups.repositoryGroup");
+        for (Iterator i = repositoryGroupsSubsets.iterator(); i.hasNext(); ) {
+            RepositoryGroupConfiguration v = readRepositoryGroupConfiguration("", (Registry) i.next());
+            repositoryGroups.add(v);
+        }
+        value.setRepositoryGroups(repositoryGroups);
+        java.util.List managedRepositories = new java.util.ArrayList/*<ManagedRepositoryConfiguration>*/();
+        List managedRepositoriesSubsets = registry.getSubsetList(prefix + "managedRepositories.managedRepository");
+        for (Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); ) {
+            ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration("", (Registry) i.next());
+            managedRepositories.add(v);
+        }
+        value.setManagedRepositories(managedRepositories);
+        java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
+        List remoteRepositoriesSubsets = registry.getSubsetList(prefix + "remoteRepositories.remoteRepository");
+        for (Iterator i = remoteRepositoriesSubsets.iterator(); i.hasNext(); ) {
+            RemoteRepositoryConfiguration v = readRemoteRepositoryConfiguration("", (Registry) i.next());
+            remoteRepositories.add(v);
+        }
+        value.setRemoteRepositories(remoteRepositories);
+        java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
+        List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
+        for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
+            ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
+            proxyConnectors.add(v);
+        }
+        value.setProxyConnectors(proxyConnectors);
+        java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
+        List networkProxiesSubsets = registry.getSubsetList(prefix + "networkProxies.networkProxy");
+        for (Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); ) {
+            NetworkProxyConfiguration v = readNetworkProxyConfiguration("", (Registry) i.next());
+            networkProxies.add(v);
+        }
+        value.setNetworkProxies(networkProxies);
+        java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
+        List legacyArtifactPathsSubsets = registry.getSubsetList(prefix + "legacyArtifactPaths.legacyArtifactPath");
+        for (Iterator i = legacyArtifactPathsSubsets.iterator(); i.hasNext(); ) {
+            LegacyArtifactPath v = readLegacyArtifactPath("", (Registry) i.next());
+            legacyArtifactPaths.add(v);
+        }
+        value.setLegacyArtifactPaths(legacyArtifactPaths);
+        RepositoryScanningConfiguration repositoryScanning = readRepositoryScanningConfiguration(prefix + "repositoryScanning.", registry);
+        value.setRepositoryScanning(repositoryScanning);
+        WebappConfiguration webapp = readWebappConfiguration(prefix + "webapp.", registry);
+        value.setWebapp(webapp);
+        OrganisationInformation organisationInfo = readOrganisationInformation(prefix + "organisationInfo.", registry);
+        value.setOrganisationInfo(organisationInfo);
+        NetworkConfiguration networkConfiguration = readNetworkConfiguration(prefix + "networkConfiguration.", registry);
+        value.setNetworkConfiguration(networkConfiguration);
+        RedbackRuntimeConfiguration redbackRuntimeConfiguration = readRedbackRuntimeConfiguration(prefix + "redbackRuntimeConfiguration.", registry);
+        value.setRedbackRuntimeConfiguration(redbackRuntimeConfiguration);
+        ArchivaRuntimeConfiguration archivaRuntimeConfiguration = readArchivaRuntimeConfiguration(prefix + "archivaRuntimeConfiguration.", registry);
+        value.setArchivaRuntimeConfiguration(archivaRuntimeConfiguration);
+        java.util.List proxyConnectorRuleConfigurations = new java.util.ArrayList/*<ProxyConnectorRuleConfiguration>*/();
+        List proxyConnectorRuleConfigurationsSubsets = registry.getSubsetList(prefix + "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration");
+        for (Iterator i = proxyConnectorRuleConfigurationsSubsets.iterator(); i.hasNext(); ) {
+            ProxyConnectorRuleConfiguration v = readProxyConnectorRuleConfiguration("", (Registry) i.next());
+            proxyConnectorRuleConfigurations.add(v);
+        }
+        value.setProxyConnectorRuleConfigurations(proxyConnectorRuleConfigurations);
+        ArchivaDefaultConfiguration archivaDefaultConfiguration = readArchivaDefaultConfiguration(prefix + "archivaDefaultConfiguration.", registry);
+        value.setArchivaDefaultConfiguration(archivaDefaultConfiguration);
+
+        return value;
+    }
+
+    private AbstractRepositoryConfiguration readAbstractRepositoryConfiguration( String prefix, Registry registry) {
+        AbstractRepositoryConfiguration value = new AbstractRepositoryConfiguration();
+
+        //String id = registry.getString( prefix + "id", value.getId() );
+
+        List<String> idList = registry.getList(prefix + "id");
+        String id = value.getId();
+        if (idList != null && !idList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = idList.size(); i < size; i++) {
+                sb.append(idList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            id = sb.toString();
+        }
+
+        value.setId(id);
+        //String type = registry.getString( prefix + "type", value.getType() );
+
+        List<String> typeList = registry.getList(prefix + "type");
+        String type = value.getType();
+        if (typeList != null && !typeList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = typeList.size(); i < size; i++) {
+                sb.append(typeList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            type = sb.toString();
+        }
+
+        value.setType(type);
+        //String name = registry.getString( prefix + "name", value.getName() );
+
+        List<String> nameList = registry.getList(prefix + "name");
+        String name = value.getName();
+        if (nameList != null && !nameList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = nameList.size(); i < size; i++) {
+                sb.append(nameList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            name = sb.toString();
+        }
+
+        value.setName(name);
+        //String layout = registry.getString( prefix + "layout", value.getLayout() );
+
+        List<String> layoutList = registry.getList(prefix + "layout");
+        String layout = value.getLayout();
+        if (layoutList != null && !layoutList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = layoutList.size(); i < size; i++) {
+                sb.append(layoutList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            layout = sb.toString();
+        }
+
+        value.setLayout(layout);
+        //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
+
+        List<String> indexDirList = registry.getList(prefix + "indexDir");
+        String indexDir = value.getIndexDir();
+        if (indexDirList != null && !indexDirList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = indexDirList.size(); i < size; i++) {
+                sb.append(indexDirList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            indexDir = sb.toString();
+        }
+
+        value.setIndexDir(indexDir);
+        //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
+
+        List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
+        String packedIndexDir = value.getPackedIndexDir();
+        if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
+                sb.append(packedIndexDirList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            packedIndexDir = sb.toString();
+        }
+
+        value.setPackedIndexDir(packedIndexDir);
+        //String description = registry.getString( prefix + "description", value.getDescription() );
+
+        List<String> descriptionList = registry.getList(prefix + "description");
+        String description = value.getDescription();
+        if (descriptionList != null && !descriptionList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = descriptionList.size(); i < size; i++) {
+                sb.append(descriptionList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            description = sb.toString();
+        }
+
+        value.setDescription(description);
+
+        return value;
+    }
+
+    private RemoteRepositoryConfiguration readRemoteRepositoryConfiguration(String prefix, Registry registry) {
+        RemoteRepositoryConfiguration value = new RemoteRepositoryConfiguration();
+
+        //String url = registry.getString( prefix + "url", value.getUrl() );
+
+        List<String> urlList = registry.getList(prefix + "url");
+        String url = value.getUrl();
+        if (urlList != null && !urlList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = urlList.size(); i < size; i++) {
+                sb.append(urlList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            url = sb.toString();
+        }
+
+        value.setUrl(url);
+        //String username = registry.getString( prefix + "username", value.getUsername() );
+
+        List<String> usernameList = registry.getList(prefix + "username");
+        String username = value.getUsername();
+        if (usernameList != null && !usernameList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = usernameList.size(); i < size; i++) {
+                sb.append(usernameList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            username = sb.toString();
+        }
+
+        value.setUsername(username);
+        //String password = registry.getString( prefix + "password", value.getPassword() );
+
+        List<String> passwordList = registry.getList(prefix + "password");
+        String password = value.getPassword();
+        if (passwordList != null && !passwordList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = passwordList.size(); i < size; i++) {
+                sb.append(passwordList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            password = sb.toString();
+        }
+
+        value.setPassword(password);
+        int timeout = registry.getInt(prefix + "timeout", value.getTimeout());
+        value.setTimeout(timeout);
+        //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
+
+        List<String> refreshCronExpressionList = registry.getList(prefix + "refreshCronExpression");
+        String refreshCronExpression = value.getRefreshCronExpression();
+        if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = refreshCronExpressionList.size(); i < size; i++) {
+                sb.append(refreshCronExpressionList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            refreshCronExpression = sb.toString();
+        }
+
+        value.setRefreshCronExpression(refreshCronExpression);
+        boolean downloadRemoteIndex = registry.getBoolean(prefix + "downloadRemoteIndex", value.isDownloadRemoteIndex());
+        value.setDownloadRemoteIndex(downloadRemoteIndex);
+        //String remoteIndexUrl = registry.getString( prefix + "remoteIndexUrl", value.getRemoteIndexUrl() );
+
+        List<String> remoteIndexUrlList = registry.getList(prefix + "remoteIndexUrl");
+        String remoteIndexUrl = value.getRemoteIndexUrl();
+        if (remoteIndexUrlList != null && !remoteIndexUrlList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = remoteIndexUrlList.size(); i < size; i++) {
+                sb.append(remoteIndexUrlList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            remoteIndexUrl = sb.toString();
+        }
+
+        value.setRemoteIndexUrl(remoteIndexUrl);
+        //String remoteDownloadNetworkProxyId = registry.getString( prefix + "remoteDownloadNetworkProxyId", value.getRemoteDownloadNetworkProxyId() );
+
+        List<String> remoteDownloadNetworkProxyIdList = registry.getList(prefix + "remoteDownloadNetworkProxyId");
+        String remoteDownloadNetworkProxyId = value.getRemoteDownloadNetworkProxyId();
+        if (remoteDownloadNetworkProxyIdList != null && !remoteDownloadNetworkProxyIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = remoteDownloadNetworkProxyIdList.size(); i < size; i++) {
+                sb.append(remoteDownloadNetworkProxyIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            remoteDownloadNetworkProxyId = sb.toString();
+        }
+
+        value.setRemoteDownloadNetworkProxyId(remoteDownloadNetworkProxyId);
+        int remoteDownloadTimeout = registry.getInt(prefix + "remoteDownloadTimeout", value.getRemoteDownloadTimeout());
+        value.setRemoteDownloadTimeout(remoteDownloadTimeout);
+        boolean downloadRemoteIndexOnStartup = registry.getBoolean(prefix + "downloadRemoteIndexOnStartup", value.isDownloadRemoteIndexOnStartup());
+        value.setDownloadRemoteIndexOnStartup(downloadRemoteIndexOnStartup);
+        java.util.Map extraParameters = registry.getProperties(prefix + "extraParameters");
+        value.setExtraParameters(extraParameters);
+        java.util.Map extraHeaders = registry.getProperties(prefix + "extraHeaders");
+        value.setExtraHeaders(extraHeaders);
+        //String checkPath = registry.getString( prefix + "checkPath", value.getCheckPath() );
+
+        List<String> checkPathList = registry.getList(prefix + "checkPath");
+        String checkPath = value.getCheckPath();
+        if (checkPathList != null && !checkPathList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = checkPathList.size(); i < size; i++) {
+                sb.append(checkPathList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            checkPath = sb.toString();
+        }
+
+        value.setCheckPath(checkPath);
+        //String id = registry.getString( prefix + "id", value.getId() );
+
+        List<String> idList = registry.getList(prefix + "id");
+        String id = value.getId();
+        if (idList != null && !idList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = idList.size(); i < size; i++) {
+                sb.append(idList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            id = sb.toString();
+        }
+
+        value.setId(id);
+        //String type = registry.getString( prefix + "type", value.getType() );
+
+        List<String> typeList = registry.getList(prefix + "type");
+        String type = value.getType();
+        if (typeList != null && !typeList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = typeList.size(); i < size; i++) {
+                sb.append(typeList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            type = sb.toString();
+        }
+
+        value.setType(type);
+        //String name = registry.getString( prefix + "name", value.getName() );
+
+        List<String> nameList = registry.getList(prefix + "name");
+        String name = value.getName();
+        if (nameList != null && !nameList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = nameList.size(); i < size; i++) {
+                sb.append(nameList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            name = sb.toString();
+        }
+
+        value.setName(name);
+        //String layout = registry.getString( prefix + "layout", value.getLayout() );
+
+        List<String> layoutList = registry.getList(prefix + "layout");
+        String layout = value.getLayout();
+        if (layoutList != null && !layoutList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = layoutList.size(); i < size; i++) {
+                sb.append(layoutList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            layout = sb.toString();
+        }
+
+        value.setLayout(layout);
+        //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
+
+        List<String> indexDirList = registry.getList(prefix + "indexDir");
+        String indexDir = value.getIndexDir();
+        if (indexDirList != null && !indexDirList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = indexDirList.size(); i < size; i++) {
+                sb.append(indexDirList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            indexDir = sb.toString();
+        }
+
+        value.setIndexDir(indexDir);
+        //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
+
+        List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
+        String packedIndexDir = value.getPackedIndexDir();
+        if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
+                sb.append(packedIndexDirList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            packedIndexDir = sb.toString();
+        }
+
+        value.setPackedIndexDir(packedIndexDir);
+        //String description = registry.getString( prefix + "description", value.getDescription() );
+
+        List<String> descriptionList = registry.getList(prefix + "description");
+        String description = value.getDescription();
+        if (descriptionList != null && !descriptionList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = descriptionList.size(); i < size; i++) {
+                sb.append(descriptionList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            description = sb.toString();
+        }
+
+        value.setDescription(description);
+
+        return value;
+    }
+
+    private ManagedRepositoryConfiguration readManagedRepositoryConfiguration(String prefix, Registry registry) {
+        ManagedRepositoryConfiguration value = new ManagedRepositoryConfiguration();
+
+        //String location = registry.getString( prefix + "location", value.getLocation() );
+
+        List<String> locationList = registry.getList(prefix + "location");
+        String location = value.getLocation();
+        if (locationList != null && !locationList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = locationList.size(); i < size; i++) {
+                sb.append(locationList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            location = sb.toString();
+        }
+
+        value.setLocation(location);
+        boolean releases = registry.getBoolean(prefix + "releases", value.isReleases());
+        value.setReleases(releases);
+        boolean blockRedeployments = registry.getBoolean(prefix + "blockRedeployments", value.isBlockRedeployments());
+        value.setBlockRedeployments(blockRedeployments);
+        boolean snapshots = registry.getBoolean(prefix + "snapshots", value.isSnapshots());
+        value.setSnapshots(snapshots);
+        boolean scanned = registry.getBoolean(prefix + "scanned", value.isScanned());
+        value.setScanned(scanned);
+        //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
+
+        List<String> refreshCronExpressionList = registry.getList(prefix + "refreshCronExpression");
+        String refreshCronExpression = value.getRefreshCronExpression();
+        if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = refreshCronExpressionList.size(); i < size; i++) {
+                sb.append(refreshCronExpressionList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            refreshCronExpression = sb.toString();
+        }
+
+        value.setRefreshCronExpression(refreshCronExpression);
+        int retentionCount = registry.getInt(prefix + "retentionCount", value.getRetentionCount());
+        value.setRetentionCount(retentionCount);
+        int retentionPeriod = registry.getInt(prefix + "retentionPeriod", value.getRetentionPeriod());
+        value.setRetentionPeriod(retentionPeriod);
+        boolean deleteReleasedSnapshots = registry.getBoolean(prefix + "deleteReleasedSnapshots", value.isDeleteReleasedSnapshots());
+        value.setDeleteReleasedSnapshots(deleteReleasedSnapshots);
+        boolean skipPackedIndexCreation = registry.getBoolean(prefix + "skipPackedIndexCreation", value.isSkipPackedIndexCreation());
+        value.setSkipPackedIndexCreation(skipPackedIndexCreation);
+        boolean stageRepoNeeded = registry.getBoolean(prefix + "stageRepoNeeded", value.isStageRepoNeeded());
+        value.setStageRepoNeeded(stageRepoNeeded);
+        //String id = registry.getString( prefix + "id", value.getId() );
+
+        List<String> idList = registry.getList(prefix + "id");
+        String id = value.getId();
+        if (idList != null && !idList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = idList.size(); i < size; i++) {
+                sb.append(idList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            id = sb.toString();
+        }
+
+        value.setId(id);
+        //String type = registry.getString( prefix + "type", value.getType() );
+
+        List<String> typeList = registry.getList(prefix + "type");
+        String type = value.getType();
+        if (typeList != null && !typeList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = typeList.size(); i < size; i++) {
+                sb.append(typeList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            type = sb.toString();
+        }
+
+        value.setType(type);
+        //String name = registry.getString( prefix + "name", value.getName() );
+
+        List<String> nameList = registry.getList(prefix + "name");
+        String name = value.getName();
+        if (nameList != null && !nameList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = nameList.size(); i < size; i++) {
+                sb.append(nameList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            name = sb.toString();
+        }
+
+        value.setName(name);
+        //String layout = registry.getString( prefix + "layout", value.getLayout() );
+
+        List<String> layoutList = registry.getList(prefix + "layout");
+        String layout = value.getLayout();
+        if (layoutList != null && !layoutList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = layoutList.size(); i < size; i++) {
+                sb.append(layoutList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            layout = sb.toString();
+        }
+
+        value.setLayout(layout);
+        //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
+
+        List<String> indexDirList = registry.getList(prefix + "indexDir");
+        String indexDir = value.getIndexDir();
+        if (indexDirList != null && !indexDirList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = indexDirList.size(); i < size; i++) {
+                sb.append(indexDirList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            indexDir = sb.toString();
+        }
+
+        value.setIndexDir(indexDir);
+        //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
+
+        List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
+        String packedIndexDir = value.getPackedIndexDir();
+        if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
+                sb.append(packedIndexDirList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            packedIndexDir = sb.toString();
+        }
+
+        value.setPackedIndexDir(packedIndexDir);
+        //String description = registry.getString( prefix + "description", value.getDescription() );
+
+        List<String> descriptionList = registry.getList(prefix + "description");
+        String description = value.getDescription();
+        if (descriptionList != null && !descriptionList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = descriptionList.size(); i < size; i++) {
+                sb.append(descriptionList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            description = sb.toString();
+        }
+
+        value.setDescription(description);
+
+        return value;
+    }
+
+    private LegacyArtifactPath readLegacyArtifactPath(String prefix, Registry registry) {
+        LegacyArtifactPath value = new LegacyArtifactPath();
+
+        //String path = registry.getString( prefix + "path", value.getPath() );
+
+        List<String> pathList = registry.getList(prefix + "path");
+        String path = value.getPath();
+        if (pathList != null && !pathList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = pathList.size(); i < size; i++) {
+                sb.append(pathList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            path = sb.toString();
+        }
+
+        value.setPath(path);
+        //String artifact = registry.getString( prefix + "artifact", value.getArtifact() );
+
+        List<String> artifactList = registry.getList(prefix + "artifact");
+        String artifact = value.getArtifact();
+        if (artifactList != null && !artifactList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = artifactList.size(); i < size; i++) {
+                sb.append(artifactList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            artifact = sb.toString();
+        }
+
+        value.setArtifact(artifact);
+
+        return value;
+    }
+
+    private RepositoryGroupConfiguration readRepositoryGroupConfiguration(String prefix, Registry registry) {
+        RepositoryGroupConfiguration value = new RepositoryGroupConfiguration();
+
+        //String id = registry.getString( prefix + "id", value.getId() );
+
+        List<String> idList = registry.getList(prefix + "id");
+        String id = value.getId();
+        if (idList != null && !idList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = idList.size(); i < size; i++) {
+                sb.append(idList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            id = sb.toString();
+        }
+
+        value.setId(id);
+
+        value.setName(registry.getString(prefix + "name"));
+        value.setType(registry.getString(prefix + "type"));
+
+        //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() );
+
+        List<String> mergedIndexPathList = registry.getList(prefix + "mergedIndexPath");
+        String mergedIndexPath = value.getMergedIndexPath();
+        if (mergedIndexPathList != null && !mergedIndexPathList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = mergedIndexPathList.size(); i < size; i++) {
+                sb.append(mergedIndexPathList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            mergedIndexPath = sb.toString();
+        }
+
+        value.setMergedIndexPath(mergedIndexPath);
+        int mergedIndexTtl = registry.getInt(prefix + "mergedIndexTtl", value.getMergedIndexTtl());
+        value.setMergedIndexTtl(mergedIndexTtl);
+        //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
+
+        value.setLocation( registry.getString( prefix + "location" ) );
+
+        List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
+        String cronExpression = value.getCronExpression();
+        if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
+                sb.append(cronExpressionList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            cronExpression = sb.toString();
+        }
+
+        value.setCronExpression(cronExpression);
+        java.util.List repositories = new java.util.ArrayList/*<String>*/();
+        repositories.addAll(registry.getList(prefix + "repositories.repository"));
+        value.setRepositories(repositories);
+
+        return value;
+    }
+
+    private RepositoryCheckPath readRepositoryCheckPath( String prefix, Registry registry) {
+        RepositoryCheckPath value = new RepositoryCheckPath();
+
+        //String url = registry.getString( prefix + "url", value.getUrl() );
+
+        List<String> urlList = registry.getList(prefix + "url");
+        String url = value.getUrl();
+        if (urlList != null && !urlList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = urlList.size(); i < size; i++) {
+                sb.append(urlList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            url = sb.toString();
+        }
+
+        value.setUrl(url);
+        //String path = registry.getString( prefix + "path", value.getPath() );
+
+        List<String> pathList = registry.getList(prefix + "path");
+        String path = value.getPath();
+        if (pathList != null && !pathList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = pathList.size(); i < size; i++) {
+                sb.append(pathList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            path = sb.toString();
+        }
+
+        value.setPath(path);
+
+        return value;
+    }
+
+    private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration( String prefix, Registry registry) {
+        AbstractRepositoryConnectorConfiguration value = new AbstractRepositoryConnectorConfiguration();
+
+        //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
+
+        List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
+        String sourceRepoId = value.getSourceRepoId();
+        if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
+                sb.append(sourceRepoIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            sourceRepoId = sb.toString();
+        }
+
+        value.setSourceRepoId(sourceRepoId);
+        //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
+
+        List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
+        String targetRepoId = value.getTargetRepoId();
+        if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
+                sb.append(targetRepoIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            targetRepoId = sb.toString();
+        }
+
+        value.setTargetRepoId(targetRepoId);
+        //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
+
+        List<String> proxyIdList = registry.getList(prefix + "proxyId");
+        String proxyId = value.getProxyId();
+        if (proxyIdList != null && !proxyIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = proxyIdList.size(); i < size; i++) {
+                sb.append(proxyIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            proxyId = sb.toString();
+        }
+
+        value.setProxyId(proxyId);
+        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
+        blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
+        value.setBlackListPatterns(blackListPatterns);
+        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
+        whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
+        value.setWhiteListPatterns(whiteListPatterns);
+        java.util.Map policies = registry.getProperties(prefix + "policies");
+        value.setPolicies(policies);
+        java.util.Map properties = registry.getProperties(prefix + "properties");
+        value.setProperties(properties);
+        boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
+        value.setDisabled(disabled);
+
+        return value;
+    }
+
+    private ProxyConnectorRuleConfiguration readProxyConnectorRuleConfiguration(String prefix, Registry registry) {
+        ProxyConnectorRuleConfiguration value = new ProxyConnectorRuleConfiguration();
+
+        //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() );
+
+        List<String> ruleTypeList = registry.getList(prefix + "ruleType");
+        String ruleType = value.getRuleType();
+        if (ruleTypeList != null && !ruleTypeList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = ruleTypeList.size(); i < size; i++) {
+                sb.append(ruleTypeList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            ruleType = sb.toString();
+        }
+
+        value.setRuleType(ruleType);
+        //String pattern = registry.getString( prefix + "pattern", value.getPattern() );
+
+        List<String> patternList = registry.getList(prefix + "pattern");
+        String pattern = value.getPattern();
+        if (patternList != null && !patternList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = patternList.size(); i < size; i++) {
+                sb.append(patternList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            pattern = sb.toString();
+        }
+
+        value.setPattern(pattern);
+        java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
+        List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
+        for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
+            ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
+            proxyConnectors.add(v);
+        }
+        value.setProxyConnectors(proxyConnectors);
+
+        return value;
+    }
+
+    private ProxyConnectorConfiguration readProxyConnectorConfiguration(String prefix, Registry registry) {
+        ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();
+
+        int order = registry.getInt(prefix + "order", value.getOrder());
+        value.setOrder(order);
+        //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
+
+        List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
+        String sourceRepoId = value.getSourceRepoId();
+        if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
+                sb.append(sourceRepoIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            sourceRepoId = sb.toString();
+        }
+
+        value.setSourceRepoId(sourceRepoId);
+        //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
+
+        List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
+        String targetRepoId = value.getTargetRepoId();
+        if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
+                sb.append(targetRepoIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            targetRepoId = sb.toString();
+        }
+
+        value.setTargetRepoId(targetRepoId);
+        //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
+
+        List<String> proxyIdList = registry.getList(prefix + "proxyId");
+        String proxyId = value.getProxyId();
+        if (proxyIdList != null && !proxyIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = proxyIdList.size(); i < size; i++) {
+                sb.append(proxyIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            proxyId = sb.toString();
+        }
+
+        value.setProxyId(proxyId);
+        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
+        blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
+        value.setBlackListPatterns(blackListPatterns);
+        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
+        whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
+        value.setWhiteListPatterns(whiteListPatterns);
+        java.util.Map policies = registry.getProperties(prefix + "policies");
+        value.setPolicies(policies);
+        java.util.Map properties = registry.getProperties(prefix + "properties");
+        value.setProperties(properties);
+        boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
+        value.setDisabled(disabled);
+
+        return value;
+    }
+
+    private SyncConnectorConfiguration readSyncConnectorConfiguration( String prefix, Registry registry) {
+        SyncConnectorConfiguration value = new SyncConnectorConfiguration();
+
+        //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
+
+        List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
+        String cronExpression = value.getCronExpression();
+        if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
+                sb.append(cronExpressionList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            cronExpression = sb.toString();
+        }
+
+        value.setCronExpression(cronExpression);
+        //String method = registry.getString( prefix + "method", value.getMethod() );
+
+        List<String> methodList = registry.getList(prefix + "method");
+        String method = value.getMethod();
+        if (methodList != null && !methodList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = methodList.size(); i < size; i++) {
+                sb.append(methodList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            method = sb.toString();
+        }
+
+        value.setMethod(method);
+        //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
+
+        List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
+        String sourceRepoId = value.getSourceRepoId();
+        if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
+                sb.append(sourceRepoIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            sourceRepoId = sb.toString();
+        }
+
+        value.setSourceRepoId(sourceRepoId);
+        //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
+
+        List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
+        String targetRepoId = value.getTargetRepoId();
+        if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
+                sb.append(targetRepoIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            targetRepoId = sb.toString();
+        }
+
+        value.setTargetRepoId(targetRepoId);
+        //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
+
+        List<String> proxyIdList = registry.getList(prefix + "proxyId");
+        String proxyId = value.getProxyId();
+        if (proxyIdList != null && !proxyIdList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = proxyIdList.size(); i < size; i++) {
+                sb.append(proxyIdList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            proxyId = sb.toString();
+        }
+
+        value.setProxyId(proxyId);
+        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
+        blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
+        value.setBlackListPatterns(blackListPatterns);
+        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
+        whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
+        value.setWhiteListPatterns(whiteListPatterns);
+        java.util.Map policies = registry.getProperties(prefix + "policies");
+        value.setPolicies(policies);
+        java.util.Map properties = registry.getProperties(prefix + "properties");
+        value.setProperties(properties);
+        boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
+        value.setDisabled(disabled);
+
+        return value;
+    }
+
+    private NetworkProxyConfiguration readNetworkProxyConfiguration(String prefix, Registry registry) {
+        NetworkProxyConfiguration value = new NetworkProxyConfiguration();
+
+        //String id = registry.getString( prefix + "id", value.getId() );
+
+        List<String> idList = registry.getList(prefix + "id");
+        String id = value.getId();
+        if (idList != null && !idList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = idList.size(); i < size; i++) {
+                sb.append(idList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            id = sb.toString();
+        }
+
+        value.setId(id);
+        //String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
+
+        List<String> protocolList = registry.getList(prefix + "protocol");
+        String protocol = value.getProtocol();
+        if (protocolList != null && !protocolList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = protocolList.size(); i < size; i++) {
+                sb.append(protocolList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            protocol = sb.toString();
+        }
+
+        value.setProtocol(protocol);
+        //String host = registry.getString( prefix + "host", value.getHost() );
+
+        List<String> hostList = registry.getList(prefix + "host");
+        String host = value.getHost();
+        if (hostList != null && !hostList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = hostList.size(); i < size; i++) {
+                sb.append(hostList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            host = sb.toString();
+        }
+
+        value.setHost(host);
+        int port = registry.getInt(prefix + "port", value.getPort());
+        value.setPort(port);
+        //String username = registry.getString( prefix + "username", value.getUsername() );
+
+        List<String> usernameList = registry.getList(prefix + "username");
+        String username = value.getUsername();
+        if (usernameList != null && !usernameList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = usernameList.size(); i < size; i++) {
+                sb.append(usernameList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            username = sb.toString();
+        }
+
+        value.setUsername(username);
+        //String password = registry.getString( prefix + "password", value.getPassword() );
+
+        List<String> passwordList = registry.getList(prefix + "password");
+        String password = value.getPassword();
+        if (passwordList != null && !passwordList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = passwordList.size(); i < size; i++) {
+                sb.append(passwordList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            password = sb.toString();
+        }
+
+        value.setPassword(password);
+        boolean useNtlm = registry.getBoolean(prefix + "useNtlm", value.isUseNtlm());
+        value.setUseNtlm(useNtlm);
+
+        return value;
+    }
+
+    private RepositoryScanningConfiguration readRepositoryScanningConfiguration(String prefix, Registry registry) {
+        RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();
+
+        java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
+        List fileTypesSubsets = registry.getSubsetList(prefix + "fileTypes.fileType");
+        for (Iterator i = fileTypesSubsets.iterator(); i.hasNext(); ) {
+            FileType v = readFileType("", (Registry) i.next());
+            fileTypes.add(v);
+        }
+        value.setFileTypes(fileTypes);
+        java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
+        knownContentConsumers.addAll(registry.getList(prefix + "knownContentConsumers.knownContentConsumer"));
+        value.setKnownContentConsumers(knownContentConsumers);
+        java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
+        invalidContentConsumers.addAll(registry.getList(prefix + "invalidContentConsumers.invalidContentConsumer"));
+        value.setInvalidContentConsumers(invalidContentConsumers);
+
+        return value;
+    }
+
+    private FileType readFileType(String prefix, Registry registry) {
+        FileType value = new FileType();
+
+        //String id = registry.getString( prefix + "id", value.getId() );
+
+        List<String> idList = registry.getList(prefix + "id");
+        String id = value.getId();
+        if (idList != null && !idList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = idList.size(); i < size; i++) {
+                sb.append(idList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            id = sb.toString();
+        }
+
+        value.setId(id);
+        java.util.List patterns = new java.util.ArrayList/*<String>*/();
+        patterns.addAll(registry.getList(prefix + "patterns.pattern"));
+        value.setPatterns(patterns);
+
+        return value;
+    }
+
+    private OrganisationInformation readOrganisationInformation(String prefix, Registry registry) {
+        OrganisationInformation value = new OrganisationInformation();
+
+        //String name = registry.getString( prefix + "name", value.getName() );
+
+        List<String> nameList = registry.getList(prefix + "name");
+        String name = value.getName();
+        if (nameList != null && !nameList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = nameList.size(); i < size; i++) {
+                sb.append(nameList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            name = sb.toString();
+        }
+
+        value.setName(name);
+        //String url = registry.getString( prefix + "url", value.getUrl() );
+
+        List<String> urlList = registry.getList(prefix + "url");
+        String url = value.getUrl();
+        if (urlList != null && !urlList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = urlList.size(); i < size; i++) {
+                sb.append(urlList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            url = sb.toString();
+        }
+
+        value.setUrl(url);
+        //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() );
+
+        List<String> logoLocationList = registry.getList(prefix + "logoLocation");
+        String logoLocation = value.getLogoLocation();
+        if (logoLocationList != null && !logoLocationList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = logoLocationList.size(); i < size; i++) {
+                sb.append(logoLocationList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            logoLocation = sb.toString();
+        }
+
+        value.setLogoLocation(logoLocation);
+
+        return value;
+    }
+
+    private WebappConfiguration readWebappConfiguration(String prefix, Registry registry) {
+        WebappConfiguration value = new WebappConfiguration();
+
+        UserInterfaceOptions ui = readUserInterfaceOptions(prefix + "ui.", registry);
+        value.setUi(ui);
+
+        return value;
+    }
+
+    private UserInterfaceOptions readUserInterfaceOptions(String prefix, Registry registry) {
+        UserInterfaceOptions value = new UserInterfaceOptions();
+
+        boolean showFindArtifacts = registry.getBoolean(prefix + "showFindArtifacts", value.isShowFindArtifacts());
+        value.setShowFindArtifacts(showFindArtifacts);
+        boolean appletFindEnabled = registry.getBoolean(prefix + "appletFindEnabled", value.isAppletFindEnabled());
+        value.setAppletFindEnabled(appletFindEnabled);
+        boolean disableEasterEggs = registry.getBoolean(prefix + "disableEasterEggs", value.isDisableEasterEggs());
+        value.setDisableEasterEggs(disableEasterEggs);
+        //String applicationUrl = registry.getString( prefix + "applicationUrl", value.getApplicationUrl() );
+
+        List<String> applicationUrlList = registry.getList(prefix + "applicationUrl");
+        String applicationUrl = value.getApplicationUrl();
+        if (applicationUrlList != null && !applicationUrlList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = applicationUrlList.size(); i < size; i++) {
+                sb.append(applicationUrlList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            applicationUrl = sb.toString();
+        }
+
+        value.setApplicationUrl(applicationUrl);
+        boolean disableRegistration = registry.getBoolean(prefix + "disableRegistration", value.isDisableRegistration());
+        value.setDisableRegistration(disableRegistration);
+
+        return value;
+    }
+
+    private NetworkConfiguration readNetworkConfiguration(String prefix, Registry registry) {
+        NetworkConfiguration value = new NetworkConfiguration();
+
+        int maxTotal = registry.getInt(prefix + "maxTotal", value.getMaxTotal());
+        value.setMaxTotal(maxTotal);
+        int maxTotalPerHost = registry.getInt(prefix + "maxTotalPerHost", value.getMaxTotalPerHost());
+        value.setMaxTotalPerHost(maxTotalPerHost);
+        boolean usePooling = registry.getBoolean(prefix + "usePooling", value.isUsePooling());
+        value.setUsePooling(usePooling);
+
+        return value;
+    }
+
+    private ArchivaRuntimeConfiguration readArchivaRuntimeConfiguration(String prefix, Registry registry) {
+        ArchivaRuntimeConfiguration value = new ArchivaRuntimeConfiguration();
+
+        CacheConfiguration urlFailureCacheConfiguration = readCacheConfiguration(prefix + "urlFailureCacheConfiguration.", registry);
+        value.setUrlFailureCacheConfiguration(urlFailureCacheConfiguration);
+        FileLockConfiguration fileLockConfiguration = readFileLockConfiguration(prefix + "fileLockConfiguration.", registry);
+        value.setFileLockConfiguration(fileLockConfiguration);
+        //String dataDirectory = registry.getString( prefix + "dataDirectory", value.getDataDirectory() );
+
+        List<String> dataDirectoryList = registry.getList(prefix + "dataDirectory");
+        String dataDirectory = value.getDataDirectory();
+        if (dataDirectoryList != null && !dataDirectoryList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = dataDirectoryList.size(); i < size; i++) {
+                sb.append(dataDirectoryList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            dataDirectory = sb.toString();
+        }
+
+        value.setDataDirectory(dataDirectory);
+        //String repositoryBaseDirectory = registry.getString( prefix + "repositoryBaseDirectory", value.getRepositoryBaseDirectory() );
+
+        List<String> repositoryBaseDirectoryList = registry.getList(prefix + "repositoryBaseDirectory");
+        String repositoryBaseDirectory = value.getRepositoryBaseDirectory();
+        if (repositoryBaseDirectoryList != null && !repositoryBaseDirectoryList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = repositoryBaseDirectoryList.size(); i < size; i++) {
+                sb.append(repositoryBaseDirectoryList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            repositoryBaseDirectory = sb.toString();
+        }
+
+        value.setRepositoryBaseDirectory(repositoryBaseDirectory);
+        //String remoteRepositoryBaseDirectory = registry.getString( prefix + "remoteRepositoryBaseDirectory", value.getRemoteRepositoryBaseDirectory() );
+
+        List<String> remoteRepositoryBaseDirectoryList = registry.getList(prefix + "remoteRepositoryBaseDirectory");
+        String remoteRepositoryBaseDirectory = value.getRemoteRepositoryBaseDirectory();
+        if (remoteRepositoryBaseDirectoryList != null && !remoteRepositoryBaseDirectoryList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = remoteRepositoryBaseDirectoryList.size(); i < size; i++) {
+                sb.append(remoteRepositoryBaseDirectoryList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            remoteRepositoryBaseDirectory = sb.toString();
+        }
+
+        value.setRemoteRepositoryBaseDirectory(remoteRepositoryBaseDirectory);
+        //String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() );
+
+
+        List<String> repositoryGroupBaseDirectoryList = registry.getList(prefix + "repositoryGroupBaseDirectory");
+        String repositoryGroupBaseDirectory = value.getRepositoryGroupBaseDirectory();
+        if (repositoryGroupBaseDirectoryList != null && !repositoryGroupBaseDirectoryList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = repositoryGroupBaseDirectoryList.size(); i < size; i++) {
+                sb.append(repositoryGroupBaseDirectoryList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            repositoryGroupBaseDirectory = sb.toString();
+        }
+
+        value.setRepositoryGroupBaseDirectory(repositoryGroupBaseDirectory);
+
+        List<String> defaultLanguageList = registry.getList(prefix + "defaultLanguage");
+        String defaultLanguage = value.getDefaultLanguage();
+        if (defaultLanguageList != null && !defaultLanguageList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = defaultLanguageList.size(); i < size; i++) {
+                sb.append(defaultLanguageList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            defaultLanguage = sb.toString();
+        }
+
+        value.setDefaultLanguage(defaultLanguage);
+        //String languageRange = registry.getString( prefix + "languageRange", value.getLanguageRange() );
+
+        List<String> languageRangeList = registry.getList(prefix + "languageRange");
+        String languageRange = value.getLanguageRange();
+        if (languageRangeList != null && !languageRangeList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = languageRangeList.size(); i < size; i++) {
+                sb.append(languageRangeList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            languageRange = sb.toString();
+        }
+
+        value.setLanguageRange(languageRange);
+
+        List<String> checksumTypeList = registry.getList(prefix + "checksumTypes.type");
+        value.setChecksumTypes(checksumTypeList);
+
+        return value;
+    }
+
+    private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration(String prefix, Registry registry) {
+        RedbackRuntimeConfiguration value = new RedbackRuntimeConfiguration();
+
+        boolean migratedFromRedbackConfiguration = registry.getBoolean(prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration());
+        value.setMigratedFromRedbackConfiguration(migratedFromRedbackConfiguration);
+        java.util.List userManagerImpls = new java.util.ArrayList/*<String>*/();
+        userManagerImpls.addAll(registry.getList(prefix + "userManagerImpls.userManagerImpl"));
+        value.setUserManagerImpls(userManagerImpls);
+        java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
+        rbacManagerImpls.addAll(registry.getList(prefix + "rbacManagerImpls.rbacManagerImpl"));
+        value.setRbacManagerImpls(rbacManagerImpls);
+        LdapConfiguration ldapConfiguration = readLdapConfiguration(prefix + "ldapConfiguration.", registry);
+        value.setLdapConfiguration(ldapConfiguration);
+        java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
+        List ldapGroupMappingsSubsets = registry.getSubsetList(prefix + "ldapGroupMappings.ldapGroupMapping");
+        for (Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); ) {
+            LdapGroupMapping v = readLdapGroupMapping("", (Registry) i.next());
+            ldapGroupMappings.add(v);
+        }
+        value.setLdapGroupMappings(ldapGroupMappings);
+        java.util.Map configurationProperties = registry.getProperties(prefix + "configurationProperties");
+        value.setConfigurationProperties(configurationProperties);
+        boolean useUsersCache = registry.getBoolean(prefix + "useUsersCache", value.isUseUsersCache());
+        value.setUseUsersCache(useUsersCache);
+        CacheConfiguration usersCacheConfiguration = readCacheConfiguration(prefix + "usersCacheConfiguration.", registry);
+        value.setUsersCacheConfiguration(usersCacheConfiguration);
+
+        return value;
+    }
+
+    private ArchivaDefaultConfiguration readArchivaDefaultConfiguration(String prefix, Registry registry) {
+        ArchivaDefaultConfiguration value = new ArchivaDefaultConfiguration();
+
+        java.util.List defaultCheckPaths = new java.util.ArrayList/*<RepositoryCheckPath>*/();
+        List defaultCheckPathsSubsets = registry.getSubsetList(prefix + "defaultCheckPaths.defaultCheckPath");
+        for (Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); ) {
+            RepositoryCheckPath v = readRepositoryCheckPath("", (Registry) i.next());
+            defaultCheckPaths.add(v);
+        }
+        value.setDefaultCheckPaths(defaultCheckPaths);
+
+        return value;
+    }
+
+    private LdapConfiguration readLdapConfiguration(String prefix, Registry registry) {
+        LdapConfiguration value = new LdapConfiguration();
+
+        //String hostName = registry.getString( prefix + "hostName", value.getHostName() );
+
+        List<String> hostNameList = registry.getList(prefix + "hostName");
+        String hostName = value.getHostName();
+        if (hostNameList != null && !hostNameList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = hostNameList.size(); i < size; i++) {
+                sb.append(hostNameList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            hostName = sb.toString();
+        }
+
+        value.setHostName(hostName);
+        int port = registry.getInt(prefix + "port", value.getPort());
+        value.setPort(port);
+        boolean ssl = registry.getBoolean(prefix + "ssl", value.isSsl());
+        value.setSsl(ssl);
+        //String baseDn = registry.getString( prefix + "baseDn", value.getBaseDn() );
+
+        List<String> baseDnList = registry.getList(prefix + "baseDn");
+        String baseDn = value.getBaseDn();
+        if (baseDnList != null && !baseDnList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = baseDnList.size(); i < size; i++) {
+                sb.append(baseDnList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            baseDn = sb.toString();
+        }
+
+        value.setBaseDn(baseDn);
+        //String baseGroupsDn = registry.getString( prefix + "baseGroupsDn", value.getBaseGroupsDn() );
+
+        List<String> baseGroupsDnList = registry.getList(prefix + "baseGroupsDn");
+        String baseGroupsDn = value.getBaseGroupsDn();
+        if (baseGroupsDnList != null && !baseGroupsDnList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = baseGroupsDnList.size(); i < size; i++) {
+                sb.append(baseGroupsDnList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            baseGroupsDn = sb.toString();
+        }
+
+        value.setBaseGroupsDn(baseGroupsDn);
+        //String contextFactory = registry.getString( prefix + "contextFactory", value.getContextFactory() );
+
+        List<String> contextFactoryList = registry.getList(prefix + "contextFactory");
+        String contextFactory = value.getContextFactory();
+        if (contextFactoryList != null && !contextFactoryList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = contextFactoryList.size(); i < size; i++) {
+                sb.append(contextFactoryList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            contextFactory = sb.toString();
+        }
+
+        value.setContextFactory(contextFactory);
+        //String bindDn = registry.getString( prefix + "bindDn", value.getBindDn() );
+
+        List<String> bindDnList = registry.getList(prefix + "bindDn");
+        String bindDn = value.getBindDn();
+        if (bindDnList != null && !bindDnList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = bindDnList.size(); i < size; i++) {
+                sb.append(bindDnList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            bindDn = sb.toString();
+        }
+
+        value.setBindDn(bindDn);
+        //String password = registry.getString( prefix + "password", value.getPassword() );
+
+        List<String> passwordList = registry.getList(prefix + "password");
+        String password = value.getPassword();
+        if (passwordList != null && !passwordList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = passwordList.size(); i < size; i++) {
+                sb.append(passwordList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            password = sb.toString();
+        }
+
+        value.setPassword(password);
+        //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() );
+
+        List<String> authenticationMethodList = registry.getList(prefix + "authenticationMethod");
+        String authenticationMethod = value.getAuthenticationMethod();
+        if (authenticationMethodList != null && !authenticationMethodList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = authenticationMethodList.size(); i < size; i++) {
+                sb.append(authenticationMethodList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            authenticationMethod = sb.toString();
+        }
+
+        value.setAuthenticationMethod(authenticationMethod);
+        boolean bindAuthenticatorEnabled = registry.getBoolean(prefix + "bindAuthenticatorEnabled", value.isBindAuthenticatorEnabled());
+        value.setBindAuthenticatorEnabled(bindAuthenticatorEnabled);
+        boolean writable = registry.getBoolean(prefix + "writable", value.isWritable());
+        value.setWritable(writable);
+        boolean useRoleNameAsGroup = registry.getBoolean(prefix + "useRoleNameAsGroup", value.isUseRoleNameAsGroup());
+        value.setUseRoleNameAsGroup(useRoleNameAsGroup);
+        java.util.Map extraProperties = registry.getProperties(prefix + "extraProperties");
+        value.setExtraProperties(extraProperties);
+
+        return value;
+    }
+
+    private FileLockConfiguration readFileLockConfiguration(String prefix, Registry registry) {
+        FileLockConfiguration value = new FileLockConfiguration();
+
+        boolean skipLocking = registry.getBoolean(prefix + "skipLocking", value.isSkipLocking());
+        value.setSkipLocking(skipLocking);
+        int lockingTimeout = registry.getInt(prefix + "lockingTimeout", value.getLockingTimeout());
+        value.setLockingTimeout(lockingTimeout);
+
+        return value;
+    }
+
+    private CacheConfiguration readCacheConfiguration(String prefix, Registry registry) {
+        CacheConfiguration value = new CacheConfiguration();
+
+        int timeToIdleSeconds = registry.getInt(prefix + "timeToIdleSeconds", value.getTimeToIdleSeconds());
+        value.setTimeToIdleSeconds(timeToIdleSeconds);
+        int timeToLiveSeconds = registry.getInt(prefix + "timeToLiveSeconds", value.getTimeToLiveSeconds());
+        value.setTimeToLiveSeconds(timeToLiveSeconds);
+        int maxElementsInMemory = registry.getInt(prefix + "maxElementsInMemory", value.getMaxElementsInMemory());
+        value.setMaxElementsInMemory(maxElementsInMemory);
+        int maxElementsOnDisk = registry.getInt(prefix + "maxElementsOnDisk", value.getMaxElementsOnDisk());
+        value.setMaxElementsOnDisk(maxElementsOnDisk);
+
+        return value;
+    }
+
+    private LdapGroupMapping readLdapGroupMapping(String prefix, Registry registry) {
+        LdapGroupMapping value = new LdapGroupMapping();
+
+        //String group = registry.getString( prefix + "group", value.getGroup() );
+
+        List<String> groupList = registry.getList(prefix + "group");
+        String group = value.getGroup();
+        if (groupList != null && !groupList.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0, size = groupList.size(); i < size; i++) {
+                sb.append(groupList.get(i));
+                if (i < size - 1) {
+                    sb.append(',');
+                }
+            }
+            group = sb.toString();
+        }
+
+        value.setGroup(group);
+        java.util.List roleNames = new java.util.ArrayList/*<String>*/();
+        roleNames.addAll(registry.getList(prefix + "roleNames.roleName"));
+        value.setRoleNames(roleNames);
+
+        return value;
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/io/registry/ConfigurationRegistryWriter.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/io/registry/ConfigurationRegistryWriter.java
new file mode 100644 (file)
index 0000000..253eae8
--- /dev/null
@@ -0,0 +1,1141 @@
+
+package org.apache.archiva.configuration.provider.io.registry;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.components.registry.Registry;
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.model.AbstractRepositoryConnectorConfiguration;
+import org.apache.archiva.configuration.model.ArchivaDefaultConfiguration;
+import org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration;
+import org.apache.archiva.configuration.model.CacheConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.FileLockConfiguration;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.model.LdapConfiguration;
+import org.apache.archiva.configuration.model.LdapGroupMapping;
+import org.apache.archiva.configuration.model.LegacyArtifactPath;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.NetworkConfiguration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.OrganisationInformation;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorRuleConfiguration;
+import org.apache.archiva.configuration.model.RedbackRuntimeConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryCheckPath;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.model.SyncConnectorConfiguration;
+import org.apache.archiva.configuration.model.UserInterfaceOptions;
+import org.apache.archiva.configuration.model.WebappConfiguration;
+
+import java.util.Iterator;
+import java.util.List;
+
+// Util imports
+// Model class imports
+
+
+/**
+ * Generate Plexus Registry output mechanism for model 'Configuration'.
+ */
+public class ConfigurationRegistryWriter {
+    public void write( Configuration model, Registry registry) {
+        writeConfiguration("", model, registry);
+    }
+
+    private void writeList(Registry registry, List<String> subList, String subsetPath, String elementName) {
+        if (subList != null && subList.size() > 0
+        ) {
+            registry.removeSubset(subsetPath);
+
+            int count = 0;
+            for (Iterator<String> iter = subList.iterator(); iter.hasNext(); count++) {
+                String name = subsetPath + "." + elementName + "(" + count + ")";
+                String value = iter.next();
+                registry.setString(name, value);
+            }
+        }
+    }
+
+    private void writeConfiguration(String prefix, Configuration value, Registry registry) {
+        if (value != null) {
+            if (value.getVersion() != null
+            ) {
+                String version = "version";
+                registry.setString(prefix + version, value.getVersion());
+            }
+            if (value.getMetadataStore() != null && !value.getMetadataStore().equals("jcr")
+            ) {
+                String metadataStore = "metadataStore";
+                registry.setString(prefix + metadataStore, value.getMetadataStore());
+            }
+            if (value.getRepositoryGroups() != null && value.getRepositoryGroups().size() > 0
+            ) {
+                registry.removeSubset(prefix + "repositoryGroups");
+
+                int count = 0;
+                for (Iterator iter = value.getRepositoryGroups().iterator(); iter.hasNext(); count++) {
+                    String name = "repositoryGroups.repositoryGroup(" + count + ")";
+                    RepositoryGroupConfiguration o = (RepositoryGroupConfiguration) iter.next();
+                    writeRepositoryGroupConfiguration(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getManagedRepositories() != null && value.getManagedRepositories().size() > 0
+            ) {
+                registry.removeSubset(prefix + "managedRepositories");
+
+                int count = 0;
+                for (Iterator iter = value.getManagedRepositories().iterator(); iter.hasNext(); count++) {
+                    String name = "managedRepositories.managedRepository(" + count + ")";
+                    ManagedRepositoryConfiguration o = (ManagedRepositoryConfiguration) iter.next();
+                    writeManagedRepositoryConfiguration(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getRemoteRepositories() != null && value.getRemoteRepositories().size() > 0
+            ) {
+                registry.removeSubset(prefix + "remoteRepositories");
+
+                int count = 0;
+                for (Iterator iter = value.getRemoteRepositories().iterator(); iter.hasNext(); count++) {
+                    String name = "remoteRepositories.remoteRepository(" + count + ")";
+                    RemoteRepositoryConfiguration o = (RemoteRepositoryConfiguration) iter.next();
+                    writeRemoteRepositoryConfiguration(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getProxyConnectors() != null && value.getProxyConnectors().size() > 0
+            ) {
+                registry.removeSubset(prefix + "proxyConnectors");
+
+                int count = 0;
+                for (Iterator iter = value.getProxyConnectors().iterator(); iter.hasNext(); count++) {
+                    String name = "proxyConnectors.proxyConnector(" + count + ")";
+                    ProxyConnectorConfiguration o = (ProxyConnectorConfiguration) iter.next();
+                    writeProxyConnectorConfiguration(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getNetworkProxies() != null && value.getNetworkProxies().size() > 0
+            ) {
+                registry.removeSubset(prefix + "networkProxies");
+
+                int count = 0;
+                for (Iterator iter = value.getNetworkProxies().iterator(); iter.hasNext(); count++) {
+                    String name = "networkProxies.networkProxy(" + count + ")";
+                    NetworkProxyConfiguration o = (NetworkProxyConfiguration) iter.next();
+                    writeNetworkProxyConfiguration(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getLegacyArtifactPaths() != null && value.getLegacyArtifactPaths().size() > 0
+            ) {
+                registry.removeSubset(prefix + "legacyArtifactPaths");
+
+                int count = 0;
+                for (Iterator iter = value.getLegacyArtifactPaths().iterator(); iter.hasNext(); count++) {
+                    String name = "legacyArtifactPaths.legacyArtifactPath(" + count + ")";
+                    LegacyArtifactPath o = (LegacyArtifactPath) iter.next();
+                    writeLegacyArtifactPath(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getRepositoryScanning() != null
+            ) {
+                writeRepositoryScanningConfiguration(prefix + "repositoryScanning.", value.getRepositoryScanning(), registry);
+            }
+            if (value.getWebapp() != null
+            ) {
+                writeWebappConfiguration(prefix + "webapp.", value.getWebapp(), registry);
+            }
+            if (value.getOrganisationInfo() != null
+            ) {
+                writeOrganisationInformation(prefix + "organisationInfo.", value.getOrganisationInfo(), registry);
+            }
+            if (value.getNetworkConfiguration() != null
+            ) {
+                writeNetworkConfiguration(prefix + "networkConfiguration.", value.getNetworkConfiguration(), registry);
+            }
+            if (value.getRedbackRuntimeConfiguration() != null
+            ) {
+                writeRedbackRuntimeConfiguration(prefix + "redbackRuntimeConfiguration.", value.getRedbackRuntimeConfiguration(), registry);
+            }
+            if (value.getArchivaRuntimeConfiguration() != null
+            ) {
+                writeArchivaRuntimeConfiguration(prefix + "archivaRuntimeConfiguration.", value.getArchivaRuntimeConfiguration(), registry);
+            }
+            if (value.getProxyConnectorRuleConfigurations() != null && value.getProxyConnectorRuleConfigurations().size() > 0
+            ) {
+                registry.removeSubset(prefix + "proxyConnectorRuleConfigurations");
+
+                int count = 0;
+                for (Iterator iter = value.getProxyConnectorRuleConfigurations().iterator(); iter.hasNext(); count++) {
+                    String name = "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration(" + count + ")";
+                    ProxyConnectorRuleConfiguration o = (ProxyConnectorRuleConfiguration) iter.next();
+                    writeProxyConnectorRuleConfiguration(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getArchivaDefaultConfiguration() != null
+            ) {
+                writeArchivaDefaultConfiguration(prefix + "archivaDefaultConfiguration.", value.getArchivaDefaultConfiguration(), registry);
+            }
+        }
+    }
+
+    private void writeAbstractRepositoryConfiguration( String prefix, AbstractRepositoryConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getId() != null
+            ) {
+                String id = "id";
+                registry.setString(prefix + id, value.getId());
+            }
+            if (value.getType() != null && !value.getType().equals("MAVEN")
+            ) {
+                String type = "type";
+                registry.setString(prefix + type, value.getType());
+            }
+            if (value.getName() != null
+            ) {
+                String name = "name";
+                registry.setString(prefix + name, value.getName());
+            }
+            if (value.getLayout() != null && !value.getLayout().equals("default")
+            ) {
+                String layout = "layout";
+                registry.setString(prefix + layout, value.getLayout());
+            }
+            if (value.getIndexDir() != null && !value.getIndexDir().equals("")
+            ) {
+                String indexDir = "indexDir";
+                registry.setString(prefix + indexDir, value.getIndexDir());
+            }
+            if (value.getPackedIndexDir() != null && !value.getPackedIndexDir().equals("")
+            ) {
+                String packedIndexDir = "packedIndexDir";
+                registry.setString(prefix + packedIndexDir, value.getPackedIndexDir());
+            }
+            if (value.getDescription() != null && !value.getDescription().equals("")
+            ) {
+                String description = "description";
+                registry.setString(prefix + description, value.getDescription());
+            }
+        }
+    }
+
+    private void writeRemoteRepositoryConfiguration(String prefix, RemoteRepositoryConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getUrl() != null
+            ) {
+                String url = "url";
+                registry.setString(prefix + url, value.getUrl());
+            }
+            if (value.getUsername() != null
+            ) {
+                String username = "username";
+                registry.setString(prefix + username, value.getUsername());
+            }
+            if (value.getPassword() != null
+            ) {
+                String password = "password";
+                registry.setString(prefix + password, value.getPassword());
+            }
+            if (value.getTimeout() != 60
+            ) {
+                String timeout = "timeout";
+                registry.setInt(prefix + timeout, value.getTimeout());
+            }
+            if (value.getRefreshCronExpression() != null && !value.getRefreshCronExpression().equals("0 0 08 ? * SUN")
+            ) {
+                String refreshCronExpression = "refreshCronExpression";
+                registry.setString(prefix + refreshCronExpression, value.getRefreshCronExpression());
+            }
+            String downloadRemoteIndex = "downloadRemoteIndex";
+            registry.setBoolean(prefix + downloadRemoteIndex, value.isDownloadRemoteIndex());
+            if (value.getRemoteIndexUrl() != null
+            ) {
+                String remoteIndexUrl = "remoteIndexUrl";
+                registry.setString(prefix + remoteIndexUrl, value.getRemoteIndexUrl());
+            }
+            if (value.getRemoteDownloadNetworkProxyId() != null
+            ) {
+                String remoteDownloadNetworkProxyId = "remoteDownloadNetworkProxyId";
+                registry.setString(prefix + remoteDownloadNetworkProxyId, value.getRemoteDownloadNetworkProxyId());
+            }
+            if (value.getRemoteDownloadTimeout() != 300
+            ) {
+                String remoteDownloadTimeout = "remoteDownloadTimeout";
+                registry.setInt(prefix + remoteDownloadTimeout, value.getRemoteDownloadTimeout());
+            }
+            String downloadRemoteIndexOnStartup = "downloadRemoteIndexOnStartup";
+            registry.setBoolean(prefix + downloadRemoteIndexOnStartup, value.isDownloadRemoteIndexOnStartup());
+            if (value.getExtraParameters() != null && value.getExtraParameters().size() > 0
+            ) {
+                registry.removeSubset(prefix + "extraParameters");
+
+                for (Iterator iter = value.getExtraParameters().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getExtraParameters().get(key);
+
+                    registry.setString(prefix + "extraParameters." + key, v);
+                }
+            }
+            if (value.getExtraHeaders() != null && value.getExtraHeaders().size() > 0
+            ) {
+                registry.removeSubset(prefix + "extraHeaders");
+
+                for (Iterator iter = value.getExtraHeaders().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getExtraHeaders().get(key);
+
+                    registry.setString(prefix + "extraHeaders." + key, v);
+                }
+            }
+            if (value.getCheckPath() != null
+            ) {
+                String checkPath = "checkPath";
+                registry.setString(prefix + checkPath, value.getCheckPath());
+            }
+            if (value.getId() != null
+            ) {
+                String id = "id";
+                registry.setString(prefix + id, value.getId());
+            }
+            if (value.getType() != null && !value.getType().equals("MAVEN")
+            ) {
+                String type = "type";
+                registry.setString(prefix + type, value.getType());
+            }
+            if (value.getName() != null
+            ) {
+                String name = "name";
+                registry.setString(prefix + name, value.getName());
+            }
+            if (value.getLayout() != null && !value.getLayout().equals("default")
+            ) {
+                String layout = "layout";
+                registry.setString(prefix + layout, value.getLayout());
+            }
+            if (value.getIndexDir() != null && !value.getIndexDir().equals("")
+            ) {
+                String indexDir = "indexDir";
+                registry.setString(prefix + indexDir, value.getIndexDir());
+            }
+            if (value.getPackedIndexDir() != null && !value.getPackedIndexDir().equals("")
+            ) {
+                String packedIndexDir = "packedIndexDir";
+                registry.setString(prefix + packedIndexDir, value.getPackedIndexDir());
+            }
+            if (value.getDescription() != null && !value.getDescription().equals("")
+            ) {
+                String description = "description";
+                registry.setString(prefix + description, value.getDescription());
+            }
+        }
+    }
+
+    private void writeManagedRepositoryConfiguration(String prefix, ManagedRepositoryConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getLocation() != null
+            ) {
+                String location = "location";
+                registry.setString(prefix + location, value.getLocation());
+            }
+            String releases = "releases";
+            registry.setBoolean(prefix + releases, value.isReleases());
+            String blockRedeployments = "blockRedeployments";
+            registry.setBoolean(prefix + blockRedeployments, value.isBlockRedeployments());
+            String snapshots = "snapshots";
+            registry.setBoolean(prefix + snapshots, value.isSnapshots());
+            String scanned = "scanned";
+            registry.setBoolean(prefix + scanned, value.isScanned());
+            if (value.getRefreshCronExpression() != null && !value.getRefreshCronExpression().equals("0 0 * * * ?")
+            ) {
+                String refreshCronExpression = "refreshCronExpression";
+                registry.setString(prefix + refreshCronExpression, value.getRefreshCronExpression());
+            }
+            if (value.getRetentionCount() != 2
+            ) {
+                String retentionCount = "retentionCount";
+                registry.setInt(prefix + retentionCount, value.getRetentionCount());
+            }
+            if (value.getRetentionPeriod() != 100
+            ) {
+                String retentionPeriod = "retentionPeriod";
+                registry.setInt(prefix + retentionPeriod, value.getRetentionPeriod());
+            }
+            String deleteReleasedSnapshots = "deleteReleasedSnapshots";
+            registry.setBoolean(prefix + deleteReleasedSnapshots, value.isDeleteReleasedSnapshots());
+            String skipPackedIndexCreation = "skipPackedIndexCreation";
+            registry.setBoolean(prefix + skipPackedIndexCreation, value.isSkipPackedIndexCreation());
+            String stageRepoNeeded = "stageRepoNeeded";
+            registry.setBoolean(prefix + stageRepoNeeded, value.isStageRepoNeeded());
+            if (value.getId() != null
+            ) {
+                String id = "id";
+                registry.setString(prefix + id, value.getId());
+            }
+            if (value.getType() != null && !value.getType().equals("MAVEN")
+            ) {
+                String type = "type";
+                registry.setString(prefix + type, value.getType());
+            }
+            if (value.getName() != null
+            ) {
+                String name = "name";
+                registry.setString(prefix + name, value.getName());
+            }
+            if (value.getLayout() != null && !value.getLayout().equals("default")
+            ) {
+                String layout = "layout";
+                registry.setString(prefix + layout, value.getLayout());
+            }
+            if (value.getIndexDir() != null && !value.getIndexDir().equals("")
+            ) {
+                String indexDir = "indexDir";
+                registry.setString(prefix + indexDir, value.getIndexDir());
+            }
+            if (value.getPackedIndexDir() != null && !value.getPackedIndexDir().equals("")
+            ) {
+                String packedIndexDir = "packedIndexDir";
+                registry.setString(prefix + packedIndexDir, value.getPackedIndexDir());
+            }
+            if (value.getDescription() != null && !value.getDescription().equals("")
+            ) {
+                String description = "description";
+                registry.setString(prefix + description, value.getDescription());
+            }
+        }
+    }
+
+    private void writeLegacyArtifactPath(String prefix, LegacyArtifactPath value, Registry registry) {
+        if (value != null) {
+            if (value.getPath() != null
+            ) {
+                String path = "path";
+                registry.setString(prefix + path, value.getPath());
+            }
+            if (value.getArtifact() != null
+            ) {
+                String artifact = "artifact";
+                registry.setString(prefix + artifact, value.getArtifact());
+            }
+        }
+    }
+
+    private void writeRepositoryGroupConfiguration(String prefix, RepositoryGroupConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getId() != null
+            ) {
+                String id = "id";
+                registry.setString(prefix + id, value.getId());
+            }
+            if (value.getName() != null) {
+                registry.setString(prefix + "name", value.getName());
+            }
+            if (value.getType() != null) {
+                registry.setString(prefix + "type", value.getType());
+            }
+            if (value.getLocation()!=null) {
+                registry.setString( prefix+"location", value.getType( ) );
+            }
+            if (value.getMergedIndexPath() != null && !value.getMergedIndexPath().equals(".indexer")
+            ) {
+                String mergedIndexPath = "mergedIndexPath";
+                registry.setString(prefix + mergedIndexPath, value.getMergedIndexPath());
+            }
+            if (value.getMergedIndexTtl() != 30
+            ) {
+                String mergedIndexTtl = "mergedIndexTtl";
+                registry.setInt(prefix + mergedIndexTtl, value.getMergedIndexTtl());
+            }
+            if (value.getCronExpression() != null && !value.getCronExpression().equals("")
+            ) {
+                String cronExpression = "cronExpression";
+                registry.setString(prefix + cronExpression, value.getCronExpression());
+            }
+            if (value.getRepositories() != null && value.getRepositories().size() > 0
+            ) {
+                registry.removeSubset(prefix + "repositories");
+
+                int count = 0;
+                for (Iterator iter = value.getRepositories().iterator(); iter.hasNext(); count++) {
+                    String name = "repositories.repository(" + count + ")";
+                    String repository = (String) iter.next();
+                    registry.setString(prefix + name, repository);
+                }
+            }
+        }
+    }
+
+    private void writeRepositoryCheckPath( String prefix, RepositoryCheckPath value, Registry registry) {
+        if (value != null) {
+            if (value.getUrl() != null
+            ) {
+                String url = "url";
+                registry.setString(prefix + url, value.getUrl());
+            }
+            if (value.getPath() != null
+            ) {
+                String path = "path";
+                registry.setString(prefix + path, value.getPath());
+            }
+        }
+    }
+
+    private void writeAbstractRepositoryConnectorConfiguration( String prefix, AbstractRepositoryConnectorConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getSourceRepoId() != null
+            ) {
+                String sourceRepoId = "sourceRepoId";
+                registry.setString(prefix + sourceRepoId, value.getSourceRepoId());
+            }
+            if (value.getTargetRepoId() != null
+            ) {
+                String targetRepoId = "targetRepoId";
+                registry.setString(prefix + targetRepoId, value.getTargetRepoId());
+            }
+            if (value.getProxyId() != null
+            ) {
+                String proxyId = "proxyId";
+                registry.setString(prefix + proxyId, value.getProxyId());
+            }
+            if (value.getBlackListPatterns() != null && value.getBlackListPatterns().size() > 0
+            ) {
+                registry.removeSubset(prefix + "blackListPatterns");
+
+                int count = 0;
+                for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) {
+                    String name = "blackListPatterns.blackListPattern(" + count + ")";
+                    String blackListPattern = (String) iter.next();
+                    registry.setString(prefix + name, blackListPattern);
+                }
+            }
+            if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0
+            ) {
+                registry.removeSubset(prefix + "whiteListPatterns");
+
+                int count = 0;
+                for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) {
+                    String name = "whiteListPatterns.whiteListPattern(" + count + ")";
+                    String whiteListPattern = (String) iter.next();
+                    registry.setString(prefix + name, whiteListPattern);
+                }
+            }
+            if (value.getPolicies() != null && value.getPolicies().size() > 0
+            ) {
+                registry.removeSubset(prefix + "policies");
+
+                for (Iterator iter = value.getPolicies().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getPolicies().get(key);
+
+                    registry.setString(prefix + "policies." + key, v);
+                }
+            }
+            if (value.getProperties() != null && value.getProperties().size() > 0
+            ) {
+                registry.removeSubset(prefix + "properties");
+
+                for (Iterator iter = value.getProperties().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getProperties().get(key);
+
+                    registry.setString(prefix + "properties." + key, v);
+                }
+            }
+            String disabled = "disabled";
+            registry.setBoolean(prefix + disabled, value.isDisabled());
+        }
+    }
+
+    private void writeProxyConnectorRuleConfiguration(String prefix, ProxyConnectorRuleConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getRuleType() != null
+            ) {
+                String ruleType = "ruleType";
+                registry.setString(prefix + ruleType, value.getRuleType());
+            }
+            if (value.getPattern() != null
+            ) {
+                String pattern = "pattern";
+                registry.setString(prefix + pattern, value.getPattern());
+            }
+            if (value.getProxyConnectors() != null && value.getProxyConnectors().size() > 0
+            ) {
+                registry.removeSubset(prefix + "proxyConnectors");
+
+                int count = 0;
+                for (Iterator iter = value.getProxyConnectors().iterator(); iter.hasNext(); count++) {
+                    String name = "proxyConnectors.proxyConnector(" + count + ")";
+                    ProxyConnectorConfiguration o = (ProxyConnectorConfiguration) iter.next();
+                    writeProxyConnectorConfiguration(prefix + name + ".", o, registry);
+                }
+            }
+        }
+    }
+
+    private void writeProxyConnectorConfiguration(String prefix, ProxyConnectorConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getOrder() != 0
+            ) {
+                String order = "order";
+                registry.setInt(prefix + order, value.getOrder());
+            }
+            if (value.getSourceRepoId() != null
+            ) {
+                String sourceRepoId = "sourceRepoId";
+                registry.setString(prefix + sourceRepoId, value.getSourceRepoId());
+            }
+            if (value.getTargetRepoId() != null
+            ) {
+                String targetRepoId = "targetRepoId";
+                registry.setString(prefix + targetRepoId, value.getTargetRepoId());
+            }
+            if (value.getProxyId() != null
+            ) {
+                String proxyId = "proxyId";
+                registry.setString(prefix + proxyId, value.getProxyId());
+            }
+            if (value.getBlackListPatterns() != null && value.getBlackListPatterns().size() > 0
+            ) {
+                registry.removeSubset(prefix + "blackListPatterns");
+
+                int count = 0;
+                for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) {
+                    String name = "blackListPatterns.blackListPattern(" + count + ")";
+                    String blackListPattern = (String) iter.next();
+                    registry.setString(prefix + name, blackListPattern);
+                }
+            }
+            if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0
+            ) {
+                registry.removeSubset(prefix + "whiteListPatterns");
+
+                int count = 0;
+                for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) {
+                    String name = "whiteListPatterns.whiteListPattern(" + count + ")";
+                    String whiteListPattern = (String) iter.next();
+                    registry.setString(prefix + name, whiteListPattern);
+                }
+            }
+            if (value.getPolicies() != null && value.getPolicies().size() > 0
+            ) {
+                registry.removeSubset(prefix + "policies");
+
+                for (Iterator iter = value.getPolicies().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getPolicies().get(key);
+
+                    registry.setString(prefix + "policies." + key, v);
+                }
+            }
+            if (value.getProperties() != null && value.getProperties().size() > 0
+            ) {
+                registry.removeSubset(prefix + "properties");
+
+                for (Iterator iter = value.getProperties().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getProperties().get(key);
+
+                    registry.setString(prefix + "properties." + key, v);
+                }
+            }
+            String disabled = "disabled";
+            registry.setBoolean(prefix + disabled, value.isDisabled());
+        }
+    }
+
+    private void writeSyncConnectorConfiguration( String prefix, SyncConnectorConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getCronExpression() != null && !value.getCronExpression().equals("0 0 * * * ?")
+            ) {
+                String cronExpression = "cronExpression";
+                registry.setString(prefix + cronExpression, value.getCronExpression());
+            }
+            if (value.getMethod() != null && !value.getMethod().equals("rsync")
+            ) {
+                String method = "method";
+                registry.setString(prefix + method, value.getMethod());
+            }
+            if (value.getSourceRepoId() != null
+            ) {
+                String sourceRepoId = "sourceRepoId";
+                registry.setString(prefix + sourceRepoId, value.getSourceRepoId());
+            }
+            if (value.getTargetRepoId() != null
+            ) {
+                String targetRepoId = "targetRepoId";
+                registry.setString(prefix + targetRepoId, value.getTargetRepoId());
+            }
+            if (value.getProxyId() != null
+            ) {
+                String proxyId = "proxyId";
+                registry.setString(prefix + proxyId, value.getProxyId());
+            }
+            if (value.getBlackListPatterns() != null && value.getBlackListPatterns().size() > 0
+            ) {
+                registry.removeSubset(prefix + "blackListPatterns");
+
+                int count = 0;
+                for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) {
+                    String name = "blackListPatterns.blackListPattern(" + count + ")";
+                    String blackListPattern = (String) iter.next();
+                    registry.setString(prefix + name, blackListPattern);
+                }
+            }
+            if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0
+            ) {
+                registry.removeSubset(prefix + "whiteListPatterns");
+
+                int count = 0;
+                for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) {
+                    String name = "whiteListPatterns.whiteListPattern(" + count + ")";
+                    String whiteListPattern = (String) iter.next();
+                    registry.setString(prefix + name, whiteListPattern);
+                }
+            }
+            if (value.getPolicies() != null && value.getPolicies().size() > 0
+            ) {
+                registry.removeSubset(prefix + "policies");
+
+                for (Iterator iter = value.getPolicies().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getPolicies().get(key);
+
+                    registry.setString(prefix + "policies." + key, v);
+                }
+            }
+            if (value.getProperties() != null && value.getProperties().size() > 0
+            ) {
+                registry.removeSubset(prefix + "properties");
+
+                for (Iterator iter = value.getProperties().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getProperties().get(key);
+
+                    registry.setString(prefix + "properties." + key, v);
+                }
+            }
+            String disabled = "disabled";
+            registry.setBoolean(prefix + disabled, value.isDisabled());
+        }
+    }
+
+    private void writeNetworkProxyConfiguration(String prefix, NetworkProxyConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getId() != null
+            ) {
+                String id = "id";
+                registry.setString(prefix + id, value.getId());
+            }
+            if (value.getProtocol() != null && !value.getProtocol().equals("http")
+            ) {
+                String protocol = "protocol";
+                registry.setString(prefix + protocol, value.getProtocol());
+            }
+            if (value.getHost() != null
+            ) {
+                String host = "host";
+                registry.setString(prefix + host, value.getHost());
+            }
+            if (value.getPort() != 8080
+            ) {
+                String port = "port";
+                registry.setInt(prefix + port, value.getPort());
+            }
+            if (value.getUsername() != null
+            ) {
+                String username = "username";
+                registry.setString(prefix + username, value.getUsername());
+            }
+            if (value.getPassword() != null
+            ) {
+                String password = "password";
+                registry.setString(prefix + password, value.getPassword());
+            }
+            String useNtlm = "useNtlm";
+            registry.setBoolean(prefix + useNtlm, value.isUseNtlm());
+        }
+    }
+
+    private void writeRepositoryScanningConfiguration( String prefix, RepositoryScanningConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getFileTypes() != null && value.getFileTypes().size() > 0
+            ) {
+                registry.removeSubset(prefix + "fileTypes");
+
+                int count = 0;
+                for (Iterator iter = value.getFileTypes().iterator(); iter.hasNext(); count++) {
+                    String name = "fileTypes.fileType(" + count + ")";
+                    FileType o = (FileType) iter.next();
+                    writeFileType(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getKnownContentConsumers() != null && value.getKnownContentConsumers().size() > 0
+            ) {
+                registry.removeSubset(prefix + "knownContentConsumers");
+
+                int count = 0;
+                for (Iterator iter = value.getKnownContentConsumers().iterator(); iter.hasNext(); count++) {
+                    String name = "knownContentConsumers.knownContentConsumer(" + count + ")";
+                    String knownContentConsumer = (String) iter.next();
+                    registry.setString(prefix + name, knownContentConsumer);
+                }
+            }
+            if (value.getInvalidContentConsumers() != null && value.getInvalidContentConsumers().size() > 0
+            ) {
+                registry.removeSubset(prefix + "invalidContentConsumers");
+
+                int count = 0;
+                for (Iterator iter = value.getInvalidContentConsumers().iterator(); iter.hasNext(); count++) {
+                    String name = "invalidContentConsumers.invalidContentConsumer(" + count + ")";
+                    String invalidContentConsumer = (String) iter.next();
+                    registry.setString(prefix + name, invalidContentConsumer);
+                }
+            }
+        }
+    }
+
+    private void writeFileType(String prefix, FileType value, Registry registry) {
+        if (value != null) {
+            if (value.getId() != null
+            ) {
+                String id = "id";
+                registry.setString(prefix + id, value.getId());
+            }
+            if (value.getPatterns() != null && value.getPatterns().size() > 0
+            ) {
+                registry.removeSubset(prefix + "patterns");
+
+                int count = 0;
+                for (Iterator iter = value.getPatterns().iterator(); iter.hasNext(); count++) {
+                    String name = "patterns.pattern(" + count + ")";
+                    String pattern = (String) iter.next();
+                    registry.setString(prefix + name, pattern);
+                }
+            }
+        }
+    }
+
+    private void writeOrganisationInformation( String prefix, OrganisationInformation value, Registry registry) {
+        if (value != null) {
+            if (value.getName() != null
+            ) {
+                String name = "name";
+                registry.setString(prefix + name, value.getName());
+            }
+            if (value.getUrl() != null
+            ) {
+                String url = "url";
+                registry.setString(prefix + url, value.getUrl());
+            }
+            if (value.getLogoLocation() != null
+            ) {
+                String logoLocation = "logoLocation";
+                registry.setString(prefix + logoLocation, value.getLogoLocation());
+            }
+        }
+    }
+
+    private void writeWebappConfiguration( String prefix, WebappConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getUi() != null
+            ) {
+                writeUserInterfaceOptions(prefix + "ui.", value.getUi(), registry);
+            }
+        }
+    }
+
+    private void writeUserInterfaceOptions( String prefix, UserInterfaceOptions value, Registry registry) {
+        if (value != null) {
+            String showFindArtifacts = "showFindArtifacts";
+            registry.setBoolean(prefix + showFindArtifacts, value.isShowFindArtifacts());
+            String appletFindEnabled = "appletFindEnabled";
+            registry.setBoolean(prefix + appletFindEnabled, value.isAppletFindEnabled());
+            String disableEasterEggs = "disableEasterEggs";
+            registry.setBoolean(prefix + disableEasterEggs, value.isDisableEasterEggs());
+            if (value.getApplicationUrl() != null
+            ) {
+                String applicationUrl = "applicationUrl";
+                registry.setString(prefix + applicationUrl, value.getApplicationUrl());
+            }
+            String disableRegistration = "disableRegistration";
+            registry.setBoolean(prefix + disableRegistration, value.isDisableRegistration());
+        }
+    }
+
+    private void writeNetworkConfiguration( String prefix, NetworkConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getMaxTotal() != 30
+            ) {
+                String maxTotal = "maxTotal";
+                registry.setInt(prefix + maxTotal, value.getMaxTotal());
+            }
+            if (value.getMaxTotalPerHost() != 30
+            ) {
+                String maxTotalPerHost = "maxTotalPerHost";
+                registry.setInt(prefix + maxTotalPerHost, value.getMaxTotalPerHost());
+            }
+            String usePooling = "usePooling";
+            registry.setBoolean(prefix + usePooling, value.isUsePooling());
+        }
+    }
+
+    private void writeArchivaRuntimeConfiguration( String prefix, ArchivaRuntimeConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getUrlFailureCacheConfiguration() != null
+            ) {
+                writeCacheConfiguration(prefix + "urlFailureCacheConfiguration.", value.getUrlFailureCacheConfiguration(), registry);
+            }
+            if (value.getFileLockConfiguration() != null
+            ) {
+                writeFileLockConfiguration(prefix + "fileLockConfiguration.", value.getFileLockConfiguration(), registry);
+            }
+            if (value.getDataDirectory() != null
+            ) {
+                String dataDirectory = "dataDirectory";
+                registry.setString(prefix + dataDirectory, value.getDataDirectory());
+            }
+            if (value.getRepositoryBaseDirectory() != null
+            ) {
+                String repositoryBaseDirectory = "repositoryBaseDirectory";
+                registry.setString(prefix + repositoryBaseDirectory, value.getRepositoryBaseDirectory());
+            }
+            if (value.getRemoteRepositoryBaseDirectory() != null
+            ) {
+                String remoteRepositoryBaseDirectory = "remoteRepositoryBaseDirectory";
+                registry.setString(prefix + remoteRepositoryBaseDirectory, value.getRemoteRepositoryBaseDirectory());
+            }
+            if (value.getRepositoryGroupBaseDirectory() != null
+            ) {
+                String repositoryGroupBaseDirectory = "repositoryGroupBaseDirectory";
+                registry.setString(prefix + repositoryGroupBaseDirectory, value.getRepositoryGroupBaseDirectory());
+            }
+
+            if (value.getDefaultLanguage() != null && !value.getDefaultLanguage().equals("en-US")
+            ) {
+                String defaultLanguage = "defaultLanguage";
+                registry.setString(prefix + defaultLanguage, value.getDefaultLanguage());
+            }
+            if (value.getLanguageRange() != null && !value.getLanguageRange().equals("en,fr,de")
+            ) {
+                String languageRange = "languageRange";
+                registry.setString(prefix + languageRange, value.getLanguageRange());
+            }
+            writeList(registry, value.getChecksumTypes(), prefix+"checksumTypes", "type");
+        }
+    }
+
+    private void writeRedbackRuntimeConfiguration( String prefix, RedbackRuntimeConfiguration value, Registry registry) {
+        if (value != null) {
+            String migratedFromRedbackConfiguration = "migratedFromRedbackConfiguration";
+            registry.setBoolean(prefix + migratedFromRedbackConfiguration, value.isMigratedFromRedbackConfiguration());
+            if (value.getUserManagerImpls() != null && value.getUserManagerImpls().size() > 0
+            ) {
+                registry.removeSubset(prefix + "userManagerImpls");
+
+                int count = 0;
+                for (Iterator iter = value.getUserManagerImpls().iterator(); iter.hasNext(); count++) {
+                    String name = "userManagerImpls.userManagerImpl(" + count + ")";
+                    String userManagerImpl = (String) iter.next();
+                    registry.setString(prefix + name, userManagerImpl);
+                }
+            }
+            if (value.getRbacManagerImpls() != null && value.getRbacManagerImpls().size() > 0
+            ) {
+                registry.removeSubset(prefix + "rbacManagerImpls");
+
+                int count = 0;
+                for (Iterator iter = value.getRbacManagerImpls().iterator(); iter.hasNext(); count++) {
+                    String name = "rbacManagerImpls.rbacManagerImpl(" + count + ")";
+                    String rbacManagerImpl = (String) iter.next();
+                    registry.setString(prefix + name, rbacManagerImpl);
+                }
+            }
+            if (value.getLdapConfiguration() != null
+            ) {
+                writeLdapConfiguration(prefix + "ldapConfiguration.", value.getLdapConfiguration(), registry);
+            }
+            if (value.getLdapGroupMappings() != null && value.getLdapGroupMappings().size() > 0
+            ) {
+                registry.removeSubset(prefix + "ldapGroupMappings");
+
+                int count = 0;
+                for (Iterator iter = value.getLdapGroupMappings().iterator(); iter.hasNext(); count++) {
+                    String name = "ldapGroupMappings.ldapGroupMapping(" + count + ")";
+                    LdapGroupMapping o = (LdapGroupMapping) iter.next();
+                    writeLdapGroupMapping(prefix + name + ".", o, registry);
+                }
+            }
+            if (value.getConfigurationProperties() != null && value.getConfigurationProperties().size() > 0
+            ) {
+                registry.removeSubset(prefix + "configurationProperties");
+
+                for (Iterator iter = value.getConfigurationProperties().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getConfigurationProperties().get(key);
+
+                    registry.setString(prefix + "configurationProperties." + key, v);
+                }
+            }
+            String useUsersCache = "useUsersCache";
+            registry.setBoolean(prefix + useUsersCache, value.isUseUsersCache());
+            if (value.getUsersCacheConfiguration() != null
+            ) {
+                writeCacheConfiguration(prefix + "usersCacheConfiguration.", value.getUsersCacheConfiguration(), registry);
+            }
+        }
+    }
+
+    private void writeArchivaDefaultConfiguration( String prefix, ArchivaDefaultConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getDefaultCheckPaths() != null && value.getDefaultCheckPaths().size() > 0
+            ) {
+                registry.removeSubset(prefix + "defaultCheckPaths");
+
+                int count = 0;
+                for (Iterator iter = value.getDefaultCheckPaths().iterator(); iter.hasNext(); count++) {
+                    String name = "defaultCheckPaths.defaultCheckPath(" + count + ")";
+                    RepositoryCheckPath o = (RepositoryCheckPath) iter.next();
+                    writeRepositoryCheckPath(prefix + name + ".", o, registry);
+                }
+            }
+        }
+    }
+
+    private void writeLdapConfiguration( String prefix, LdapConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getHostName() != null
+            ) {
+                String hostName = "hostName";
+                registry.setString(prefix + hostName, value.getHostName());
+            }
+            if (value.getPort() != 0
+            ) {
+                String port = "port";
+                registry.setInt(prefix + port, value.getPort());
+            }
+            String ssl = "ssl";
+            registry.setBoolean(prefix + ssl, value.isSsl());
+            if (value.getBaseDn() != null
+            ) {
+                String baseDn = "baseDn";
+                registry.setString(prefix + baseDn, value.getBaseDn());
+            }
+            if (value.getBaseGroupsDn() != null
+            ) {
+                String baseGroupsDn = "baseGroupsDn";
+                registry.setString(prefix + baseGroupsDn, value.getBaseGroupsDn());
+            }
+            if (value.getContextFactory() != null
+            ) {
+                String contextFactory = "contextFactory";
+                registry.setString(prefix + contextFactory, value.getContextFactory());
+            }
+            if (value.getBindDn() != null
+            ) {
+                String bindDn = "bindDn";
+                registry.setString(prefix + bindDn, value.getBindDn());
+            }
+            if (value.getPassword() != null
+            ) {
+                String password = "password";
+                registry.setString(prefix + password, value.getPassword());
+            }
+            if (value.getAuthenticationMethod() != null
+            ) {
+                String authenticationMethod = "authenticationMethod";
+                registry.setString(prefix + authenticationMethod, value.getAuthenticationMethod());
+            }
+            String bindAuthenticatorEnabled = "bindAuthenticatorEnabled";
+            registry.setBoolean(prefix + bindAuthenticatorEnabled, value.isBindAuthenticatorEnabled());
+            String writable = "writable";
+            registry.setBoolean(prefix + writable, value.isWritable());
+            String useRoleNameAsGroup = "useRoleNameAsGroup";
+            registry.setBoolean(prefix + useRoleNameAsGroup, value.isUseRoleNameAsGroup());
+            if (value.getExtraProperties() != null && value.getExtraProperties().size() > 0
+            ) {
+                registry.removeSubset(prefix + "extraProperties");
+
+                for (Iterator iter = value.getExtraProperties().keySet().iterator(); iter.hasNext(); ) {
+                    String key = (String) iter.next();
+                    String v = (String) value.getExtraProperties().get(key);
+
+                    registry.setString(prefix + "extraProperties." + key, v);
+                }
+            }
+        }
+    }
+
+    private void writeFileLockConfiguration( String prefix, FileLockConfiguration value, Registry registry) {
+        if (value != null) {
+            String skipLocking = "skipLocking";
+            registry.setBoolean(prefix + skipLocking, value.isSkipLocking());
+            if (value.getLockingTimeout() != 0
+            ) {
+                String lockingTimeout = "lockingTimeout";
+                registry.setInt(prefix + lockingTimeout, value.getLockingTimeout());
+            }
+        }
+    }
+
+    private void writeCacheConfiguration( String prefix, CacheConfiguration value, Registry registry) {
+        if (value != null) {
+            if (value.getTimeToIdleSeconds() != -1
+            ) {
+                String timeToIdleSeconds = "timeToIdleSeconds";
+                registry.setInt(prefix + timeToIdleSeconds, value.getTimeToIdleSeconds());
+            }
+            if (value.getTimeToLiveSeconds() != -1
+            ) {
+                String timeToLiveSeconds = "timeToLiveSeconds";
+                registry.setInt(prefix + timeToLiveSeconds, value.getTimeToLiveSeconds());
+            }
+            if (value.getMaxElementsInMemory() != -1
+            ) {
+                String maxElementsInMemory = "maxElementsInMemory";
+                registry.setInt(prefix + maxElementsInMemory, value.getMaxElementsInMemory());
+            }
+            if (value.getMaxElementsOnDisk() != -1
+            ) {
+                String maxElementsOnDisk = "maxElementsOnDisk";
+                registry.setInt(prefix + maxElementsOnDisk, value.getMaxElementsOnDisk());
+            }
+        }
+    }
+
+    private void writeLdapGroupMapping(String prefix, LdapGroupMapping value, Registry registry) {
+        if (value != null) {
+            if (value.getGroup() != null
+            ) {
+                String group = "group";
+                registry.setString(prefix + group, value.getGroup());
+            }
+            if (value.getRoleNames() != null && value.getRoleNames().size() > 0
+            ) {
+                registry.removeSubset(prefix + "roleNames");
+
+                int count = 0;
+                for (Iterator iter = value.getRoleNames().iterator(); iter.hasNext(); count++) {
+                    String name = "roleNames.roleName(" + count + ")";
+                    String roleName = (String) iter.next();
+                    registry.setString(prefix + name, roleName);
+                }
+            }
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/util/ConfigMapper.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/java/org/apache/archiva/configuration/provider/util/ConfigMapper.java
new file mode 100644 (file)
index 0000000..d03137a
--- /dev/null
@@ -0,0 +1,117 @@
+package org.apache.archiva.configuration.provider.util;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * Helper class that can be used for mapping configuration keys (e.g. user configuration keys) to
+ * archiva configuration objects.
+ *
+ * @param <T> The class used to retrieve the attribute data
+ * @param <K> The class used to retrieve the data that is for prefix matching
+ * @author Martin Stockhammer <martin_s@apache.org>
+ * @since 3.0
+ */
+public class ConfigMapper<T, K>
+{
+    private final Map<String, Function<T,  String>> stringFunctionMap = new HashMap<>( );
+    private final Map<String, Function<T,  Integer>> intFunctionMap = new HashMap<>( );
+    private final Map<String, Function<T,  Boolean>> booleanFunctionMap = new HashMap<>( );
+    private final Map<String, BiFunction<String, K, String>> prefixStringFunctionMap = new HashMap<>( );
+
+    public void addStringMapping( String attributeName, Function<T, String> mapping) {
+        this.stringFunctionMap.put( attributeName, mapping );
+    }
+
+    public void  addPrefixStringMapping(String prefix, BiFunction<String, K, String> mapping) {
+        prefixStringFunctionMap.put( prefix, mapping );
+    }
+
+    public String getString( String attributeName, T instance) {
+        return stringFunctionMap.get( attributeName ).apply( instance );
+    }
+
+    public String getPrefixString(String attributeName, K instance) {
+        BiFunction<String, K, String> function = prefixStringFunctionMap.entrySet( ).stream( ).filter( entry -> attributeName.startsWith( entry.getKey( ) ) ).findFirst( )
+            .map( entry -> entry.getValue( ) )
+            .get( );
+        return function.apply( attributeName, instance );
+    }
+
+    public boolean isStringMapping(String attributeName) {
+        return stringFunctionMap.containsKey( attributeName );
+    }
+
+    public boolean isIntMapping(String attributeName) {
+        return intFunctionMap.containsKey( attributeName );
+    }
+
+    public boolean isBooleanMapping(String attributeName) {
+        return booleanFunctionMap.containsKey( attributeName );
+    }
+
+    public boolean isPrefixMapping(String attributeName) {
+        return prefixStringFunctionMap.keySet( ).stream( ).anyMatch( prefix -> attributeName.startsWith( prefix ) );
+    }
+
+    public boolean isMapping(String attributeName) {
+        return isStringMapping( attributeName ) || isIntMapping( attributeName ) || isBooleanMapping( attributeName );
+    }
+
+    public void addIntMapping( String attributeName, Function<T, Integer> mapping) {
+        this.intFunctionMap.put( attributeName, mapping );
+    }
+
+    public int getInt( String attributeName, T instance) {
+        return this.intFunctionMap.get( attributeName ).apply( instance );
+    }
+
+    public void addBooleanMapping( String attributeName, Function<T, Boolean> mapping) {
+        this.booleanFunctionMap.put( attributeName, mapping );
+    }
+
+    public boolean getBoolean( String attributeName, T instance) {
+        return this.booleanFunctionMap.get( attributeName ).apply( instance );
+    }
+
+    public List<String> getStringAttributes() {
+        return new ArrayList<>( stringFunctionMap.keySet( ) );
+    }
+
+    public List<String> getIntAttributes() {
+        return new ArrayList<>( intFunctionMap.keySet( ) );
+    }
+
+    public List<String> getBooleanAttributes() {
+        return new ArrayList<>( booleanFunctionMap.keySet( ) );
+    }
+
+    public List<String> getAllAttributes() {
+        return Arrays.asList( stringFunctionMap,intFunctionMap, booleanFunctionMap).stream()
+            .flatMap( map->map.keySet().stream() ).collect( Collectors.toList());
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/resources/META-INF/spring-context.xml
new file mode 100644 (file)
index 0000000..3fe1e38
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/context 
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+       default-lazy-init="true">
+
+  <context:annotation-config/>
+  <context:component-scan base-package="org.apache.archiva.configuration"/>
+  <!-- olamy could be removed as only here temporary for plexus-spring -->
+  <alias name="archivaConfiguration#default" alias="archivaConfiguration"/>
+
+</beans>
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/resources/org/apache/archiva/configuration/default-archiva.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/main/resources/org/apache/archiva/configuration/default-archiva.xml
new file mode 100644 (file)
index 0000000..5f3731d
--- /dev/null
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+  <version>3.0.0</version>
+  <managedRepositories>
+    <managedRepository>
+      <id>internal</id>
+      <name>Archiva Managed Internal Repository</name>
+      <location>${appserver.base}/repositories/internal</location>
+      <indexDir>${appserver.base}/repositories/internal/.indexer</indexDir>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <blockRedeployments>true</blockRedeployments>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
+      <retentionPeriod>30</retentionPeriod>
+    </managedRepository>
+    <managedRepository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <location>${appserver.base}/repositories/snapshots</location>
+      <indexDir>${appserver.base}/repositories/snapshots/.indexer</indexDir>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <blockRedeployments>false</blockRedeployments>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
+      <retentionPeriod>30</retentionPeriod>
+    </managedRepository>
+  </managedRepositories>
+  <remoteRepositories>
+    <remoteRepository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>https://repo.maven.apache.org/maven2</url>
+      <layout>default</layout>
+    </remoteRepository>
+  </remoteRepositories>
+
+  <proxyConnectors>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>central</targetRepoId>
+      <proxyId/>
+      <policies>
+        <snapshots>disabled</snapshots>
+        <releases>once</releases>
+        <checksum>fix</checksum>
+        <cache-failures>cached</cache-failures>
+      </policies>
+      <whiteListPatterns>
+        <whiteListPattern>**/*</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+  </proxyConnectors>
+
+  <legacyArtifactPaths>
+    <legacyArtifactPath>
+        <path>jaxen/jars/jaxen-1.0-FCS-full.jar</path>
+        <artifact>jaxen:jaxen:1.0-FCS:full:jar</artifact>
+    </legacyArtifactPath>
+  </legacyArtifactPaths>
+
+  <repositoryScanning>
+    <fileTypes>
+      <fileType>
+        <id>artifacts</id>
+        <patterns>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.jar</pattern>
+          <pattern>**/*.ear</pattern>
+          <pattern>**/*.war</pattern>
+          <pattern>**/*.car</pattern>
+          <pattern>**/*.sar</pattern>
+          <pattern>**/*.mar</pattern>
+          <pattern>**/*.rar</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+          <pattern>**/*.tar.gz</pattern>
+          <pattern>**/*.tar.bz2</pattern>
+          <pattern>**/*.zip</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>indexable-content</id>
+        <patterns>
+          <pattern>**/*.txt</pattern>
+          <pattern>**/*.TXT</pattern>
+          <pattern>**/*.block</pattern>
+          <pattern>**/*.config</pattern>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.xml</pattern>
+          <pattern>**/*.xsd</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>auto-remove</id>
+        <patterns>
+          <pattern>**/*.bak</pattern>
+          <pattern>**/*~</pattern>
+          <pattern>**/*-</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>ignored</id>
+        <patterns>
+          <pattern>**/.htaccess</pattern>
+          <pattern>**/KEYS</pattern>
+          <pattern>**/*.rb</pattern>
+          <pattern>**/*.sh</pattern>
+          <pattern>**/.svn/**</pattern>
+          <pattern>**/.DAV/**</pattern>
+          <pattern>.index/**</pattern>
+          <pattern>.indexer/**</pattern>
+        </patterns>
+      </fileType>
+    </fileTypes>
+    <knownContentConsumers>
+      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
+      <knownContentConsumer>validate-checksum</knownContentConsumer>
+      <knownContentConsumer>validate-signature</knownContentConsumer>
+      <knownContentConsumer>index-content</knownContentConsumer>
+      <knownContentConsumer>auto-remove</knownContentConsumer>
+      <knownContentConsumer>auto-rename</knownContentConsumer>
+      <knownContentConsumer>metadata-updater</knownContentConsumer>
+      <knownContentConsumer>create-archiva-metadata</knownContentConsumer>
+      <knownContentConsumer>duplicate-artifacts</knownContentConsumer>
+      <!--knownContentConsumer>repository-purge</knownContentConsumer-->
+    </knownContentConsumers>
+    <invalidContentConsumers>
+      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
+    </invalidContentConsumers>
+  </repositoryScanning>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>true</showFindArtifacts>
+      <appletFindEnabled>true</appletFindEnabled>
+    </ui>
+  </webapp>
+
+  <archivaRuntimeConfiguration>
+    <checksumTypes>
+      <type>MD5</type>
+      <type>SHA1</type>
+      <type>SHA256</type>
+    </checksumTypes>
+  </archivaRuntimeConfiguration>
+
+  <redbackRuntimeConfiguration>
+    <userManagerImpls>
+      <userManagerImpl>jpa</userManagerImpl>
+    </userManagerImpls>
+    <rbacManagerImpls>
+      <rbacManagerImpl>cached</rbacManagerImpl>
+    </rbacManagerImpls>
+  </redbackRuntimeConfiguration>
+
+  <archivaDefaultConfiguration>
+    <defaultCheckPaths>
+      <defaultCheckPath>
+        <url>http://download.oracle.com/maven</url>
+        <path>com/sleepycat/je/license.txt</path>
+      </defaultCheckPath>
+      <defaultCheckPath>
+        <url>https://download.oracle.com/maven</url>
+        <path>com/sleepycat/je/license.txt</path>
+      </defaultCheckPath>
+    </defaultCheckPaths>
+  </archivaDefaultConfiguration>
+
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-0.9.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-0.9.xml
new file mode 100644 (file)
index 0000000..c803243
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <repositories>
+    <repository>
+      <directory>managed-repository</directory>
+      <id>local</id>
+      <name>local</name>
+    </repository>
+  </repositories>
+  <proxiedRepositories>
+    <proxiedRepository>
+      <url>http://www.ibiblio.org/maven2/</url>
+      <managedRepository>local</managedRepository>
+      <useNetworkProxy>true</useNetworkProxy>
+      <id>ibiblio</id>
+      <name>Ibiblio</name>
+    </proxiedRepository>
+    <proxiedRepository>
+      <url>http://repository.codehaus.org/</url>
+      <managedRepository>local</managedRepository>
+      <id>codehaus</id>
+      <name>Codehaus</name>
+    </proxiedRepository>
+  </proxiedRepositories>
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-1.3.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-1.3.xml
new file mode 100644 (file)
index 0000000..8575ebd
--- /dev/null
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<configuration>
+<version>2</version>
+<repositoryScanning>
+<fileTypes>
+<fileType>
+<id>artifacts</id>
+<patterns>
+<pattern>**/*.pom</pattern>
+<pattern>**/*.jar</pattern>
+<pattern>**/*.ear</pattern>
+<pattern>**/*.war</pattern>
+<pattern>**/*.car</pattern>
+<pattern>**/*.sar</pattern>
+<pattern>**/*.mar</pattern>
+<pattern>**/*.rar</pattern>
+<pattern>**/*.dtd</pattern>
+<pattern>**/*.tld</pattern>
+<pattern>**/*.tar.gz</pattern>
+<pattern>**/*.tar.bz2</pattern>
+<pattern>**/*.zip</pattern>
+</patterns>
+</fileType>
+<fileType>
+<id>indexable-content</id>
+<patterns>
+<pattern>**/*.txt</pattern>
+<pattern>**/*.TXT</pattern>
+<pattern>**/*.block</pattern>
+<pattern>**/*.config</pattern>
+<pattern>**/*.pom</pattern>
+<pattern>**/*.xml</pattern>
+<pattern>**/*.xsd</pattern>
+<pattern>**/*.dtd</pattern>
+<pattern>**/*.tld</pattern>
+</patterns>
+</fileType>
+<fileType>
+<id>auto-remove</id>
+<patterns>
+<pattern>**/*.bak</pattern>
+<pattern>**/*~</pattern>
+<pattern>**/*-</pattern>
+</patterns>
+</fileType>
+<fileType>
+<id>ignored</id>
+<patterns>
+<pattern>**/.htaccess</pattern>
+<pattern>**/KEYS</pattern>
+<pattern>**/*.rb</pattern>
+<pattern>**/*.sh</pattern>
+<pattern>**/.svn/**</pattern>
+<pattern>**/.DAV/**</pattern>
+</patterns>
+</fileType>
+</fileTypes>
+<knownContentConsumers>
+<knownContentConsumer>update-db-artifact</knownContentConsumer>
+<knownContentConsumer>create-missing-checksums</knownContentConsumer>
+<knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
+<knownContentConsumer>validate-checksum</knownContentConsumer>
+<knownContentConsumer>validate-signature</knownContentConsumer>
+<knownContentConsumer>index-content</knownContentConsumer>
+<knownContentConsumer>auto-remove</knownContentConsumer>
+<knownContentConsumer>auto-rename</knownContentConsumer>
+<knownContentConsumer>metadata-updater</knownContentConsumer>
+</knownContentConsumers>
+<invalidContentConsumers>
+<invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
+</invalidContentConsumers>
+</repositoryScanning>
+<databaseScanning>
+<cronExpression>0 0 * * * ?</cronExpression>
+<unprocessedConsumers>
+<unprocessedConsumer>update-db-project</unprocessedConsumer>
+</unprocessedConsumers>
+<cleanupConsumers>
+<cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
+<cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
+<cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
+</cleanupConsumers>
+</databaseScanning>
+<managedRepositories>
+<managedRepository>
+<location>${appserver.base}/data/repositories/internal</location>
+<blockRedeployments>true</blockRedeployments>
+<retentionPeriod>30</retentionPeriod>
+<id>internal</id>
+<name>Archiva Managed Internal Repository</name>
+</managedRepository>
+<managedRepository>
+<location>${appserver.base}/data/repositories/snapshots</location>
+<releases>false</releases>
+<snapshots>true</snapshots>
+<refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
+<retentionPeriod>30</retentionPeriod>
+<id>snapshots</id>
+<name>Archiva Managed Snapshot Repository</name>
+</managedRepository>
+</managedRepositories>
+<remoteRepositories>
+<remoteRepository>
+<url>http://repo1.maven.org/maven2</url>
+<id>central</id>
+<name>Central Repository</name>
+</remoteRepository>
+<remoteRepository>
+<url>http://download.java.net/maven/2/</url>
+<id>maven2-repository.dev.java.net</id>
+<name>Java.net Repository for Maven 2</name>
+</remoteRepository>
+</remoteRepositories>
+<proxyConnectors>
+<proxyConnector>
+<order>1</order>
+<sourceRepoId>internal</sourceRepoId>
+<targetRepoId>central</targetRepoId>
+<proxyId/>
+<whiteListPatterns>
+<whiteListPattern>**/*</whiteListPattern>
+</whiteListPatterns>
+<policies>
+<releases>once</releases>
+<checksum>fix</checksum>
+<snapshots>never</snapshots>
+<cache-failures>yes</cache-failures>
+</policies>
+</proxyConnector>
+<proxyConnector>
+<order>2</order>
+<sourceRepoId>internal</sourceRepoId>
+<targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+<proxyId/>
+<whiteListPatterns>
+<whiteListPattern>javax/**</whiteListPattern>
+<whiteListPattern>org/jvnet/**</whiteListPattern>
+<whiteListPattern>com/sun/**</whiteListPattern>
+</whiteListPatterns>
+<policies>
+<releases>once</releases>
+<checksum>fix</checksum>
+<snapshots>never</snapshots>
+<cache-failures>yes</cache-failures>
+</policies>
+</proxyConnector>
+</proxyConnectors>
+<legacyArtifactPaths>
+<legacyArtifactPath>
+<path>jaxen/jars/jaxen-1.0-FCS-full.jar</path>
+<artifact>jaxen:jaxen:1.0-FCS:full:jar</artifact>
+</legacyArtifactPath>
+</legacyArtifactPaths>
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-v1.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/archiva-v1.xml
new file mode 100644 (file)
index 0000000..2b05c92
--- /dev/null
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <repositories>
+    <repository>
+      <id>internal</id>
+      <name>Archiva Managed Internal Repository</name>
+      <url>file://${appserver.base}/repositories/internal</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>true</indexed>
+      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
+    </repository>
+    <repository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <url>file://${appserver.base}/repositories/snapshots</url>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <indexed>false</indexed>
+      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
+    </repository>
+    <repository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>false</indexed>
+    </repository>
+    <repository>
+      <id>maven2-repository.dev.java.net</id>
+      <name>Java.net Repository for Maven 2</name>
+      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>false</indexed>
+    </repository>
+  </repositories>
+
+  <proxyConnectors>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>central</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+    </proxyConnector>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+      <whiteListPatterns>
+        <whiteListPattern>javax/**</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+  </proxyConnectors>
+
+  <networkProxies>
+    <networkProxy>
+      <id>example</id>
+      <protocol>http</protocol>
+      <host>proxy.mycompany.com</host>
+      <port>8080</port>
+      <username>myself</username>
+      <password>mypass</password>
+    </networkProxy>
+  </networkProxies>
+
+  <repositoryScanning>
+    <fileTypes>
+      <fileType>
+        <id>artifacts</id>
+        <patterns>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.jar</pattern>
+          <pattern>**/*.ear</pattern>
+          <pattern>**/*.war</pattern>
+          <pattern>**/*.car</pattern>
+          <pattern>**/*.sar</pattern>
+          <pattern>**/*.mar</pattern>
+          <pattern>**/*.rar</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+          <pattern>**/*.tar.gz</pattern>
+          <pattern>**/*.tar.bz2</pattern>
+          <pattern>**/*.zip</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>indexable-content</id>
+        <patterns>
+          <pattern>**/*.txt</pattern>
+          <pattern>**/*.TXT</pattern>
+          <pattern>**/*.block</pattern>
+          <pattern>**/*.config</pattern>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.xml</pattern>
+          <pattern>**/*.xsd</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>auto-remove</id>
+        <patterns>
+          <pattern>**/*.bak</pattern>
+          <pattern>**/*~</pattern>
+          <pattern>**/*-</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>ignored</id>
+        <patterns>
+          <pattern>**/.htaccess</pattern>
+          <pattern>**/KEYS</pattern>
+          <pattern>**/*.rb</pattern>
+          <pattern>**/*.sh</pattern>
+          <pattern>**/.svn/**</pattern>
+          <pattern>**/.DAV/**</pattern>
+        </patterns>
+      </fileType>
+    </fileTypes>
+    <knownContentConsumers>
+      <knownContentConsumer>update-db-artifact</knownContentConsumer>
+      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
+      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
+      <knownContentConsumer>validate-checksum</knownContentConsumer>
+      <knownContentConsumer>validate-signature</knownContentConsumer>
+      <knownContentConsumer>index-content</knownContentConsumer>
+      <knownContentConsumer>auto-remove</knownContentConsumer>
+      <knownContentConsumer>auto-rename</knownContentConsumer>
+      <knownContentConsumer>metadata-updater</knownContentConsumer>
+      <!--knownContentConsumer>repository-purge</knownContentConsumer-->
+    </knownContentConsumers>
+    <invalidContentConsumers>
+      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
+    </invalidContentConsumers>
+  </repositoryScanning>
+
+  <databaseScanning>
+    <cronExpression>0 0 * * * ?</cronExpression>
+    <unprocessedConsumers>
+      <unprocessedConsumer>index-artifact</unprocessedConsumer>
+      <unprocessedConsumer>update-db-project</unprocessedConsumer>
+      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
+      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
+      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
+      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
+    </unprocessedConsumers>
+    <cleanupConsumers>
+      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
+    </cleanupConsumers>
+  </databaseScanning>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>true</showFindArtifacts>
+      <appletFindEnabled>true</appletFindEnabled>
+    </ui>
+  </webapp>
+
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/autodetect-v1.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/autodetect-v1.xml
new file mode 100644 (file)
index 0000000..29f3775
--- /dev/null
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <repositories>
+    <repository>
+      <id>internal</id>
+      <name>Archiva Managed Internal Repository</name>
+      <url>file://${appserver.base}/repositories/internal</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>true</indexed>
+      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
+    </repository>
+    <repository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <url>file:${appserver.base}/repositories/snapshots</url>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <indexed>true</indexed>
+      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
+    </repository>
+    <repository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>false</indexed>
+    </repository>
+    <repository>
+      <id>maven2-repository.dev.java.net</id>
+      <name>Java.net Repository for Maven 2</name>
+      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <indexed>false</indexed>
+    </repository>
+  </repositories>
+
+  <proxyConnectors>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>central</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+    </proxyConnector>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+      <whiteListPatterns>
+        <whiteListPattern>javax/**</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+  </proxyConnectors>
+
+  <networkProxies>
+    <networkProxy>
+      <id>example</id>
+      <protocol>http</protocol>
+      <host>proxy.mycompany.com</host>
+      <port>8080</port>
+      <username>myself</username>
+      <password>mypass</password>
+    </networkProxy>
+  </networkProxies>
+
+  <repositoryScanning>
+    <fileTypes>
+      <fileType>
+        <id>artifacts</id>
+        <patterns>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.jar</pattern>
+          <pattern>**/*.ear</pattern>
+          <pattern>**/*.war</pattern>
+          <pattern>**/*.car</pattern>
+          <pattern>**/*.sar</pattern>
+          <pattern>**/*.mar</pattern>
+          <pattern>**/*.rar</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+          <pattern>**/*.tar.gz</pattern>
+          <pattern>**/*.tar.bz2</pattern>
+          <pattern>**/*.zip</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>indexable-content</id>
+        <patterns>
+          <pattern>**/*.txt</pattern>
+          <pattern>**/*.TXT</pattern>
+          <pattern>**/*.block</pattern>
+          <pattern>**/*.config</pattern>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.xml</pattern>
+          <pattern>**/*.xsd</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>auto-remove</id>
+        <patterns>
+          <pattern>**/*.bak</pattern>
+          <pattern>**/*~</pattern>
+          <pattern>**/*-</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>ignored</id>
+        <patterns>
+          <pattern>**/.htaccess</pattern>
+          <pattern>**/KEYS</pattern>
+          <pattern>**/*.rb</pattern>
+          <pattern>**/*.sh</pattern>
+          <pattern>**/.svn/**</pattern>
+          <pattern>**/.DAV/**</pattern>
+        </patterns>
+      </fileType>
+    </fileTypes>
+    <knownContentConsumers>
+      <knownContentConsumer>update-db-artifact</knownContentConsumer>
+      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
+      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
+      <knownContentConsumer>validate-checksum</knownContentConsumer>
+      <knownContentConsumer>validate-signature</knownContentConsumer>
+      <knownContentConsumer>index-content</knownContentConsumer>
+      <knownContentConsumer>auto-remove</knownContentConsumer>
+      <knownContentConsumer>auto-rename</knownContentConsumer>
+      <knownContentConsumer>metadata-updater</knownContentConsumer>
+    </knownContentConsumers>
+    <invalidContentConsumers>
+      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
+    </invalidContentConsumers>
+  </repositoryScanning>
+
+  <databaseScanning>
+    <cronExpression>0 0 * * * ?</cronExpression>
+    <unprocessedConsumers>
+      <unprocessedConsumer>index-artifact</unprocessedConsumer>
+      <unprocessedConsumer>update-db-project</unprocessedConsumer>
+      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
+      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
+      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
+      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
+    </unprocessedConsumers>
+    <cleanupConsumers>
+      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
+    </cleanupConsumers>
+  </databaseScanning>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>true</showFindArtifacts>
+      <appletFindEnabled>true</appletFindEnabled>
+    </ui>
+  </webapp>
+
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-base.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-base.xml
new file mode 100644 (file)
index 0000000..84ab085
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <version>2</version>
+  <managedRepositories>
+    <managedRepository>
+      <id>internal</id>
+      <name>Archiva Managed Internal Repository</name>
+      <location>${appserver.base}/repositories/internal</location>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
+    </managedRepository>
+    <managedRepository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <location>${appserver.base}/repositories/snapshots</location>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
+    </managedRepository>
+  </managedRepositories>
+  <remoteRepositories>
+    <remoteRepository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+      <layout>default</layout>
+    </remoteRepository>
+    <remoteRepository>
+      <id>maven2-repository.dev.java.net</id>
+      <name>Java.net Repository for Maven 2</name>
+      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+      <layout>default</layout>
+    </remoteRepository>
+  </remoteRepositories>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>false</showFindArtifacts>
+    </ui>
+  </webapp>
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-single-list-elements.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-single-list-elements.xml
new file mode 100644 (file)
index 0000000..3e3d4dc
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <version>2</version>
+  <repositoryGroups>
+    <repositoryGroup>
+      <id>default</id>
+      <repositories>
+        <repository>snapshots</repository>
+      </repositories>
+    </repositoryGroup>
+  </repositoryGroups>
+  <managedRepositories>
+    <managedRepository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <location>${appserver.base}/repositories/snapshots</location>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
+    </managedRepository>
+  </managedRepositories>
+  <remoteRepositories>
+    <remoteRepository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+      <layout>default</layout>
+    </remoteRepository>
+  </remoteRepositories>
+  <proxyConnectors>
+    <proxyConnector>
+      <order>2</order>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+      <proxyId/>
+      <whiteListPatterns>
+        <whiteListPattern>javax/**</whiteListPattern>
+      </whiteListPatterns>
+      <policies>
+        <releases>once</releases>
+        <checksum>fix</checksum>
+        <snapshots>never</snapshots>
+        <cache-failures>yes</cache-failures>
+      </policies>
+    </proxyConnector>
+  </proxyConnectors>
+  <networkProxies>
+    <networkProxy>
+      <id>proxy</id>
+      <host>proxy</host>
+      <port>8080</port>
+    </networkProxy>
+  </networkProxies>
+  <legacyArtifactPaths>
+    <legacyArtifactPath>
+      <path>jaxen/jars/jaxen-1.0-FCS-full.jar</path>
+      <artifact>jaxen:jaxen:1.0-FCS:full:jar</artifact>
+    </legacyArtifactPath>
+  </legacyArtifactPaths>
+  <repositoryScanning>
+    <knownContentConsumers>
+      <knownContentConsumer>auto-remove</knownContentConsumer>
+    </knownContentConsumers>
+    <invalidContentConsumers>
+      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
+    </invalidContentConsumers>
+  </repositoryScanning>
+  <databaseScanning>
+    <unprocessedConsumers>
+      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
+    </unprocessedConsumers>
+    <cleanupConsumers>
+      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
+    </cleanupConsumers>
+  </databaseScanning>
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-user.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/conf-user.xml
new file mode 100644 (file)
index 0000000..61c4dad
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<configuration>
+  <version>2</version>
+  <proxyConnectors>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>central</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+    </proxyConnector>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+      <proxyId/>
+      <snapshotsPolicy>disabled</snapshotsPolicy>
+      <releasePolicy>never</releasePolicy>
+      <failurePolicy>not-found</failurePolicy>
+      <whiteListPatterns>
+        <whiteListPattern>javax/**</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+  </proxyConnectors>
+
+  <webapp>
+    <ui>
+      <appletFindEnabled>false</appletFindEnabled>
+    </ui>
+  </webapp>
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/corrupt.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/corrupt.xml
new file mode 100644 (file)
index 0000000..b446928
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/escape-cron-expressions.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/escape-cron-expressions.xml
new file mode 100644 (file)
index 0000000..547e8c0
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<configuration>
+  <version>2</version>
+  <managedRepositories>
+    <managedRepository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <location>file://${appserver.base}/repositories/internal</location>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
+    </managedRepository>
+  </managedRepositories>
+  <databaseScanning>
+    <cronExpression>0 0 0 * * ?</cronExpression>
+    <unprocessedConsumers>
+      <unprocessedConsumer>index-artifact</unprocessedConsumer>
+      <unprocessedConsumer>update-db-project</unprocessedConsumer>
+      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
+      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
+      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
+      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
+    </unprocessedConsumers>
+    <cleanupConsumers>
+      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
+    </cleanupConsumers>
+  </databaseScanning>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>false</showFindArtifacts>
+    </ui>
+  </webapp>
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/maven-proxy-complete.conf b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/maven-proxy-complete.conf
new file mode 100644 (file)
index 0000000..dd98bba
--- /dev/null
@@ -0,0 +1,144 @@
+################ GLOBAL SETTINGS
+# This is where maven-proxy stores files it has downloaded
+repo.local.store=target
+
+#The port to listen on - not used if loaded as a webapp
+port=9999
+
+#This is the base area that all files are loaded from. While it is possible to leave this blank, this behaviour
+#is deprecated and will be disabled in version 2.0.  There are too many namespace conflicts caused by not using
+#a prefix.
+#The repository will be shown at http://localhost:9999/repository/
+#for the .war loaded into a webapp server, the default prefix is "repository" (edit the web.xml to change)
+# As maven doesn't like a trailing slash, this address shouldn't have one either.
+prefix=repository
+
+#This is the simple date format used to display the last modified date while browsing the repository.
+lastModifiedDateFormat=yyyy/MM/dd HH:mm:ss
+
+################ SNAPSHOT HANDLING
+#If you want the proxy to look for newer snapshots, set to true
+snapshot.update=true
+
+################ M2 METADATA HANDLING
+#If you want the proxy to prevent looking for newer metadata, set to false (default is true)
+#metadata.update=false
+
+################ M2 POM HANDLING
+#If you want the proxy to look for newer POMs, set to true (default is false)
+pom.update=true
+
+################ PROMOTION HANDLING
+# ***** NOT CURRENTLY IMPLEMENTED *****
+#Promotion describes the process by which new artifacts are loaded to global maven-proxy repository.  It
+# is designed to be used by "higher security installations" that do not want to acquire artifacts from
+# remote repositories without approval.
+#
+#If promotion handling is enabled, then the proxy will not download remote artifacts without permission
+# (local repositories with copy=false are considered to be local)
+#
+#Permission to download is granted via the Promotion menu which will be enabled
+#  when promotion handling is enabled.
+#
+#If promotion is false, artifacts are sourced from any repository as per normal.
+#
+#Promotion and snapshots:  If promotion is enabled, snapshots are not downloadable.  The concept of using
+# a snapshot in a production build (which is primarily what promotion is for) is counterintuitive.
+##
+promotion=false
+
+################ WEB INTERFACE
+# This defines the absolute URL the server should use to identify itself.
+# This can often be determined automatically, but we recommend you specify
+# it explicitly to prevent problems during startup.
+# The prefix will be added to this for the actual repository
+# i.e. proxy available at http://localhost:9999/, repository at http://localhost:9999/repository
+serverName=http://localhost:9999
+
+#If true, the repository can be browsed
+browsable=true
+
+#If true, the repository can be searched
+searchable=true
+
+#Not currently implemented. Will allow webdav access to the repository at some point.
+webdav=true
+
+#Stylesheet - if configured, will override the default stylesheet shipped with maven-proxy - absolute URLs only
+#eg.  /maven-proxy/style.css, http://www.example.com/style.css
+stylesheet=/maven-proxy/style.css
+
+#bgColor / bgColorHighlight are replaced in the built in stylesheet to produce a simple color scheme.
+#If a stylesheet is set, these are not used.
+bgColor=#14B
+bgColorHighlight=#94B
+
+#rowColor / rowColorHighlight are replaced in the built in stylesheet to produce a simple color scheme.
+#If a stylesheet is set, these are not used.
+rowColor=#CCF
+rowColorHighlight=#DDF
+
+
+################ PROXIES
+#This is just a hack, it should auto discover them
+proxy.list=one,two,three
+
+#Unauthenticated proxy
+proxy.one.host=proxy1.example.com
+proxy.one.port=3128
+
+#Authenticated proxy
+proxy.two.host=proxy2.example.org
+proxy.two.port=80
+proxy.two.username=username2
+proxy.two.password=password2
+
+#Authenticated proxy
+proxy.three.host=proxy3.example.net
+proxy.three.port=3129
+proxy.three.username=username3
+proxy.three.password=password3
+
+
+################# REPOSITORIES
+#This is not just a hack, it specifies the order repositories should be checked
+#Note that the proxy adds a "/" which is why the urls aren't suffixed with a "/"
+repo.list=local-repo,www-ibiblio-org,dist-codehaus-org,private-example-com
+
+#local-store
+# The local store represents a location that local jars you host can be located.
+# This could also be achieved by having a local http repository, but this is less cumbersome
+repo.local-repo.url=file://target
+repo.local-repo.description=Super Secret Custom Repository
+#If copy is true, jars are copied from the store to the proxy-repo. Only configurable for file:/// repos
+repo.local-repo.copy=false
+#If hardfail is true, any unexpected errors from the repository will cause
+#the client download to fail (typically with a 500 error)
+repo.local-repo.hardfail=true
+#Don't cache a file repository
+repo.local-repo.cache.period=0
+
+
+#www.ibiblio.org
+repo.www-ibiblio-org.url=http://www.ibiblio.org/maven2
+repo.www-ibiblio-org.description=www.ibiblio.org
+repo.www-ibiblio-org.proxy=one
+repo.www-ibiblio-org.hardfail=true
+#Cache this repository for 1 hour
+repo.www-ibiblio-org.cache.period=3600
+repo.www-ibiblio-org.cache.failures=true
+
+#dist.codehaus.org
+repo.dist-codehaus-org.url=http://dist.codehaus.org
+repo.dist-codehaus-org.proxy=two
+repo.dist-codehaus-org.hardfail=false
+repo.dist-codehaus-org.cache.period=3600
+repo.dist-codehaus-org.cache.failures=true
+
+#private.example.com
+repo.private-example-com.url=http://private.example.com/internal
+repo.private-example-com.description=Commercial In Confidence Repository
+repo.private-example-com.username=username1
+repo.private-example-com.password=password1
+repo.private-example-com.proxy=three
+repo.private-example-com.cache.period=3600
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/repository-manager.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/conf/repository-manager.xml
new file mode 100644 (file)
index 0000000..8fabacf
--- /dev/null
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <version>2</version>
+  <managedRepositories>
+    <managedRepository>
+      <id>internal</id>
+      <name>Archiva Managed Internal Repository</name>
+      <location>${appserver.base}/repositories/internal</location>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
+    </managedRepository>
+    <managedRepository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <location>${appserver.base}/repositories/internal</location>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
+    </managedRepository>
+  </managedRepositories>
+  <remoteRepositories>
+    <remoteRepository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+      <layout>default</layout>
+    </remoteRepository>
+    <remoteRepository>
+      <id>maven2-repository.dev.java.net</id>
+      <name>Java.net Repository for Maven 2</name>
+      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+      <layout>default</layout>
+      <username></username>
+      <password></password>
+    </remoteRepository>
+  </remoteRepositories>
+
+  <proxyConnectors>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>central</targetRepoId>
+      <proxyId/>
+      <policies>
+        <releases>ignored</releases>
+        <snapshots>disabled</snapshots>
+        <cache-failures>cached</cache-failures>
+      </policies>
+    </proxyConnector>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+      <proxyId/>
+      <policies>
+        <releases>ignored</releases>
+        <snapshots>disabled</snapshots>
+        <cache-failures>cached</cache-failures>
+      </policies>
+      <whiteListPatterns>
+        <whiteListPattern>javax/**</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+  </proxyConnectors>
+
+  <networkProxies>
+    <networkProxy>
+      <id>example</id>
+      <protocol>http</protocol>
+      <host>proxy.mycompany.com</host>
+      <port>8080</port>
+      <username>myself</username>
+      <password>mypass</password>
+    </networkProxy>
+  </networkProxies>
+
+  <repositoryScanning>
+    <fileTypes>
+      <fileType>
+        <id>artifacts</id>
+        <patterns>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.jar</pattern>
+          <pattern>**/*.ear</pattern>
+          <pattern>**/*.war</pattern>
+          <pattern>**/*.car</pattern>
+          <pattern>**/*.sar</pattern>
+          <pattern>**/*.mar</pattern>
+          <pattern>**/*.rar</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+          <pattern>**/*.tar.gz</pattern>
+          <pattern>**/*.tar.bz2</pattern>
+          <pattern>**/*.zip</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>indexable-content</id>
+        <patterns>
+          <pattern>**/*.txt</pattern>
+          <pattern>**/*.TXT</pattern>
+          <pattern>**/*.block</pattern>
+          <pattern>**/*.config</pattern>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.xml</pattern>
+          <pattern>**/*.xsd</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>auto-remove</id>
+        <patterns>
+          <pattern>**/*.bak</pattern>
+          <pattern>**/*~</pattern>
+          <pattern>**/*-</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>ignored</id>
+        <patterns>
+          <pattern>**/.htaccess</pattern>
+          <pattern>**/KEYS</pattern>
+          <pattern>**/*.rb</pattern>
+          <pattern>**/*.sh</pattern>
+          <pattern>**/.svn/**</pattern>
+          <pattern>**/.DAV/**</pattern>
+        </patterns>
+      </fileType>
+    </fileTypes>
+    <knownContentConsumers>
+      <knownContentConsumer>update-db-artifact</knownContentConsumer>
+      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
+      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
+      <knownContentConsumer>validate-checksum</knownContentConsumer>
+      <knownContentConsumer>validate-signature</knownContentConsumer>
+      <knownContentConsumer>index-content</knownContentConsumer>
+      <knownContentConsumer>auto-remove</knownContentConsumer>
+      <knownContentConsumer>auto-rename</knownContentConsumer>
+      <knownContentConsumer>metadata-updater</knownContentConsumer>
+    </knownContentConsumers>
+    <invalidContentConsumers>
+      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
+    </invalidContentConsumers>
+  </repositoryScanning>
+
+  <databaseScanning>
+    <cronExpression>0 0 * * * ?</cronExpression>
+    <unprocessedConsumers>
+      <unprocessedConsumer>index-artifact</unprocessedConsumer>
+      <unprocessedConsumer>update-db-project</unprocessedConsumer>
+      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
+      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
+      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
+      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
+    </unprocessedConsumers>
+    <cleanupConsumers>
+      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
+    </cleanupConsumers>
+  </databaseScanning>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>true</showFindArtifacts>
+      <appletFindEnabled>true</appletFindEnabled>
+    </ui>
+  </webapp>
+
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ArchivaConfigurationMRM789Test.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ArchivaConfigurationMRM789Test.java
new file mode 100644 (file)
index 0000000..6067496
--- /dev/null
@@ -0,0 +1,140 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.model.UserInterfaceOptions;
+import org.apache.archiva.configuration.model.WebappConfiguration;
+import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.context.ApplicationContext;
+import org.springframework.test.context.ContextConfiguration;
+
+import javax.inject.Inject;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test the configuration store.
+ */
+@RunWith( ArchivaSpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+public class ArchivaConfigurationMRM789Test
+{
+
+    private static String FILE_ENCODING = "UTF-8";
+
+    @Inject
+    protected ApplicationContext applicationContext;
+
+    @Inject
+    FileTypes filetypes;
+
+    public static Path getTestFile( String path )
+    {
+        return Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), path );
+    }
+
+    @SuppressWarnings( "unchecked" )
+    protected <T> T lookup( Class<T> clazz, String hint )
+    {
+        return (T) applicationContext.getBean( "archivaConfiguration#" + hint, ArchivaConfiguration.class );
+    }
+   
+    // test for [MRM-789]
+    @Test
+    public void testGetConfigurationFromDefaultsWithDefaultRepoLocationAlreadyExisting()
+        throws Exception
+    {
+        Path repo = Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "target/test-classes/existing_snapshots" );
+        Files.createDirectories(repo);
+
+        repo = Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "target/test-classes/existing_internal" );
+        Files.createDirectories(repo);
+
+        String existingTestDefaultArchivaConfigFile = FileUtils.readFileToString(
+            getTestFile( "target/test-classes/org/apache/archiva/configuration/test-default-archiva.xml" ).toFile(), FILE_ENCODING );
+        existingTestDefaultArchivaConfigFile =
+            StringUtils.replace( existingTestDefaultArchivaConfigFile, "${appserver.base}", org.apache.archiva.common.utils.FileUtils.getBasedir() );
+
+        Path generatedTestDefaultArchivaConfigFile = Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(),
+                                                               "target/test-classes/org/apache/archiva/configuration/default-archiva.xml" );
+
+        FileUtils.writeStringToFile( generatedTestDefaultArchivaConfigFile.toFile(), existingTestDefaultArchivaConfigFile,
+                                     Charset.forName(FILE_ENCODING) );
+
+        ArchivaConfiguration archivaConfiguration =
+            lookup( ArchivaConfiguration.class, "test-defaults-default-repo-location-exists" );
+        Configuration configuration = archivaConfiguration.getConfiguration();
+        assertConfiguration( configuration, 2, 2, 2 );
+
+        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
+        assertTrue( "check managed repositories", repository.getLocation().endsWith( "data/repositories/internal" ) );
+
+        Files.deleteIfExists(generatedTestDefaultArchivaConfigFile);
+        assertFalse( Files.exists(generatedTestDefaultArchivaConfigFile) );
+    }
+
+
+    /**
+     * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
+     */
+    private void assertConfiguration( Configuration configuration, int managedExpected, int remoteExpected,
+                                      int proxyConnectorExpected )
+        throws Exception
+    {
+
+        assertEquals( "check managed repositories: " + configuration.getManagedRepositories(), managedExpected,
+                      configuration.getManagedRepositories().size() );
+        assertEquals( "check remote repositories: " + configuration.getRemoteRepositories(), remoteExpected,
+                      configuration.getRemoteRepositories().size() );
+        assertEquals( "check proxy connectors:" + configuration.getProxyConnectors(), proxyConnectorExpected,
+                      configuration.getProxyConnectors().size() );
+
+        RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning();
+        assertNotNull( "check repository scanning", repoScanning );
+        assertEquals( "check file types", 4, repoScanning.getFileTypes().size() );
+        assertEquals( "check known consumers", 9, repoScanning.getKnownContentConsumers().size() );
+        assertEquals( "check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size() );
+
+        List<String> patterns = filetypes.getFileTypePatterns( "artifacts" );
+        assertNotNull( "check 'artifacts' file type", patterns );
+        assertEquals( "check 'artifacts' patterns", 13, patterns.size() );
+
+        WebappConfiguration webapp = configuration.getWebapp();
+        assertNotNull( "check webapp", webapp );
+
+        UserInterfaceOptions ui = webapp.getUi();
+        assertNotNull( "check webapp ui", ui );
+        assertTrue( "check showFindArtifacts", ui.isShowFindArtifacts() );
+        assertTrue( "check appletFindEnabled", ui.isAppletFindEnabled() );
+    }
+
+   
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ArchivaConfigurationTest.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ArchivaConfigurationTest.java
new file mode 100644 (file)
index 0000000..ae2079b
--- /dev/null
@@ -0,0 +1,742 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.components.registry.RegistryException;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.LegacyArtifactPath;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.model.UserInterfaceOptions;
+import org.apache.archiva.configuration.model.WebappConfiguration;
+import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.annotation.DirtiesContext.ClassMode;
+import org.springframework.test.context.ContextConfiguration;
+
+import javax.inject.Inject;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.mock;
+
+/**
+ * Test the configuration store.
+ */
+@RunWith(ArchivaSpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" })
+@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
+public class ArchivaConfigurationTest
+{
+
+    private Logger log = LoggerFactory.getLogger( getClass() );
+
+    @Inject
+    protected ApplicationContext applicationContext;
+
+    @Inject
+    FileTypes filetypes;
+
+    public static Path getTestFile( String path )
+    {
+        return Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), path );
+    }
+
+    @SuppressWarnings( "unchecked" )
+    protected <T> T lookup( Class<T> clazz, String hint )
+    {
+        return (T) applicationContext.getBean( "archivaConfiguration#" + hint, ArchivaConfiguration.class );
+    }
+
+    @Test
+    public void testGetConfigurationFromDefaults()
+        throws Exception
+    {
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-defaults" );
+        Configuration configuration = archivaConfiguration.getConfiguration();
+
+        assertConfiguration( configuration, 2, 1, 1 );
+        assertEquals( "check network proxies", 0, configuration.getNetworkProxies().size() );
+
+        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
+
+        assertEquals( "check managed repositories", "${appserver.base}/repositories/internal",
+                      repository.getLocation() );
+        assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
+        assertEquals( "check managed repositories", "internal", repository.getId() );
+        assertEquals( "check managed repositories", "default", repository.getLayout() );
+        assertTrue( "check managed repositories", repository.isScanned() );
+    }
+
+    @Test
+    public void testGetConfigurationFromRegistryWithASingleNamedConfigurationResource()
+        throws Exception
+    {
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-configuration" );
+        Configuration configuration = archivaConfiguration.getConfiguration();
+        assertConfiguration( configuration, 2, 2, 2 );
+        assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() );
+
+        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
+
+        assertEquals( "check managed repositories", "${appserver.base}/repositories/internal",
+                      repository.getLocation() );
+        assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
+        assertEquals( "check managed repositories", "internal", repository.getId() );
+        assertEquals( "check managed repositories", "default", repository.getLayout() );
+        assertTrue( "check managed repositories", repository.isScanned() );
+    }
+
+    /**
+     * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
+     */
+    private void assertConfiguration( Configuration configuration, int managedExpected, int remoteExpected,
+                                      int proxyConnectorExpected )
+        throws Exception
+    {
+
+        assertEquals( "check managed repositories: " + configuration.getManagedRepositories(), managedExpected,
+                      configuration.getManagedRepositories().size() );
+        assertEquals( "check remote repositories: " + configuration.getRemoteRepositories(), remoteExpected,
+                      configuration.getRemoteRepositories().size() );
+        assertEquals( "check proxy connectors:" + configuration.getProxyConnectors(), proxyConnectorExpected,
+                      configuration.getProxyConnectors().size() );
+
+        RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning();
+        assertNotNull( "check repository scanning", repoScanning );
+        assertEquals( "check file types", 4, repoScanning.getFileTypes().size() );
+        assertEquals( "check known consumers", 9, repoScanning.getKnownContentConsumers().size() );
+        assertEquals( "check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size() );
+
+        List<String> patterns = filetypes.getFileTypePatterns( "artifacts" );
+        assertNotNull( "check 'artifacts' file type", patterns );
+        assertEquals( "check 'artifacts' patterns", 13, patterns.size() );
+
+        WebappConfiguration webapp = configuration.getWebapp();
+        assertNotNull( "check webapp", webapp );
+
+        UserInterfaceOptions ui = webapp.getUi();
+        assertNotNull( "check webapp ui", ui );
+        assertTrue( "check showFindArtifacts", ui.isShowFindArtifacts() );
+        assertTrue( "check appletFindEnabled", ui.isAppletFindEnabled() );
+    }
+
+    @Test
+    public void testGetConfigurationFromRegistryWithTwoConfigurationResources()
+        throws Exception
+    {
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-configuration-both" );
+
+        Configuration configuration = archivaConfiguration.getConfiguration();
+
+        // from base
+        assertEquals( "check repositories", 2, configuration.getManagedRepositories().size() );
+        assertEquals( "check repositories", 2, configuration.getRemoteRepositories().size() );
+        // from user
+        assertEquals( "check proxy connectors", 2, configuration.getProxyConnectors().size() );
+
+        WebappConfiguration webapp = configuration.getWebapp();
+        assertNotNull( "check webapp", webapp );
+
+        UserInterfaceOptions ui = webapp.getUi();
+        assertNotNull( "check webapp ui", ui );
+        // from base
+        assertFalse( "check showFindArtifacts", ui.isShowFindArtifacts() );
+        // from user
+        assertFalse( "check appletFindEnabled", ui.isAppletFindEnabled() );
+    }
+
+    @Test
+    public void testGetConfigurationSystemOverride()
+        throws Exception
+    {
+
+        System.setProperty( "org.apache.archiva.webapp.ui.appletFindEnabled", "false" );
+
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-configuration" );
+
+        archivaConfiguration.reload();
+
+        try
+        {
+            Configuration configuration = archivaConfiguration.getConfiguration();
+
+            assertFalse( "check boolean", configuration.getWebapp().getUi().isAppletFindEnabled() );
+        }
+        finally
+        {
+            System.getProperties().remove( "org.apache.archiva.webapp.ui.appletFindEnabled" );
+            archivaConfiguration.reload();
+            Configuration configuration = archivaConfiguration.getConfiguration();
+            assertTrue( "check boolean", configuration.getWebapp().getUi().isAppletFindEnabled() );
+        }
+    }
+
+    @Test
+    public void testStoreConfiguration()
+        throws Exception
+    {
+        Path file = getTestFile( "target/test/test-file.xml" );
+        Files.deleteIfExists(file);
+        assertFalse( Files.exists(file) );
+
+        // TODO: remove with commons-configuration 1.4
+        //file.getParentFile().mkdirs();
+        //FileUtils.writeStringToFile( file, "<configuration/>", null );
+
+        DefaultArchivaConfiguration archivaConfiguration =
+            (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-save" );
+
+        archivaConfiguration.reload();
+
+        Configuration configuration = new Configuration();
+        configuration.setVersion( "1" );
+        configuration.setWebapp( new WebappConfiguration() );
+        configuration.getWebapp().setUi( new UserInterfaceOptions() );
+        configuration.getWebapp().getUi().setAppletFindEnabled( false );
+
+        // add a change listener
+        ConfigurationListener listener = mock( ConfigurationListener.class );
+        archivaConfiguration.addListener( listener );
+
+        listener.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED ) );
+
+        archivaConfiguration.save( configuration );
+
+        assertTrue( "Check file exists", Files.exists(file) );
+
+        // check it
+        configuration = archivaConfiguration.getConfiguration();
+        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+
+        // read it back
+        archivaConfiguration = (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-read-saved" );
+
+        archivaConfiguration.reload();
+        configuration = archivaConfiguration.getConfiguration();
+        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+    }
+
+    private static ConfigurationListener createConfigurationListenerMockControl()
+    {
+        return mock( ConfigurationListener.class );// MockControl.createControl( ConfigurationListener.class );
+    }
+
+    @Test
+    public void testStoreConfigurationUser()
+        throws Exception
+    {
+        Path baseFile = getTestFile( "target/test/test-file.xml" );
+        Files.deleteIfExists( baseFile );
+        assertFalse( Files.exists(baseFile) );
+
+        Path userFile = getTestFile( "target/test/test-file-user.xml" );
+        Files.deleteIfExists( userFile );
+        assertFalse( Files.exists(userFile) );
+
+        Files.createDirectories(userFile.getParent());
+        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
+
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user" );
+
+        Configuration configuration = new Configuration();
+        configuration.setWebapp( new WebappConfiguration() );
+        configuration.getWebapp().setUi( new UserInterfaceOptions() );
+        configuration.getWebapp().getUi().setAppletFindEnabled( false );
+
+        archivaConfiguration.save( configuration );
+
+        assertTrue( "Check file exists", Files.exists(userFile) );
+        assertFalse( "Check file not created", Files.exists(baseFile) );
+
+        // check it
+        configuration = archivaConfiguration.getConfiguration();
+        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+    }
+
+    @Test
+    public void testStoreConfigurationLoadedFromDefaults()
+        throws Exception
+    {
+        Path baseFile = getTestFile( "target/test/test-file.xml" );
+        Files.delete(baseFile);
+        assertFalse( Files.exists(baseFile) );
+
+        Path userFile = getTestFile( "target/test/test-file-user.xml" );
+        Files.deleteIfExists(userFile);
+        assertFalse( Files.exists(userFile) );
+
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user-defaults" );
+
+        archivaConfiguration.reload();
+
+        Configuration configuration = new Configuration();
+        configuration.setWebapp( new WebappConfiguration() );
+        configuration.getWebapp().setUi( new UserInterfaceOptions() );
+        configuration.getWebapp().getUi().setAppletFindEnabled( false );
+
+        // add a change listener
+        ConfigurationListener listener = createConfigurationListenerMockControl();
+        archivaConfiguration.addListener( listener );
+
+        listener.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED ) );
+
+        archivaConfiguration.save( configuration );
+
+        assertTrue( "Check file exists", Files.exists(userFile) );
+        assertFalse( "Check file not created", Files.exists(baseFile) );
+
+        // check it
+        configuration = archivaConfiguration.getConfiguration();
+        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+    }
+
+    @Test
+    public void testDefaultUserConfigFilename()
+        throws Exception
+    {
+        DefaultArchivaConfiguration archivaConfiguration =
+            (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class, "default" );
+        String expectedFile = System.getProperty( "user.home" ) + "/.m2/archiva.xml";
+        String systemFile = System.getProperty(ArchivaConfiguration.USER_CONFIG_PROPERTY);
+        if (StringUtils.isNotEmpty( systemFile )) {
+            expectedFile = systemFile;
+        } else
+        {
+            String envFile = System.getenv( ArchivaConfiguration.USER_CONFIG_ENVVAR );
+            if ( StringUtils.isNotEmpty( envFile ) )
+                expectedFile = envFile;
+        }
+
+        archivaConfiguration.reload();
+
+        assertEquals( expectedFile,
+                      archivaConfiguration.getUserConfigFilename() );
+        assertEquals( System.getProperty( "appserver.base", "${appserver.base}" ) + "/conf/archiva.xml",
+                      archivaConfiguration.getAltConfigFilename() );
+    }
+
+    @Test
+    public void testStoreConfigurationFallback()
+        throws Exception
+    {
+        Path baseFile = getTestFile( "target/test/test-file.xml" );
+        Files.deleteIfExists(baseFile);
+        assertFalse( Files.exists(baseFile) );
+
+        Path userFile = getTestFile( "target/test/test-file-user.xml" );
+        Files.deleteIfExists(userFile);
+        assertFalse( Files.exists(userFile) );
+
+        Files.createDirectories( baseFile.getParent());
+        FileUtils.writeStringToFile( baseFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
+
+        ArchivaConfiguration archivaConfiguration =
+            (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-save-user-fallback" );
+
+        archivaConfiguration.reload();
+
+        Configuration configuration = new Configuration();
+        configuration.setWebapp( new WebappConfiguration() );
+        configuration.getWebapp().setUi( new UserInterfaceOptions() );
+        configuration.getWebapp().getUi().setAppletFindEnabled( false );
+
+        archivaConfiguration.save( configuration );
+
+        assertTrue( "Check file exists", Files.exists(baseFile) );
+        assertFalse( "Check file not created", Files.exists(userFile) );
+
+        // check it
+        configuration = archivaConfiguration.getConfiguration();
+        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+    }
+
+    @Test
+    public void testStoreConfigurationFailsWhenReadFromBothLocationsNoLists()
+        throws Exception
+    {
+        Path baseFile = getTestFile( "target/test/test-file.xml" );
+        Files.deleteIfExists(baseFile);
+        assertFalse( Files.exists(baseFile) );
+
+        Path userFile = getTestFile( "target/test/test-file-user.xml" );
+        Files.deleteIfExists(userFile);
+        assertFalse( Files.exists(userFile) );
+
+        Files.createDirectories( baseFile.getParent() );
+        FileUtils.writeStringToFile( baseFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
+
+        Files.createDirectories( userFile.getParent());
+        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
+
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user" );
+
+        archivaConfiguration.reload();
+
+        Configuration configuration = archivaConfiguration.getConfiguration();
+        assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+
+        configuration.getWebapp().getUi().setAppletFindEnabled( false );
+
+        archivaConfiguration.save( configuration );
+
+        assertTrue( "Check file exists", Files.exists(baseFile) );
+        assertEquals( "Check base file is unchanged", "<configuration/>",
+                      FileUtils.readFileToString( baseFile.toFile(), Charset.forName( "UTF-8" ) ) );
+        assertTrue( "Check file exists", Files.exists(userFile) );
+        assertFalse( "Check base file is changed",
+                     "<configuration/>".equals( FileUtils.readFileToString( userFile.toFile(), Charset.forName( "UTF-8" ) ) ) );
+
+        // check it
+        configuration = archivaConfiguration.getConfiguration();
+        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+    }
+
+    @Test
+    public void testStoreConfigurationFailsWhenReadFromBothLocationsUserHasLists()
+        throws Exception
+    {
+        Path baseFile = getTestFile( "target/test/test-file.xml" );
+        Files.deleteIfExists(baseFile);
+        assertFalse( Files.exists(baseFile) );
+
+        Path userFile = getTestFile( "target/test/test-file-user.xml" );
+        Files.deleteIfExists(userFile);
+        assertFalse( Files.exists(userFile) );
+
+        Files.createDirectories( userFile.getParent() );
+        FileUtils.copyFile( getTestFile( "src/test/conf/conf-user.xml" ).toFile(), userFile.toFile() );
+
+        Files.createDirectories(baseFile.getParent());
+        FileUtils.writeStringToFile( baseFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
+
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user" );
+
+        archivaConfiguration.reload();
+
+        Configuration configuration = archivaConfiguration.getConfiguration();
+        assertTrue( "check value", configuration.getWebapp().getUi().isShowFindArtifacts() );
+
+        configuration.getWebapp().getUi().setShowFindArtifacts( false );
+
+        archivaConfiguration.save( configuration );
+
+        assertTrue( "Check file exists", Files.exists(baseFile) );
+        assertEquals( "Check base file is unchanged", "<configuration/>",
+                      FileUtils.readFileToString( baseFile.toFile(), Charset.forName( "UTF-8" ) ) );
+        assertTrue( "Check file exists", Files.exists(userFile) );
+        assertFalse( "Check base file is changed",
+                     "<configuration/>".equals( FileUtils.readFileToString( userFile.toFile(), Charset.forName( "UTF-8" ) ) ) );
+
+        // check it
+        configuration = archivaConfiguration.getConfiguration();
+        assertFalse( "check value", configuration.getWebapp().getUi().isShowFindArtifacts() );
+    }
+
+    @Test
+    public void testStoreConfigurationFailsWhenReadFromBothLocationsAppserverHasLists()
+        throws Exception
+    {
+        Path baseFile = getTestFile( "target/test/test-file.xml" );
+        Files.deleteIfExists(baseFile);
+        assertFalse( Files.exists(baseFile) );
+
+        Path userFile = getTestFile( "target/test/test-file-user.xml" );
+        Files.deleteIfExists(userFile);
+        assertFalse( Files.exists(userFile) );
+
+        Files.createDirectories(baseFile.getParent());
+        FileUtils.copyFile( getTestFile( "src/test/conf/conf-base.xml" ).toFile(), baseFile.toFile() );
+
+        Files.createDirectories(userFile.getParent());
+        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
+
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user" );
+
+        archivaConfiguration.reload();
+
+        Configuration configuration = archivaConfiguration.getConfiguration();
+        assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+
+        configuration.getWebapp().getUi().setAppletFindEnabled( false );
+
+        try
+        {
+            archivaConfiguration.save( configuration );
+            fail( "Configuration saving should not succeed if it was loaded from two locations" );
+        }
+        catch ( IndeterminateConfigurationException e )
+        {
+            // check it was reverted
+            configuration = archivaConfiguration.getConfiguration();
+            assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
+        }
+    }
+
+    @Test
+    public void testLoadConfigurationFromInvalidBothLocationsOnDisk()
+        throws Exception
+    {
+        String propFile = System.getProperty( ArchivaConfiguration.USER_CONFIG_PROPERTY );
+        System.setProperty( ArchivaConfiguration.USER_CONFIG_PROPERTY, "/../../..//*intentionally:invalid*/.m2/archiva-user.xml" );
+        ArchivaConfiguration archivaConfiguration =
+            lookup( ArchivaConfiguration.class, "test-not-allowed-to-write-to-both" );
+        Configuration config = archivaConfiguration.getConfiguration();
+
+        try
+        {
+            archivaConfiguration.save( config );
+            fail( "Should have thrown a RegistryException because the configuration can't be saved." );
+        }
+        catch ( RegistryException e )
+        {
+            /* expected exception */
+        }
+        if (propFile!=null)
+        {
+            System.setProperty( ArchivaConfiguration.USER_CONFIG_PROPERTY, propFile );
+        }
+    }
+
+    @Test
+    public void testLoadConfigurationFromInvalidUserLocationOnDisk()
+        throws Exception
+    {
+        Path testConfDir = getTestFile( "target/test-appserver-base/conf/" );
+        Files.createDirectories( testConfDir );
+
+        ArchivaConfiguration archivaConfiguration =
+            lookup( ArchivaConfiguration.class, "test-not-allowed-to-write-to-user" );
+        Configuration config = archivaConfiguration.getConfiguration();
+        archivaConfiguration.save( config );
+        // No Exception == test passes.
+        // Expected Path is: Should not have thrown an exception.
+    }
+
+
+    @Test
+    public void testConfigurationUpgradeFrom13()
+        throws Exception
+    {
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-upgrade-1.3" );
+
+        // we just use the defaults when upgrading from 1.3 at this point.
+        Configuration configuration = archivaConfiguration.getConfiguration();
+        assertConfiguration( configuration, 2, 2, 2 );
+        assertEquals( "check network proxies", 0, configuration.getNetworkProxies().size() );
+
+        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
+
+        assertEquals( "check managed repositories", "${appserver.base}/data/repositories/internal",
+                      repository.getLocation() );
+        assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
+        assertEquals( "check managed repositories", "internal", repository.getId() );
+        assertEquals( "check managed repositories", "default", repository.getLayout() );
+        assertTrue( "check managed repositories", repository.isScanned() );
+
+        log.info( "knowContentConsumers {}", configuration.getRepositoryScanning().getKnownContentConsumers() );
+
+        assertFalse(
+            configuration.getRepositoryScanning().getKnownContentConsumers().contains( "update-db-artifact" ) );
+        assertFalse( configuration.getRepositoryScanning().getKnownContentConsumers().contains(
+            "update-db-repository-metadata" ) );
+
+        assertTrue(
+            configuration.getRepositoryScanning().getKnownContentConsumers().contains( "create-archiva-metadata" ) );
+
+        assertTrue(
+            configuration.getRepositoryScanning().getKnownContentConsumers().contains( "duplicate-artifacts" ) );
+    }
+
+
+    @Test
+    public void testCronExpressionsWithComma()
+        throws Exception
+    {
+        Path baseFile = getTestFile( "target/test/test-file.xml" );
+        Files.deleteIfExists(baseFile);
+        assertFalse( Files.exists(baseFile) );
+
+        Path userFile = getTestFile( "target/test/test-file-user.xml" );
+        Files.deleteIfExists(userFile);
+        assertFalse( Files.exists(userFile) );
+
+        Files.createDirectories(baseFile.getParent());
+        FileUtils.copyFile( getTestFile( "src/test/conf/escape-cron-expressions.xml" ).toFile(), baseFile.toFile() );
+
+        Files.createDirectories(userFile.getParent());
+        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.defaultCharset() );
+
+        final ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-cron-expressions" );
+
+        archivaConfiguration.reload();
+
+        Configuration configuration = archivaConfiguration.getConfiguration();
+
+        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
+
+        assertEquals( "check cron expression", "0 0,30 * * * ?", repository.getRefreshCronExpression().trim() );
+
+        // add a test listener to confirm it doesn't see the escaped format. We don't need to test the number of calls,
+        // etc. as it's done in other tests
+        archivaConfiguration.addListener( new ConfigurationListener()
+        {
+            @Override
+            public void configurationEvent( ConfigurationEvent event )
+            {
+                assertEquals( ConfigurationEvent.SAVED, event.getType() );
+
+            }
+        } );
+
+        archivaConfiguration.save( configuration );
+
+        configuration = archivaConfiguration.getConfiguration();
+
+        // test for the escape character '\' showing up on repositories.jsp
+        repository.setRefreshCronExpression( "0 0,20 0 * * ?" );
+
+        archivaConfiguration.save( configuration );
+
+        repository = archivaConfiguration.getConfiguration().findManagedRepositoryById( "snapshots" );
+
+        assertEquals( "check cron expression", "0 0,20 0 * * ?", repository.getRefreshCronExpression() );
+    }
+
+    @Test
+    public void testRemoveLastElements()
+        throws Exception
+    {
+        Path baseFile = getTestFile( "target/test/test-file.xml" );
+        Files.deleteIfExists(baseFile);
+        assertFalse( Files.exists(baseFile) );
+
+        Path userFile = getTestFile( "target/test/test-file-user.xml" );
+        Files.deleteIfExists(userFile);
+        assertFalse( Files.exists(userFile) );
+
+        Files.createDirectories( baseFile.getParent() );
+        FileUtils.copyFile( getTestFile( "src/test/conf/conf-single-list-elements.xml" ).toFile(), baseFile.toFile() );
+
+        Files.createDirectories( userFile.getParent());
+        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
+
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-remove-central" );
+
+        archivaConfiguration.reload();
+
+        Configuration configuration = archivaConfiguration.getConfiguration();
+
+        RepositoryGroupConfiguration repositoryGroup = configuration.getRepositoryGroups().get( 0 );
+        assertNotNull( repositoryGroup );
+        configuration.removeRepositoryGroup( repositoryGroup );
+        assertTrue( configuration.getRepositoryGroups().isEmpty() );
+
+        RemoteRepositoryConfiguration repository = configuration.getRemoteRepositoriesAsMap().get( "central" );
+        assertNotNull( repository );
+        configuration.removeRemoteRepository( repository );
+        assertTrue( configuration.getRemoteRepositories().isEmpty() );
+
+        ManagedRepositoryConfiguration managedRepository =
+            configuration.getManagedRepositoriesAsMap().get( "snapshots" );
+        assertNotNull( managedRepository );
+        configuration.removeManagedRepository( managedRepository );
+        assertTrue( configuration.getManagedRepositories().isEmpty() );
+
+        ProxyConnectorConfiguration proxyConnector = configuration.getProxyConnectors().get( 0 );
+        assertNotNull( proxyConnector );
+        configuration.removeProxyConnector( proxyConnector );
+        assertTrue( configuration.getProxyConnectors().isEmpty() );
+
+        NetworkProxyConfiguration networkProxy = configuration.getNetworkProxiesAsMap().get( "proxy" );
+        assertNotNull( networkProxy );
+        configuration.removeNetworkProxy( networkProxy );
+        assertTrue( configuration.getNetworkProxies().isEmpty() );
+
+        LegacyArtifactPath path = configuration.getLegacyArtifactPaths().get( 0 );
+        assertNotNull( path );
+        configuration.removeLegacyArtifactPath( path );
+        assertTrue( configuration.getLegacyArtifactPaths().isEmpty() );
+
+        RepositoryScanningConfiguration scanning = configuration.getRepositoryScanning();
+        String consumer = scanning.getKnownContentConsumers().get( 0 );
+        assertNotNull( consumer );
+        scanning.removeKnownContentConsumer( consumer );
+        // default values
+        assertFalse( scanning.getKnownContentConsumers().isEmpty() );
+        consumer = scanning.getInvalidContentConsumers().get( 0 );
+        assertNotNull( consumer );
+        scanning.removeInvalidContentConsumer( consumer );
+        assertTrue( scanning.getInvalidContentConsumers().isEmpty() );
+
+        archivaConfiguration.save( configuration );
+
+        archivaConfiguration = lookup( ArchivaConfiguration.class, "test-read-saved" );
+        configuration = archivaConfiguration.getConfiguration();
+        assertNull( configuration.getRemoteRepositoriesAsMap().get( "central" ) );
+        assertTrue( configuration.getRepositoryGroups().isEmpty() );
+        assertNull( configuration.getManagedRepositoriesAsMap().get( "snapshots" ) );
+        assertTrue( configuration.getProxyConnectors().isEmpty() );
+        assertNull( configuration.getNetworkProxiesAsMap().get( "proxy" ) );
+        assertTrue( configuration.getLegacyArtifactPaths().isEmpty() );
+        scanning = configuration.getRepositoryScanning();
+        assertFalse( scanning.getKnownContentConsumers().isEmpty() );
+        assertTrue( scanning.getInvalidContentConsumers().isEmpty() );
+    }
+
+    /**
+     * [MRM-582] Remote Repositories with empty <username> and <password> fields shouldn't be created in configuration.
+     */
+    @Test
+    public void testGetConfigurationFixEmptyRemoteRepoUsernamePassword()
+        throws Exception
+    {
+        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-configuration" );
+
+        Configuration configuration = archivaConfiguration.getConfiguration();
+        assertConfiguration( configuration, 2, 2, 2 );
+        assertEquals( "check remote repositories", 2, configuration.getRemoteRepositories().size() );
+
+        RemoteRepositoryConfiguration repository =
+            configuration.getRemoteRepositoriesAsMap().get( "maven2-repository.dev.java.net" );
+
+        assertEquals( "remote repository.url", "https://maven2-repository.dev.java.net/nonav/repository",
+                      repository.getUrl() );
+        assertEquals( "remote repository.name", "Java.net Repository for Maven 2", repository.getName() );
+        assertEquals( "remote repository.id", "maven2-repository.dev.java.net", repository.getId() );
+        assertEquals( "remote repository.layout", "default", repository.getLayout() );
+        assertNull( "remote repository.username == null", repository.getUsername() );
+        assertNull( "remote repository.password == null", repository.getPassword() );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ConfigurationTest.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/ConfigurationTest.java
new file mode 100644 (file)
index 0000000..599bf92
--- /dev/null
@@ -0,0 +1,157 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Map;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test the generated Configuration class from Modello. This is primarily to test the hand coded methods.
+ */
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
+public class ConfigurationTest
+{
+    private Configuration configuration = new Configuration();
+
+    @Test
+    public void testNetworkProxyRetrieval()
+    {
+        NetworkProxyConfiguration proxy1 = createNetworkProxy( "id1", "host1", 8080 );
+        configuration.addNetworkProxy( proxy1 );
+        NetworkProxyConfiguration proxy2 = createNetworkProxy( "id2", "host2", 9090 );
+        configuration.addNetworkProxy( proxy2 );
+
+        Map<String, NetworkProxyConfiguration> map = configuration.getNetworkProxiesAsMap();
+        assertNotNull( map );
+        assertEquals( 2, map.size() );
+        assertEquals( new HashSet<String>( Arrays.asList( "id1", "id2" ) ), map.keySet() );
+        assertEquals( new HashSet<NetworkProxyConfiguration>( Arrays.asList( proxy1, proxy2 ) ),
+                      new HashSet<NetworkProxyConfiguration>( map.values() ) );
+    }
+
+    private NetworkProxyConfiguration createNetworkProxy( String id, String host, int port )
+    {
+        NetworkProxyConfiguration proxy = new NetworkProxyConfiguration();
+        proxy.setId( id );
+        proxy.setHost( host );
+        proxy.setPort( port );
+        proxy.setProtocol( "http" );
+        return proxy;
+    }
+
+    @Test
+    public void testRemoteRepositoryRetrieval()
+    {
+        RemoteRepositoryConfiguration repo1 = createRemoteRepository( "id1", "name 1", "url 1" );
+        configuration.addRemoteRepository( repo1 );
+        RemoteRepositoryConfiguration repo2 = createRemoteRepository( "id2", "name 2", "url 2" );
+        configuration.addRemoteRepository( repo2 );
+
+        Map<String, RemoteRepositoryConfiguration> map = configuration.getRemoteRepositoriesAsMap();
+        assertNotNull( map );
+        assertEquals( 2, map.size() );
+        assertEquals( new HashSet<String>( Arrays.asList( "id1", "id2" ) ), map.keySet() );
+        assertEquals( new HashSet<RemoteRepositoryConfiguration>( Arrays.asList( repo1, repo2 ) ),
+                      new HashSet<RemoteRepositoryConfiguration>( map.values() ) );
+
+        assertEquals( repo1, configuration.findRemoteRepositoryById( "id1" ) );
+        assertEquals( repo2, configuration.findRemoteRepositoryById( "id2" ) );
+        assertNull( configuration.findRemoteRepositoryById( "id3" ) );
+    }
+
+    private RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url )
+    {
+        RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration();
+        repo.setId( id );
+        repo.setName( name );
+        repo.setLayout( "default" );
+        repo.setUrl( url );
+        return repo;
+    }
+
+    @Test
+    public void testManagedRepositoryRetrieval()
+    {
+        ManagedRepositoryConfiguration repo1 = createManagedRepository( "id1", "name 1", "path 1", false );
+        configuration.addManagedRepository( repo1 );
+        ManagedRepositoryConfiguration repo2 = createManagedRepository( "id2", "name 2", "path 2", true );
+        configuration.addManagedRepository( repo2 );
+
+        Map<String, ManagedRepositoryConfiguration> map = configuration.getManagedRepositoriesAsMap();
+        assertNotNull( map );
+        assertEquals( 2, map.size() );
+        assertEquals( new HashSet<String>( Arrays.asList( "id1", "id2" ) ), map.keySet() );
+        assertEquals( new HashSet<ManagedRepositoryConfiguration>( Arrays.asList( repo1, repo2 ) ),
+                      new HashSet<ManagedRepositoryConfiguration>( map.values() ) );
+
+        assertEquals( repo1, configuration.findManagedRepositoryById( "id1" ) );
+        assertEquals( repo2, configuration.findManagedRepositoryById( "id2" ) );
+        assertNull( configuration.findManagedRepositoryById( "id3" ) );
+    }
+
+    private ManagedRepositoryConfiguration createManagedRepository( String id, String name, String location,
+                                                                    boolean scanned )
+    {
+        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        repo.setId( id );
+        repo.setName( name );
+        repo.setLocation( location );
+        repo.setScanned( scanned );
+        return repo;
+    }
+
+    @Test
+    public void testNetworkProxyRetrievalWhenEmpty()
+    {
+        Map<String, NetworkProxyConfiguration> map = configuration.getNetworkProxiesAsMap();
+        assertNotNull( map );
+        assertTrue( map.isEmpty() );
+    }
+
+    @Test
+    public void testRemoteRepositoryRetrievalWhenEmpty()
+    {
+        Map<String, RemoteRepositoryConfiguration> map = configuration.getRemoteRepositoriesAsMap();
+        assertNotNull( map );
+        assertTrue( map.isEmpty() );
+
+        assertNull( configuration.findRemoteRepositoryById( "id" ) );
+    }
+
+    @Test
+    public void testManagedRepositoryRetrievalWhenEmpty()
+    {
+        Map<String, ManagedRepositoryConfiguration> map = configuration.getManagedRepositoriesAsMap();
+        assertNotNull( map );
+        assertTrue( map.isEmpty() );
+
+        assertNull( configuration.findManagedRepositoryById( "id" ) );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/FileTypesTest.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/FileTypesTest.java
new file mode 100644 (file)
index 0000000..38921e3
--- /dev/null
@@ -0,0 +1,79 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+
+import javax.inject.Inject;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+@RunWith( ArchivaSpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml" } )
+public class FileTypesTest
+{
+    @Inject
+    private FileTypes filetypes;
+
+    @Test
+    public void testIsArtifact()
+    {
+        assertTrue( filetypes.matchesArtifactPattern( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom" ) );
+        assertTrue( filetypes.matchesArtifactPattern(
+            "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.jar" ) );
+        assertTrue( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) );
+
+        assertFalse(
+            filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) );
+        assertFalse(
+            filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) );
+        assertFalse(
+            filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.asc" ) );
+        assertFalse(
+            filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.pgp" ) );
+        assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) );
+        assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/maven-metadata.xml" ) );
+    }
+
+    @Test
+    public void testDefaultExclusions()
+    {
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.gz" ) );
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.zip" ) );
+        assertTrue( filetypes.matchesDefaultExclusions(
+            "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) );
+        assertTrue( filetypes.matchesDefaultExclusions(
+            "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) );
+        assertTrue( filetypes.matchesDefaultExclusions(
+            "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) );
+        assertTrue( filetypes.matchesDefaultExclusions(
+            "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) );
+        assertTrue( filetypes.matchesDefaultExclusions(
+            "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.md5" ) );
+
+        assertFalse( filetypes.matchesDefaultExclusions(
+            "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.zip" ) );
+        assertFalse( filetypes.matchesDefaultExclusions(
+            "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/LegacyArtifactPathTest.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/LegacyArtifactPathTest.java
new file mode 100644 (file)
index 0000000..38e7dfb
--- /dev/null
@@ -0,0 +1,63 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.LegacyArtifactPath;
+import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+/**
+ * Test the generated LegacyArtifactPath class from Modello. This is primarily to test the hand coded methods.
+ *
+ * @since 1.1
+ */
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
+public class LegacyArtifactPathTest
+{
+
+    private LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath();
+
+    @Test
+    public void testLegacyArtifactPathWithClassifierResolution()
+    {
+        legacyArtifactPath.setArtifact( "groupId:artifactId:version:classifier:type" );
+
+        assertEquals( "groupId", legacyArtifactPath.getGroupId() );
+        assertEquals( "artifactId", legacyArtifactPath.getArtifactId() );
+        assertEquals( "version", legacyArtifactPath.getVersion() );
+        assertEquals( "classifier", legacyArtifactPath.getClassifier() );
+        assertEquals( "type", legacyArtifactPath.getType() );
+    }
+
+    @Test
+    public void testLegacyArtifactPathWithoutClassifierResolution()
+    {
+        legacyArtifactPath.setArtifact( "groupId:artifactId:version::type" );
+
+        assertEquals( "groupId", legacyArtifactPath.getGroupId() );
+        assertEquals( "artifactId", legacyArtifactPath.getArtifactId() );
+        assertEquals( "version", legacyArtifactPath.getVersion() );
+        assertNull( legacyArtifactPath.getClassifier() );
+        assertEquals( "type", legacyArtifactPath.getType() );
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/MavenProxyPropertyLoaderTest.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/MavenProxyPropertyLoaderTest.java
new file mode 100644 (file)
index 0000000..892cf32
--- /dev/null
@@ -0,0 +1,103 @@
+package org.apache.archiva.configuration.provider;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Map;
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ */
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
+public class MavenProxyPropertyLoaderTest
+{
+    private MavenProxyPropertyLoader loader;
+
+    @Test
+    public void testLoadValidMavenProxyConfiguration()
+        throws IOException, InvalidConfigurationException
+    {
+        Path confFile = ArchivaConfigurationTest.getTestFile( "src/test/conf/maven-proxy-complete.conf" );
+
+        Configuration configuration = new Configuration();
+        NetworkProxyConfiguration proxy = new NetworkProxyConfiguration();
+        proxy.setHost( "original-host" );
+        configuration.addNetworkProxy( proxy ); // overwritten
+
+        loader.load( Files.newInputStream(confFile), configuration );
+
+        Map<String, ManagedRepositoryConfiguration> repositoryIdMap = configuration.getManagedRepositoriesAsMap();
+        assertEquals( "Count repositories", 1, repositoryIdMap.size() );
+        assertRepositoryExists( "maven-proxy", "target", repositoryIdMap.get( "maven-proxy" ) );
+
+        Map<String, RemoteRepositoryConfiguration> remoteRepositoryMap = configuration.getRemoteRepositoriesAsMap();
+        assertEquals( "Count repositories", 4, remoteRepositoryMap.size() );
+        assertRepositoryExists( "local-repo", "file://target", remoteRepositoryMap.get( "local-repo" ) );
+        assertRepositoryExists( "www-ibiblio-org", "http://www.ibiblio.org/maven2",
+                                remoteRepositoryMap.get( "www-ibiblio-org" ) );
+        assertRepositoryExists( "dist-codehaus-org", "http://dist.codehaus.org",
+                                remoteRepositoryMap.get( "dist-codehaus-org" ) );
+        assertRepositoryExists( "private-example-com", "http://private.example.com/internal",
+                                remoteRepositoryMap.get( "private-example-com" ) );
+    }
+
+    private void assertRepositoryExists( String id, String expectedLocation, ManagedRepositoryConfiguration repo )
+    {
+        assertNotNull( "Repository id [" + id + "] should not be null", repo );
+        assertEquals( "Repository id", id, repo.getId() );
+        assertEquals( "Repository url", expectedLocation, repo.getLocation() );
+    }
+
+    private void assertRepositoryExists( String id, String expectedUrl, RemoteRepositoryConfiguration repo )
+    {
+        assertNotNull( "Repository id [" + id + "] should not be null", repo );
+        assertEquals( "Repository id", id, repo.getId() );
+        assertEquals( "Repository url", expectedUrl, repo.getUrl() );
+    }
+
+    @Test( expected=InvalidConfigurationException.class )
+    public void testInvalidConfiguration() 
+        throws InvalidConfigurationException
+    {
+        Configuration configuration = new Configuration();
+        loader.load( new Properties(), configuration );
+        //fail( "Incomplete config should have failed" );
+    }
+
+    @Before
+    public void setUp()
+        throws Exception
+    {
+        loader = new MavenProxyPropertyLoader();
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/functors/ProxyConnectorConfigurationOrderComparatorTest.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/functors/ProxyConnectorConfigurationOrderComparatorTest.java
new file mode 100644 (file)
index 0000000..b5873f5
--- /dev/null
@@ -0,0 +1,138 @@
+package org.apache.archiva.configuration.provider.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.functors.ProxyConnectorConfigurationOrderComparator;
+import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * ProxyConnectorConfigurationOrderComparatorTest
+ *
+ *
+ */
+@SuppressWarnings( "deprecation" )
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
+public class ProxyConnectorConfigurationOrderComparatorTest
+{
+    @Test
+    public void testSortOfAllZeros()
+    {
+        List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
+
+        proxies.add( createConnector( "corporate", 0 ) );
+        proxies.add( createConnector( "snapshots", 0 ) );
+        proxies.add( createConnector( "3rdparty", 0 ) );
+        proxies.add( createConnector( "sandbox", 0 ) );
+
+        Collections.sort( proxies, ProxyConnectorConfigurationOrderComparator.getInstance() );
+
+        assertProxyOrder( new String[]{ "corporate", "snapshots", "3rdparty", "sandbox" }, proxies );
+    }
+
+    @Test
+    public void testSortNormal()
+    {
+        List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
+
+        proxies.add( createConnector( "corporate", 3 ) );
+        proxies.add( createConnector( "snapshots", 1 ) );
+        proxies.add( createConnector( "3rdparty", 2 ) );
+        proxies.add( createConnector( "sandbox", 4 ) );
+
+        Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() );
+
+        assertProxyOrder( new String[]{ "snapshots", "3rdparty", "corporate", "sandbox" }, proxies );
+    }
+
+    @Test
+    public void testSortPartial()
+    {
+        List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
+
+        proxies.add( createConnector( "corporate", 3 ) );
+        proxies.add( createConnector( "snapshots", 0 ) );
+        proxies.add( createConnector( "3rdparty", 2 ) );
+        proxies.add( createConnector( "sandbox", 0 ) );
+
+        Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() );
+
+        assertProxyOrder( new String[]{ "3rdparty", "corporate", "snapshots", "sandbox" }, proxies );
+    }
+
+    private void assertProxyOrder( String[] ids, List<ProxyConnectorConfiguration> proxies )
+    {
+        assertEquals( "Proxies.size() == ids.length", ids.length, proxies.size() );
+
+        int orderFailedAt = -1;
+
+        for ( int i = 0; i < ids.length; i++ )
+        {
+            if ( !StringUtils.equals( ids[i], proxies.get( i ).getProxyId() ) )
+            {
+                orderFailedAt = i;
+                break;
+            }
+        }
+
+        if ( orderFailedAt >= 0 )
+        {
+            StringBuilder msg = new StringBuilder();
+
+            msg.append( "Failed expected order of the proxies <" );
+            msg.append( StringUtils.join( ids, ", " ) );
+            msg.append( ">, actual <" );
+
+            boolean needsComma = false;
+            for ( ProxyConnectorConfiguration proxy : proxies )
+            {
+                if ( needsComma )
+                {
+                    msg.append( ", " );
+                }
+                msg.append( proxy.getProxyId() );
+                needsComma = true;
+            }
+            msg.append( "> failure at index <" ).append( orderFailedAt ).append( ">." );
+
+            fail( msg.toString() );
+        }
+    }
+
+    private ProxyConnectorConfiguration createConnector( String id, int order )
+    {
+        ProxyConnectorConfiguration proxy = new ProxyConnectorConfiguration();
+        proxy.setProxyId( id );
+        proxy.setOrder( order );
+        proxy.setSourceRepoId( id + "_m" );
+        proxy.setTargetRepoId( id + "_r" );
+
+        return proxy;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/functors/RepositoryConfigurationComparatorTest.java b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/java/org/apache/archiva/configuration/provider/functors/RepositoryConfigurationComparatorTest.java
new file mode 100644 (file)
index 0000000..0423351
--- /dev/null
@@ -0,0 +1,57 @@
+package org.apache.archiva.configuration.provider.functors;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.functors.RepositoryConfigurationComparator;
+import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Comparator;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Test the repositry comparator.
+ */
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
+public class RepositoryConfigurationComparatorTest
+{
+    @Test
+    public void testComparator()
+    {
+        Comparator<AbstractRepositoryConfiguration> comparator = new RepositoryConfigurationComparator();
+
+        assertEquals( 0, comparator.compare( null, null ) );
+        assertEquals( 1, comparator.compare( createRepository( "id" ), null ) );
+        assertEquals( -1, comparator.compare( null, createRepository( "id" ) ) );
+        assertEquals( 0, comparator.compare( createRepository( "id1" ), createRepository( "id1" ) ) );
+        assertEquals( -1, comparator.compare( createRepository( "id1" ), createRepository( "id2" ) ) );
+        assertEquals( 1, comparator.compare( createRepository( "id2" ), createRepository( "id1" ) ) );
+    }
+
+    private ManagedRepositoryConfiguration createRepository( String id )
+    {
+        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        repo.setId( id );
+        return repo;
+    }
+}
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/log4j2-test.xml
new file mode 100644 (file)
index 0000000..03547df
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<configuration>
+  <Properties>
+
+  </Properties>
+  <appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%d{ISO8601_PERIOD} [%L] [%t] %-5level %logger{3} - %msg%n"/>
+    </Console>
+    <!--
+    <RandomAccessFile name="LogFile" fileName="target/test.log">
+      <PatternLayout pattern="%d{ISO8601_PERIOD} [%L] [%t] %-5level %logger{3} - %msg%n"/>
+    </RandomAccessFile>
+    -->
+  </appenders>
+  <loggers>
+    <logger name="org.apache.archiva" level="info"/>
+    <logger name="org.apache.archiva.repository.scanner" level="info"/>
+    <root level="error" includeLocation="true">
+      <appender-ref ref="console"/>
+    </root>
+  </loggers>
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml
new file mode 100755 (executable)
index 0000000..dc1215e
--- /dev/null
@@ -0,0 +1,176 @@
+<configuration>
+  <version>3.0.0</version>
+  <managedRepositories>
+    <managedRepository>
+      <id>internal</id>
+      <name>Archiva Managed Internal Repository</name>
+      <location>${appserver.base}/target/test-classes/existing_internal</location>
+      <layout>default</layout>
+      <releases>true</releases>
+      <snapshots>false</snapshots>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
+      <retentionPeriod>30</retentionPeriod>
+    </managedRepository>
+    <managedRepository>
+      <id>snapshots</id>
+      <name>Archiva Managed Snapshot Repository</name>
+      <location>${appserver.base}/target/test-classes/existing_snapshots</location>
+      <layout>default</layout>
+      <releases>false</releases>
+      <snapshots>true</snapshots>
+      <scanned>true</scanned>
+      <refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
+      <retentionPeriod>30</retentionPeriod>
+    </managedRepository>
+  </managedRepositories>
+  <remoteRepositories>
+    <remoteRepository>
+      <id>central</id>
+      <name>Central Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+      <layout>default</layout>
+    </remoteRepository>
+    <remoteRepository>
+      <id>maven2-repository.dev.java.net</id>
+      <name>Java.net Repository for Maven 2</name>
+      <url>http://download.java.net/maven/2/</url>
+      <layout>default</layout>
+    </remoteRepository>
+  </remoteRepositories>
+
+  <proxyConnectors>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>central</targetRepoId>
+      <proxyId/>
+      <policies>
+        <snapshots>disabled</snapshots>
+        <releases>once</releases>
+        <checksum>fix</checksum>
+        <cache-failures>cached</cache-failures>
+      </policies>
+      <whiteListPatterns>
+        <whiteListPattern>**/*</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+    <proxyConnector>
+      <sourceRepoId>internal</sourceRepoId>
+      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
+      <proxyId/>
+      <policies>
+        <snapshots>disabled</snapshots>
+        <releases>once</releases>
+        <checksum>fix</checksum>
+        <cache-failures>cached</cache-failures>
+      </policies>
+      <whiteListPatterns>
+        <whiteListPattern>javax/**</whiteListPattern>
+        <whiteListPattern>org/jvnet/**</whiteListPattern>
+        <whiteListPattern>com/sun/**</whiteListPattern>
+      </whiteListPatterns>
+    </proxyConnector>
+  </proxyConnectors>
+
+  <legacyArtifactPaths>
+    <legacyArtifactPath>
+        <path>jaxen/jars/jaxen-1.0-FCS-full.jar</path>
+        <artifact>jaxen:jaxen:1.0-FCS:full:jar</artifact>
+    </legacyArtifactPath>
+  </legacyArtifactPaths>
+
+  <repositoryScanning>
+    <fileTypes>
+      <fileType>
+        <id>artifacts</id>
+        <patterns>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.jar</pattern>
+          <pattern>**/*.ear</pattern>
+          <pattern>**/*.war</pattern>
+          <pattern>**/*.car</pattern>
+          <pattern>**/*.sar</pattern>
+          <pattern>**/*.mar</pattern>
+          <pattern>**/*.rar</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+          <pattern>**/*.tar.gz</pattern>
+          <pattern>**/*.tar.bz2</pattern>
+          <pattern>**/*.zip</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>indexable-content</id>
+        <patterns>
+          <pattern>**/*.txt</pattern>
+          <pattern>**/*.TXT</pattern>
+          <pattern>**/*.block</pattern>
+          <pattern>**/*.config</pattern>
+          <pattern>**/*.pom</pattern>
+          <pattern>**/*.xml</pattern>
+          <pattern>**/*.xsd</pattern>
+          <pattern>**/*.dtd</pattern>
+          <pattern>**/*.tld</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>auto-remove</id>
+        <patterns>
+          <pattern>**/*.bak</pattern>
+          <pattern>**/*~</pattern>
+          <pattern>**/*-</pattern>
+        </patterns>
+      </fileType>
+      <fileType>
+        <id>ignored</id>
+        <patterns>
+          <pattern>**/.htaccess</pattern>
+          <pattern>**/KEYS</pattern>
+          <pattern>**/*.rb</pattern>
+          <pattern>**/*.sh</pattern>
+          <pattern>**/.svn/**</pattern>
+          <pattern>**/.DAV/**</pattern>
+        </patterns>
+      </fileType>
+    </fileTypes>
+    <knownContentConsumers>
+      <knownContentConsumer>update-db-artifact</knownContentConsumer>
+      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
+      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
+      <knownContentConsumer>validate-checksum</knownContentConsumer>
+      <knownContentConsumer>validate-signature</knownContentConsumer>
+      <knownContentConsumer>index-content</knownContentConsumer>
+      <knownContentConsumer>auto-remove</knownContentConsumer>
+      <knownContentConsumer>auto-rename</knownContentConsumer>
+      <knownContentConsumer>metadata-updater</knownContentConsumer>
+      <!--knownContentConsumer>repository-purge</knownContentConsumer-->
+    </knownContentConsumers>
+    <invalidContentConsumers>
+      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
+    </invalidContentConsumers>
+  </repositoryScanning>
+
+  <databaseScanning>
+    <cronExpression>0 0 * * * ?</cronExpression>
+    <unprocessedConsumers>
+      <unprocessedConsumer>index-artifact</unprocessedConsumer>
+      <unprocessedConsumer>update-db-project</unprocessedConsumer>
+      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
+      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
+      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
+      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
+    </unprocessedConsumers>
+    <cleanupConsumers>
+      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
+      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
+    </cleanupConsumers>
+  </databaseScanning>
+
+  <webapp>
+    <ui>
+      <showFindArtifacts>true</showFindArtifacts>
+      <appletFindEnabled>true</appletFindEnabled>
+    </ui>
+  </webapp>
+</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-configuration/archiva-configuration-provider/src/test/resources/spring-context.xml
new file mode 100755 (executable)
index 0000000..4f63c98
--- /dev/null
@@ -0,0 +1,340 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/context 
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+       default-lazy-init="true">
+
+  <context:property-placeholder system-properties-mode="OVERRIDE"/>
+
+  <bean name="archivaConfiguration#test-defaults-default-repo-location-exists" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#empty"/>
+  </bean>
+  <bean name="registry#empty" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry"/>
+
+  <bean name="archivaConfiguration#test-defaults" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#emptydef"/>
+  </bean>
+  <bean name="registry#emptydef" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry"/>
+
+  <bean name="archivaConfiguration#test-upgrade-09"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-upgrade-09"/>
+  </bean>
+
+
+
+  <bean name="registry#test-upgrade-09" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+        <configuration>
+            <xml fileName="${basedir}/src/test/conf/archiva-0.9.xml"
+                 config-name="org.apache.archiva" config-at="org.apache.archiva"/>
+        </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="archivaConfiguration#test-upgrade-1.3"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-upgrade-1.3"/>
+  </bean>
+
+  <bean name="registry#test-upgrade-1.3" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+        <configuration>
+            <xml fileName="${basedir}/src/test/conf/archiva-1.3.xml"
+                 config-name="org.apache.archiva" config-at="org.apache.archiva"/>
+        </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="archivaConfiguration#test-configuration"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#configured"/>
+  </bean>
+
+  <bean name="registry#configured" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+        <configuration>
+            <system/>
+            <xml fileName="${basedir}/src/test/conf/repository-manager.xml"
+                 config-name="org.apache.archiva" config-at="org.apache.archiva"/>
+        </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+
+  <bean name="archivaConfiguration#test-autodetect-v1"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-autodetect-v1"/>
+  </bean>
+
+  <bean name="registry#test-autodetect-v1" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+        <configuration>
+            <system/>
+            <xml fileName="${basedir}/target/test-autodetect-v1/archiva-user.xml" config-optional="true"
+                 config-name="org.apache.archiva.user"
+                 config-at="org.apache.archiva"/>
+        </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="archivaConfiguration#test-archiva-v1"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-archiva-v1"/>
+  </bean>
+
+  <bean name="registry#test-archiva-v1" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+        <configuration>
+            <system/>
+            <xml fileName="${basedir}/src/test/conf/archiva-v1.xml"
+                 config-name="org.apache.archiva" config-at="org.apache.archiva"/>
+        </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="archivaConfiguration#test-save"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-save"/>
+  </bean>
+
+  <bean name="registry#test-save" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+        <configuration>
+            <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
+                 config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
+        </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="archivaConfiguration#test-save-user-defaults"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-save-user-defaults"/>
+  </bean>
+
+  <bean name="registry#test-save-user-defaults" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+      <configuration>
+          <xml fileName="${basedir}/target/test/test-file-user.xml" config-optional="true" config-forceCreate="true"
+               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
+          <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="false"
+               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
+      </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="archivaConfiguration#test-save-user-fallback"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-save-user-fallback"/>
+  </bean>
+
+  <bean name="registry#test-save-user-fallback" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+      <configuration>
+          <xml fileName="${basedir}/target/test/test-file-user.xml" config-optional="true" config-forceCreate="false"
+               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
+          <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
+               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
+      </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="archivaConfiguration#test-save-user"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-save-user"/>
+  </bean>
+
+  <bean name="registry#test-save-user" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+      <configuration>
+          <xml fileName="${basedir}/target/test/test-file-user.xml" config-optional="true" config-forceCreate="true"
+               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
+          <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="false"
+               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
+      </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+
+  <bean name="archivaConfiguration#test-configuration-both"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-configuration-both"/>
+  </bean>
+
+  <bean name="registry#test-configuration-both" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+      <configuration>
+          <xml fileName="${basedir}/src/test/conf/conf-user.xml" config-optional="true" config-forceCreate="true"
+               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
+          <xml fileName="${basedir}/src/test/conf/conf-base.xml" config-optional="true" config-forceCreate="true"
+               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
+      </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+
+  <bean name="archivaConfiguration#test-read-saved"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-read-saved"/>
+  </bean>
+
+  <bean name="registry#test-read-saved" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+        <configuration>
+            <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
+                 config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
+        </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+
+  <bean name="archivaConfiguration#test-cron-expressions"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-cron-expressions"/>
+    <property name="userConfigFilename" value="${basedir}/target/test/test-file.xml"/>
+  </bean>
+
+  <bean name="registry#test-cron-expressions" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+        <configuration>
+            <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
+                 config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
+        </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+
+  <bean name="archivaConfiguration#test-remove-central"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-remove-central"/>
+  </bean>
+
+  <bean name="registry#test-remove-central" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+      <configuration>
+          <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
+               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
+      </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+
+  <bean name="archivaConfiguration#test-not-allowed-to-write-to-both"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-not-allowed-to-write-to-both"/>
+    <property name="userConfigFilename" value="/../../..//target/*intentionally:invalid*/.m2/archiva-user.xml"/>
+    <property name="altConfigFilename" value="/../../..//target/*intentionally:invalid*/conf/archiva.xml"/>
+  </bean>
+
+  <bean name="registry#test-not-allowed-to-write-to-both" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+      <configuration>
+          <xml fileName="/../../..//*intentionally:invalid*/.m2/archiva-user.xml" config-optional="true"
+               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
+          <xml fileName="/../../..//*intentionally:invalid*/conf/archiva.xml" config-optional="true"
+               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
+      </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="archivaConfiguration#test-not-allowed-to-write-to-user"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
+    <property name="registry" ref="registry#test-not-allowed-to-write-to-user"/>
+    <property name="userConfigFilename" value="${basedir}/target/*intentionally:invalid*/.m2/archiva-user.xml"/>
+    <property name="altConfigFilename" value="${basedir}/target/test-appserver-base/conf/archiva.xml"/>
+  </bean>
+
+  <bean name="registry#test-not-allowed-to-write-to-user" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
+    <property name="initialConfiguration">
+      <value>
+        <![CDATA[
+      <configuration>
+          <xml fileName="${basedir}/target/*intentionally:invalid*/.m2/archiva-user.xml" config-optional="true"
+               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
+          <xml fileName="${basedir}/target/test-appserver-base/conf/archiva.xml" config-optional="true"
+               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
+      </configuration>
+        ]]>
+      </value>
+    </property>
+  </bean>
+
+  <bean name="cache#url-failures-cache" class="org.apache.archiva.components.cache.ehcache.EhcacheCache">
+    <constructor-arg index="0" value="java.lang.String"/>
+    <constructor-arg index="1" value="java.util.Date"/>
+    <property name="diskExpiryThreadIntervalSeconds" value="600"/>
+    <property name="diskPersistent" value="false"/>
+    <property name="eternal" value="false"/>
+    <property name="maxElementsInMemory" value="1000"/>
+    <property name="memoryEvictionPolicy" value="LRU"/>
+    <property name="name" value="url-failures-cache"/>
+    <property name="overflowToDisk" value="false"/>
+    <property name="timeToIdleSeconds" value="2700"/>
+    <property name="timeToLiveSeconds" value="1800"/>
+  </bean>
+
+</beans>
\ No newline at end of file
index 4852451990013d8357f0b2d142b604cea56f4c35..aff864c2f72d4a622bd59970f18f553bb011de55 100644 (file)
     <version>3.0.0-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.archiva.configuration</groupId>
   <artifactId>archiva-configuration</artifactId>
   <name>Archiva Base :: Configuration</name>
+  <version>3.0.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
 
   <properties>
     <site.staging.base>${project.parent.parent.basedir}</site.staging.base>
   </properties>
 
+  <modules>
+    <module>archiva-configuration-model</module>
+    <module>archiva-configuration-provider</module>
+  </modules>
   <dependencies>
-    <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-common</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-policies</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva.components.registry</groupId>
-      <artifactId>archiva-components-spring-registry-api</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring-test</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-context</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>commons-logging</groupId>
-          <artifactId>commons-logging</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva.components.registry</groupId>
-      <artifactId>archiva-components-spring-registry-commons</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>org.springframework</groupId>
-          <artifactId>spring-test</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva.components</groupId>
-      <artifactId>archiva-components-expression-evaluator</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>jakarta.annotation</groupId>
-      <artifactId>jakarta.annotation-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>jakarta.inject</groupId>
-      <artifactId>jakarta.inject-api</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-configuration2</artifactId>
-      <scope>runtime</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>commons-logging</groupId>
-          <artifactId>commons-logging</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-lang3</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-collections4</artifactId>
-    </dependency>
-
-
-    <!-- Test scope -->
-
-    <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-test-utils</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-test</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-jcl</artifactId>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>test</scope>
-    </dependency>
 
   </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <systemPropertyVariables>
-            <basedir>${basedir}</basedir>
-          </systemPropertyVariables>
-          <trimStackTrace>false</trimStackTrace>
-        </configuration>
-      </plugin>
-    </plugins>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.rat</groupId>
-          <artifactId>apache-rat-plugin</artifactId>
-          <configuration>
-            <excludes>
-              <exclude>src/main/resources/org/apache/archiva/configuration/default-archiva.xml</exclude>
-              <exclude>src/test/conf/maven-proxy-complete.conf</exclude>
-              <exclude>src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml</exclude>
-              <exclude>nbactions.xml</exclude>
-            </excludes>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
 </project>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConfiguration.java
deleted file mode 100644 (file)
index 695f0c0..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class AbstractRepositoryConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class AbstractRepositoryConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The repository identifier.
-     *           
-     */
-    private String id;
-
-    /**
-     * 
-     *             The repository type. Currently only MAVEN type
-     * is known.
-     *           
-     */
-    private String type = "MAVEN";
-
-    /**
-     * 
-     *             The descriptive name of the repository.
-     *           
-     */
-    private String name;
-
-    /**
-     * 
-     *             The layout of the repository. Valid values are
-     * "default" and "legacy".
-     *           
-     */
-    private String layout = "default";
-
-    /**
-     * 
-     *             The directory for the indexes of this
-     * repository.
-     *           
-     */
-    private String indexDir = "";
-
-    /**
-     * 
-     *             The directory for the packed indexes of this
-     * repository.
-     *           
-     */
-    private String packedIndexDir = "";
-
-    /**
-     * 
-     *             The description of this repository.
-     *           
-     */
-    private String description = "";
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get the description of this repository.
-     * 
-     * @return String
-     */
-    public String getDescription()
-    {
-        return this.description;
-    } //-- String getDescription()
-
-    /**
-     * Get the repository identifier.
-     * 
-     * @return String
-     */
-    public String getId()
-    {
-        return this.id;
-    } //-- String getId()
-
-    /**
-     * Get the directory for the indexes of this repository.
-     * 
-     * @return String
-     */
-    public String getIndexDir()
-    {
-        return this.indexDir;
-    } //-- String getIndexDir()
-
-    /**
-     * Get the layout of the repository. Valid values are "default"
-     * and "legacy".
-     * 
-     * @return String
-     */
-    public String getLayout()
-    {
-        return this.layout;
-    } //-- String getLayout()
-
-    /**
-     * Get the descriptive name of the repository.
-     * 
-     * @return String
-     */
-    public String getName()
-    {
-        return this.name;
-    } //-- String getName()
-
-    /**
-     * Get the directory for the packed indexes of this repository.
-     * 
-     * @return String
-     */
-    public String getPackedIndexDir()
-    {
-        return this.packedIndexDir;
-    } //-- String getPackedIndexDir()
-
-    /**
-     * Get the repository type. Currently only MAVEN type is known.
-     * 
-     * @return String
-     */
-    public String getType()
-    {
-        return this.type;
-    } //-- String getType()
-
-    /**
-     * Set the description of this repository.
-     * 
-     * @param description
-     */
-    public void setDescription( String description )
-    {
-        this.description = description;
-    } //-- void setDescription( String )
-
-    /**
-     * Set the repository identifier.
-     * 
-     * @param id
-     */
-    public void setId( String id )
-    {
-        this.id = id;
-    } //-- void setId( String )
-
-    /**
-     * Set the directory for the indexes of this repository.
-     * 
-     * @param indexDir
-     */
-    public void setIndexDir( String indexDir )
-    {
-        this.indexDir = indexDir;
-    } //-- void setIndexDir( String )
-
-    /**
-     * Set the layout of the repository. Valid values are "default"
-     * and "legacy".
-     * 
-     * @param layout
-     */
-    public void setLayout( String layout )
-    {
-        this.layout = layout;
-    } //-- void setLayout( String )
-
-    /**
-     * Set the descriptive name of the repository.
-     * 
-     * @param name
-     */
-    public void setName( String name )
-    {
-        this.name = name;
-    } //-- void setName( String )
-
-    /**
-     * Set the directory for the packed indexes of this repository.
-     * 
-     * @param packedIndexDir
-     */
-    public void setPackedIndexDir( String packedIndexDir )
-    {
-        this.packedIndexDir = packedIndexDir;
-    } //-- void setPackedIndexDir( String )
-
-    /**
-     * Set the repository type. Currently only MAVEN type is known.
-     * 
-     * @param type
-     */
-    public void setType( String type )
-    {
-        this.type = type;
-    } //-- void setType( String )
-
-    
-            public int hashCode()
-            {
-                int result = 17;
-                result = 37 * result + ( id != null ? id.hashCode() : 0 );
-                return result;
-            }
-
-            public boolean equals( Object other )
-            {
-                if ( this == other )
-                {
-                    return true;
-                }
-
-                if ( !( other instanceof AbstractRepositoryConfiguration ) )
-                {
-                    return false;
-                }
-
-                AbstractRepositoryConfiguration that = (AbstractRepositoryConfiguration) other;
-                boolean result = true;
-                result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
-                return result;
-            }
-       
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConnectorConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConnectorConfiguration.java
deleted file mode 100644 (file)
index 5a7bc58..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class AbstractRepositoryConnectorConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class AbstractRepositoryConnectorConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The Repository Source for this connector.
-     *           
-     */
-    private String sourceRepoId;
-
-    /**
-     * 
-     *             The Repository Target for this connector.
-     *           
-     */
-    private String targetRepoId;
-
-    /**
-     * 
-     *             The network proxy ID to use for this connector.
-     *           
-     */
-    private String proxyId;
-
-    /**
-     * Field blackListPatterns.
-     */
-    private java.util.List<String> blackListPatterns;
-
-    /**
-     * Field whiteListPatterns.
-     */
-    private java.util.List<String> whiteListPatterns;
-
-    /**
-     * Field policies.
-     */
-    private java.util.Map policies;
-
-    /**
-     * Field properties.
-     */
-    private java.util.Map properties;
-
-    /**
-     * 
-     *             If the the repository proxy connector is
-     * disabled or not
-     *           .
-     */
-    private boolean disabled = false;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addBlackListPattern.
-     * 
-     * @param string
-     */
-    public void addBlackListPattern( String string )
-    {
-        getBlackListPatterns().add( string );
-    } //-- void addBlackListPattern( String )
-
-    /**
-     * Method addPolicy.
-     * 
-     * @param key
-     * @param value
-     */
-    public void addPolicy( String key, String value )
-    {
-        getPolicies().put( key, value );
-    } //-- void addPolicy( Object, String )
-
-    /**
-     * Method addProperty.
-     * 
-     * @param key
-     * @param value
-     */
-    public void addProperty( String key, String value )
-    {
-        getProperties().put( key, value );
-    } //-- void addProperty( Object, String )
-
-    /**
-     * Method addWhiteListPattern.
-     * 
-     * @param string
-     */
-    public void addWhiteListPattern( String string )
-    {
-        getWhiteListPatterns().add( string );
-    } //-- void addWhiteListPattern( String )
-
-    /**
-     * Method getBlackListPatterns.
-     * 
-     * @return List
-     */
-    public java.util.List<String> getBlackListPatterns()
-    {
-        if ( this.blackListPatterns == null )
-        {
-            this.blackListPatterns = new java.util.ArrayList<String>();
-        }
-
-        return this.blackListPatterns;
-    } //-- java.util.List<String> getBlackListPatterns()
-
-    /**
-     * Method getPolicies.
-     * 
-     * @return Map
-     */
-    public java.util.Map<String, String> getPolicies()
-    {
-        if ( this.policies == null )
-        {
-            this.policies = new java.util.HashMap();
-        }
-
-        return this.policies;
-    } //-- java.util.Map getPolicies()
-
-    /**
-     * Method getProperties.
-     * 
-     * @return Map
-     */
-    public java.util.Map<String, String> getProperties()
-    {
-        if ( this.properties == null )
-        {
-            this.properties = new java.util.HashMap();
-        }
-
-        return this.properties;
-    } //-- java.util.Map getProperties()
-
-    /**
-     * Get the network proxy ID to use for this connector.
-     * 
-     * @return String
-     */
-    public String getProxyId()
-    {
-        return this.proxyId;
-    } //-- String getProxyId()
-
-    /**
-     * Get the Repository Source for this connector.
-     * 
-     * @return String
-     */
-    public String getSourceRepoId()
-    {
-        return this.sourceRepoId;
-    } //-- String getSourceRepoId()
-
-    /**
-     * Get the Repository Target for this connector.
-     * 
-     * @return String
-     */
-    public String getTargetRepoId()
-    {
-        return this.targetRepoId;
-    } //-- String getTargetRepoId()
-
-    /**
-     * Method getWhiteListPatterns.
-     * 
-     * @return List
-     */
-    public java.util.List<String> getWhiteListPatterns()
-    {
-        if ( this.whiteListPatterns == null )
-        {
-            this.whiteListPatterns = new java.util.ArrayList<String>();
-        }
-
-        return this.whiteListPatterns;
-    } //-- java.util.List<String> getWhiteListPatterns()
-
-    /**
-     * Get if the the repository proxy connector is disabled or
-     * not.
-     * 
-     * @return boolean
-     */
-    public boolean isDisabled()
-    {
-        return this.disabled;
-    } //-- boolean isDisabled()
-
-    /**
-     * Method removeBlackListPattern.
-     * 
-     * @param string
-     */
-    public void removeBlackListPattern( String string )
-    {
-        getBlackListPatterns().remove( string );
-    } //-- void removeBlackListPattern( String )
-
-    /**
-     * Method removeWhiteListPattern.
-     * 
-     * @param string
-     */
-    public void removeWhiteListPattern( String string )
-    {
-        getWhiteListPatterns().remove( string );
-    } //-- void removeWhiteListPattern( String )
-
-    /**
-     * Set the list of blacklisted patterns for this connector.
-     * 
-     * @param blackListPatterns
-     */
-    public void setBlackListPatterns( java.util.List<String> blackListPatterns )
-    {
-        this.blackListPatterns = blackListPatterns;
-    } //-- void setBlackListPatterns( java.util.List )
-
-    /**
-     * Set if the the repository proxy connector is disabled or
-     * not.
-     * 
-     * @param disabled
-     */
-    public void setDisabled( boolean disabled )
-    {
-        this.disabled = disabled;
-    } //-- void setDisabled( boolean )
-
-    /**
-     * Set policy configuration for the connector.
-     * 
-     * @param policies
-     */
-    public void setPolicies( java.util.Map policies )
-    {
-        this.policies = policies;
-    } //-- void setPolicies( java.util.Map )
-
-    /**
-     * Set configuration for the connector.
-     * 
-     * @param properties
-     */
-    public void setProperties( java.util.Map properties )
-    {
-        this.properties = properties;
-    } //-- void setProperties( java.util.Map )
-
-    /**
-     * Set the network proxy ID to use for this connector.
-     * 
-     * @param proxyId
-     */
-    public void setProxyId( String proxyId )
-    {
-        this.proxyId = proxyId;
-    } //-- void setProxyId( String )
-
-    /**
-     * Set the Repository Source for this connector.
-     * 
-     * @param sourceRepoId
-     */
-    public void setSourceRepoId( String sourceRepoId )
-    {
-        this.sourceRepoId = sourceRepoId;
-    } //-- void setSourceRepoId( String )
-
-    /**
-     * Set the Repository Target for this connector.
-     * 
-     * @param targetRepoId
-     */
-    public void setTargetRepoId( String targetRepoId )
-    {
-        this.targetRepoId = targetRepoId;
-    } //-- void setTargetRepoId( String )
-
-    /**
-     * Set the list of whitelisted patterns for this connector.
-     * 
-     * @param whiteListPatterns
-     */
-    public void setWhiteListPatterns( java.util.List<String> whiteListPatterns )
-    {
-        this.whiteListPatterns = whiteListPatterns;
-    } //-- void setWhiteListPatterns( java.util.List )
-
-    
-    /**
-     * Obtain a specific policy from the underlying connector.
-     *
-     * @param policyId the policy id to fetch.
-     * @param defaultValue the default value for the policy id.
-     * @return the configured policy value (or default value if not found).
-     */
-    public String getPolicy( String policyId, String defaultValue )
-    {
-        if ( this.getPolicies() == null )
-        {
-            return null;
-        }
-
-        Object value = this.getPolicies().get( policyId );
-
-        if ( value == null )
-        {
-            return defaultValue;
-        }
-
-        return (String) value;
-    }
-          
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaConfiguration.java
deleted file mode 100644 (file)
index cf90a13..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.components.registry.Registry;
-import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.components.registry.RegistryListener;
-
-import java.nio.file.Path;
-import java.util.List;
-import java.util.Locale;
-
-/**
- * Configuration holder for the model read from the registry.
- */
-public interface ArchivaConfiguration
-{
-
-
-    String USER_CONFIG_PROPERTY = "archiva.user.configFileName";
-    String USER_CONFIG_ENVVAR = "ARCHIVA_USER_CONFIG_FILE";
-
-    /**
-     * Get the configuration.
-     *
-     * @return the configuration
-     */
-    Configuration getConfiguration();
-
-    /**
-     * Save any updated configuration.
-     *
-     * @param configuration the configuration to save
-     * @throws org.apache.archiva.components.registry.RegistryException
-     *          if there is a problem saving the registry data
-     * @throws IndeterminateConfigurationException
-     *          if the configuration cannot be saved because it was read from two sources
-     */
-    void save( Configuration configuration )
-        throws RegistryException, IndeterminateConfigurationException;
-
-    /**
-     * Save any updated configuration. This method allows to add a tag to the thrown event.
-     * This allows to verify the origin if the caller is the same as the listener.
-     *
-     * @param configuration the configuration to save
-     * @param eventTag the tag to add to the thrown event
-     * @throws org.apache.archiva.components.registry.RegistryException
-     *          if there is a problem saving the registry data
-     * @throws IndeterminateConfigurationException
-     *          if the configuration cannot be saved because it was read from two sources
-     */
-    void save( Configuration configuration, String eventTag )
-        throws RegistryException, IndeterminateConfigurationException;
-
-    /**
-     * Determines if the configuration in use was as a result of a defaulted configuration.
-     *
-     * @return true if the configuration was created from the default-archiva.xml as opposed
-     *         to being loaded from the usual locations of ${user.home}/.m2/archiva.xml or
-     *         ${appserver.base}/conf/archiva.xml
-     */
-    boolean isDefaulted();
-
-    /**
-     * Add a configuration listener to notify of changes to the configuration.
-     *
-     * @param listener the listener
-     */
-    void addListener( ConfigurationListener listener );
-
-    /**
-     * Remove a configuration listener to stop notifications of changes to the configuration.
-     *
-     * @param listener the listener
-     */
-    void removeListener( ConfigurationListener listener );
-
-    /**
-     * Add a registry listener to notify of events in spring-registry.
-     *
-     * @param listener the listener
-     *                 TODO: Remove in future.
-     */
-    void addChangeListener( RegistryListener listener );
-
-    void removeChangeListener( RegistryListener listener );
-
-    /**
-     * reload configuration from file included registry
-     *
-     * @since 1.4-M1
-     */
-    void reload();
-
-    public Locale getDefaultLocale();
-
-    public List<Locale.LanguageRange> getLanguagePriorities();
-
-    public Path getAppServerBaseDir();
-
-    /**
-     * Returns the base directory for repositories that have a relative location path set.
-     * @return
-     */
-    public Path getRepositoryBaseDir();
-
-    /**
-     * Returns the base directory for remote repositories
-     * @return
-     */
-    public Path getRemoteRepositoryBaseDir();
-
-    /**
-     * Returns the base directory for repository group files.
-     * @return
-     */
-    public Path getRepositoryGroupBaseDir();
-
-    /**
-     * Returns the data directory where repositories and metadata reside
-     * @return
-     */
-    public Path getDataDirectory();
-
-    /**
-     * Return the used configuration registry
-     * @return
-     */
-    Registry getRegistry( );
-}
-
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaDefaultConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaDefaultConfiguration.java
deleted file mode 100644 (file)
index 3917cc8..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * 
- *       Archiva default settings.
- *     
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class ArchivaDefaultConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * Field defaultCheckPaths.
-     */
-    private java.util.List<RepositoryCheckPath> defaultCheckPaths;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addDefaultCheckPath.
-     * 
-     * @param repositoryCheckPath
-     */
-    public void addDefaultCheckPath( RepositoryCheckPath repositoryCheckPath )
-    {
-        getDefaultCheckPaths().add( repositoryCheckPath );
-    } //-- void addDefaultCheckPath( RepositoryCheckPath )
-
-    /**
-     * Method getDefaultCheckPaths.
-     * 
-     * @return List
-     */
-    public java.util.List<RepositoryCheckPath> getDefaultCheckPaths()
-    {
-        if ( this.defaultCheckPaths == null )
-        {
-            this.defaultCheckPaths = new java.util.ArrayList<RepositoryCheckPath>();
-        }
-
-        return this.defaultCheckPaths;
-    } //-- java.util.List<RepositoryCheckPath> getDefaultCheckPaths()
-
-    /**
-     * Method removeDefaultCheckPath.
-     * 
-     * @param repositoryCheckPath
-     */
-    public void removeDefaultCheckPath( RepositoryCheckPath repositoryCheckPath )
-    {
-        getDefaultCheckPaths().remove( repositoryCheckPath );
-    } //-- void removeDefaultCheckPath( RepositoryCheckPath )
-
-    /**
-     * Set the default check paths for certain remote repositories.
-     * 
-     * @param defaultCheckPaths
-     */
-    public void setDefaultCheckPaths( java.util.List<RepositoryCheckPath> defaultCheckPaths )
-    {
-        this.defaultCheckPaths = defaultCheckPaths;
-    } //-- void setDefaultCheckPaths( java.util.List )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaRuntimeConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaRuntimeConfiguration.java
deleted file mode 100644 (file)
index b056860..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * 
- *         The runtime configuration.
- *       
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class ArchivaRuntimeConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * the url failure cache configuration.
-     */
-    private CacheConfiguration urlFailureCacheConfiguration;
-
-    /**
-     * the FileLocking configuration.
-     */
-    private FileLockConfiguration fileLockConfiguration;
-
-    /**
-     * The base directory where the archiva data is stored. If not
-     * set, the appserver.base is used.
-     */
-    private String dataDirectory;
-
-    /**
-     * The base directory for local storage of repository data. If
-     * not set, it's ${dataDirectory}/repositories.
-     */
-    private String repositoryBaseDirectory;
-
-    /**
-     * The base directory for local storage of remote repository
-     * data. If not set, it's ${dataDirectory}/remotes.
-     */
-    private String remoteRepositoryBaseDirectory;
-
-    /**
-     * The base directory for local storage of repository group files.
-     * If not set, it's ${dataDirectory}/groups
-     */
-    private String repositoryGroupBaseDirectory;
-
-    /**
-     * The default language used for setting internationalized
-     * strings.
-     */
-    private String defaultLanguage = "en-US";
-
-    /**
-     * Comma separated list of language patterns. Sorted by
-     * priority descending. Used for display of internationalized
-     * strings.
-     */
-    private String languageRange = "en,fr,de";
-
-    /**
-     * List of checksum types (algorithms) that should be applied to repository artifacts.
-     */
-    private List<String> checksumTypes = new ArrayList(Arrays.asList("MD5","SHA1","SHA256"));
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get the base directory where the archiva data is stored. If
-     * not set, the appserver.base is used.
-     * 
-     * @return String
-     */
-    public String getDataDirectory()
-    {
-        return this.dataDirectory;
-    } //-- String getDataDirectory()
-
-    /**
-     * Get the default language used for setting internationalized
-     * strings.
-     * 
-     * @return String
-     */
-    public String getDefaultLanguage()
-    {
-        return this.defaultLanguage;
-    } //-- String getDefaultLanguage()
-
-    /**
-     * Get the FileLocking configuration.
-     * 
-     * @return FileLockConfiguration
-     */
-    public FileLockConfiguration getFileLockConfiguration()
-    {
-        return this.fileLockConfiguration;
-    } //-- FileLockConfiguration getFileLockConfiguration()
-
-    /**
-     * Get comma separated list of language patterns. Sorted by
-     * priority descending. Used for display of internationalized
-     * strings.
-     * 
-     * @return String
-     */
-    public String getLanguageRange()
-    {
-        return this.languageRange;
-    } //-- String getLanguageRange()
-
-    /**
-     * Get the base directory for local storage of remote
-     * repository data. If not set, it's ${dataDirectory}/remotes.
-     * 
-     * @return String
-     */
-    public String getRemoteRepositoryBaseDirectory()
-    {
-        return this.remoteRepositoryBaseDirectory;
-    } //-- String getRemoteRepositoryBaseDirectory()
-
-    /**
-     * Get the base directory for local storage of repository data.
-     * If not set, it's ${dataDirectory}/repositories.
-     * 
-     * @return String
-     */
-    public String getRepositoryBaseDirectory()
-    {
-        return this.repositoryBaseDirectory;
-    } //-- String getRepositoryBaseDirectory()
-
-    /**
-     * Get the base directory for local storage of repository group data.
-     * If not set it's ${dataDirectory}/groups
-     *
-     * @return The path to the directory. Either a absolute path, or a path
-     * relative to ${dataDirectory}
-     */
-    public String getRepositoryGroupBaseDirectory() {
-        return this.repositoryGroupBaseDirectory;
-    }
-
-    /**
-     * Get the url failure cache configuration.
-     * 
-     * @return CacheConfiguration
-     */
-    public CacheConfiguration getUrlFailureCacheConfiguration()
-    {
-        return this.urlFailureCacheConfiguration;
-    } //-- CacheConfiguration getUrlFailureCacheConfiguration()
-
-    /**
-     * Set the base directory where the archiva data is stored. If
-     * not set, the appserver.base is used.
-     * 
-     * @param dataDirectory
-     */
-    public void setDataDirectory( String dataDirectory )
-    {
-        this.dataDirectory = dataDirectory;
-    } //-- void setDataDirectory( String )
-
-    /**
-     * Set the default language used for setting internationalized
-     * strings.
-     * 
-     * @param defaultLanguage
-     */
-    public void setDefaultLanguage( String defaultLanguage )
-    {
-        this.defaultLanguage = defaultLanguage;
-    } //-- void setDefaultLanguage( String )
-
-    /**
-     * Set the FileLocking configuration.
-     * 
-     * @param fileLockConfiguration
-     */
-    public void setFileLockConfiguration( FileLockConfiguration fileLockConfiguration )
-    {
-        this.fileLockConfiguration = fileLockConfiguration;
-    } //-- void setFileLockConfiguration( FileLockConfiguration )
-
-    /**
-     * Set comma separated list of language patterns. Sorted by
-     * priority descending. Used for display of internationalized
-     * strings.
-     * 
-     * @param languageRange
-     */
-    public void setLanguageRange( String languageRange )
-    {
-        this.languageRange = languageRange;
-    } //-- void setLanguageRange( String )
-
-    /**
-     * Set the base directory for local storage of remote
-     * repository data. If not set, it's ${dataDirectory}/remotes.
-     * 
-     * @param remoteRepositoryBaseDirectory
-     */
-    public void setRemoteRepositoryBaseDirectory( String remoteRepositoryBaseDirectory )
-    {
-        this.remoteRepositoryBaseDirectory = remoteRepositoryBaseDirectory;
-    } //-- void setRemoteRepositoryBaseDirectory( String )
-
-    /**
-     * Set the base directory for local storage of repository data.
-     * If not set, it's ${dataDirectory}/repositories.
-     * 
-     * @param repositoryBaseDirectory
-     */
-    public void setRepositoryBaseDirectory( String repositoryBaseDirectory )
-    {
-        this.repositoryBaseDirectory = repositoryBaseDirectory;
-    } //-- void setRepositoryBaseDirectory( String )
-
-
-    public void setRepositoryGroupBaseDirectory(String repositoryGroupBaseDirectory) {
-        this.repositoryGroupBaseDirectory = repositoryGroupBaseDirectory;
-    }
-
-    /**
-     * Set the url failure cache configuration.
-     * 
-     * @param urlFailureCacheConfiguration
-     */
-    public void setUrlFailureCacheConfiguration( CacheConfiguration urlFailureCacheConfiguration )
-    {
-        this.urlFailureCacheConfiguration = urlFailureCacheConfiguration;
-    } //-- void setUrlFailureCacheConfiguration( CacheConfiguration )
-
-
-    /**
-     * Returns the list of checksum types to generate
-     * @return
-     */
-    public List<String> getChecksumTypes()
-    {
-        if ( this.checksumTypes == null )
-        {
-            this.checksumTypes = new java.util.ArrayList<String>();
-        }
-
-        return this.checksumTypes;
-    }
-
-    /**
-     * Adds a checksum type
-     * @param type
-     */
-    public void addChecksumType(String type) {
-
-        if (!getChecksumTypes().contains(type)) {
-            getChecksumTypes().add(type);
-        }
-    }
-
-    /**
-     * Removes a checksum type
-     * @param type
-     */
-    public void removeChecksumType(String type) {
-        getChecksumTypes().remove(type);
-    }
-
-    /**
-     * Set all checksum types
-     * @param checksumTypes
-     */
-    public void setChecksumTypes(List<String> checksumTypes) {
-        if (checksumTypes!=null) {
-            getChecksumTypes().clear();
-            getChecksumTypes().addAll(checksumTypes);
-        }
-    }
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/CacheConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/CacheConfiguration.java
deleted file mode 100644 (file)
index 5d765ed..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Cache configuration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class CacheConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * TimeToIdleSeconds.
-     */
-    private int timeToIdleSeconds = -1;
-
-    /**
-     * TimeToLiveSeconds.
-     */
-    private int timeToLiveSeconds = -1;
-
-    /**
-     * max elements in memory.
-     */
-    private int maxElementsInMemory = -1;
-
-    /**
-     * max elements on disk.
-     */
-    private int maxElementsOnDisk = -1;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get max elements in memory.
-     * 
-     * @return int
-     */
-    public int getMaxElementsInMemory()
-    {
-        return this.maxElementsInMemory;
-    } //-- int getMaxElementsInMemory()
-
-    /**
-     * Get max elements on disk.
-     * 
-     * @return int
-     */
-    public int getMaxElementsOnDisk()
-    {
-        return this.maxElementsOnDisk;
-    } //-- int getMaxElementsOnDisk()
-
-    /**
-     * Get timeToIdleSeconds.
-     * 
-     * @return int
-     */
-    public int getTimeToIdleSeconds()
-    {
-        return this.timeToIdleSeconds;
-    } //-- int getTimeToIdleSeconds()
-
-    /**
-     * Get timeToLiveSeconds.
-     * 
-     * @return int
-     */
-    public int getTimeToLiveSeconds()
-    {
-        return this.timeToLiveSeconds;
-    } //-- int getTimeToLiveSeconds()
-
-    /**
-     * Set max elements in memory.
-     * 
-     * @param maxElementsInMemory
-     */
-    public void setMaxElementsInMemory( int maxElementsInMemory )
-    {
-        this.maxElementsInMemory = maxElementsInMemory;
-    } //-- void setMaxElementsInMemory( int )
-
-    /**
-     * Set max elements on disk.
-     * 
-     * @param maxElementsOnDisk
-     */
-    public void setMaxElementsOnDisk( int maxElementsOnDisk )
-    {
-        this.maxElementsOnDisk = maxElementsOnDisk;
-    } //-- void setMaxElementsOnDisk( int )
-
-    /**
-     * Set timeToIdleSeconds.
-     * 
-     * @param timeToIdleSeconds
-     */
-    public void setTimeToIdleSeconds( int timeToIdleSeconds )
-    {
-        this.timeToIdleSeconds = timeToIdleSeconds;
-    } //-- void setTimeToIdleSeconds( int )
-
-    /**
-     * Set timeToLiveSeconds.
-     * 
-     * @param timeToLiveSeconds
-     */
-    public void setTimeToLiveSeconds( int timeToLiveSeconds )
-    {
-        this.timeToLiveSeconds = timeToLiveSeconds;
-    } //-- void setTimeToLiveSeconds( int )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/Configuration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/Configuration.java
deleted file mode 100644 (file)
index 1bd3bce..0000000
+++ /dev/null
@@ -1,839 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class Configuration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class Configuration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * This is the version of the configuration format.
-     */
-    private String version = "3.0.0";
-
-    /**
-     * The type of the metadata storage. Allowed values: jcr, file,
-     * cassandra.
-     */
-    private String metadataStore = "jcr";
-
-    /**
-     * Field repositoryGroups.
-     */
-    private java.util.List<RepositoryGroupConfiguration> repositoryGroups;
-
-    /**
-     * Field managedRepositories.
-     */
-    private java.util.List<ManagedRepositoryConfiguration> managedRepositories;
-
-    /**
-     * Field remoteRepositories.
-     */
-    private java.util.List<RemoteRepositoryConfiguration> remoteRepositories;
-
-    /**
-     * Field proxyConnectors.
-     */
-    private java.util.List<ProxyConnectorConfiguration> proxyConnectors;
-
-    /**
-     * Field networkProxies.
-     */
-    private java.util.List<NetworkProxyConfiguration> networkProxies;
-
-    /**
-     * Field legacyArtifactPaths.
-     */
-    private java.util.List<LegacyArtifactPath> legacyArtifactPaths;
-
-    /**
-     * 
-     *             The repository scanning configuration.
-     *           
-     */
-    private RepositoryScanningConfiguration repositoryScanning;
-
-    /**
-     * 
-     *             The webapp configuration.
-     *           
-     */
-    private WebappConfiguration webapp;
-
-    /**
-     * 
-     *             The organisation info.
-     *           
-     */
-    private OrganisationInformation organisationInfo;
-
-    /**
-     * 
-     *             The NetworkConfiguration .
-     *           
-     */
-    private NetworkConfiguration networkConfiguration;
-
-    /**
-     * The RedbackRuntimeConfiguration.
-     */
-    private RedbackRuntimeConfiguration redbackRuntimeConfiguration;
-
-    /**
-     * The ArchivaRuntimeConfiguration.
-     */
-    private ArchivaRuntimeConfiguration archivaRuntimeConfiguration;
-
-    /**
-     * Field proxyConnectorRuleConfigurations.
-     */
-    private java.util.List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations;
-
-    /**
-     * Archiva default settings.
-     */
-    private ArchivaDefaultConfiguration archivaDefaultConfiguration;
-
-    /**
-     * Field modelEncoding.
-     */
-    private String modelEncoding = "UTF-8";
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addLegacyArtifactPath.
-     * 
-     * @param legacyArtifactPath
-     */
-    public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
-    {
-        getLegacyArtifactPaths().add( legacyArtifactPath );
-    } //-- void addLegacyArtifactPath( LegacyArtifactPath )
-
-    /**
-     * Method addManagedRepository.
-     * 
-     * @param managedRepositoryConfiguration
-     */
-    public void addManagedRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration )
-    {
-        getManagedRepositories().add( managedRepositoryConfiguration );
-    } //-- void addManagedRepository( ManagedRepositoryConfiguration )
-
-    /**
-     * Method addNetworkProxy.
-     * 
-     * @param networkProxyConfiguration
-     */
-    public void addNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
-    {
-        getNetworkProxies().add( networkProxyConfiguration );
-    } //-- void addNetworkProxy( NetworkProxyConfiguration )
-
-    /**
-     * Method addProxyConnector.
-     * 
-     * @param proxyConnectorConfiguration
-     */
-    public void addProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
-    {
-        getProxyConnectors().add( proxyConnectorConfiguration );
-    } //-- void addProxyConnector( ProxyConnectorConfiguration )
-
-    /**
-     * Method addProxyConnectorRuleConfiguration.
-     * 
-     * @param proxyConnectorRuleConfiguration
-     */
-    public void addProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration )
-    {
-        getProxyConnectorRuleConfigurations().add( proxyConnectorRuleConfiguration );
-    } //-- void addProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration )
-
-    /**
-     * Method addRemoteRepository.
-     * 
-     * @param remoteRepositoryConfiguration
-     */
-    public void addRemoteRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration )
-    {
-        getRemoteRepositories().add( remoteRepositoryConfiguration );
-    } //-- void addRemoteRepository( RemoteRepositoryConfiguration )
-
-    /**
-     * Method addRepositoryGroup.
-     * 
-     * @param repositoryGroupConfiguration
-     */
-    public void addRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration )
-    {
-        getRepositoryGroups().add( repositoryGroupConfiguration );
-    } //-- void addRepositoryGroup( RepositoryGroupConfiguration )
-
-    /**
-     * Get archiva default settings.
-     * 
-     * @return ArchivaDefaultConfiguration
-     */
-    public ArchivaDefaultConfiguration getArchivaDefaultConfiguration()
-    {
-        return this.archivaDefaultConfiguration;
-    } //-- ArchivaDefaultConfiguration getArchivaDefaultConfiguration()
-
-    /**
-     * Get the ArchivaRuntimeConfiguration.
-     * 
-     * @return ArchivaRuntimeConfiguration
-     */
-    public ArchivaRuntimeConfiguration getArchivaRuntimeConfiguration()
-    {
-        return this.archivaRuntimeConfiguration;
-    } //-- ArchivaRuntimeConfiguration getArchivaRuntimeConfiguration()
-
-    /**
-     * Method getLegacyArtifactPaths.
-     * 
-     * @return List
-     */
-    public java.util.List<LegacyArtifactPath> getLegacyArtifactPaths()
-    {
-        if ( this.legacyArtifactPaths == null )
-        {
-            this.legacyArtifactPaths = new java.util.ArrayList<LegacyArtifactPath>();
-        }
-
-        return this.legacyArtifactPaths;
-    } //-- java.util.List<LegacyArtifactPath> getLegacyArtifactPaths()
-
-    /**
-     * Method getManagedRepositories.
-     * 
-     * @return List
-     */
-    public java.util.List<ManagedRepositoryConfiguration> getManagedRepositories()
-    {
-        if ( this.managedRepositories == null )
-        {
-            this.managedRepositories = new java.util.ArrayList<ManagedRepositoryConfiguration>();
-        }
-
-        return this.managedRepositories;
-    } //-- java.util.List<ManagedRepositoryConfiguration> getManagedRepositories()
-
-    /**
-     * Get the type of the metadata storage. Allowed values: jcr,
-     * file, cassandra.
-     * 
-     * @return String
-     */
-    public String getMetadataStore()
-    {
-        return this.metadataStore;
-    } //-- String getMetadataStore()
-
-    /**
-     * Get the modelEncoding field.
-     * 
-     * @return String
-     */
-    public String getModelEncoding()
-    {
-        return this.modelEncoding;
-    } //-- String getModelEncoding()
-
-    /**
-     * Get the NetworkConfiguration .
-     * 
-     * @return NetworkConfiguration
-     */
-    public NetworkConfiguration getNetworkConfiguration()
-    {
-        return this.networkConfiguration;
-    } //-- NetworkConfiguration getNetworkConfiguration()
-
-    /**
-     * Method getNetworkProxies.
-     * 
-     * @return List
-     */
-    public java.util.List<NetworkProxyConfiguration> getNetworkProxies()
-    {
-        if ( this.networkProxies == null )
-        {
-            this.networkProxies = new java.util.ArrayList<NetworkProxyConfiguration>();
-        }
-
-        return this.networkProxies;
-    } //-- java.util.List<NetworkProxyConfiguration> getNetworkProxies()
-
-    /**
-     * Get the organisation info.
-     * 
-     * @return OrganisationInformation
-     */
-    public OrganisationInformation getOrganisationInfo()
-    {
-        return this.organisationInfo;
-    } //-- OrganisationInformation getOrganisationInfo()
-
-    /**
-     * Method getProxyConnectorRuleConfigurations.
-     * 
-     * @return List
-     */
-    public java.util.List<ProxyConnectorRuleConfiguration> getProxyConnectorRuleConfigurations()
-    {
-        if ( this.proxyConnectorRuleConfigurations == null )
-        {
-            this.proxyConnectorRuleConfigurations = new java.util.ArrayList<ProxyConnectorRuleConfiguration>();
-        }
-
-        return this.proxyConnectorRuleConfigurations;
-    } //-- java.util.List<ProxyConnectorRuleConfiguration> getProxyConnectorRuleConfigurations()
-
-    /**
-     * Method getProxyConnectors.
-     * 
-     * @return List
-     */
-    public java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
-    {
-        if ( this.proxyConnectors == null )
-        {
-            this.proxyConnectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
-        }
-
-        return this.proxyConnectors;
-    } //-- java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
-
-    /**
-     * Get the RedbackRuntimeConfiguration.
-     * 
-     * @return RedbackRuntimeConfiguration
-     */
-    public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
-    {
-        return this.redbackRuntimeConfiguration;
-    } //-- RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
-
-    /**
-     * Method getRemoteRepositories.
-     * 
-     * @return List
-     */
-    public java.util.List<RemoteRepositoryConfiguration> getRemoteRepositories()
-    {
-        if ( this.remoteRepositories == null )
-        {
-            this.remoteRepositories = new java.util.ArrayList<RemoteRepositoryConfiguration>();
-        }
-
-        return this.remoteRepositories;
-    } //-- java.util.List<RemoteRepositoryConfiguration> getRemoteRepositories()
-
-    /**
-     * Method getRepositoryGroups.
-     * 
-     * @return List
-     */
-    public java.util.List<RepositoryGroupConfiguration> getRepositoryGroups()
-    {
-        if ( this.repositoryGroups == null )
-        {
-            this.repositoryGroups = new java.util.ArrayList<RepositoryGroupConfiguration>();
-        }
-
-        return this.repositoryGroups;
-    } //-- java.util.List<RepositoryGroupConfiguration> getRepositoryGroups()
-
-    /**
-     * Get the repository scanning configuration.
-     * 
-     * @return RepositoryScanningConfiguration
-     */
-    public RepositoryScanningConfiguration getRepositoryScanning()
-    {
-        return this.repositoryScanning;
-    } //-- RepositoryScanningConfiguration getRepositoryScanning()
-
-    /**
-     * Get this is the version of the configuration format.
-     * 
-     * @return String
-     */
-    public String getVersion()
-    {
-        return this.version;
-    } //-- String getVersion()
-
-    /**
-     * Get the webapp configuration.
-     * 
-     * @return WebappConfiguration
-     */
-    public WebappConfiguration getWebapp()
-    {
-        return this.webapp;
-    } //-- WebappConfiguration getWebapp()
-
-    /**
-     * Method removeLegacyArtifactPath.
-     * 
-     * @param legacyArtifactPath
-     */
-    public void removeLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
-    {
-        getLegacyArtifactPaths().remove( legacyArtifactPath );
-    } //-- void removeLegacyArtifactPath( LegacyArtifactPath )
-
-    /**
-     * Method removeManagedRepository.
-     * 
-     * @param managedRepositoryConfiguration
-     */
-    public void removeManagedRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration )
-    {
-        getManagedRepositories().remove( managedRepositoryConfiguration );
-    } //-- void removeManagedRepository( ManagedRepositoryConfiguration )
-
-    /**
-     * Method removeNetworkProxy.
-     * 
-     * @param networkProxyConfiguration
-     */
-    public void removeNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
-    {
-        getNetworkProxies().remove( networkProxyConfiguration );
-    } //-- void removeNetworkProxy( NetworkProxyConfiguration )
-
-    /**
-     * Method removeProxyConnector.
-     * 
-     * @param proxyConnectorConfiguration
-     */
-    public void removeProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
-    {
-        getProxyConnectors().remove( proxyConnectorConfiguration );
-    } //-- void removeProxyConnector( ProxyConnectorConfiguration )
-
-    /**
-     * Method removeProxyConnectorRuleConfiguration.
-     * 
-     * @param proxyConnectorRuleConfiguration
-     */
-    public void removeProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration )
-    {
-        getProxyConnectorRuleConfigurations().remove( proxyConnectorRuleConfiguration );
-    } //-- void removeProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration )
-
-    /**
-     * Method removeRemoteRepository.
-     * 
-     * @param remoteRepositoryConfiguration
-     */
-    public void removeRemoteRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration )
-    {
-        getRemoteRepositories().remove( remoteRepositoryConfiguration );
-    } //-- void removeRemoteRepository( RemoteRepositoryConfiguration )
-
-    /**
-     * Method removeRepositoryGroup.
-     * 
-     * @param repositoryGroupConfiguration
-     */
-    public void removeRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration )
-    {
-        getRepositoryGroups().remove( repositoryGroupConfiguration );
-    } //-- void removeRepositoryGroup( RepositoryGroupConfiguration )
-
-    /**
-     * Set archiva default settings.
-     * 
-     * @param archivaDefaultConfiguration
-     */
-    public void setArchivaDefaultConfiguration( ArchivaDefaultConfiguration archivaDefaultConfiguration )
-    {
-        this.archivaDefaultConfiguration = archivaDefaultConfiguration;
-    } //-- void setArchivaDefaultConfiguration( ArchivaDefaultConfiguration )
-
-    /**
-     * Set the ArchivaRuntimeConfiguration.
-     * 
-     * @param archivaRuntimeConfiguration
-     */
-    public void setArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
-    {
-        this.archivaRuntimeConfiguration = archivaRuntimeConfiguration;
-    } //-- void setArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration )
-
-    /**
-     * Set the list of custom legacy path to artifact.
-     * 
-     * @param legacyArtifactPaths
-     */
-    public void setLegacyArtifactPaths( java.util.List<LegacyArtifactPath> legacyArtifactPaths )
-    {
-        this.legacyArtifactPaths = legacyArtifactPaths;
-    } //-- void setLegacyArtifactPaths( java.util.List )
-
-    /**
-     * Set the list of repositories that this archiva instance
-     * uses.
-     * 
-     * @param managedRepositories
-     */
-    public void setManagedRepositories( java.util.List<ManagedRepositoryConfiguration> managedRepositories )
-    {
-        this.managedRepositories = managedRepositories;
-    } //-- void setManagedRepositories( java.util.List )
-
-    /**
-     * Set the type of the metadata storage. Allowed values: jcr,
-     * file, cassandra.
-     * 
-     * @param metadataStore
-     */
-    public void setMetadataStore( String metadataStore )
-    {
-        this.metadataStore = metadataStore;
-    } //-- void setMetadataStore( String )
-
-    /**
-     * Set the modelEncoding field.
-     * 
-     * @param modelEncoding
-     */
-    public void setModelEncoding( String modelEncoding )
-    {
-        this.modelEncoding = modelEncoding;
-    } //-- void setModelEncoding( String )
-
-    /**
-     * Set the NetworkConfiguration .
-     * 
-     * @param networkConfiguration
-     */
-    public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
-    {
-        this.networkConfiguration = networkConfiguration;
-    } //-- void setNetworkConfiguration( NetworkConfiguration )
-
-    /**
-     * Set the list of network proxies to use for outgoing
-     * requests.
-     * 
-     * @param networkProxies
-     */
-    public void setNetworkProxies( java.util.List<NetworkProxyConfiguration> networkProxies )
-    {
-        this.networkProxies = networkProxies;
-    } //-- void setNetworkProxies( java.util.List )
-
-    /**
-     * Set the organisation info.
-     * 
-     * @param organisationInfo
-     */
-    public void setOrganisationInfo( OrganisationInformation organisationInfo )
-    {
-        this.organisationInfo = organisationInfo;
-    } //-- void setOrganisationInfo( OrganisationInformation )
-
-    /**
-     * Set the list of ProxyConnectorRuleConfigurations.
-     * 
-     * @param proxyConnectorRuleConfigurations
-     */
-    public void setProxyConnectorRuleConfigurations( java.util.List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations )
-    {
-        this.proxyConnectorRuleConfigurations = proxyConnectorRuleConfigurations;
-    } //-- void setProxyConnectorRuleConfigurations( java.util.List )
-
-    /**
-     * Set the list of proxy connectors for this archiva instance.
-     * 
-     * @param proxyConnectors
-     */
-    public void setProxyConnectors( java.util.List<ProxyConnectorConfiguration> proxyConnectors )
-    {
-        this.proxyConnectors = proxyConnectors;
-    } //-- void setProxyConnectors( java.util.List )
-
-    /**
-     * Set the RedbackRuntimeConfiguration.
-     * 
-     * @param redbackRuntimeConfiguration
-     */
-    public void setRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
-    {
-        this.redbackRuntimeConfiguration = redbackRuntimeConfiguration;
-    } //-- void setRedbackRuntimeConfiguration( RedbackRuntimeConfiguration )
-
-    /**
-     * Set the list of repositories that this archiva can retrieve
-     * from or publish to.
-     * 
-     * @param remoteRepositories
-     */
-    public void setRemoteRepositories( java.util.List<RemoteRepositoryConfiguration> remoteRepositories )
-    {
-        this.remoteRepositories = remoteRepositories;
-    } //-- void setRemoteRepositories( java.util.List )
-
-    /**
-     * Set the list of repository groups.
-     * 
-     * @param repositoryGroups
-     */
-    public void setRepositoryGroups( java.util.List<RepositoryGroupConfiguration> repositoryGroups )
-    {
-        this.repositoryGroups = repositoryGroups;
-    } //-- void setRepositoryGroups( java.util.List )
-
-    /**
-     * Set the repository scanning configuration.
-     * 
-     * @param repositoryScanning
-     */
-    public void setRepositoryScanning( RepositoryScanningConfiguration repositoryScanning )
-    {
-        this.repositoryScanning = repositoryScanning;
-    } //-- void setRepositoryScanning( RepositoryScanningConfiguration )
-
-    /**
-     * Set this is the version of the configuration format.
-     * 
-     * @param version
-     */
-    public void setVersion( String version )
-    {
-        this.version = version;
-    } //-- void setVersion( String )
-
-    /**
-     * Set the webapp configuration.
-     * 
-     * @param webapp
-     */
-    public void setWebapp( WebappConfiguration webapp )
-    {
-        this.webapp = webapp;
-    } //-- void setWebapp( WebappConfiguration )
-
-    
-    private java.util.Map<String, java.util.List<String>> repositoryToGroupMap; 
-    
-    public java.util.Map<String, java.util.List<String>> getRepositoryToGroupMap()
-    {
-        if ( repositoryGroups != null )
-        {
-            java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>();
-            
-            for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
-            {
-                for ( String repositoryId : (java.util.List<String>) group.getRepositories() )
-                {
-                    java.util.List<String> groups = map.get( repositoryId );
-                    if ( groups == null )
-                    {
-                        groups = new java.util.ArrayList<String>();
-                        map.put( repositoryId, groups );
-                    }
-                    groups.add( group.getId() );
-                }
-            }
-            
-            repositoryToGroupMap = map;
-        }
-        return repositoryToGroupMap;
-    }
-    
-    public java.util.Map<String, RepositoryGroupConfiguration> getRepositoryGroupsAsMap()
-    {
-        java.util.Map<String, RepositoryGroupConfiguration> map = new java.util.HashMap<String, RepositoryGroupConfiguration>();
-        if ( repositoryGroups != null )
-        {
-            for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
-            {
-                map.put( group.getId(), group );
-            }
-        }
-        return map;
-    }
-    
-    public RepositoryGroupConfiguration findRepositoryGroupById( String id )
-    {
-        if ( repositoryGroups != null && id!=null)
-        {
-            return ( (java.util.List<RepositoryGroupConfiguration>) repositoryGroups ).stream( ).filter( g -> g != null && id.equals( g.getId( ) ) ).findFirst( ).orElse( null );
-        }
-        return null;
-    }
-
-    private java.util.Map<String, java.util.List<String>> groupToRepositoryMap;
-
-    public java.util.Map<String, java.util.List<String>> getGroupToRepositoryMap()
-    {
-        if ( repositoryGroups != null && managedRepositories != null )
-        {
-            java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>();
-            
-            for ( ManagedRepositoryConfiguration repo : (java.util.List<ManagedRepositoryConfiguration>) managedRepositories )
-            {
-                for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
-                {
-                    if ( !group.getRepositories().contains( repo.getId() ) )
-                    {
-                        String groupId = group.getId();
-                        java.util.List<String> repos = map.get( groupId );
-                        if ( repos == null )
-                        {
-                            repos = new java.util.ArrayList<String>();
-                            map.put( groupId, repos );
-                        }
-                        repos.add( repo.getId() );
-                    }
-                }
-            }
-            groupToRepositoryMap = map;
-        }
-        return groupToRepositoryMap;
-    }
-          
-    
-    public java.util.Map<String, NetworkProxyConfiguration> getNetworkProxiesAsMap()
-    {
-        java.util.Map<String, NetworkProxyConfiguration> map = new java.util.HashMap<String, NetworkProxyConfiguration>();
-        if ( networkProxies != null )
-        {
-            for ( java.util.Iterator<NetworkProxyConfiguration> i = networkProxies.iterator(); i.hasNext(); )
-            {
-                NetworkProxyConfiguration proxy = i.next();
-                map.put( proxy.getId(), proxy );
-            }
-        }
-        return map;
-    }
-
-    public java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> getProxyConnectorAsMap()
-    {
-        java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap =
-            new java.util.HashMap<String, java.util.List<ProxyConnectorConfiguration>>();
-
-        if( proxyConnectors != null )
-        {
-            java.util.Iterator<ProxyConnectorConfiguration> it = proxyConnectors.iterator();
-            while ( it.hasNext() )
-            {
-                ProxyConnectorConfiguration proxyConfig = it.next();
-                String key = proxyConfig.getSourceRepoId();
-
-                java.util.List<ProxyConnectorConfiguration> connectors = proxyConnectorMap.get( key );
-                if ( connectors == null )
-                {
-                    connectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
-                    proxyConnectorMap.put( key, connectors );
-                }
-
-                connectors.add( proxyConfig );
-                java.util.Collections.sort( connectors,
-                    org.apache.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator.getInstance() );
-            }
-        }
-
-        return proxyConnectorMap;
-    }
-
-    public java.util.Map<String, RemoteRepositoryConfiguration> getRemoteRepositoriesAsMap()
-    {
-        java.util.Map<String, RemoteRepositoryConfiguration> map = new java.util.HashMap<String, RemoteRepositoryConfiguration>();
-        if ( remoteRepositories != null )
-        {
-            for ( java.util.Iterator<RemoteRepositoryConfiguration> i = remoteRepositories.iterator(); i.hasNext(); )
-            {
-                RemoteRepositoryConfiguration repo = i.next();
-                map.put( repo.getId(), repo );
-            }
-        }
-        return map;
-    }
-
-    public RemoteRepositoryConfiguration findRemoteRepositoryById( String id )
-    {
-        if ( remoteRepositories != null )
-        {
-            for ( java.util.Iterator<RemoteRepositoryConfiguration> i = remoteRepositories.iterator(); i.hasNext(); )
-            {
-                RemoteRepositoryConfiguration repo = i.next();
-                if ( repo.getId().equals( id ) )
-                {
-                    return repo;
-                }
-            }
-        }
-        return null;
-    }
-
-    public java.util.Map<String, ManagedRepositoryConfiguration> getManagedRepositoriesAsMap()
-    {
-        java.util.Map<String, ManagedRepositoryConfiguration> map = new java.util.HashMap<String, ManagedRepositoryConfiguration>();
-        if ( managedRepositories != null )
-        {
-            for ( java.util.Iterator<ManagedRepositoryConfiguration> i = managedRepositories.iterator(); i.hasNext(); )
-            {
-                ManagedRepositoryConfiguration repo = i.next();
-                map.put( repo.getId(), repo );
-            }
-        }
-        return map;
-    }
-
-    public ManagedRepositoryConfiguration findManagedRepositoryById( String id )
-    {
-        if ( managedRepositories != null )
-        {
-            for ( java.util.Iterator<ManagedRepositoryConfiguration> i = managedRepositories.iterator(); i.hasNext(); )
-            {
-                ManagedRepositoryConfiguration repo = i.next();
-                if ( repo.getId().equals( id ) )
-                {
-                    return repo;
-                }
-            }
-        }
-        return null;
-    }
-          
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationEvent.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationEvent.java
deleted file mode 100644 (file)
index 9639eff..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * ConfigurationEvent
- *
- *
- */
-public class ConfigurationEvent
-{
-    public static final int SAVED = 1;
-
-    public static final int CHANGED = 2;
-
-    private int type;
-
-    private String tag;
-
-    public ConfigurationEvent( int type )
-    {
-        this.type = type;
-        tag = "";
-    }
-
-    public ConfigurationEvent(int type, String tag) {
-        this.type = type;
-        this.tag = tag;
-    }
-
-    public int getType()
-    {
-        return type;
-    }
-
-    public String getTag( )
-    {
-        return tag;
-    }
-
-    public void setTag( String tag )
-    {
-        this.tag = tag;
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o ) return true;
-        if ( o == null || getClass( ) != o.getClass( ) ) return false;
-
-        ConfigurationEvent that = (ConfigurationEvent) o;
-
-        if ( type != that.type ) return false;
-        return tag.equals( that.tag );
-    }
-
-    @Override
-    public int hashCode( )
-    {
-        int result = type;
-        result = 31 * result + tag.hashCode( );
-        return result;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationListener.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationListener.java
deleted file mode 100644 (file)
index 2abeb63..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * ConfigurationListener
- *
- *
- */
-public interface ConfigurationListener
-{
-    /**
-     * Generic event point to notify components that something has happend in the configuration.
-     */
-    void configurationEvent( ConfigurationEvent event );
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationNames.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationNames.java
deleted file mode 100644 (file)
index aaa0a5d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Utility methods for testing the configuration property name.
- *
- *
- */
-public class ConfigurationNames
-{
-    public static boolean isNetworkProxy( String propertyName )
-    {
-        return startsWith( "networkProxies.", propertyName );
-    }
-
-    public static boolean isRepositoryScanning( String propertyName )
-    {
-        return startsWith( "repositoryScanning.", propertyName );
-    }
-
-    public static boolean isManagedRepositories( String propertyName )
-    {
-        return startsWith( "managedRepositories.", propertyName );
-    }
-
-    public static boolean isRemoteRepositories( String propertyName )
-    {
-        return startsWith( "remoteRepositories.", propertyName );
-    }
-
-    public static boolean isProxyConnector( String propertyName )
-    {
-        return startsWith( "proxyConnectors.", propertyName );
-    }
-
-    private static boolean startsWith( String prefix, String name )
-    {
-        if ( name == null )
-        {
-            return false;
-        }
-
-        if ( name.length() <= 0 )
-        {
-            return false;
-        }
-
-        return name.startsWith( prefix );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationRuntimeException.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ConfigurationRuntimeException.java
deleted file mode 100644 (file)
index 2368d20..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Unrecoverable exception in the configuration mechanism that is the result of a programming error.
- */
-public class ConfigurationRuntimeException
-    extends RuntimeException
-{
-    public ConfigurationRuntimeException( String msg, Throwable cause )
-    {
-        super( msg, cause );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java
deleted file mode 100644 (file)
index b9db304..0000000
+++ /dev/null
@@ -1,894 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator;
-import org.apache.archiva.configuration.io.registry.ConfigurationRegistryReader;
-import org.apache.archiva.configuration.io.registry.ConfigurationRegistryWriter;
-import org.apache.archiva.policies.AbstractUpdatePolicy;
-import org.apache.archiva.policies.CachedFailuresPolicy;
-import org.apache.archiva.policies.ChecksumPolicy;
-import org.apache.archiva.components.evaluator.DefaultExpressionEvaluator;
-import org.apache.archiva.components.evaluator.EvaluatorException;
-import org.apache.archiva.components.evaluator.ExpressionEvaluator;
-import org.apache.archiva.components.evaluator.sources.SystemPropertyExpressionSource;
-import org.apache.archiva.components.registry.Registry;
-import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.components.registry.RegistryListener;
-import org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.ListUtils;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.InvalidPathException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.*;
-import java.util.Map.Entry;
-
-/**
- * <p>
- * Implementation of configuration holder that retrieves it from the registry.
- * </p>
- * <p>
- * The registry layers and merges the 2 configuration files: user, and application server.
- * </p>
- * <p>
- * Instead of relying on the model defaults, if the registry is empty a default configuration file is loaded and
- * applied from a resource. The defaults are not loaded into the registry as the lists (eg repositories) could no longer
- * be removed if that was the case.
- * </p>
- * <p>
- * When saving the configuration, it is saved to the location it was read from. If it was read from the defaults, it
- * will be saved to the user location.
- * However, if the configuration contains information from both sources, an exception is raised as this is currently
- * unsupported. The reason for this is that it is not possible to identify where to re-save elements, and can result
- * in list configurations (eg repositories) becoming inconsistent.
- * </p>
- * <p>
- * If the configuration is outdated, it will be upgraded when it is loaded. This is done by checking the version flag
- * before reading it from the registry.
- * <p>
- * FIXME: The synchronization must be improved, the current impl may lead to inconsistent data or multiple getConfiguration() calls (martin_s@apache.org)
- * </p>
- */
-@Service("archivaConfiguration#default")
-public class DefaultArchivaConfiguration
-        implements ArchivaConfiguration, RegistryListener {
-    private final Logger log = LoggerFactory.getLogger(DefaultArchivaConfiguration.class);
-
-    private static String FILE_ENCODING = "UTF-8";
-
-    /**
-     * Plexus registry to read the configuration from.
-     */
-    @Inject
-    @Named(value = "commons-configuration")
-    private Registry registry;
-
-    /**
-     * The configuration that has been converted.
-     */
-    private Configuration configuration;
-
-    /**
-     * see #initialize
-     * default-value="${user.home}/.m2/archiva.xml"
-     */
-    private String userConfigFilename = "${user.home}/.m2/archiva.xml";
-
-    /**
-     * see #initialize
-     * default-value="${appserver.base}/conf/archiva.xml"
-     */
-    private String altConfigFilename = "${appserver.base}/conf/archiva.xml";
-
-    /**
-     * Configuration Listeners we've registered.
-     */
-    private Set<ConfigurationListener> listeners = new HashSet<>();
-
-    /**
-     * Registry Listeners we've registered.
-     */
-    private Set<RegistryListener> registryListeners = new HashSet<>();
-
-    /**
-     * Boolean to help determine if the configuration exists as a result of pulling in
-     * the default-archiva.xml
-     */
-    private boolean isConfigurationDefaulted = false;
-
-    private static final String KEY = "org.apache.archiva";
-
-    // Section used for default only configuration
-    private static final String KEY_DEFAULT_ONLY = "org.apache.archiva_default";
-
-    private Locale defaultLocale = Locale.getDefault();
-
-    private List<Locale.LanguageRange> languagePriorities = new ArrayList<>();
-
-    private volatile Path dataDirectory;
-    private volatile Path repositoryBaseDirectory;
-    private volatile Path remoteRepositoryBaseDirectory;
-    private volatile Path repositoryGroupBaseDirectory;
-
-    @PostConstruct
-    private void init() {
-        languagePriorities = Locale.LanguageRange.parse("en,fr,de");
-    }
-
-
-    @Override
-    public Configuration getConfiguration() {
-        return loadConfiguration();
-    }
-
-    private synchronized Configuration loadConfiguration() {
-        if (configuration == null) {
-            configuration = load();
-            configuration = unescapeExpressions(configuration);
-            if (isConfigurationDefaulted) {
-                configuration = checkRepositoryLocations(configuration);
-            }
-        }
-
-        return configuration;
-    }
-
-    private boolean hasConfigVersionChanged(Configuration current, Registry defaultOnlyConfiguration) {
-        return current == null || current.getVersion() == null ||
-                !current.getVersion().trim().equals(defaultOnlyConfiguration.getString("version", "").trim());
-    }
-
-    @SuppressWarnings("unchecked")
-    private Configuration load() {
-        // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties)
-        Registry subset = registry.getSubset(KEY);
-        if (subset.getString("version") == null) {
-            if (subset.getSubset("repositoryScanning").isEmpty()) {
-                // only for empty
-                subset = readDefaultConfiguration();
-            } else {
-                throw new RuntimeException("No version tag found in configuration. Archiva configuration version 1.x is not longer supported.");
-            }
-        }
-
-        Configuration config = new ConfigurationRegistryReader().read(subset);
-
-        // Resolving data and repositories directories
-        // If the config entries are absolute, the path is used as it is
-        // if the config entries are empty, they are resolved:
-        //   dataDirectory = ${appserver.base}/data
-        //   repositoryDirectory = ${dataDirectory}/repositories
-        // If the entries are relative they are resolved
-        //   relative to the appserver.base, for dataDirectory
-        //   relative to dataDirectory for repositoryBase
-        String dataDir = config.getArchivaRuntimeConfiguration().getDataDirectory();
-        if (StringUtils.isEmpty(dataDir)) {
-            dataDirectory = getAppServerBaseDir().resolve("data");
-        } else {
-            Path tmpDataDir = Paths.get(dataDir);
-            if (tmpDataDir.isAbsolute()) {
-                dataDirectory = tmpDataDir;
-            } else {
-                dataDirectory = getAppServerBaseDir().resolve(tmpDataDir);
-            }
-        }
-        config.getArchivaRuntimeConfiguration().setDataDirectory(dataDirectory.normalize().toString());
-        String repoBaseDir = config.getArchivaRuntimeConfiguration().getRepositoryBaseDirectory();
-        if (StringUtils.isEmpty(repoBaseDir)) {
-            repositoryBaseDirectory = dataDirectory.resolve("repositories");
-
-        } else {
-            Path tmpRepoBaseDir = Paths.get(repoBaseDir);
-            if (tmpRepoBaseDir.isAbsolute()) {
-                repositoryBaseDirectory = tmpRepoBaseDir;
-            } else {
-                dataDirectory.resolve(tmpRepoBaseDir);
-            }
-        }
-
-        String remoteRepoBaseDir = config.getArchivaRuntimeConfiguration().getRemoteRepositoryBaseDirectory();
-        if (StringUtils.isEmpty(remoteRepoBaseDir)) {
-            remoteRepositoryBaseDirectory = dataDirectory.resolve("remotes");
-        } else {
-            Path tmpRemoteRepoDir = Paths.get(remoteRepoBaseDir);
-            if (tmpRemoteRepoDir.isAbsolute()) {
-                remoteRepositoryBaseDirectory = tmpRemoteRepoDir;
-            } else {
-                dataDirectory.resolve(tmpRemoteRepoDir);
-            }
-        }
-
-        String repositoryGroupBaseDir = config.getArchivaRuntimeConfiguration().getRepositoryGroupBaseDirectory();
-        if (StringUtils.isEmpty(repositoryGroupBaseDir)) {
-            repositoryGroupBaseDirectory = dataDirectory.resolve("groups");
-        } else {
-            Path tmpGroupDir = Paths.get(repositoryGroupBaseDir);
-            if (tmpGroupDir.isAbsolute()) {
-                repositoryGroupBaseDirectory = tmpGroupDir;
-            } else {
-                dataDirectory.resolve(tmpGroupDir);
-            }
-        }
-
-
-        config.getRepositoryGroups();
-        config.getRepositoryGroupsAsMap();
-        if (!CollectionUtils.isEmpty(config.getRemoteRepositories())) {
-            List<RemoteRepositoryConfiguration> remoteRepos = config.getRemoteRepositories();
-            for (RemoteRepositoryConfiguration repo : remoteRepos) {
-                // [MRM-582] Remote Repositories with empty <username> and <password> fields shouldn't be created in configuration.
-                if (StringUtils.isBlank(repo.getUsername())) {
-                    repo.setUsername(null);
-                }
-
-                if (StringUtils.isBlank(repo.getPassword())) {
-                    repo.setPassword(null);
-                }
-            }
-        }
-
-        if (!config.getProxyConnectors().isEmpty()) {
-            // Fix Proxy Connector Settings.
-
-            // Create a copy of the list to read from (to prevent concurrent modification exceptions)
-            List<ProxyConnectorConfiguration> proxyConnectorList = new ArrayList<>(config.getProxyConnectors());
-            // Remove the old connector list.
-            config.getProxyConnectors().clear();
-
-            for (ProxyConnectorConfiguration connector : proxyConnectorList) {
-                // Fix policies
-                boolean connectorValid = true;
-
-                Map<String, String> policies = new HashMap<>();
-                // Make copy of policies
-                policies.putAll(connector.getPolicies());
-                // Clear out policies
-                connector.getPolicies().clear();
-
-                // Work thru policies. cleaning them up.
-                for (Entry<String, String> entry : policies.entrySet()) {
-                    String policyId = entry.getKey();
-                    String setting = entry.getValue();
-
-                    // Upgrade old policy settings.
-                    if ("releases".equals(policyId) || "snapshots".equals(policyId)) {
-                        if ("ignored".equals(setting)) {
-                            setting = AbstractUpdatePolicy.ALWAYS.getId();
-                        } else if ("disabled".equals(setting)) {
-                            setting = AbstractUpdatePolicy.NEVER.getId();
-                        }
-                    } else if ("cache-failures".equals(policyId)) {
-                        if ("ignored".equals(setting)) {
-                            setting = CachedFailuresPolicy.NO.getId();
-                        } else if ("cached".equals(setting)) {
-                            setting = CachedFailuresPolicy.YES.getId();
-                        }
-                    } else if ("checksum".equals(policyId)) {
-                        if ("ignored".equals(setting)) {
-                            setting = ChecksumPolicy.IGNORE.getId();
-                        }
-                    }
-
-                    // Validate existance of policy key.
-                    connector.addPolicy(policyId, setting);
-                }
-
-                if (connectorValid) {
-                    config.addProxyConnector(connector);
-                }
-            }
-
-            // Normalize the order fields in the proxy connectors.
-            Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap =
-                    config.getProxyConnectorAsMap();
-
-            for (List<ProxyConnectorConfiguration> connectors : proxyConnectorMap.values()) {
-                // Sort connectors by order field.
-                Collections.sort(connectors, ProxyConnectorConfigurationOrderComparator.getInstance());
-
-                // Normalize the order field values.
-                int order = 1;
-                for (ProxyConnectorConfiguration connector : connectors) {
-                    connector.setOrder(order++);
-                }
-            }
-        }
-
-        this.defaultLocale = Locale.forLanguageTag(config.getArchivaRuntimeConfiguration().getDefaultLanguage());
-        this.languagePriorities = Locale.LanguageRange.parse(config.getArchivaRuntimeConfiguration().getLanguageRange());
-        return config;
-    }
-
-    /*
-     * Updates the checkpath list for repositories.
-     *
-     * We are replacing existing ones and adding new ones. This allows to update the list with new releases.
-     *
-     * We are also updating existing remote repositories, if they exist already.
-     *
-     * This update method should only be called, if the config version changes to avoid overwriting
-     * user repository settings all the time.
-     */
-    private void updateCheckPathDefaults(Configuration config, Registry defaultConfiguration) {
-        List<RepositoryCheckPath> existingCheckPathList = config.getArchivaDefaultConfiguration().getDefaultCheckPaths();
-        HashMap<String, RepositoryCheckPath> existingCheckPaths = new HashMap<>();
-        HashMap<String, RepositoryCheckPath> newCheckPaths = new HashMap<>();
-        for (RepositoryCheckPath path : config.getArchivaDefaultConfiguration().getDefaultCheckPaths()) {
-            existingCheckPaths.put(path.getUrl(), path);
-        }
-        List defaultCheckPathsSubsets = defaultConfiguration.getSubsetList("archivaDefaultConfiguration.defaultCheckPaths.defaultCheckPath");
-        for (Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); ) {
-            RepositoryCheckPath v = readRepositoryCheckPath((Registry) i.next());
-            if (existingCheckPaths.containsKey(v.getUrl())) {
-                existingCheckPathList.remove(existingCheckPaths.get(v.getUrl()));
-            }
-            existingCheckPathList.add(v);
-            newCheckPaths.put(v.getUrl(), v);
-        }
-        // Remote repositories update
-        for (RemoteRepositoryConfiguration remoteRepositoryConfiguration : config.getRemoteRepositories()) {
-            String url = remoteRepositoryConfiguration.getUrl().toLowerCase();
-            if (newCheckPaths.containsKey(url)) {
-                String currentPath = remoteRepositoryConfiguration.getCheckPath();
-                String newPath = newCheckPaths.get(url).getPath();
-                log.info("Updating connection check path for repository {}, from '{}' to '{}'.", remoteRepositoryConfiguration.getId(),
-                        currentPath, newPath);
-                remoteRepositoryConfiguration.setCheckPath(newPath);
-            }
-        }
-    }
-
-    private RepositoryCheckPath readRepositoryCheckPath(Registry registry) {
-        RepositoryCheckPath value = new RepositoryCheckPath();
-
-        String url = registry.getString("url", value.getUrl());
-
-        value.setUrl(url);
-        String path = registry.getString("path", value.getPath());
-        value.setPath(path);
-        return value;
-    }
-
-
-    private Registry readDefaultConfiguration() {
-        // if it contains some old configuration, remove it (Archiva 0.9)
-        registry.removeSubset(KEY);
-
-        try {
-            registry.addConfigurationFromResource("org/apache/archiva/configuration/default-archiva.xml", KEY);
-            this.isConfigurationDefaulted = true;
-        } catch (RegistryException e) {
-            throw new ConfigurationRuntimeException(
-                    "Fatal error: Unable to find the built-in default configuration and load it into the registry", e);
-        }
-        return registry.getSubset(KEY);
-    }
-
-    /*
-     * Reads the default only configuration into a special prefix. This allows to check for changes
-     * of the default configuration.
-     */
-    private Registry readDefaultOnlyConfiguration() {
-        registry.removeSubset(KEY_DEFAULT_ONLY);
-        try {
-            registry.addConfigurationFromResource("org/apache/archiva/configuration/default-archiva.xml", KEY_DEFAULT_ONLY);
-        } catch (RegistryException e) {
-            throw new ConfigurationRuntimeException(
-                    "Fatal error: Unable to find the built-in default configuration and load it into the registry", e);
-        }
-        return registry.getSubset(KEY_DEFAULT_ONLY);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public synchronized void save(Configuration configuration) throws IndeterminateConfigurationException, RegistryException
-    {
-        save( configuration, "" );
-    }
-
-    /**
-     * Saves the configuration and adds the given tag to the event.
-     * @param configuration the configuration to save
-     * @param eventTag the tag to add to the configuration saved event
-     * @throws IndeterminateConfigurationException if the
-     * @throws RegistryException
-     */
-    @Override
-    public synchronized void save(Configuration configuration, String eventTag)
-            throws IndeterminateConfigurationException, RegistryException {
-        Registry section = registry.getSection(KEY + ".user");
-        Registry baseSection = registry.getSection(KEY + ".base");
-        if (section == null) {
-            section = baseSection;
-            if (section == null) {
-                section = createDefaultConfigurationFile(eventTag);
-            }
-        } else if (baseSection != null) {
-            Collection<String> keys = baseSection.getKeys();
-            boolean foundList = false;
-            for (Iterator<String> i = keys.iterator(); i.hasNext() && !foundList; ) {
-                String key = i.next();
-
-                // a little aggressive with the repositoryScanning and databaseScanning - should be no need to split
-                // that configuration
-                if (key.startsWith("repositories") //
-                        || key.startsWith("proxyConnectors") //
-                        || key.startsWith("networkProxies") //
-                        || key.startsWith("repositoryScanning") //
-                        || key.startsWith("remoteRepositories") //
-                        || key.startsWith("managedRepositories") //
-                        || key.startsWith("repositoryGroups")) //
-                {
-                    foundList = true;
-                }
-            }
-
-            if (foundList) {
-                this.configuration = null;
-
-                throw new IndeterminateConfigurationException(
-                        "Configuration can not be saved when it is loaded from two sources");
-            }
-        }
-
-        // escape all cron expressions to handle ','
-        escapeCronExpressions(configuration);
-
-        // [MRM-661] Due to a bug in the modello registry writer, we need to take these out by hand. They'll be put back by the writer.
-        if (section != null) {
-            if (configuration.getManagedRepositories().isEmpty()) {
-                section.removeSubset("managedRepositories");
-            }
-            if (configuration.getRemoteRepositories().isEmpty()) {
-                section.removeSubset("remoteRepositories");
-
-            }
-            if (configuration.getProxyConnectors().isEmpty()) {
-                section.removeSubset("proxyConnectors");
-            }
-            if (configuration.getNetworkProxies().isEmpty()) {
-                section.removeSubset("networkProxies");
-            }
-            if (configuration.getLegacyArtifactPaths().isEmpty()) {
-                section.removeSubset("legacyArtifactPaths");
-            }
-            if (configuration.getRepositoryGroups().isEmpty()) {
-                section.removeSubset("repositoryGroups");
-            }
-            if (configuration.getRepositoryScanning() != null) {
-                if (configuration.getRepositoryScanning().getKnownContentConsumers().isEmpty()) {
-                    section.removeSubset("repositoryScanning.knownContentConsumers");
-                }
-                if (configuration.getRepositoryScanning().getInvalidContentConsumers().isEmpty()) {
-                    section.removeSubset("repositoryScanning.invalidContentConsumers");
-                }
-            }
-            if (configuration.getArchivaRuntimeConfiguration() != null) {
-                section.removeSubset("archivaRuntimeConfiguration.defaultCheckPaths");
-            }
-
-            new ConfigurationRegistryWriter().write(configuration, section);
-            section.save();
-        }
-
-
-        this.configuration = unescapeExpressions(configuration);
-        isConfigurationDefaulted = false;
-
-        triggerEvent(ConfigurationEvent.SAVED, eventTag);
-    }
-
-    private void escapeCronExpressions(Configuration configuration) {
-        for (ManagedRepositoryConfiguration c : configuration.getManagedRepositories()) {
-            c.setRefreshCronExpression(escapeCronExpression(c.getRefreshCronExpression()));
-        }
-    }
-
-    private Registry createDefaultConfigurationFile(String eventTag)
-            throws RegistryException {
-        // TODO: may not be needed under commons-configuration 1.4 - check
-
-        String contents = "<configuration />";
-
-        String fileLocation = userConfigFilename;
-
-        if (!writeFile("user configuration", userConfigFilename, contents)) {
-            fileLocation = altConfigFilename;
-            if (!writeFile("alternative configuration", altConfigFilename, contents, true)) {
-                throw new RegistryException(
-                        "Unable to create configuration file in either user [" + userConfigFilename + "] or alternative ["
-                                + altConfigFilename
-                                + "] locations on disk, usually happens when not allowed to write to those locations.");
-            }
-        }
-
-        // olamy hackish I know :-)
-        contents = "<configuration><xml fileName=\"" + fileLocation
-                + "\" config-forceCreate=\"true\" config-name=\"org.apache.archiva.user\"/>" + "</configuration>";
-
-        ((CommonsConfigurationRegistry) registry).setInitialConfiguration(contents);
-
-        registry.initialize();
-
-        for (RegistryListener regListener : registryListeners) {
-            addRegistryChangeListener(regListener);
-        }
-
-        triggerEvent(ConfigurationEvent.SAVED, eventTag==null?"default-file":eventTag);
-
-        Registry section = registry.getSection(KEY + ".user");
-        if (section == null) {
-            return new CommonsConfigurationRegistry( );
-        } else {
-            return section;
-        }
-    }
-
-    private boolean writeFile(String filetype, String path, String contents) {
-        return writeFile( filetype, path, contents, false );
-    }
-
-    /**
-     * Attempts to write the contents to a file, if an IOException occurs, return false.
-     * <p/>
-     * The file will be created if the directory to the file exists, otherwise this will return false.
-     *
-     * @param filetype the filetype (freeform text) to use in logging messages when failure to write.
-     * @param path     the path to write to.
-     * @param contents the contents to write.
-     * @return true if write successful.
-     */
-    private boolean writeFile(String filetype, String path, String contents, boolean createDirs) {                
-        try {
-            Path file = Paths.get(path);
-            // Check parent directory (if it is declared)
-            final Path parent = file.getParent();
-            if (parent != null) {
-                // Check that directory exists
-                if (!Files.exists( parent ) && createDirs) {
-                    Files.createDirectories( parent );
-                }
-                if (!Files.isDirectory(parent)) {
-                    // Directory to file must exist for file to be created
-                    return false;
-                }
-            }
-            FileUtils.writeStringToFile(file.toFile(), contents, FILE_ENCODING);
-            return true;
-        } catch (IOException e) {
-            log.error("Unable to create {} file: {}", filetype, e.getMessage(), e);
-            return false;
-        } catch (InvalidPathException ipe) {
-            log.error("Unable to read {} file: {}", path, ipe.getMessage(), ipe);
-            return false;
-        }
-    }
-
-    private void triggerEvent(int type, String eventTag) {
-        ConfigurationEvent evt = new ConfigurationEvent(type, eventTag);
-        for (ConfigurationListener listener : listeners) {
-            listener.configurationEvent(evt);
-        }
-    }
-
-    @Override
-    public void addListener(ConfigurationListener listener) {
-        if (listener == null) {
-            return;
-        }
-
-        listeners.add(listener);
-    }
-
-    @Override
-    public void removeListener(ConfigurationListener listener) {
-        if (listener == null) {
-            return;
-        }
-
-        listeners.remove(listener);
-    }
-
-
-    @Override
-    public void addChangeListener(RegistryListener listener) {
-        addRegistryChangeListener(listener);
-
-        // keep track for later
-        registryListeners.add(listener);
-    }
-
-    private void addRegistryChangeListener(RegistryListener listener) {
-        Registry section = registry.getSection(KEY + ".user");
-        if (section != null) {
-            section.addChangeListener(listener);
-        }
-        section = registry.getSection(KEY + ".base");
-        if (section != null) {
-            section.addChangeListener(listener);
-        }
-    }
-
-    @Override
-    public void removeChangeListener(RegistryListener listener) {
-        boolean removed = registryListeners.remove(listener);
-        log.debug("RegistryListener: '{}' removed {}", listener, removed);
-
-        Registry section = registry.getSection(KEY + ".user");
-        if (section != null) {
-            section.removeChangeListener(listener);
-        }
-        section = registry.getSection(KEY + ".base");
-        if (section != null) {
-            section.removeChangeListener(listener);
-        }
-
-    }
-
-    @PostConstruct
-    public void initialize() {
-
-        // Resolve expressions in the userConfigFilename and altConfigFilename
-        try {
-            ExpressionEvaluator expressionEvaluator = new DefaultExpressionEvaluator();
-            expressionEvaluator.addExpressionSource(new SystemPropertyExpressionSource());
-            String userConfigFileNameSysProps = System.getProperty(USER_CONFIG_PROPERTY);
-            if (StringUtils.isNotBlank(userConfigFileNameSysProps)) {
-                userConfigFilename = userConfigFileNameSysProps;
-            } else {
-                String userConfigFileNameEnv = System.getenv(USER_CONFIG_ENVVAR);
-                if (StringUtils.isNotBlank(userConfigFileNameEnv)) {
-                    userConfigFilename = userConfigFileNameEnv;
-                } else {
-                    userConfigFilename = expressionEvaluator.expand(userConfigFilename);
-                }
-            }
-            altConfigFilename = expressionEvaluator.expand(altConfigFilename);
-            loadConfiguration();
-            handleUpgradeConfiguration();
-        } catch (IndeterminateConfigurationException | RegistryException e) {
-            throw new RuntimeException("failed during upgrade from previous version" + e.getMessage(), e);
-        } catch (EvaluatorException e) {
-            throw new RuntimeException(
-                    "Unable to evaluate expressions found in " + "userConfigFilename or altConfigFilename.", e);
-        }
-        registry.addChangeListener(this);
-    }
-
-    /**
-     * Handle upgrade to newer version
-     */
-    private void handleUpgradeConfiguration()
-            throws RegistryException, IndeterminateConfigurationException {
-
-        List<String> dbConsumers = Arrays.asList("update-db-artifact", "update-db-repository-metadata");
-
-        // remove database consumers if here
-        List<String> intersec =
-                ListUtils.intersection(dbConsumers, configuration.getRepositoryScanning().getKnownContentConsumers());
-
-        if (!intersec.isEmpty()) {
-
-            List<String> knowContentConsumers =
-                    new ArrayList<>(configuration.getRepositoryScanning().getKnownContentConsumers().size());
-            for (String knowContentConsumer : configuration.getRepositoryScanning().getKnownContentConsumers()) {
-                if (!dbConsumers.contains(knowContentConsumer)) {
-                    knowContentConsumers.add(knowContentConsumer);
-                }
-            }
-
-            configuration.getRepositoryScanning().setKnownContentConsumers(knowContentConsumers);
-        }
-
-        // ensure create-archiva-metadata is here
-        if (!configuration.getRepositoryScanning().getKnownContentConsumers().contains("create-archiva-metadata")) {
-            List<String> knowContentConsumers =
-                    new ArrayList<>(configuration.getRepositoryScanning().getKnownContentConsumers());
-            knowContentConsumers.add("create-archiva-metadata");
-            configuration.getRepositoryScanning().setKnownContentConsumers(knowContentConsumers);
-        }
-
-        // ensure duplicate-artifacts is here
-        if (!configuration.getRepositoryScanning().getKnownContentConsumers().contains("duplicate-artifacts")) {
-            List<String> knowContentConsumers =
-                    new ArrayList<>(configuration.getRepositoryScanning().getKnownContentConsumers());
-            knowContentConsumers.add("duplicate-artifacts");
-            configuration.getRepositoryScanning().setKnownContentConsumers(knowContentConsumers);
-        }
-
-        Registry defaultOnlyConfiguration = readDefaultOnlyConfiguration();
-        // Currently we check only for configuration version change, not certain version numbers.
-        if (hasConfigVersionChanged(configuration, defaultOnlyConfiguration)) {
-            updateCheckPathDefaults(configuration, defaultOnlyConfiguration);
-            String newVersion = defaultOnlyConfiguration.getString("version");
-            if (newVersion == null) {
-                throw new IndeterminateConfigurationException("The default configuration has no version information!");
-            }
-            configuration.setVersion(newVersion);
-            try {
-                save(configuration);
-            } catch (IndeterminateConfigurationException e) {
-                log.error("Error occured during configuration update to new version: {}", e.getMessage());
-            } catch (RegistryException e) {
-                log.error("Error occured during configuration update to new version: {}", e.getMessage());
-            }
-        }
-    }
-
-    @Override
-    public void reload() {
-        this.configuration = null;
-        try {
-            this.registry.initialize();
-        } catch (RegistryException e) {
-            throw new ConfigurationRuntimeException(e.getMessage(), e);
-        }
-        this.initialize();
-    }
-
-    @Override
-    public Locale getDefaultLocale() {
-        return defaultLocale;
-    }
-
-    @Override
-    public List<Locale.LanguageRange> getLanguagePriorities() {
-        return languagePriorities;
-    }
-
-    @Override
-    public Path getAppServerBaseDir() {
-        String basePath = registry.getString("appserver.base");
-        if (!StringUtils.isEmpty(basePath)) {
-            return Paths.get(basePath);
-        } else {
-            return Paths.get("");
-        }
-    }
-
-    @Override
-    public Path getRepositoryBaseDir() {
-        if (repositoryBaseDirectory == null) {
-            getConfiguration();
-        }
-        return repositoryBaseDirectory;
-
-    }
-
-    @Override
-    public Path getRemoteRepositoryBaseDir() {
-        if (remoteRepositoryBaseDirectory == null) {
-            getConfiguration();
-        }
-        return remoteRepositoryBaseDirectory;
-    }
-
-    @Override
-    public Path getRepositoryGroupBaseDir() {
-        if (repositoryGroupBaseDirectory == null) {
-            getConfiguration();
-        }
-        return repositoryGroupBaseDirectory;
-    }
-
-    @Override
-    public Path getDataDirectory() {
-        if (dataDirectory == null) {
-            getConfiguration();
-        }
-        return dataDirectory;
-    }
-
-    @Override
-    public void beforeConfigurationChange(Registry registry, String propertyName, Object propertyValue) {
-        // nothing to do here
-    }
-
-    @Override
-    public synchronized void afterConfigurationChange(Registry registry, String propertyName, Object propertyValue) {
-        // configuration = null;
-        // this.dataDirectory = null;
-        // this.repositoryBaseDirectory = null;
-    }
-
-    private String removeExpressions(String directory) {
-        String value = StringUtils.replace(directory, "${appserver.base}",
-                registry.getString("appserver.base", "${appserver.base}"));
-        value = StringUtils.replace(value, "${appserver.home}",
-                registry.getString("appserver.home", "${appserver.home}"));
-        return value;
-    }
-
-    private String unescapeCronExpression(String cronExpression) {
-        return StringUtils.replace(cronExpression, "\\,", ",");
-    }
-
-    private String escapeCronExpression(String cronExpression) {
-        return StringUtils.replace(cronExpression, ",", "\\,");
-    }
-
-    private Configuration unescapeExpressions(Configuration config) {
-        // TODO: for commons-configuration 1.3 only
-        for (ManagedRepositoryConfiguration c : config.getManagedRepositories()) {
-            c.setLocation(removeExpressions(c.getLocation()));
-            c.setRefreshCronExpression(unescapeCronExpression(c.getRefreshCronExpression()));
-        }
-
-        return config;
-    }
-
-    private Configuration checkRepositoryLocations(Configuration config) {
-        // additional check for [MRM-789], ensure that the location of the default repositories 
-        // are not installed in the server installation        
-        for (ManagedRepositoryConfiguration repo : (List<ManagedRepositoryConfiguration>) config.getManagedRepositories()) {
-            String repoPath = repo.getLocation();
-            Path repoLocation = Paths.get(repoPath);
-
-            if (Files.exists(repoLocation) && Files.isDirectory(repoLocation) && !repoPath.endsWith(
-                    "/repositories/" + repo.getId())) {
-                repo.setLocation(repoPath + "/data/repositories/" + repo.getId());
-            }
-        }
-
-        return config;
-    }
-
-    public String getUserConfigFilename() {
-        return userConfigFilename;
-    }
-
-    public String getAltConfigFilename() {
-        return altConfigFilename;
-    }
-
-    @Override
-    public boolean isDefaulted() {
-        return this.isConfigurationDefaulted;
-    }
-
-    public Registry getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(Registry registry) {
-        this.registry = registry;
-    }
-
-
-    public void setUserConfigFilename(String userConfigFilename) {
-        this.userConfigFilename = userConfigFilename;
-    }
-
-    public void setAltConfigFilename(String altConfigFilename) {
-        this.altConfigFilename = altConfigFilename;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileLockConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileLockConfiguration.java
deleted file mode 100644 (file)
index 259e3b8..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * File Locking configuration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class FileLockConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * skipping the locking mechanism.
-     */
-    private boolean skipLocking = true;
-
-    /**
-     * maximum time to wait to get the file lock (0 infinite).
-     */
-    private int lockingTimeout = 0;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get maximum time to wait to get the file lock (0 infinite).
-     * 
-     * @return int
-     */
-    public int getLockingTimeout()
-    {
-        return this.lockingTimeout;
-    } //-- int getLockingTimeout()
-
-    /**
-     * Get skipping the locking mechanism.
-     * 
-     * @return boolean
-     */
-    public boolean isSkipLocking()
-    {
-        return this.skipLocking;
-    } //-- boolean isSkipLocking()
-
-    /**
-     * Set maximum time to wait to get the file lock (0 infinite).
-     * 
-     * @param lockingTimeout
-     */
-    public void setLockingTimeout( int lockingTimeout )
-    {
-        this.lockingTimeout = lockingTimeout;
-    } //-- void setLockingTimeout( int )
-
-    /**
-     * Set skipping the locking mechanism.
-     * 
-     * @param skipLocking
-     */
-    public void setSkipLocking( boolean skipLocking )
-    {
-        this.skipLocking = skipLocking;
-    } //-- void setSkipLocking( boolean )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileType.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileType.java
deleted file mode 100644 (file)
index d3930c1..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * The FileType object.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class FileType
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * Field id.
-     */
-    private String id;
-
-    /**
-     * Field patterns.
-     */
-    private java.util.List<String> patterns;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addPattern.
-     * 
-     * @param string
-     */
-    public void addPattern( String string )
-    {
-        getPatterns().add( string );
-    } //-- void addPattern( String )
-
-    /**
-     * Get the id field.
-     * 
-     * @return String
-     */
-    public String getId()
-    {
-        return this.id;
-    } //-- String getId()
-
-    /**
-     * Method getPatterns.
-     * 
-     * @return List
-     */
-    public java.util.List<String> getPatterns()
-    {
-        if ( this.patterns == null )
-        {
-            this.patterns = new java.util.ArrayList<String>();
-        }
-
-        return this.patterns;
-    } //-- java.util.List<String> getPatterns()
-
-    /**
-     * Method removePattern.
-     * 
-     * @param string
-     */
-    public void removePattern( String string )
-    {
-        getPatterns().remove( string );
-    } //-- void removePattern( String )
-
-    /**
-     * Set the id field.
-     * 
-     * @param id
-     */
-    public void setId( String id )
-    {
-        this.id = id;
-    } //-- void setId( String )
-
-    /**
-     * Set the patterns field.
-     * 
-     * @param patterns
-     */
-    public void setPatterns( java.util.List<String> patterns )
-    {
-        this.patterns = patterns;
-    } //-- void setPatterns( java.util.List )
-
-    
-
-            @Override
-            public boolean equals( Object o )
-            {
-                if ( this == o )
-                {
-                    return true;
-                }
-                if ( o == null || getClass() != o.getClass() )
-                {
-                    return false;
-                }
-
-                FileType fileType = (FileType) o;
-
-                if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
-                {
-                    return false;
-                }
-
-                return true;
-            }
-
-            @Override
-            public int hashCode()
-            {
-                return id != null ? 37 + id.hashCode() : 0;
-            }
-          
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileTypes.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileTypes.java
deleted file mode 100644 (file)
index 2415f71..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.common.FileTypeUtils;
-import org.apache.archiva.configuration.functors.FiletypeSelectionPredicate;
-import org.apache.archiva.components.registry.Registry;
-import org.apache.archiva.components.registry.RegistryListener;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.IterableUtils;
-import org.apache.commons.collections4.Predicate;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.nio.file.FileSystems;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * FileTypes
- */
-@Service("fileTypes")
-public class FileTypes
-    implements RegistryListener
-{
-    public static final String ARTIFACTS = "artifacts";
-
-    public static final String AUTO_REMOVE = "auto-remove";
-
-    public static final String INDEXABLE_CONTENT = "indexable-content";
-
-    public static final String IGNORED = "ignored";
-
-    @Inject
-    @Named(value = "archivaConfiguration#default")
-    private ArchivaConfiguration archivaConfiguration;
-
-
-    public FileTypes() {
-
-    }
-
-    /**
-     * Map of default values for the file types.
-     */
-    private Map<String, List<String>> defaultTypeMap = new HashMap<>();
-
-    private List<String> artifactPatterns;
-
-    /**
-     * Default exclusions from artifact consumers that are using the file types. Note that this is simplistic in the
-     * case of the support files (based on extension) as it is elsewhere - it may be better to match these to actual
-     * artifacts and exclude later during scanning.
-     *
-     * @deprecated
-     */
-    public static final List<String> DEFAULT_EXCLUSIONS = FileTypeUtils.DEFAULT_EXCLUSIONS;
-
-    public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
-    {
-        this.archivaConfiguration = archivaConfiguration;
-    }
-
-    /**
-     * Get the list of patterns for a specified filetype.
-     * You will always get a list.  In this order.
-     * <ul>
-     * <li>The Configured List</li>
-     * <li>The Default List</li>
-     * <li>A single item list of <code>&quot;**&#47;*&quot;</code></li>
-     * </ul>
-     *
-     * @param id the id to lookup.
-     * @return the list of patterns.
-     */
-    public List<String> getFileTypePatterns( String id )
-    {
-        Configuration config = archivaConfiguration.getConfiguration();
-        Predicate selectedFiletype = new FiletypeSelectionPredicate( id );
-        RepositoryScanningConfiguration repositoryScanningConfiguration = config.getRepositoryScanning();
-        if ( repositoryScanningConfiguration != null )
-        {
-            FileType filetype =
-                IterableUtils.find( config.getRepositoryScanning().getFileTypes(), selectedFiletype );
-
-            if ( ( filetype != null ) && CollectionUtils.isNotEmpty( filetype.getPatterns() ) )
-            {
-                return filetype.getPatterns();
-            }
-        }
-        List<String> defaultPatterns = defaultTypeMap.get( id );
-
-        if ( CollectionUtils.isEmpty( defaultPatterns ) )
-        {
-            return Collections.singletonList( "**/*" );
-        }
-
-        return defaultPatterns;
-    }
-
-    public synchronized boolean matchesArtifactPattern( String relativePath )
-    {
-        // Correct the slash pattern.
-        relativePath = relativePath.replace( '\\', '/' );
-
-        if ( artifactPatterns == null )
-        {
-            artifactPatterns = getFileTypePatterns( ARTIFACTS );
-        }
-
-        for ( String pattern : artifactPatterns )
-        {
-            if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) )
-            {
-                // Found match
-                return true;
-            }
-        }
-
-        // No match.
-        return false;
-    }
-
-    public boolean matchesDefaultExclusions( String relativePath )
-    {
-        // Correct the slash pattern.
-        relativePath = relativePath.replace( '\\', '/' );
-
-        for ( String pattern : DEFAULT_EXCLUSIONS )
-        {
-            if ( FileSystems.getDefault().getPathMatcher( "glob:" + pattern).matches( Paths.get( relativePath ) ) )
-            {
-                // Found match
-                return true;
-            }
-        }
-
-        // No match.
-        return false;
-    }
-
-    @PostConstruct
-    public void initialize()
-    {
-        initialiseTypeMap( this.archivaConfiguration.getConfiguration() );
-
-        this.archivaConfiguration.addChangeListener( this );
-    }
-
-    private void initialiseTypeMap( Configuration configuration )
-    {
-        defaultTypeMap.clear();
-
-        // Store the default file type declaration.
-        List<FileType> filetypes = configuration.getRepositoryScanning().getFileTypes();
-        for ( FileType filetype : filetypes )
-        {
-            List<String> patterns = defaultTypeMap.get( filetype.getId() );
-            if ( patterns == null )
-            {
-                patterns = new ArrayList<>( filetype.getPatterns().size() );
-            }
-            patterns.addAll( filetype.getPatterns() );
-
-            defaultTypeMap.put( filetype.getId(), patterns );
-        }
-    }
-
-    @Override
-    public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
-    {
-        if ( propertyName.contains( "fileType" ) )
-        {
-            artifactPatterns = null;
-
-            initialiseTypeMap( archivaConfiguration.getConfiguration() );
-        }
-    }
-
-    @Override
-    public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue )
-    {
-        /* nothing to do */
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/IndeterminateConfigurationException.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/IndeterminateConfigurationException.java
deleted file mode 100644 (file)
index 04160fa..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Occurs when the configuration is stored in two locations and the save location can not be determined.
- */
-public class IndeterminateConfigurationException
-    extends Exception
-{
-    public IndeterminateConfigurationException( String message )
-    {
-        super( message );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/InvalidConfigurationException.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/InvalidConfigurationException.java
deleted file mode 100644 (file)
index 55f5b34..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * An error in the configuration.
- */
-public class InvalidConfigurationException
-    extends Exception
-{
-    private final String name;
-
-    public InvalidConfigurationException( String name, String message )
-    {
-        super( message );
-        this.name = name;
-    }
-
-    public InvalidConfigurationException( String name, String message, Throwable cause )
-    {
-        super( message, cause );
-
-        this.name = name;
-    }
-
-    public String getName()
-    {
-        return name;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapConfiguration.java
deleted file mode 100644 (file)
index 5541c73..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * 
- *         The LDAP configuration.
- *       
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class LdapConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * The LDAP host.
-     */
-    private String hostName;
-
-    /**
-     * The LDAP port.
-     */
-    private int port = 0;
-
-    /**
-     * ssl LDAP connection.
-     */
-    private boolean ssl = false;
-
-    /**
-     * The LDAP base dn.
-     */
-    private String baseDn;
-
-    /**
-     * The LDAP base dn for groups (if empty baseDn is used).
-     */
-    private String baseGroupsDn;
-
-    /**
-     * contextFactory to use.
-     */
-    private String contextFactory;
-
-    /**
-     * The LDAP bind dn.
-     */
-    private String bindDn;
-
-    /**
-     * The LDAP password.
-     */
-    private String password;
-
-    /**
-     * The LDAP authenticationMethod.
-     */
-    private String authenticationMethod;
-
-    /**
-     * The LDAP authenticator enabled.
-     */
-    private boolean bindAuthenticatorEnabled = false;
-
-    /**
-     * LDAP writable.
-     */
-    private boolean writable = false;
-
-    /**
-     * Will use role name as LDAP group.
-     */
-    private boolean useRoleNameAsGroup = false;
-
-    /**
-     * Field extraProperties.
-     */
-    private java.util.Map extraProperties;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addExtraProperty.
-     * 
-     * @param key
-     * @param value
-     */
-    public void addExtraProperty( Object key, String value )
-    {
-        getExtraProperties().put( key, value );
-    } //-- void addExtraProperty( Object, String )
-
-    /**
-     * Get the LDAP authenticationMethod.
-     * 
-     * @return String
-     */
-    public String getAuthenticationMethod()
-    {
-        return this.authenticationMethod;
-    } //-- String getAuthenticationMethod()
-
-    /**
-     * Get the LDAP base dn.
-     * 
-     * @return String
-     */
-    public String getBaseDn()
-    {
-        return this.baseDn;
-    } //-- String getBaseDn()
-
-    /**
-     * Get the LDAP base dn for groups (if empty baseDn is used).
-     * 
-     * @return String
-     */
-    public String getBaseGroupsDn()
-    {
-        return this.baseGroupsDn;
-    } //-- String getBaseGroupsDn()
-
-    /**
-     * Get the LDAP bind dn.
-     * 
-     * @return String
-     */
-    public String getBindDn()
-    {
-        return this.bindDn;
-    } //-- String getBindDn()
-
-    /**
-     * Get contextFactory to use.
-     * 
-     * @return String
-     */
-    public String getContextFactory()
-    {
-        return this.contextFactory;
-    } //-- String getContextFactory()
-
-    /**
-     * Method getExtraProperties.
-     * 
-     * @return Map
-     */
-    public java.util.Map getExtraProperties()
-    {
-        if ( this.extraProperties == null )
-        {
-            this.extraProperties = new java.util.HashMap();
-        }
-
-        return this.extraProperties;
-    } //-- java.util.Map getExtraProperties()
-
-    /**
-     * Get the LDAP host.
-     * 
-     * @return String
-     */
-    public String getHostName()
-    {
-        return this.hostName;
-    } //-- String getHostName()
-
-    /**
-     * Get the LDAP password.
-     * 
-     * @return String
-     */
-    public String getPassword()
-    {
-        return this.password;
-    } //-- String getPassword()
-
-    /**
-     * Get the LDAP port.
-     * 
-     * @return int
-     */
-    public int getPort()
-    {
-        return this.port;
-    } //-- int getPort()
-
-    /**
-     * Get the LDAP authenticator enabled.
-     * 
-     * @return boolean
-     */
-    public boolean isBindAuthenticatorEnabled()
-    {
-        return this.bindAuthenticatorEnabled;
-    } //-- boolean isBindAuthenticatorEnabled()
-
-    /**
-     * Get ssl LDAP connection.
-     * 
-     * @return boolean
-     */
-    public boolean isSsl()
-    {
-        return this.ssl;
-    } //-- boolean isSsl()
-
-    /**
-     * Get will use role name as LDAP group.
-     * 
-     * @return boolean
-     */
-    public boolean isUseRoleNameAsGroup()
-    {
-        return this.useRoleNameAsGroup;
-    } //-- boolean isUseRoleNameAsGroup()
-
-    /**
-     * Get lDAP writable.
-     * 
-     * @return boolean
-     */
-    public boolean isWritable()
-    {
-        return this.writable;
-    } //-- boolean isWritable()
-
-    /**
-     * Set the LDAP authenticationMethod.
-     * 
-     * @param authenticationMethod
-     */
-    public void setAuthenticationMethod( String authenticationMethod )
-    {
-        this.authenticationMethod = authenticationMethod;
-    } //-- void setAuthenticationMethod( String )
-
-    /**
-     * Set the LDAP base dn.
-     * 
-     * @param baseDn
-     */
-    public void setBaseDn( String baseDn )
-    {
-        this.baseDn = baseDn;
-    } //-- void setBaseDn( String )
-
-    /**
-     * Set the LDAP base dn for groups (if empty baseDn is used).
-     * 
-     * @param baseGroupsDn
-     */
-    public void setBaseGroupsDn( String baseGroupsDn )
-    {
-        this.baseGroupsDn = baseGroupsDn;
-    } //-- void setBaseGroupsDn( String )
-
-    /**
-     * Set the LDAP authenticator enabled.
-     * 
-     * @param bindAuthenticatorEnabled
-     */
-    public void setBindAuthenticatorEnabled( boolean bindAuthenticatorEnabled )
-    {
-        this.bindAuthenticatorEnabled = bindAuthenticatorEnabled;
-    } //-- void setBindAuthenticatorEnabled( boolean )
-
-    /**
-     * Set the LDAP bind dn.
-     * 
-     * @param bindDn
-     */
-    public void setBindDn( String bindDn )
-    {
-        this.bindDn = bindDn;
-    } //-- void setBindDn( String )
-
-    /**
-     * Set contextFactory to use.
-     * 
-     * @param contextFactory
-     */
-    public void setContextFactory( String contextFactory )
-    {
-        this.contextFactory = contextFactory;
-    } //-- void setContextFactory( String )
-
-    /**
-     * Set additional properties to use for ldap connection.
-     * 
-     * @param extraProperties
-     */
-    public void setExtraProperties( java.util.Map extraProperties )
-    {
-        this.extraProperties = extraProperties;
-    } //-- void setExtraProperties( java.util.Map )
-
-    /**
-     * Set the LDAP host.
-     * 
-     * @param hostName
-     */
-    public void setHostName( String hostName )
-    {
-        this.hostName = hostName;
-    } //-- void setHostName( String )
-
-    /**
-     * Set the LDAP password.
-     * 
-     * @param password
-     */
-    public void setPassword( String password )
-    {
-        this.password = password;
-    } //-- void setPassword( String )
-
-    /**
-     * Set the LDAP port.
-     * 
-     * @param port
-     */
-    public void setPort( int port )
-    {
-        this.port = port;
-    } //-- void setPort( int )
-
-    /**
-     * Set ssl LDAP connection.
-     * 
-     * @param ssl
-     */
-    public void setSsl( boolean ssl )
-    {
-        this.ssl = ssl;
-    } //-- void setSsl( boolean )
-
-    /**
-     * Set will use role name as LDAP group.
-     * 
-     * @param useRoleNameAsGroup
-     */
-    public void setUseRoleNameAsGroup( boolean useRoleNameAsGroup )
-    {
-        this.useRoleNameAsGroup = useRoleNameAsGroup;
-    } //-- void setUseRoleNameAsGroup( boolean )
-
-    /**
-     * Set lDAP writable.
-     * 
-     * @param writable
-     */
-    public void setWritable( boolean writable )
-    {
-        this.writable = writable;
-    } //-- void setWritable( boolean )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapGroupMapping.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapGroupMapping.java
deleted file mode 100644 (file)
index 05288c1..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * configuration of a LDAP group to Archiva roles.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class LdapGroupMapping
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * LDAP Group.
-     */
-    private String group;
-
-    /**
-     * Field roleNames.
-     */
-    private java.util.List<String> roleNames;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addRoleName.
-     * 
-     * @param string
-     */
-    public void addRoleName( String string )
-    {
-        getRoleNames().add( string );
-    } //-- void addRoleName( String )
-
-    /**
-     * Get lDAP Group.
-     * 
-     * @return String
-     */
-    public String getGroup()
-    {
-        return this.group;
-    } //-- String getGroup()
-
-    /**
-     * Method getRoleNames.
-     * 
-     * @return List
-     */
-    public java.util.List<String> getRoleNames()
-    {
-        if ( this.roleNames == null )
-        {
-            this.roleNames = new java.util.ArrayList<String>();
-        }
-
-        return this.roleNames;
-    } //-- java.util.List<String> getRoleNames()
-
-    /**
-     * Method removeRoleName.
-     * 
-     * @param string
-     */
-    public void removeRoleName( String string )
-    {
-        getRoleNames().remove( string );
-    } //-- void removeRoleName( String )
-
-    /**
-     * Set lDAP Group.
-     * 
-     * @param group
-     */
-    public void setGroup( String group )
-    {
-        this.group = group;
-    } //-- void setGroup( String )
-
-    /**
-     * Set archiva roles.
-     * 
-     * @param roleNames
-     */
-    public void setRoleNames( java.util.List<String> roleNames )
-    {
-        this.roleNames = roleNames;
-    } //-- void setRoleNames( java.util.List )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LegacyArtifactPath.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LegacyArtifactPath.java
deleted file mode 100644 (file)
index 695245f..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class LegacyArtifactPath.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class LegacyArtifactPath
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The legacy path.
-     *           
-     */
-    private String path;
-
-    /**
-     * 
-     *             The artifact reference, as " [groupId] :
-     * [artifactId] : [version] : [classifier] : [type] ".
-     *           
-     */
-    private String artifact;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get the artifact reference, as " [groupId] : [artifactId] :
-     * [version] : [classifier] : [type] ".
-     * 
-     * @return String
-     */
-    public String getArtifact()
-    {
-        return this.artifact;
-    } //-- String getArtifact()
-
-    /**
-     * Get the legacy path.
-     * 
-     * @return String
-     */
-    public String getPath()
-    {
-        return this.path;
-    } //-- String getPath()
-
-    /**
-     * Set the artifact reference, as " [groupId] : [artifactId] :
-     * [version] : [classifier] : [type] ".
-     * 
-     * @param artifact
-     */
-    public void setArtifact( String artifact )
-    {
-        this.artifact = artifact;
-    } //-- void setArtifact( String )
-
-    /**
-     * Set the legacy path.
-     * 
-     * @param path
-     */
-    public void setPath( String path )
-    {
-        this.path = path;
-    } //-- void setPath( String )
-
-    
-    public boolean match( String path )
-    {
-        return path.equals( this.path );
-    }
-
-    public String getGroupId()
-    {
-        return artifact.split( ":" )[0];
-    }
-
-    public String getArtifactId()
-    {
-        return artifact.split( ":" )[1];
-    }
-        
-    public String getVersion()
-    {
-        return artifact.split( ":" )[2];
-    }
-    
-    public String getClassifier()
-    {
-        String classifier = artifact.split( ":" )[3];
-        return classifier.length() > 0 ? classifier : null;
-    }
-    
-    public String getType()
-    {
-        return artifact.split( ":" )[4];
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( o == null || getClass() != o.getClass() )
-        {
-            return false;
-        }
-
-        LegacyArtifactPath that = (LegacyArtifactPath) o;
-
-        if ( path != null ? !path.equals( that.path ) : that.path != null )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        return path != null ? 37 + path.hashCode() : 0;
-    }
-       
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ManagedRepositoryConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ManagedRepositoryConfiguration.java
deleted file mode 100644 (file)
index a8da04d..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class ManagedRepositoryConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class ManagedRepositoryConfiguration
-    extends AbstractRepositoryConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The file system location for this repository.
-     *           
-     */
-    private String location;
-
-    /**
-     * True if this repository contains release versioned artifacts.
-     */
-    private boolean releases = true;
-
-    /**
-     * True if re-deployment of artifacts already in the repository
-     * will be blocked.
-     */
-    private boolean blockRedeployments = false;
-
-    /**
-     * True if this repository contains snapshot versioned artifacts
-     */
-    private boolean snapshots = false;
-
-    /**
-     * True if this repository should be scanned and processed.
-     */
-    private boolean scanned = true;
-
-    /**
-     * 
-     *             When to run the refresh task.
-     *             Default is every hour
-     *           .
-     */
-    private String refreshCronExpression = "0 0 * * * ?";
-
-    /**
-     * 
-     *             The total count of the artifact to be retained
-     * for each snapshot.
-     *           
-     */
-    private int retentionCount = 2;
-
-    /**
-     * 
-     *             The number of days after which snapshots will be
-     * removed.
-     *           
-     */
-    private int retentionPeriod = 100;
-
-    /**
-     * 
-     *             True if the released snapshots are to be removed
-     * from the repo during repository purge.
-     *           
-     */
-    private boolean deleteReleasedSnapshots = false;
-
-    /**
-     * 
-     *             True to not generate packed index (note you
-     * won't be able to export your index.
-     *           
-     */
-    private boolean skipPackedIndexCreation = false;
-
-    /**
-     * 
-     *             Need a staging repository
-     *           .
-     */
-    private boolean stageRepoNeeded = false;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get the file system location for this repository.
-     * 
-     * @return String
-     */
-    public String getLocation()
-    {
-        return this.location;
-    } //-- String getLocation()
-
-    /**
-     * Get when to run the refresh task.
-     *             Default is every hour.
-     * 
-     * @return String
-     */
-    public String getRefreshCronExpression()
-    {
-        return this.refreshCronExpression;
-    } //-- String getRefreshCronExpression()
-
-    /**
-     * Get the total count of the artifact to be retained for each
-     * snapshot.
-     * 
-     * @return int
-     */
-    public int getRetentionCount()
-    {
-        return this.retentionCount;
-    } //-- int getRetentionCount()
-
-    /**
-     * Get the number of days after which snapshots will be
-     * removed.
-     * 
-     * @return int
-     */
-    public int getRetentionPeriod()
-    {
-        return this.retentionPeriod;
-    } //-- int getRetentionPeriod()
-
-    /**
-     * Get true if re-deployment of artifacts already in the
-     * repository will be blocked.
-     * 
-     * @return boolean
-     */
-    public boolean isBlockRedeployments()
-    {
-        return this.blockRedeployments;
-    } //-- boolean isBlockRedeployments()
-
-    /**
-     * Get true if the released snapshots are to be removed from
-     * the repo during repository purge.
-     * 
-     * @return boolean
-     */
-    public boolean isDeleteReleasedSnapshots()
-    {
-        return this.deleteReleasedSnapshots;
-    } //-- boolean isDeleteReleasedSnapshots()
-
-    /**
-     * Get true if this repository contains release versioned
-     * artifacts.
-     * 
-     * @return boolean
-     */
-    public boolean isReleases()
-    {
-        return this.releases;
-    } //-- boolean isReleases()
-
-    /**
-     * Get true if this repository should be scanned and processed.
-     * 
-     * @return boolean
-     */
-    public boolean isScanned()
-    {
-        return this.scanned;
-    } //-- boolean isScanned()
-
-    /**
-     * Get true to not generate packed index (note you won't be
-     * able to export your index.
-     * 
-     * @return boolean
-     */
-    public boolean isSkipPackedIndexCreation()
-    {
-        return this.skipPackedIndexCreation;
-    } //-- boolean isSkipPackedIndexCreation()
-
-    /**
-     * Get true if this repository contains snapshot versioned
-     * artifacts.
-     * 
-     * @return boolean
-     */
-    public boolean isSnapshots()
-    {
-        return this.snapshots;
-    } //-- boolean isSnapshots()
-
-    /**
-     * Get need a staging repository.
-     * 
-     * @return boolean
-     */
-    public boolean isStageRepoNeeded()
-    {
-        return this.stageRepoNeeded;
-    } //-- boolean isStageRepoNeeded()
-
-    /**
-     * Set true if re-deployment of artifacts already in the
-     * repository will be blocked.
-     * 
-     * @param blockRedeployments
-     */
-    public void setBlockRedeployments( boolean blockRedeployments )
-    {
-        this.blockRedeployments = blockRedeployments;
-    } //-- void setBlockRedeployments( boolean )
-
-    /**
-     * Set true if the released snapshots are to be removed from
-     * the repo during repository purge.
-     * 
-     * @param deleteReleasedSnapshots
-     */
-    public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
-    {
-        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
-    } //-- void setDeleteReleasedSnapshots( boolean )
-
-    /**
-     * Set the file system location for this repository.
-     * 
-     * @param location
-     */
-    public void setLocation( String location )
-    {
-        this.location = location;
-    } //-- void setLocation( String )
-
-    /**
-     * Set when to run the refresh task.
-     *             Default is every hour.
-     * 
-     * @param refreshCronExpression
-     */
-    public void setRefreshCronExpression( String refreshCronExpression )
-    {
-        this.refreshCronExpression = refreshCronExpression;
-    } //-- void setRefreshCronExpression( String )
-
-    /**
-     * Set true if this repository contains release versioned
-     * artifacts.
-     * 
-     * @param releases
-     */
-    public void setReleases( boolean releases )
-    {
-        this.releases = releases;
-    } //-- void setReleases( boolean )
-
-    /**
-     * Set the total count of the artifact to be retained for each
-     * snapshot.
-     * 
-     * @param retentionCount
-     */
-    public void setRetentionCount( int retentionCount )
-    {
-        this.retentionCount = retentionCount;
-    } //-- void setRetentionCount( int )
-
-    /**
-     * Set the number of days after which snapshots will be
-     * removed.
-     * 
-     * @param retentionPeriod
-     */
-    public void setRetentionPeriod( int retentionPeriod )
-    {
-        this.retentionPeriod = retentionPeriod;
-    } //-- void setRetentionPeriod( int )
-
-    /**
-     * Set true if this repository should be scanned and processed.
-     * 
-     * @param scanned
-     */
-    public void setScanned( boolean scanned )
-    {
-        this.scanned = scanned;
-    } //-- void setScanned( boolean )
-
-    /**
-     * Set true to not generate packed index (note you won't be
-     * able to export your index.
-     * 
-     * @param skipPackedIndexCreation
-     */
-    public void setSkipPackedIndexCreation( boolean skipPackedIndexCreation )
-    {
-        this.skipPackedIndexCreation = skipPackedIndexCreation;
-    } //-- void setSkipPackedIndexCreation( boolean )
-
-    /**
-     * Set true if this repository contains snapshot versioned
-     * artifacts.
-     * 
-     * @param snapshots
-     */
-    public void setSnapshots( boolean snapshots )
-    {
-        this.snapshots = snapshots;
-    } //-- void setSnapshots( boolean )
-
-    /**
-     * Set need a staging repository.
-     * 
-     * @param stageRepoNeeded
-     */
-    public void setStageRepoNeeded( boolean stageRepoNeeded )
-    {
-        this.stageRepoNeeded = stageRepoNeeded;
-    } //-- void setStageRepoNeeded( boolean )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/MavenProxyPropertyLoader.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/MavenProxyPropertyLoader.java
deleted file mode 100644 (file)
index 20e3f34..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.policies.ReleasesPolicy;
-import org.apache.archiva.policies.SnapshotsPolicy;
-import org.apache.commons.lang3.StringUtils;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-/**
- */
-public class MavenProxyPropertyLoader
-{
-    private static final String REPO_LOCAL_STORE = "repo.local.store";
-
-    private static final String PROXY_LIST = "proxy.list";
-
-    private static final String REPO_LIST = "repo.list";
-
-    public void load( Properties props, Configuration configuration )
-        throws InvalidConfigurationException
-    {
-        // set up the managed repository
-        String localCachePath = getMandatoryProperty( props, REPO_LOCAL_STORE );
-
-        ManagedRepositoryConfiguration config = new ManagedRepositoryConfiguration();
-        config.setLocation( localCachePath );
-        config.setName( "Imported Maven-Proxy Cache" );
-        config.setId( "maven-proxy" );
-        config.setScanned( false );
-        config.setReleases( true );
-        config.setSnapshots( false );
-        configuration.addManagedRepository( config );
-
-        // Add the network proxies.
-        String propertyList = props.getProperty( PROXY_LIST );
-        if ( propertyList != null )
-        {
-            StringTokenizer tok = new StringTokenizer( propertyList, "," );
-            while ( tok.hasMoreTokens() )
-            {
-                String key = tok.nextToken();
-                if ( StringUtils.isNotEmpty( key ) )
-                {
-                    NetworkProxyConfiguration proxy = new NetworkProxyConfiguration();
-                    proxy.setHost( getMandatoryProperty( props, "proxy." + key + ".host" ) );
-                    proxy.setPort( Integer.parseInt( getMandatoryProperty( props, "proxy." + key + ".port" ) ) );
-
-                    // the username and password isn't required
-                    proxy.setUsername( props.getProperty( "proxy." + key + ".username" ) );
-                    proxy.setPassword( props.getProperty( "proxy." + key + ".password" ) );
-
-                    configuration.addNetworkProxy( proxy );
-                }
-            }
-        }
-
-        // Add the remote repository list
-        String repoList = getMandatoryProperty( props, REPO_LIST );
-
-        StringTokenizer tok = new StringTokenizer( repoList, "," );
-        while ( tok.hasMoreTokens() )
-        {
-            String key = tok.nextToken();
-
-            Properties repoProps = getSubset( props, "repo." + key + "." );
-            String url = getMandatoryProperty( props, "repo." + key + ".url" );
-            String proxyKey = repoProps.getProperty( "proxy" );
-
-//            int cachePeriod = Integer.parseInt( repoProps.getProperty( "cache.period", "60" ) );
-
-            RemoteRepositoryConfiguration repository = new RemoteRepositoryConfiguration();
-            repository.setId( key );
-            repository.setName( "Imported Maven-Proxy Remote Proxy" );
-            repository.setUrl( url );
-            repository.setLayout( "legacy" );
-
-            configuration.addRemoteRepository( repository );
-
-            ProxyConnectorConfiguration proxyConnector = new ProxyConnectorConfiguration();
-            proxyConnector.setSourceRepoId( "maven-proxy" );
-            proxyConnector.setTargetRepoId( key );
-            proxyConnector.setProxyId( proxyKey );
-            // TODO: convert cachePeriod to closest "daily" or "hourly"
-            proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.DAILY.getId() );
-            proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS.getId() );
-
-            configuration.addProxyConnector( proxyConnector );
-        }
-    }
-
-    @SuppressWarnings( "unchecked" )
-    private Properties getSubset( Properties props, String prefix )
-    {
-        Enumeration keys = props.keys();
-        Properties result = new Properties();
-        while ( keys.hasMoreElements() )
-        {
-            String key = (String) keys.nextElement();
-            String value = props.getProperty( key );
-            if ( key.startsWith( prefix ) )
-            {
-                String newKey = key.substring( prefix.length() );
-                result.setProperty( newKey, value );
-            }
-        }
-        return result;
-    }
-
-    public void load( InputStream is, Configuration configuration )
-        throws IOException, InvalidConfigurationException
-    {
-        Properties props = new Properties();
-        props.load( is );
-        load( props, configuration );
-    }
-
-    private String getMandatoryProperty( Properties props, String key )
-        throws InvalidConfigurationException
-    {
-        String value = props.getProperty( key );
-
-        if ( value == null )
-        {
-            throw new InvalidConfigurationException( key, "Missing required field: " + key );
-        }
-
-        return value;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkConfiguration.java
deleted file mode 100644 (file)
index a7eacec..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * 
- *         The network configuration for external http request to
- * repositories.
- *       
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class NetworkConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * maximum total external http connections.
-     */
-    private int maxTotal = 30;
-
-    /**
-     * maximum total external http connections per host.
-     */
-    private int maxTotalPerHost = 30;
-
-    /**
-     * use or not http connection pooling default true.
-     */
-    private boolean usePooling = true;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get maximum total external http connections.
-     * 
-     * @return int
-     */
-    public int getMaxTotal()
-    {
-        return this.maxTotal;
-    } //-- int getMaxTotal()
-
-    /**
-     * Get maximum total external http connections per host.
-     * 
-     * @return int
-     */
-    public int getMaxTotalPerHost()
-    {
-        return this.maxTotalPerHost;
-    } //-- int getMaxTotalPerHost()
-
-    /**
-     * Get use or not http connection pooling default true.
-     * 
-     * @return boolean
-     */
-    public boolean isUsePooling()
-    {
-        return this.usePooling;
-    } //-- boolean isUsePooling()
-
-    /**
-     * Set maximum total external http connections.
-     * 
-     * @param maxTotal
-     */
-    public void setMaxTotal( int maxTotal )
-    {
-        this.maxTotal = maxTotal;
-    } //-- void setMaxTotal( int )
-
-    /**
-     * Set maximum total external http connections per host.
-     * 
-     * @param maxTotalPerHost
-     */
-    public void setMaxTotalPerHost( int maxTotalPerHost )
-    {
-        this.maxTotalPerHost = maxTotalPerHost;
-    } //-- void setMaxTotalPerHost( int )
-
-    /**
-     * Set use or not http connection pooling default true.
-     * 
-     * @param usePooling
-     */
-    public void setUsePooling( boolean usePooling )
-    {
-        this.usePooling = usePooling;
-    } //-- void setUsePooling( boolean )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkProxyConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkProxyConfiguration.java
deleted file mode 100644 (file)
index 234ef8a..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class NetworkProxyConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class NetworkProxyConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The ID for this proxy.
-     *           
-     */
-    private String id;
-
-    /**
-     * 
-     *             The network protocol to use with this proxy:
-     * "http", "socks-4"
-     *           .
-     */
-    private String protocol = "http";
-
-    /**
-     * 
-     *             The proxy host.
-     *           
-     */
-    private String host;
-
-    /**
-     * 
-     *             The proxy port.
-     *           
-     */
-    private int port = 8080;
-
-    /**
-     * 
-     *             The proxy user.
-     *           
-     */
-    private String username;
-
-    /**
-     * 
-     *             The proxy password.
-     *           
-     */
-    private String password;
-
-    /**
-     * 
-     *             Use ntlm authentification.
-     *           
-     */
-    private boolean useNtlm = false;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get the proxy host.
-     * 
-     * @return String
-     */
-    public String getHost()
-    {
-        return this.host;
-    } //-- String getHost()
-
-    /**
-     * Get the ID for this proxy.
-     * 
-     * @return String
-     */
-    public String getId()
-    {
-        return this.id;
-    } //-- String getId()
-
-    /**
-     * Get the proxy password.
-     * 
-     * @return String
-     */
-    public String getPassword()
-    {
-        return this.password;
-    } //-- String getPassword()
-
-    /**
-     * Get the proxy port.
-     * 
-     * @return int
-     */
-    public int getPort()
-    {
-        return this.port;
-    } //-- int getPort()
-
-    /**
-     * Get the network protocol to use with this proxy: "http",
-     * "socks-4".
-     * 
-     * @return String
-     */
-    public String getProtocol()
-    {
-        return this.protocol;
-    } //-- String getProtocol()
-
-    /**
-     * Get the proxy user.
-     * 
-     * @return String
-     */
-    public String getUsername()
-    {
-        return this.username;
-    } //-- String getUsername()
-
-    /**
-     * Get use ntlm authentification.
-     * 
-     * @return boolean
-     */
-    public boolean isUseNtlm()
-    {
-        return this.useNtlm;
-    } //-- boolean isUseNtlm()
-
-    /**
-     * Set the proxy host.
-     * 
-     * @param host
-     */
-    public void setHost( String host )
-    {
-        this.host = host;
-    } //-- void setHost( String )
-
-    /**
-     * Set the ID for this proxy.
-     * 
-     * @param id
-     */
-    public void setId( String id )
-    {
-        this.id = id;
-    } //-- void setId( String )
-
-    /**
-     * Set the proxy password.
-     * 
-     * @param password
-     */
-    public void setPassword( String password )
-    {
-        this.password = password;
-    } //-- void setPassword( String )
-
-    /**
-     * Set the proxy port.
-     * 
-     * @param port
-     */
-    public void setPort( int port )
-    {
-        this.port = port;
-    } //-- void setPort( int )
-
-    /**
-     * Set the network protocol to use with this proxy: "http",
-     * "socks-4".
-     * 
-     * @param protocol
-     */
-    public void setProtocol( String protocol )
-    {
-        this.protocol = protocol;
-    } //-- void setProtocol( String )
-
-    /**
-     * Set use ntlm authentification.
-     * 
-     * @param useNtlm
-     */
-    public void setUseNtlm( boolean useNtlm )
-    {
-        this.useNtlm = useNtlm;
-    } //-- void setUseNtlm( boolean )
-
-    /**
-     * Set the proxy user.
-     * 
-     * @param username
-     */
-    public void setUsername( String username )
-    {
-        this.username = username;
-    } //-- void setUsername( String )
-
-    
-            public int hashCode()
-            {
-                int result = 17;
-                result = 37 * result + ( id != null ? id.hashCode() : 0 );
-                return result;
-            }
-
-            public boolean equals( Object other )
-            {
-                if ( this == other )
-                {
-                    return true;
-                }
-
-                if ( !( other instanceof NetworkProxyConfiguration ) )
-                {
-                    return false;
-                }
-
-                NetworkProxyConfiguration that = (NetworkProxyConfiguration) other;
-                boolean result = true;
-                result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
-                return result;
-            }
-          
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/OrganisationInformation.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/OrganisationInformation.java
deleted file mode 100644 (file)
index a7f7fb6..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * 
- *         The organisation information settings.
- *       
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class OrganisationInformation
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * name of the organisation.
-     */
-    private String name;
-
-    /**
-     * name of the organisation.
-     */
-    private String url;
-
-    /**
-     * name of the organisation.
-     */
-    private String logoLocation;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get name of the organisation.
-     * 
-     * @return String
-     */
-    public String getLogoLocation()
-    {
-        return this.logoLocation;
-    } //-- String getLogoLocation()
-
-    /**
-     * Get name of the organisation.
-     * 
-     * @return String
-     */
-    public String getName()
-    {
-        return this.name;
-    } //-- String getName()
-
-    /**
-     * Get name of the organisation.
-     * 
-     * @return String
-     */
-    public String getUrl()
-    {
-        return this.url;
-    } //-- String getUrl()
-
-    /**
-     * Set name of the organisation.
-     * 
-     * @param logoLocation
-     */
-    public void setLogoLocation( String logoLocation )
-    {
-        this.logoLocation = logoLocation;
-    } //-- void setLogoLocation( String )
-
-    /**
-     * Set name of the organisation.
-     * 
-     * @param name
-     */
-    public void setName( String name )
-    {
-        this.name = name;
-    } //-- void setName( String )
-
-    /**
-     * Set name of the organisation.
-     * 
-     * @param url
-     */
-    public void setUrl( String url )
-    {
-        this.url = url;
-    } //-- void setUrl( String )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorConfiguration.java
deleted file mode 100644 (file)
index 944c8b6..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class ProxyConnectorConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class ProxyConnectorConfiguration
-    extends AbstractRepositoryConnectorConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The order of the proxy connectors. (0 means no
-     * order specified)
-     *           .
-     */
-    private int order = 0;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get the order of the proxy connectors. (0 means no order
-     * specified).
-     * 
-     * @return int
-     */
-    public int getOrder()
-    {
-        return this.order;
-    } //-- int getOrder()
-
-    /**
-     * Set the order of the proxy connectors. (0 means no order
-     * specified).
-     * 
-     * @param order
-     */
-    public void setOrder( int order )
-    {
-        this.order = order;
-    } //-- void setOrder( int )
-
-    
-    /**
-     * The order id for UNORDERED
-     */
-    public static final int UNORDERED = 0;
-
-    /**
-     * The policy key {@link #getPolicies()} for error handling.
-     * See {@link org.apache.archiva.policies.DownloadErrorPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_PROPAGATE_ERRORS = "propagate-errors";
-
-    /**
-     * The policy key {@link #getPolicies()} for error handling when an artifact is present.
-     * See {@link org.apache.archiva.policies.DownloadErrorPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_PROPAGATE_ERRORS_ON_UPDATE = "propagate-errors-on-update";
-
-    /**
-     * The policy key {@link #getPolicies()} for snapshot handling.
-     * See {@link org.apache.archiva.policies.SnapshotsPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_SNAPSHOTS = "snapshots";
-
-    /**
-     * The policy key {@link #getPolicies()} for releases handling.
-     * See {@link org.apache.archiva.policies.ReleasesPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_RELEASES = "releases";
-
-    /**
-     * The policy key {@link #getPolicies()} for checksum handling.
-     * See {@link org.apache.archiva.policies.ChecksumPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_CHECKSUM = "checksum";
-
-    /**
-     * The policy key {@link #getPolicies()} for cache-failures handling.
-     * See {@link org.apache.archiva.policies.CachedFailuresPolicy}
-     * for details on potential values to this policy key.
-     */
-    public static final String POLICY_CACHE_FAILURES = "cache-failures";
-          
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorRuleConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorRuleConfiguration.java
deleted file mode 100644 (file)
index 3340e05..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class ProxyConnectorRuleConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class ProxyConnectorRuleConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The type if this rule: whiteList, blackList
-     * etc..
-     *           
-     */
-    private String ruleType;
-
-    /**
-     * 
-     *             The pattern for this rule: whiteList, blackList
-     * etc..
-     *           
-     */
-    private String pattern;
-
-    /**
-     * Field proxyConnectors.
-     */
-    private java.util.List<ProxyConnectorConfiguration> proxyConnectors;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addProxyConnector.
-     * 
-     * @param proxyConnectorConfiguration
-     */
-    public void addProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
-    {
-        getProxyConnectors().add( proxyConnectorConfiguration );
-    } //-- void addProxyConnector( ProxyConnectorConfiguration )
-
-    /**
-     * Get the pattern for this rule: whiteList, blackList etc..
-     * 
-     * @return String
-     */
-    public String getPattern()
-    {
-        return this.pattern;
-    } //-- String getPattern()
-
-    /**
-     * Method getProxyConnectors.
-     * 
-     * @return List
-     */
-    public java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
-    {
-        if ( this.proxyConnectors == null )
-        {
-            this.proxyConnectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
-        }
-
-        return this.proxyConnectors;
-    } //-- java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
-
-    /**
-     * Get the type if this rule: whiteList, blackList etc..
-     * 
-     * @return String
-     */
-    public String getRuleType()
-    {
-        return this.ruleType;
-    } //-- String getRuleType()
-
-    /**
-     * Method removeProxyConnector.
-     * 
-     * @param proxyConnectorConfiguration
-     */
-    public void removeProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
-    {
-        getProxyConnectors().remove( proxyConnectorConfiguration );
-    } //-- void removeProxyConnector( ProxyConnectorConfiguration )
-
-    /**
-     * Set the pattern for this rule: whiteList, blackList etc..
-     * 
-     * @param pattern
-     */
-    public void setPattern( String pattern )
-    {
-        this.pattern = pattern;
-    } //-- void setPattern( String )
-
-    /**
-     * Set associated proxyConnectors configuration.
-     * 
-     * @param proxyConnectors
-     */
-    public void setProxyConnectors( java.util.List<ProxyConnectorConfiguration> proxyConnectors )
-    {
-        this.proxyConnectors = proxyConnectors;
-    } //-- void setProxyConnectors( java.util.List )
-
-    /**
-     * Set the type if this rule: whiteList, blackList etc..
-     * 
-     * @param ruleType
-     */
-    public void setRuleType( String ruleType )
-    {
-        this.ruleType = ruleType;
-    } //-- void setRuleType( String )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RedbackRuntimeConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RedbackRuntimeConfiguration.java
deleted file mode 100644 (file)
index 2c89929..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * 
- *         The redback runtime configuration.
- *       
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class RedbackRuntimeConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * flag to know if redback configuration has been
-     * checked/migrated.
-     */
-    private boolean migratedFromRedbackConfiguration = false;
-
-    /**
-     * Field userManagerImpls.
-     */
-    private java.util.List<String> userManagerImpls;
-
-    /**
-     * Field rbacManagerImpls.
-     */
-    private java.util.List<String> rbacManagerImpls;
-
-    /**
-     * the ldap configuration.
-     */
-    private LdapConfiguration ldapConfiguration;
-
-    /**
-     * Field ldapGroupMappings.
-     */
-    private java.util.List<LdapGroupMapping> ldapGroupMappings;
-
-    /**
-     * Field configurationProperties.
-     */
-    private java.util.Map configurationProperties;
-
-    /**
-     * flag to know if redback will use a cache to prevent
-     * searching users already found.
-     */
-    private boolean useUsersCache = true;
-
-    /**
-     * the users cache configuration.
-     */
-    private CacheConfiguration usersCacheConfiguration;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addConfigurationProperty.
-     * 
-     * @param key
-     * @param value
-     */
-    public void addConfigurationProperty( Object key, String value )
-    {
-        getConfigurationProperties().put( key, value );
-    } //-- void addConfigurationProperty( Object, String )
-
-    /**
-     * Method addLdapGroupMapping.
-     * 
-     * @param ldapGroupMapping
-     */
-    public void addLdapGroupMapping( LdapGroupMapping ldapGroupMapping )
-    {
-        getLdapGroupMappings().add( ldapGroupMapping );
-    } //-- void addLdapGroupMapping( LdapGroupMapping )
-
-    /**
-     * Method addRbacManagerImpl.
-     * 
-     * @param string
-     */
-    public void addRbacManagerImpl( String string )
-    {
-        getRbacManagerImpls().add( string );
-    } //-- void addRbacManagerImpl( String )
-
-    /**
-     * Method addUserManagerImpl.
-     * 
-     * @param string
-     */
-    public void addUserManagerImpl( String string )
-    {
-        getUserManagerImpls().add( string );
-    } //-- void addUserManagerImpl( String )
-
-    /**
-     * Method getConfigurationProperties.
-     * 
-     * @return Map
-     */
-    public java.util.Map getConfigurationProperties()
-    {
-        if ( this.configurationProperties == null )
-        {
-            this.configurationProperties = new java.util.HashMap();
-        }
-
-        return this.configurationProperties;
-    } //-- java.util.Map getConfigurationProperties()
-
-    /**
-     * Get the ldap configuration.
-     * 
-     * @return LdapConfiguration
-     */
-    public LdapConfiguration getLdapConfiguration()
-    {
-        return this.ldapConfiguration;
-    } //-- LdapConfiguration getLdapConfiguration()
-
-    /**
-     * Method getLdapGroupMappings.
-     * 
-     * @return List
-     */
-    public java.util.List<LdapGroupMapping> getLdapGroupMappings()
-    {
-        if ( this.ldapGroupMappings == null )
-        {
-            this.ldapGroupMappings = new java.util.ArrayList<LdapGroupMapping>();
-        }
-
-        return this.ldapGroupMappings;
-    } //-- java.util.List<LdapGroupMapping> getLdapGroupMappings()
-
-    /**
-     * Method getRbacManagerImpls.
-     * 
-     * @return List
-     */
-    public java.util.List<String> getRbacManagerImpls()
-    {
-        if ( this.rbacManagerImpls == null )
-        {
-            this.rbacManagerImpls = new java.util.ArrayList<String>();
-        }
-
-        return this.rbacManagerImpls;
-    } //-- java.util.List<String> getRbacManagerImpls()
-
-    /**
-     * Method getUserManagerImpls.
-     * 
-     * @return List
-     */
-    public java.util.List<String> getUserManagerImpls()
-    {
-        if ( this.userManagerImpls == null )
-        {
-            this.userManagerImpls = new java.util.ArrayList<String>();
-        }
-
-        return this.userManagerImpls;
-    } //-- java.util.List<String> getUserManagerImpls()
-
-    /**
-     * Get the users cache configuration.
-     * 
-     * @return CacheConfiguration
-     */
-    public CacheConfiguration getUsersCacheConfiguration()
-    {
-        return this.usersCacheConfiguration;
-    } //-- CacheConfiguration getUsersCacheConfiguration()
-
-    /**
-     * Get flag to know if redback configuration has been
-     * checked/migrated.
-     * 
-     * @return boolean
-     */
-    public boolean isMigratedFromRedbackConfiguration()
-    {
-        return this.migratedFromRedbackConfiguration;
-    } //-- boolean isMigratedFromRedbackConfiguration()
-
-    /**
-     * Get flag to know if redback will use a cache to prevent
-     * searching users already found.
-     * 
-     * @return boolean
-     */
-    public boolean isUseUsersCache()
-    {
-        return this.useUsersCache;
-    } //-- boolean isUseUsersCache()
-
-    /**
-     * Method removeLdapGroupMapping.
-     * 
-     * @param ldapGroupMapping
-     */
-    public void removeLdapGroupMapping( LdapGroupMapping ldapGroupMapping )
-    {
-        getLdapGroupMappings().remove( ldapGroupMapping );
-    } //-- void removeLdapGroupMapping( LdapGroupMapping )
-
-    /**
-     * Method removeRbacManagerImpl.
-     * 
-     * @param string
-     */
-    public void removeRbacManagerImpl( String string )
-    {
-        getRbacManagerImpls().remove( string );
-    } //-- void removeRbacManagerImpl( String )
-
-    /**
-     * Method removeUserManagerImpl.
-     * 
-     * @param string
-     */
-    public void removeUserManagerImpl( String string )
-    {
-        getUserManagerImpls().remove( string );
-    } //-- void removeUserManagerImpl( String )
-
-    /**
-     * Set extra properties for redback configuration.
-     * String/String.
-     * 
-     * @param configurationProperties
-     */
-    public void setConfigurationProperties( java.util.Map configurationProperties )
-    {
-        this.configurationProperties = configurationProperties;
-    } //-- void setConfigurationProperties( java.util.Map )
-
-    /**
-     * Set the ldap configuration.
-     * 
-     * @param ldapConfiguration
-     */
-    public void setLdapConfiguration( LdapConfiguration ldapConfiguration )
-    {
-        this.ldapConfiguration = ldapConfiguration;
-    } //-- void setLdapConfiguration( LdapConfiguration )
-
-    /**
-     * Set ldapGroupMappings.
-     * 
-     * @param ldapGroupMappings
-     */
-    public void setLdapGroupMappings( java.util.List<LdapGroupMapping> ldapGroupMappings )
-    {
-        this.ldapGroupMappings = ldapGroupMappings;
-    } //-- void setLdapGroupMappings( java.util.List )
-
-    /**
-     * Set flag to know if redback configuration has been
-     * checked/migrated.
-     * 
-     * @param migratedFromRedbackConfiguration
-     */
-    public void setMigratedFromRedbackConfiguration( boolean migratedFromRedbackConfiguration )
-    {
-        this.migratedFromRedbackConfiguration = migratedFromRedbackConfiguration;
-    } //-- void setMigratedFromRedbackConfiguration( boolean )
-
-    /**
-     * Set the RBAC Manager impls to use.
-     * 
-     * @param rbacManagerImpls
-     */
-    public void setRbacManagerImpls( java.util.List<String> rbacManagerImpls )
-    {
-        this.rbacManagerImpls = rbacManagerImpls;
-    } //-- void setRbacManagerImpls( java.util.List )
-
-    /**
-     * Set flag to know if redback will use a cache to prevent
-     * searching users already found.
-     * 
-     * @param useUsersCache
-     */
-    public void setUseUsersCache( boolean useUsersCache )
-    {
-        this.useUsersCache = useUsersCache;
-    } //-- void setUseUsersCache( boolean )
-
-    /**
-     * Set the user manager impls to use.
-     * 
-     * @param userManagerImpls
-     */
-    public void setUserManagerImpls( java.util.List<String> userManagerImpls )
-    {
-        this.userManagerImpls = userManagerImpls;
-    } //-- void setUserManagerImpls( java.util.List )
-
-    /**
-     * Set the users cache configuration.
-     * 
-     * @param usersCacheConfiguration
-     */
-    public void setUsersCacheConfiguration( CacheConfiguration usersCacheConfiguration )
-    {
-        this.usersCacheConfiguration = usersCacheConfiguration;
-    } //-- void setUsersCacheConfiguration( CacheConfiguration )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RemoteRepositoryConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RemoteRepositoryConfiguration.java
deleted file mode 100644 (file)
index ca49d31..0000000
+++ /dev/null
@@ -1,452 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class RemoteRepositoryConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class RemoteRepositoryConfiguration
-    extends AbstractRepositoryConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The URL for this repository.
-     *           
-     */
-    private String url;
-
-    /**
-     * 
-     *             The Username for this repository.
-     *           
-     */
-    private String username;
-
-    /**
-     * 
-     *             The Password for this repository.
-     *           
-     */
-    private String password;
-
-    /**
-     * 
-     *             Timeout in seconds for connections to this
-     * repository
-     *           .
-     */
-    private int timeout = 60;
-
-    /**
-     * 
-     *             When to run the refresh task.
-     *             Default is every sunday at 8H00.
-     *           
-     */
-    private String refreshCronExpression = "0 0 08 ? * SUN";
-
-    /**
-     * 
-     *             Activate download of remote index if
-     * remoteIndexUrl is set too.
-     *           
-     */
-    private boolean downloadRemoteIndex = false;
-
-    /**
-     * 
-     *             Remote Index Url : if not starting with http
-     * will be relative to the remote repository url.
-     *           
-     */
-    private String remoteIndexUrl;
-
-    /**
-     * 
-     *             Id of the networkProxy to use when downloading
-     * remote index.
-     *           
-     */
-    private String remoteDownloadNetworkProxyId;
-
-    /**
-     * 
-     *             Timeout in seconds for download remote index.
-     * Default is more long than artifact download.
-     *           
-     */
-    private int remoteDownloadTimeout = 300;
-
-    /**
-     * 
-     *             Schedule download of remote index when archiva
-     * start
-     *           .
-     */
-    private boolean downloadRemoteIndexOnStartup = false;
-
-    /**
-     * Field extraParameters.
-     */
-    private java.util.Map extraParameters;
-
-    /**
-     * Field extraHeaders.
-     */
-    private java.util.Map extraHeaders;
-
-    /**
-     * The path to check the repository availability (relative to
-     * the repository URL). Some repositories do not allow
-     * browsing, so a certain artifact must be checked.
-     */
-    private String checkPath;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addExtraHeader.
-     * 
-     * @param key
-     * @param value
-     */
-    public void addExtraHeader( Object key, String value )
-    {
-        getExtraHeaders().put( key, value );
-    } //-- void addExtraHeader( Object, String )
-
-    /**
-     * Method addExtraParameter.
-     * 
-     * @param key
-     * @param value
-     */
-    public void addExtraParameter( Object key, String value )
-    {
-        getExtraParameters().put( key, value );
-    } //-- void addExtraParameter( Object, String )
-
-    /**
-     * Get the path to check the repository availability (relative
-     * to the repository URL). Some repositories do not allow
-     * browsing, so a certain artifact must be checked.
-     * 
-     * @return String
-     */
-    public String getCheckPath()
-    {
-        return this.checkPath;
-    } //-- String getCheckPath()
-
-    /**
-     * Method getExtraHeaders.
-     * 
-     * @return Map
-     */
-    public java.util.Map getExtraHeaders()
-    {
-        if ( this.extraHeaders == null )
-        {
-            this.extraHeaders = new java.util.HashMap();
-        }
-
-        return this.extraHeaders;
-    } //-- java.util.Map getExtraHeaders()
-
-    /**
-     * Method getExtraParameters.
-     * 
-     * @return Map
-     */
-    public java.util.Map getExtraParameters()
-    {
-        if ( this.extraParameters == null )
-        {
-            this.extraParameters = new java.util.HashMap();
-        }
-
-        return this.extraParameters;
-    } //-- java.util.Map getExtraParameters()
-
-    /**
-     * Get the Password for this repository.
-     * 
-     * @return String
-     */
-    public String getPassword()
-    {
-        return this.password;
-    } //-- String getPassword()
-
-    /**
-     * Get when to run the refresh task.
-     *             Default is every sunday at 8H00.
-     * 
-     * @return String
-     */
-    public String getRefreshCronExpression()
-    {
-        return this.refreshCronExpression;
-    } //-- String getRefreshCronExpression()
-
-    /**
-     * Get id of the networkProxy to use when downloading remote
-     * index.
-     * 
-     * @return String
-     */
-    public String getRemoteDownloadNetworkProxyId()
-    {
-        return this.remoteDownloadNetworkProxyId;
-    } //-- String getRemoteDownloadNetworkProxyId()
-
-    /**
-     * Get timeout in seconds for download remote index. Default is
-     * more long than artifact download.
-     * 
-     * @return int
-     */
-    public int getRemoteDownloadTimeout()
-    {
-        return this.remoteDownloadTimeout;
-    } //-- int getRemoteDownloadTimeout()
-
-    /**
-     * Get remote Index Url : if not starting with http will be
-     * relative to the remote repository url.
-     * 
-     * @return String
-     */
-    public String getRemoteIndexUrl()
-    {
-        return this.remoteIndexUrl;
-    } //-- String getRemoteIndexUrl()
-
-    /**
-     * Get timeout in seconds for connections to this repository.
-     * 
-     * @return int
-     */
-    public int getTimeout()
-    {
-        return this.timeout;
-    } //-- int getTimeout()
-
-    /**
-     * Get the URL for this repository.
-     * 
-     * @return String
-     */
-    public String getUrl()
-    {
-        return this.url;
-    } //-- String getUrl()
-
-    /**
-     * Get the Username for this repository.
-     * 
-     * @return String
-     */
-    public String getUsername()
-    {
-        return this.username;
-    } //-- String getUsername()
-
-    /**
-     * Get activate download of remote index if remoteIndexUrl is
-     * set too.
-     * 
-     * @return boolean
-     */
-    public boolean isDownloadRemoteIndex()
-    {
-        return this.downloadRemoteIndex;
-    } //-- boolean isDownloadRemoteIndex()
-
-    /**
-     * Get schedule download of remote index when archiva start.
-     * 
-     * @return boolean
-     */
-    public boolean isDownloadRemoteIndexOnStartup()
-    {
-        return this.downloadRemoteIndexOnStartup;
-    } //-- boolean isDownloadRemoteIndexOnStartup()
-
-    /**
-     * Set the path to check the repository availability (relative
-     * to the repository URL). Some repositories do not allow
-     * browsing, so a certain artifact must be checked.
-     * 
-     * @param checkPath
-     */
-    public void setCheckPath( String checkPath )
-    {
-        this.checkPath = checkPath;
-    } //-- void setCheckPath( String )
-
-    /**
-     * Set activate download of remote index if remoteIndexUrl is
-     * set too.
-     * 
-     * @param downloadRemoteIndex
-     */
-    public void setDownloadRemoteIndex( boolean downloadRemoteIndex )
-    {
-        this.downloadRemoteIndex = downloadRemoteIndex;
-    } //-- void setDownloadRemoteIndex( boolean )
-
-    /**
-     * Set schedule download of remote index when archiva start.
-     * 
-     * @param downloadRemoteIndexOnStartup
-     */
-    public void setDownloadRemoteIndexOnStartup( boolean downloadRemoteIndexOnStartup )
-    {
-        this.downloadRemoteIndexOnStartup = downloadRemoteIndexOnStartup;
-    } //-- void setDownloadRemoteIndexOnStartup( boolean )
-
-    /**
-     * Set additional http headers to add to url when requesting
-     * remote repositories.
-     * 
-     * @param extraHeaders
-     */
-    public void setExtraHeaders( java.util.Map extraHeaders )
-    {
-        this.extraHeaders = extraHeaders;
-    } //-- void setExtraHeaders( java.util.Map )
-
-    /**
-     * Set additionnal request parameters to add to url when
-     * requesting remote repositories.
-     * 
-     * @param extraParameters
-     */
-    public void setExtraParameters( java.util.Map extraParameters )
-    {
-        this.extraParameters = extraParameters;
-    } //-- void setExtraParameters( java.util.Map )
-
-    /**
-     * Set the Password for this repository.
-     * 
-     * @param password
-     */
-    public void setPassword( String password )
-    {
-        this.password = password;
-    } //-- void setPassword( String )
-
-    /**
-     * Set when to run the refresh task.
-     *             Default is every sunday at 8H00.
-     * 
-     * @param refreshCronExpression
-     */
-    public void setRefreshCronExpression( String refreshCronExpression )
-    {
-        this.refreshCronExpression = refreshCronExpression;
-    } //-- void setRefreshCronExpression( String )
-
-    /**
-     * Set id of the networkProxy to use when downloading remote
-     * index.
-     * 
-     * @param remoteDownloadNetworkProxyId
-     */
-    public void setRemoteDownloadNetworkProxyId( String remoteDownloadNetworkProxyId )
-    {
-        this.remoteDownloadNetworkProxyId = remoteDownloadNetworkProxyId;
-    } //-- void setRemoteDownloadNetworkProxyId( String )
-
-    /**
-     * Set timeout in seconds for download remote index. Default is
-     * more long than artifact download.
-     * 
-     * @param remoteDownloadTimeout
-     */
-    public void setRemoteDownloadTimeout( int remoteDownloadTimeout )
-    {
-        this.remoteDownloadTimeout = remoteDownloadTimeout;
-    } //-- void setRemoteDownloadTimeout( int )
-
-    /**
-     * Set remote Index Url : if not starting with http will be
-     * relative to the remote repository url.
-     * 
-     * @param remoteIndexUrl
-     */
-    public void setRemoteIndexUrl( String remoteIndexUrl )
-    {
-        this.remoteIndexUrl = remoteIndexUrl;
-    } //-- void setRemoteIndexUrl( String )
-
-    /**
-     * Set timeout in seconds for connections to this repository.
-     * 
-     * @param timeout
-     */
-    public void setTimeout( int timeout )
-    {
-        this.timeout = timeout;
-    } //-- void setTimeout( int )
-
-    /**
-     * Set the URL for this repository.
-     * 
-     * @param url
-     */
-    public void setUrl( String url )
-    {
-        this.url = url;
-    } //-- void setUrl( String )
-
-    /**
-     * Set the Username for this repository.
-     * 
-     * @param username
-     */
-    public void setUsername( String username )
-    {
-        this.username = username;
-    } //-- void setUsername( String )
-
-    
-            public String toString()
-            {
-                return "RemoteRepositoryConfiguration id:'" + getId() + "',name:'" + getName() +"'";
-            }
-
-
-       
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryCheckPath.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryCheckPath.java
deleted file mode 100644 (file)
index 27f7660..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class RepositoryCheckPath.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class RepositoryCheckPath
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * 
-     *             The URL for which this path should be used
-     *           .
-     */
-    private String url;
-
-    /**
-     * 
-     *             The path to use for checking the repository
-     * connection.
-     *           
-     */
-    private String path;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get the path to use for checking the repository connection.
-     * 
-     * @return String
-     */
-    public String getPath()
-    {
-        return this.path;
-    } //-- String getPath()
-
-    /**
-     * Get the URL for which this path should be used.
-     * 
-     * @return String
-     */
-    public String getUrl()
-    {
-        return this.url;
-    } //-- String getUrl()
-
-    /**
-     * Set the path to use for checking the repository connection.
-     * 
-     * @param path
-     */
-    public void setPath( String path )
-    {
-        this.path = path;
-    } //-- void setPath( String )
-
-    /**
-     * Set the URL for which this path should be used.
-     * 
-     * @param url
-     */
-    public void setUrl( String url )
-    {
-        this.url = url;
-    } //-- void setUrl( String )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryGroupConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryGroupConfiguration.java
deleted file mode 100644 (file)
index 877ccaa..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Class RepositoryGroupConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class RepositoryGroupConfiguration extends AbstractRepositoryConfiguration
-    implements Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * The id of the repository group.
-     */
-    private String id;
-
-    /**
-     * The name of the repository group
-     */
-    private String name;
-
-    /**
-     *
-     *             The repository type. Currently only MAVEN type
-     * is known.
-     *
-     */
-    private String type = "MAVEN";
-
-
-    /**
-     * The path of the merged index.
-     */
-    private String mergedIndexPath = ".indexer";
-
-    /**
-     * The time to live of the merged index of the repository group.
-     */
-    private int mergedIndexTtl = 30;
-
-    /**
-     * 
-     *           When to run the index merging for this group.
-     *
-     */
-    private String cronExpression = "";
-
-    /**
-     * Field repositories.
-     */
-    private List<String> repositories;
-
-    /**
-     * The path for local data
-     */
-    private String location;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-
-    /**
-     * Return the local path for group data. If the merged index property is set to a non absolute path,
-     * it is relative to this location.
-     *
-     * @return the path for group data storage
-     */
-    public String getLocation( )
-    {
-        return location;
-    }
-
-    /**
-     * Set the local path for group data
-     * @param location
-     */
-    public void setLocation( String location )
-    {
-        this.location = location;
-    }
-
-    /**
-     * Method addRepository.
-     * 
-     * @param string
-     */
-    public void addRepository( String string )
-    {
-        getRepositories().add( string );
-    } //-- void addRepository( String )
-
-    /**
-     * Get when to run the index merging for this group.
-     *           No default value.
-     * 
-     * @return String
-     */
-    public String getCronExpression()
-    {
-        return this.cronExpression;
-    } //-- String getCronExpression()
-
-    /**
-     * Get the id of the repository group.
-     * 
-     * @return String
-     */
-    public String getId()
-    {
-        return this.id;
-    } //-- String getId()
-
-    /**
-     * Get the path of the merged index.
-     * 
-     * @return String
-     */
-    public String getMergedIndexPath()
-    {
-        return this.mergedIndexPath;
-    } //-- String getMergedIndexPath()
-
-    /**
-     * Get the time to live of the merged index of the repository
-     * group.
-     * 
-     * @return int
-     */
-    public int getMergedIndexTtl()
-    {
-        return this.mergedIndexTtl;
-    } //-- int getMergedIndexTtl()
-
-    /**
-     * Method getRepositories.
-     * 
-     * @return List
-     */
-    public List<String> getRepositories()
-    {
-        if ( this.repositories == null )
-        {
-            this.repositories = new ArrayList<String>();
-        }
-
-        return this.repositories;
-    } //-- java.util.List<String> getRepositories()
-
-    /**
-     * Method removeRepository.
-     * 
-     * @param string
-     */
-    public void removeRepository( String string )
-    {
-        getRepositories().remove( string );
-    } //-- void removeRepository( String )
-
-    /**
-     * Set when to run the index merging for this group.
-     *           No default value.
-     * 
-     * @param cronExpression
-     */
-    public void setCronExpression( String cronExpression )
-    {
-        this.cronExpression = cronExpression;
-    } //-- void setCronExpression( String )
-
-    /**
-     * Set the id of the repository group.
-     * 
-     * @param id
-     */
-    public void setId( String id )
-    {
-        this.id = id;
-    } //-- void setId( String )
-
-    /**
-     * Set the path of the merged index.
-     * 
-     * @param mergedIndexPath
-     */
-    public void setMergedIndexPath( String mergedIndexPath )
-    {
-        this.mergedIndexPath = mergedIndexPath;
-    } //-- void setMergedIndexPath( String )
-
-    /**
-     * Set the time to live of the merged index of the repository
-     * group.
-     * 
-     * @param mergedIndexTtl
-     */
-    public void setMergedIndexTtl( int mergedIndexTtl )
-    {
-        this.mergedIndexTtl = mergedIndexTtl;
-    } //-- void setMergedIndexTtl( int )
-
-    /**
-     * Set the list of repository ids under the group.
-     * 
-     * @param repositories
-     */
-    public void setRepositories( List<String> repositories )
-    {
-        this.repositories = repositories;
-    } //-- void setRepositories( java.util.List )
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryScanningConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryScanningConfiguration.java
deleted file mode 100644 (file)
index 976eb34..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class RepositoryScanningConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class RepositoryScanningConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * Field fileTypes.
-     */
-    private java.util.List<FileType> fileTypes;
-
-    /**
-     * Field knownContentConsumers.
-     */
-    private java.util.List<String> knownContentConsumers;
-
-    /**
-     * Field invalidContentConsumers.
-     */
-    private java.util.List<String> invalidContentConsumers;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Method addFileType.
-     * 
-     * @param fileType
-     */
-    public void addFileType( FileType fileType )
-    {
-        getFileTypes().add( fileType );
-    } //-- void addFileType( FileType )
-
-    /**
-     * Method addInvalidContentConsumer.
-     * 
-     * @param string
-     */
-    public void addInvalidContentConsumer( String string )
-    {
-        getInvalidContentConsumers().add( string );
-    } //-- void addInvalidContentConsumer( String )
-
-    /**
-     * Method addKnownContentConsumer.
-     * 
-     * @param string
-     */
-    public void addKnownContentConsumer( String string )
-    {
-        getKnownContentConsumers().add( string );
-    } //-- void addKnownContentConsumer( String )
-
-    /**
-     * Method getFileTypes.
-     * 
-     * @return List
-     */
-    public java.util.List<FileType> getFileTypes()
-    {
-        if ( this.fileTypes == null )
-        {
-            this.fileTypes = new java.util.ArrayList<FileType>();
-        }
-
-        return this.fileTypes;
-    } //-- java.util.List<FileType> getFileTypes()
-
-    /**
-     * Method getInvalidContentConsumers.
-     * 
-     * @return List
-     */
-    public java.util.List<String> getInvalidContentConsumers()
-    {
-        if ( this.invalidContentConsumers == null )
-        {
-            this.invalidContentConsumers = new java.util.ArrayList<String>();
-        }
-
-        return this.invalidContentConsumers;
-    } //-- java.util.List<String> getInvalidContentConsumers()
-
-    /**
-     * Method getKnownContentConsumers.
-     * 
-     * @return List
-     */
-    public java.util.List<String> getKnownContentConsumers()
-    {
-        if ( this.knownContentConsumers == null )
-        {
-            this.knownContentConsumers = new java.util.ArrayList<String>();
-        }
-
-        return this.knownContentConsumers;
-    } //-- java.util.List<String> getKnownContentConsumers()
-
-    /**
-     * Method removeFileType.
-     * 
-     * @param fileType
-     */
-    public void removeFileType( FileType fileType )
-    {
-        getFileTypes().remove( fileType );
-    } //-- void removeFileType( FileType )
-
-    /**
-     * Method removeInvalidContentConsumer.
-     * 
-     * @param string
-     */
-    public void removeInvalidContentConsumer( String string )
-    {
-        getInvalidContentConsumers().remove( string );
-    } //-- void removeInvalidContentConsumer( String )
-
-    /**
-     * Method removeKnownContentConsumer.
-     * 
-     * @param string
-     */
-    public void removeKnownContentConsumer( String string )
-    {
-        getKnownContentConsumers().remove( string );
-    } //-- void removeKnownContentConsumer( String )
-
-    /**
-     * Set the FileTypes for the repository scanning configuration.
-     * 
-     * @param fileTypes
-     */
-    public void setFileTypes( java.util.List<FileType> fileTypes )
-    {
-        this.fileTypes = fileTypes;
-    } //-- void setFileTypes( java.util.List )
-
-    /**
-     * Set the list of active consumer IDs for invalid content.
-     * 
-     * @param invalidContentConsumers
-     */
-    public void setInvalidContentConsumers( java.util.List<String> invalidContentConsumers )
-    {
-        this.invalidContentConsumers = invalidContentConsumers;
-    } //-- void setInvalidContentConsumers( java.util.List )
-
-    /**
-     * Set the list of active consumers IDs for known content.
-     * 
-     * @param knownContentConsumers
-     */
-    public void setKnownContentConsumers( java.util.List<String> knownContentConsumers )
-    {
-        this.knownContentConsumers = knownContentConsumers;
-    } //-- void setKnownContentConsumers( java.util.List )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/SyncConnectorConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/SyncConnectorConfiguration.java
deleted file mode 100644 (file)
index a4f8ff9..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Class SyncConnectorConfiguration.
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class SyncConnectorConfiguration
-    extends AbstractRepositoryConnectorConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * When to run the sync mechanism. Default is every hour on the
-     * hour.
-     */
-    private String cronExpression = "0 0 * * * ?";
-
-    /**
-     * The type of synchronization to use.
-     */
-    private String method = "rsync";
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get when to run the sync mechanism. Default is every hour on
-     * the hour.
-     * 
-     * @return String
-     */
-    public String getCronExpression()
-    {
-        return this.cronExpression;
-    } //-- String getCronExpression()
-
-    /**
-     * Get the type of synchronization to use.
-     * 
-     * @return String
-     */
-    public String getMethod()
-    {
-        return this.method;
-    } //-- String getMethod()
-
-    /**
-     * Set when to run the sync mechanism. Default is every hour on
-     * the hour.
-     * 
-     * @param cronExpression
-     */
-    public void setCronExpression( String cronExpression )
-    {
-        this.cronExpression = cronExpression;
-    } //-- void setCronExpression( String )
-
-    /**
-     * Set the type of synchronization to use.
-     * 
-     * @param method
-     */
-    public void setMethod( String method )
-    {
-        this.method = method;
-    } //-- void setMethod( String )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/UserInterfaceOptions.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/UserInterfaceOptions.java
deleted file mode 100644 (file)
index 8d84766..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * 
- *         The user interface configuration settings.
- *       
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class UserInterfaceOptions
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * true if find artifacts should be enabled.
-     */
-    private boolean showFindArtifacts = true;
-
-    /**
-     * true if applet behavior for find artifacts should be enabled.
-     */
-    private boolean appletFindEnabled = true;
-
-    /**
-     * Field disableEasterEggs.
-     */
-    private boolean disableEasterEggs = false;
-
-    /**
-     * Field applicationUrl.
-     */
-    private String applicationUrl;
-
-    /**
-     * Field disableRegistration.
-     */
-    private boolean disableRegistration = false;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get the applicationUrl field.
-     * 
-     * @return String
-     */
-    public String getApplicationUrl()
-    {
-        return this.applicationUrl;
-    } //-- String getApplicationUrl()
-
-    /**
-     * Get true if applet behavior for find artifacts should be
-     * enabled.
-     * 
-     * @return boolean
-     */
-    public boolean isAppletFindEnabled()
-    {
-        return this.appletFindEnabled;
-    } //-- boolean isAppletFindEnabled()
-
-    /**
-     * Get the disableEasterEggs field.
-     * 
-     * @return boolean
-     */
-    public boolean isDisableEasterEggs()
-    {
-        return this.disableEasterEggs;
-    } //-- boolean isDisableEasterEggs()
-
-    /**
-     * Get the disableRegistration field.
-     * 
-     * @return boolean
-     */
-    public boolean isDisableRegistration()
-    {
-        return this.disableRegistration;
-    } //-- boolean isDisableRegistration()
-
-    /**
-     * Get true if find artifacts should be enabled.
-     * 
-     * @return boolean
-     */
-    public boolean isShowFindArtifacts()
-    {
-        return this.showFindArtifacts;
-    } //-- boolean isShowFindArtifacts()
-
-    /**
-     * Set true if applet behavior for find artifacts should be
-     * enabled.
-     * 
-     * @param appletFindEnabled
-     */
-    public void setAppletFindEnabled( boolean appletFindEnabled )
-    {
-        this.appletFindEnabled = appletFindEnabled;
-    } //-- void setAppletFindEnabled( boolean )
-
-    /**
-     * Set the applicationUrl field.
-     * 
-     * @param applicationUrl
-     */
-    public void setApplicationUrl( String applicationUrl )
-    {
-        this.applicationUrl = applicationUrl;
-    } //-- void setApplicationUrl( String )
-
-    /**
-     * Set the disableEasterEggs field.
-     * 
-     * @param disableEasterEggs
-     */
-    public void setDisableEasterEggs( boolean disableEasterEggs )
-    {
-        this.disableEasterEggs = disableEasterEggs;
-    } //-- void setDisableEasterEggs( boolean )
-
-    /**
-     * Set the disableRegistration field.
-     * 
-     * @param disableRegistration
-     */
-    public void setDisableRegistration( boolean disableRegistration )
-    {
-        this.disableRegistration = disableRegistration;
-    } //-- void setDisableRegistration( boolean )
-
-    /**
-     * Set true if find artifacts should be enabled.
-     * 
-     * @param showFindArtifacts
-     */
-    public void setShowFindArtifacts( boolean showFindArtifacts )
-    {
-        this.showFindArtifacts = showFindArtifacts;
-    } //-- void setShowFindArtifacts( boolean )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/WebappConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/WebappConfiguration.java
deleted file mode 100644 (file)
index aab3660..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * 
- *         The webapp configuration settings.
- *       
- * 
- * @version $Revision$ $Date$
- */
-@SuppressWarnings( "all" )
-public class WebappConfiguration
-    implements java.io.Serializable
-{
-
-      //--------------------------/
-     //- Class/Member Variables -/
-    //--------------------------/
-
-    /**
-     * options for altering the ui presentation.
-     */
-    private UserInterfaceOptions ui;
-
-
-      //-----------/
-     //- Methods -/
-    //-----------/
-
-    /**
-     * Get options for altering the ui presentation.
-     * 
-     * @return UserInterfaceOptions
-     */
-    public UserInterfaceOptions getUi()
-    {
-        return this.ui;
-    } //-- UserInterfaceOptions getUi()
-
-    /**
-     * Set options for altering the ui presentation.
-     * 
-     * @param ui
-     */
-    public void setUi( UserInterfaceOptions ui )
-    {
-        this.ui = ui;
-    } //-- void setUi( UserInterfaceOptions )
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeSelectionPredicate.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeSelectionPredicate.java
deleted file mode 100644 (file)
index 2573a5d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.FileType;
-import org.apache.commons.collections4.Predicate;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * FiletypeSelectionPredicate
- *
- *
- */
-public class FiletypeSelectionPredicate
-    implements Predicate
-{
-    private String filetypeId;
-
-    public FiletypeSelectionPredicate( String id )
-    {
-        this.filetypeId = id;
-    }
-
-    @Override
-    public boolean evaluate( Object object )
-    {
-        boolean satisfies = false;
-
-        if ( object instanceof FileType )
-        {
-            FileType filetype = (FileType) object;
-            return ( StringUtils.equals( filetypeId, filetype.getId() ) );
-        }
-
-        return satisfies;
-    }
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeToMapClosure.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeToMapClosure.java
deleted file mode 100644 (file)
index ad8ef5c..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.FileType;
-import org.apache.commons.collections4.Closure;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * FiletypeToMapClosure
- *
- *
- */
-public class FiletypeToMapClosure
-    implements Closure
-{
-    private Map<String, FileType> map = new HashMap<>();
-
-    @Override
-    public void execute( Object input )
-    {
-        if ( input instanceof FileType )
-        {
-            FileType filetype = (FileType) input;
-            map.put( filetype.getId(), filetype );
-        }
-    }
-
-    public Map<String, FileType> getMap()
-    {
-        return map;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/NetworkProxyComparator.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/NetworkProxyComparator.java
deleted file mode 100644 (file)
index d71e323..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.NetworkProxyConfiguration;
-
-import java.util.Comparator;
-
-/**
- * NetworkProxyComparator
- *
- *
- */
-public class NetworkProxyComparator
-    implements Comparator<NetworkProxyConfiguration>
-{
-    @Override
-    public int compare( NetworkProxyConfiguration o1, NetworkProxyConfiguration o2 )
-    {
-        if ( o1 == null && o2 == null )
-        {
-            return 0;
-        }
-
-        if ( o1 == null && o2 != null )
-        {
-            return 1;
-        }
-
-        if ( o1 != null && o2 == null )
-        {
-            return -1;
-        }
-
-        String id1 = o1.getId();
-        String id2 = o2.getId();
-        return id1.compareToIgnoreCase( id2 );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/NetworkProxySelectionPredicate.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/NetworkProxySelectionPredicate.java
deleted file mode 100644 (file)
index c76cfa2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.NetworkProxyConfiguration;
-import org.apache.commons.collections4.Predicate;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * NetworkProxySelectionPredicate
- *
- *
- */
-public class NetworkProxySelectionPredicate
-    implements Predicate
-{
-    private String proxyId;
-
-    public NetworkProxySelectionPredicate( String id )
-    {
-        this.proxyId = id;
-    }
-
-    @Override
-    public boolean evaluate( Object object )
-    {
-        boolean satisfies = false;
-
-        if ( object instanceof NetworkProxyConfiguration )
-        {
-            NetworkProxyConfiguration proxy = (NetworkProxyConfiguration) object;
-            return ( StringUtils.equals( proxyId, proxy.getId() ) );
-        }
-
-        return satisfies;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparator.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparator.java
deleted file mode 100644 (file)
index 05cad4b..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-
-import java.util.Comparator;
-
-/**
- *
- * Was marked as deprecated before, but is still used.
- *
- */
-public class ProxyConnectorConfigurationOrderComparator
-    implements Comparator<ProxyConnectorConfiguration>
-{
-    private static ProxyConnectorConfigurationOrderComparator INSTANCE =
-        new ProxyConnectorConfigurationOrderComparator();
-
-    @Override
-    public int compare( ProxyConnectorConfiguration o1, ProxyConnectorConfiguration o2 )
-    {
-        if ( o1 == null && o2 == null )
-        {
-            return 0;
-        }
-
-        // Ensure null goes to end of list.
-        if ( o1 == null && o2 != null )
-        {
-            return 1;
-        }
-
-        if ( o1 != null && o2 == null )
-        {
-            return -1;
-        }
-
-        // Ensure 0 (unordered) goes to end of list.
-        if ( o1.getOrder() == 0 && o2.getOrder() != 0 )
-        {
-            return 1;
-        }
-
-        if ( o1.getOrder() != 0 && o2.getOrder() == 0 )
-        {
-            return -1;
-        }
-
-        return o1.getOrder() - o2.getOrder();
-    }
-
-    public static ProxyConnectorConfigurationOrderComparator getInstance()
-    {
-        return INSTANCE;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/ProxyConnectorSelectionPredicate.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/ProxyConnectorSelectionPredicate.java
deleted file mode 100644 (file)
index 2b5641f..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.commons.collections4.Predicate;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * ProxyConnectorPredicate
- *
- *
- */
-public class ProxyConnectorSelectionPredicate
-    implements Predicate<ProxyConnectorConfiguration>
-{
-    private String sourceId;
-
-    private String targetId;
-
-    public ProxyConnectorSelectionPredicate( String sourceId, String targetId )
-    {
-        this.sourceId = sourceId;
-        this.targetId = targetId;
-    }
-
-    @Override
-    public boolean evaluate( ProxyConnectorConfiguration object )
-    {
-        boolean satisfies = false;
-
-        if ( object != null )
-        {
-            ProxyConnectorConfiguration connector = object;
-            return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
-                                                                                                        connector.getTargetRepoId() ) );
-        }
-
-        return satisfies;
-    }
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/RepositoryConfigurationComparator.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/RepositoryConfigurationComparator.java
deleted file mode 100644 (file)
index 9e2b64e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
-
-import java.util.Comparator;
-
-/**
- * RepositoryConfigurationComparator
- *
- *
- */
-public class RepositoryConfigurationComparator
-    implements Comparator<AbstractRepositoryConfiguration>
-{
-    @Override
-    public int compare( AbstractRepositoryConfiguration o1, AbstractRepositoryConfiguration o2 )
-    {
-        if ( o1 == null && o2 == null )
-        {
-            return 0;
-        }
-
-        if ( o1 == null )
-        {
-            return -1;
-        }
-
-        if ( o2 == null )
-        {
-            return 1;
-        }
-
-        return o1.getId().compareToIgnoreCase( o2.getId() );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryReader.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryReader.java
deleted file mode 100644 (file)
index 27146f5..0000000
+++ /dev/null
@@ -1,1681 +0,0 @@
-
-package org.apache.archiva.configuration.io.registry;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.*;
-import org.apache.archiva.components.registry.Registry;
-
-import java.util.Iterator;
-import java.util.List;
-
-// Util imports
-// Model class imports
-
-
-/**
- * Generate Redback Registry input mechanism for model 'Configuration'.
- */
-public class ConfigurationRegistryReader {
-    public Configuration read(Registry registry) {
-        return readConfiguration("", registry);
-    }
-
-    private Configuration readConfiguration(String prefix, Registry registry) {
-        Configuration value = new Configuration();
-
-        //String version = registry.getString( prefix + "version", value.getVersion() );
-
-        List<String> versionList = registry.getList(prefix + "version");
-        String version = value.getVersion();
-        if (versionList != null && !versionList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = versionList.size(); i < size; i++) {
-                sb.append(versionList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            version = sb.toString();
-        }
-
-        value.setVersion(version);
-        //String metadataStore = registry.getString( prefix + "metadataStore", value.getMetadataStore() );
-
-        List<String> metadataStoreList = registry.getList(prefix + "metadataStore");
-        String metadataStore = value.getMetadataStore();
-        if (metadataStoreList != null && !metadataStoreList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = metadataStoreList.size(); i < size; i++) {
-                sb.append(metadataStoreList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            metadataStore = sb.toString();
-        }
-
-        value.setMetadataStore(metadataStore);
-        java.util.List repositoryGroups = new java.util.ArrayList/*<RepositoryGroupConfiguration>*/();
-        List repositoryGroupsSubsets = registry.getSubsetList(prefix + "repositoryGroups.repositoryGroup");
-        for (Iterator i = repositoryGroupsSubsets.iterator(); i.hasNext(); ) {
-            RepositoryGroupConfiguration v = readRepositoryGroupConfiguration("", (Registry) i.next());
-            repositoryGroups.add(v);
-        }
-        value.setRepositoryGroups(repositoryGroups);
-        java.util.List managedRepositories = new java.util.ArrayList/*<ManagedRepositoryConfiguration>*/();
-        List managedRepositoriesSubsets = registry.getSubsetList(prefix + "managedRepositories.managedRepository");
-        for (Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); ) {
-            ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration("", (Registry) i.next());
-            managedRepositories.add(v);
-        }
-        value.setManagedRepositories(managedRepositories);
-        java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
-        List remoteRepositoriesSubsets = registry.getSubsetList(prefix + "remoteRepositories.remoteRepository");
-        for (Iterator i = remoteRepositoriesSubsets.iterator(); i.hasNext(); ) {
-            RemoteRepositoryConfiguration v = readRemoteRepositoryConfiguration("", (Registry) i.next());
-            remoteRepositories.add(v);
-        }
-        value.setRemoteRepositories(remoteRepositories);
-        java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
-        List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
-        for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
-            ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
-            proxyConnectors.add(v);
-        }
-        value.setProxyConnectors(proxyConnectors);
-        java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
-        List networkProxiesSubsets = registry.getSubsetList(prefix + "networkProxies.networkProxy");
-        for (Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); ) {
-            NetworkProxyConfiguration v = readNetworkProxyConfiguration("", (Registry) i.next());
-            networkProxies.add(v);
-        }
-        value.setNetworkProxies(networkProxies);
-        java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
-        List legacyArtifactPathsSubsets = registry.getSubsetList(prefix + "legacyArtifactPaths.legacyArtifactPath");
-        for (Iterator i = legacyArtifactPathsSubsets.iterator(); i.hasNext(); ) {
-            LegacyArtifactPath v = readLegacyArtifactPath("", (Registry) i.next());
-            legacyArtifactPaths.add(v);
-        }
-        value.setLegacyArtifactPaths(legacyArtifactPaths);
-        RepositoryScanningConfiguration repositoryScanning = readRepositoryScanningConfiguration(prefix + "repositoryScanning.", registry);
-        value.setRepositoryScanning(repositoryScanning);
-        WebappConfiguration webapp = readWebappConfiguration(prefix + "webapp.", registry);
-        value.setWebapp(webapp);
-        OrganisationInformation organisationInfo = readOrganisationInformation(prefix + "organisationInfo.", registry);
-        value.setOrganisationInfo(organisationInfo);
-        NetworkConfiguration networkConfiguration = readNetworkConfiguration(prefix + "networkConfiguration.", registry);
-        value.setNetworkConfiguration(networkConfiguration);
-        RedbackRuntimeConfiguration redbackRuntimeConfiguration = readRedbackRuntimeConfiguration(prefix + "redbackRuntimeConfiguration.", registry);
-        value.setRedbackRuntimeConfiguration(redbackRuntimeConfiguration);
-        ArchivaRuntimeConfiguration archivaRuntimeConfiguration = readArchivaRuntimeConfiguration(prefix + "archivaRuntimeConfiguration.", registry);
-        value.setArchivaRuntimeConfiguration(archivaRuntimeConfiguration);
-        java.util.List proxyConnectorRuleConfigurations = new java.util.ArrayList/*<ProxyConnectorRuleConfiguration>*/();
-        List proxyConnectorRuleConfigurationsSubsets = registry.getSubsetList(prefix + "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration");
-        for (Iterator i = proxyConnectorRuleConfigurationsSubsets.iterator(); i.hasNext(); ) {
-            ProxyConnectorRuleConfiguration v = readProxyConnectorRuleConfiguration("", (Registry) i.next());
-            proxyConnectorRuleConfigurations.add(v);
-        }
-        value.setProxyConnectorRuleConfigurations(proxyConnectorRuleConfigurations);
-        ArchivaDefaultConfiguration archivaDefaultConfiguration = readArchivaDefaultConfiguration(prefix + "archivaDefaultConfiguration.", registry);
-        value.setArchivaDefaultConfiguration(archivaDefaultConfiguration);
-
-        return value;
-    }
-
-    private AbstractRepositoryConfiguration readAbstractRepositoryConfiguration(String prefix, Registry registry) {
-        AbstractRepositoryConfiguration value = new AbstractRepositoryConfiguration();
-
-        //String id = registry.getString( prefix + "id", value.getId() );
-
-        List<String> idList = registry.getList(prefix + "id");
-        String id = value.getId();
-        if (idList != null && !idList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = idList.size(); i < size; i++) {
-                sb.append(idList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            id = sb.toString();
-        }
-
-        value.setId(id);
-        //String type = registry.getString( prefix + "type", value.getType() );
-
-        List<String> typeList = registry.getList(prefix + "type");
-        String type = value.getType();
-        if (typeList != null && !typeList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = typeList.size(); i < size; i++) {
-                sb.append(typeList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            type = sb.toString();
-        }
-
-        value.setType(type);
-        //String name = registry.getString( prefix + "name", value.getName() );
-
-        List<String> nameList = registry.getList(prefix + "name");
-        String name = value.getName();
-        if (nameList != null && !nameList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = nameList.size(); i < size; i++) {
-                sb.append(nameList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            name = sb.toString();
-        }
-
-        value.setName(name);
-        //String layout = registry.getString( prefix + "layout", value.getLayout() );
-
-        List<String> layoutList = registry.getList(prefix + "layout");
-        String layout = value.getLayout();
-        if (layoutList != null && !layoutList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = layoutList.size(); i < size; i++) {
-                sb.append(layoutList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            layout = sb.toString();
-        }
-
-        value.setLayout(layout);
-        //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
-
-        List<String> indexDirList = registry.getList(prefix + "indexDir");
-        String indexDir = value.getIndexDir();
-        if (indexDirList != null && !indexDirList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = indexDirList.size(); i < size; i++) {
-                sb.append(indexDirList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            indexDir = sb.toString();
-        }
-
-        value.setIndexDir(indexDir);
-        //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
-
-        List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
-        String packedIndexDir = value.getPackedIndexDir();
-        if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
-                sb.append(packedIndexDirList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            packedIndexDir = sb.toString();
-        }
-
-        value.setPackedIndexDir(packedIndexDir);
-        //String description = registry.getString( prefix + "description", value.getDescription() );
-
-        List<String> descriptionList = registry.getList(prefix + "description");
-        String description = value.getDescription();
-        if (descriptionList != null && !descriptionList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = descriptionList.size(); i < size; i++) {
-                sb.append(descriptionList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            description = sb.toString();
-        }
-
-        value.setDescription(description);
-
-        return value;
-    }
-
-    private RemoteRepositoryConfiguration readRemoteRepositoryConfiguration(String prefix, Registry registry) {
-        RemoteRepositoryConfiguration value = new RemoteRepositoryConfiguration();
-
-        //String url = registry.getString( prefix + "url", value.getUrl() );
-
-        List<String> urlList = registry.getList(prefix + "url");
-        String url = value.getUrl();
-        if (urlList != null && !urlList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = urlList.size(); i < size; i++) {
-                sb.append(urlList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            url = sb.toString();
-        }
-
-        value.setUrl(url);
-        //String username = registry.getString( prefix + "username", value.getUsername() );
-
-        List<String> usernameList = registry.getList(prefix + "username");
-        String username = value.getUsername();
-        if (usernameList != null && !usernameList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = usernameList.size(); i < size; i++) {
-                sb.append(usernameList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            username = sb.toString();
-        }
-
-        value.setUsername(username);
-        //String password = registry.getString( prefix + "password", value.getPassword() );
-
-        List<String> passwordList = registry.getList(prefix + "password");
-        String password = value.getPassword();
-        if (passwordList != null && !passwordList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = passwordList.size(); i < size; i++) {
-                sb.append(passwordList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            password = sb.toString();
-        }
-
-        value.setPassword(password);
-        int timeout = registry.getInt(prefix + "timeout", value.getTimeout());
-        value.setTimeout(timeout);
-        //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
-
-        List<String> refreshCronExpressionList = registry.getList(prefix + "refreshCronExpression");
-        String refreshCronExpression = value.getRefreshCronExpression();
-        if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = refreshCronExpressionList.size(); i < size; i++) {
-                sb.append(refreshCronExpressionList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            refreshCronExpression = sb.toString();
-        }
-
-        value.setRefreshCronExpression(refreshCronExpression);
-        boolean downloadRemoteIndex = registry.getBoolean(prefix + "downloadRemoteIndex", value.isDownloadRemoteIndex());
-        value.setDownloadRemoteIndex(downloadRemoteIndex);
-        //String remoteIndexUrl = registry.getString( prefix + "remoteIndexUrl", value.getRemoteIndexUrl() );
-
-        List<String> remoteIndexUrlList = registry.getList(prefix + "remoteIndexUrl");
-        String remoteIndexUrl = value.getRemoteIndexUrl();
-        if (remoteIndexUrlList != null && !remoteIndexUrlList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = remoteIndexUrlList.size(); i < size; i++) {
-                sb.append(remoteIndexUrlList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            remoteIndexUrl = sb.toString();
-        }
-
-        value.setRemoteIndexUrl(remoteIndexUrl);
-        //String remoteDownloadNetworkProxyId = registry.getString( prefix + "remoteDownloadNetworkProxyId", value.getRemoteDownloadNetworkProxyId() );
-
-        List<String> remoteDownloadNetworkProxyIdList = registry.getList(prefix + "remoteDownloadNetworkProxyId");
-        String remoteDownloadNetworkProxyId = value.getRemoteDownloadNetworkProxyId();
-        if (remoteDownloadNetworkProxyIdList != null && !remoteDownloadNetworkProxyIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = remoteDownloadNetworkProxyIdList.size(); i < size; i++) {
-                sb.append(remoteDownloadNetworkProxyIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            remoteDownloadNetworkProxyId = sb.toString();
-        }
-
-        value.setRemoteDownloadNetworkProxyId(remoteDownloadNetworkProxyId);
-        int remoteDownloadTimeout = registry.getInt(prefix + "remoteDownloadTimeout", value.getRemoteDownloadTimeout());
-        value.setRemoteDownloadTimeout(remoteDownloadTimeout);
-        boolean downloadRemoteIndexOnStartup = registry.getBoolean(prefix + "downloadRemoteIndexOnStartup", value.isDownloadRemoteIndexOnStartup());
-        value.setDownloadRemoteIndexOnStartup(downloadRemoteIndexOnStartup);
-        java.util.Map extraParameters = registry.getProperties(prefix + "extraParameters");
-        value.setExtraParameters(extraParameters);
-        java.util.Map extraHeaders = registry.getProperties(prefix + "extraHeaders");
-        value.setExtraHeaders(extraHeaders);
-        //String checkPath = registry.getString( prefix + "checkPath", value.getCheckPath() );
-
-        List<String> checkPathList = registry.getList(prefix + "checkPath");
-        String checkPath = value.getCheckPath();
-        if (checkPathList != null && !checkPathList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = checkPathList.size(); i < size; i++) {
-                sb.append(checkPathList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            checkPath = sb.toString();
-        }
-
-        value.setCheckPath(checkPath);
-        //String id = registry.getString( prefix + "id", value.getId() );
-
-        List<String> idList = registry.getList(prefix + "id");
-        String id = value.getId();
-        if (idList != null && !idList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = idList.size(); i < size; i++) {
-                sb.append(idList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            id = sb.toString();
-        }
-
-        value.setId(id);
-        //String type = registry.getString( prefix + "type", value.getType() );
-
-        List<String> typeList = registry.getList(prefix + "type");
-        String type = value.getType();
-        if (typeList != null && !typeList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = typeList.size(); i < size; i++) {
-                sb.append(typeList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            type = sb.toString();
-        }
-
-        value.setType(type);
-        //String name = registry.getString( prefix + "name", value.getName() );
-
-        List<String> nameList = registry.getList(prefix + "name");
-        String name = value.getName();
-        if (nameList != null && !nameList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = nameList.size(); i < size; i++) {
-                sb.append(nameList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            name = sb.toString();
-        }
-
-        value.setName(name);
-        //String layout = registry.getString( prefix + "layout", value.getLayout() );
-
-        List<String> layoutList = registry.getList(prefix + "layout");
-        String layout = value.getLayout();
-        if (layoutList != null && !layoutList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = layoutList.size(); i < size; i++) {
-                sb.append(layoutList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            layout = sb.toString();
-        }
-
-        value.setLayout(layout);
-        //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
-
-        List<String> indexDirList = registry.getList(prefix + "indexDir");
-        String indexDir = value.getIndexDir();
-        if (indexDirList != null && !indexDirList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = indexDirList.size(); i < size; i++) {
-                sb.append(indexDirList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            indexDir = sb.toString();
-        }
-
-        value.setIndexDir(indexDir);
-        //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
-
-        List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
-        String packedIndexDir = value.getPackedIndexDir();
-        if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
-                sb.append(packedIndexDirList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            packedIndexDir = sb.toString();
-        }
-
-        value.setPackedIndexDir(packedIndexDir);
-        //String description = registry.getString( prefix + "description", value.getDescription() );
-
-        List<String> descriptionList = registry.getList(prefix + "description");
-        String description = value.getDescription();
-        if (descriptionList != null && !descriptionList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = descriptionList.size(); i < size; i++) {
-                sb.append(descriptionList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            description = sb.toString();
-        }
-
-        value.setDescription(description);
-
-        return value;
-    }
-
-    private ManagedRepositoryConfiguration readManagedRepositoryConfiguration(String prefix, Registry registry) {
-        ManagedRepositoryConfiguration value = new ManagedRepositoryConfiguration();
-
-        //String location = registry.getString( prefix + "location", value.getLocation() );
-
-        List<String> locationList = registry.getList(prefix + "location");
-        String location = value.getLocation();
-        if (locationList != null && !locationList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = locationList.size(); i < size; i++) {
-                sb.append(locationList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            location = sb.toString();
-        }
-
-        value.setLocation(location);
-        boolean releases = registry.getBoolean(prefix + "releases", value.isReleases());
-        value.setReleases(releases);
-        boolean blockRedeployments = registry.getBoolean(prefix + "blockRedeployments", value.isBlockRedeployments());
-        value.setBlockRedeployments(blockRedeployments);
-        boolean snapshots = registry.getBoolean(prefix + "snapshots", value.isSnapshots());
-        value.setSnapshots(snapshots);
-        boolean scanned = registry.getBoolean(prefix + "scanned", value.isScanned());
-        value.setScanned(scanned);
-        //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
-
-        List<String> refreshCronExpressionList = registry.getList(prefix + "refreshCronExpression");
-        String refreshCronExpression = value.getRefreshCronExpression();
-        if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = refreshCronExpressionList.size(); i < size; i++) {
-                sb.append(refreshCronExpressionList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            refreshCronExpression = sb.toString();
-        }
-
-        value.setRefreshCronExpression(refreshCronExpression);
-        int retentionCount = registry.getInt(prefix + "retentionCount", value.getRetentionCount());
-        value.setRetentionCount(retentionCount);
-        int retentionPeriod = registry.getInt(prefix + "retentionPeriod", value.getRetentionPeriod());
-        value.setRetentionPeriod(retentionPeriod);
-        boolean deleteReleasedSnapshots = registry.getBoolean(prefix + "deleteReleasedSnapshots", value.isDeleteReleasedSnapshots());
-        value.setDeleteReleasedSnapshots(deleteReleasedSnapshots);
-        boolean skipPackedIndexCreation = registry.getBoolean(prefix + "skipPackedIndexCreation", value.isSkipPackedIndexCreation());
-        value.setSkipPackedIndexCreation(skipPackedIndexCreation);
-        boolean stageRepoNeeded = registry.getBoolean(prefix + "stageRepoNeeded", value.isStageRepoNeeded());
-        value.setStageRepoNeeded(stageRepoNeeded);
-        //String id = registry.getString( prefix + "id", value.getId() );
-
-        List<String> idList = registry.getList(prefix + "id");
-        String id = value.getId();
-        if (idList != null && !idList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = idList.size(); i < size; i++) {
-                sb.append(idList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            id = sb.toString();
-        }
-
-        value.setId(id);
-        //String type = registry.getString( prefix + "type", value.getType() );
-
-        List<String> typeList = registry.getList(prefix + "type");
-        String type = value.getType();
-        if (typeList != null && !typeList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = typeList.size(); i < size; i++) {
-                sb.append(typeList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            type = sb.toString();
-        }
-
-        value.setType(type);
-        //String name = registry.getString( prefix + "name", value.getName() );
-
-        List<String> nameList = registry.getList(prefix + "name");
-        String name = value.getName();
-        if (nameList != null && !nameList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = nameList.size(); i < size; i++) {
-                sb.append(nameList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            name = sb.toString();
-        }
-
-        value.setName(name);
-        //String layout = registry.getString( prefix + "layout", value.getLayout() );
-
-        List<String> layoutList = registry.getList(prefix + "layout");
-        String layout = value.getLayout();
-        if (layoutList != null && !layoutList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = layoutList.size(); i < size; i++) {
-                sb.append(layoutList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            layout = sb.toString();
-        }
-
-        value.setLayout(layout);
-        //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
-
-        List<String> indexDirList = registry.getList(prefix + "indexDir");
-        String indexDir = value.getIndexDir();
-        if (indexDirList != null && !indexDirList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = indexDirList.size(); i < size; i++) {
-                sb.append(indexDirList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            indexDir = sb.toString();
-        }
-
-        value.setIndexDir(indexDir);
-        //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
-
-        List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
-        String packedIndexDir = value.getPackedIndexDir();
-        if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
-                sb.append(packedIndexDirList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            packedIndexDir = sb.toString();
-        }
-
-        value.setPackedIndexDir(packedIndexDir);
-        //String description = registry.getString( prefix + "description", value.getDescription() );
-
-        List<String> descriptionList = registry.getList(prefix + "description");
-        String description = value.getDescription();
-        if (descriptionList != null && !descriptionList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = descriptionList.size(); i < size; i++) {
-                sb.append(descriptionList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            description = sb.toString();
-        }
-
-        value.setDescription(description);
-
-        return value;
-    }
-
-    private LegacyArtifactPath readLegacyArtifactPath(String prefix, Registry registry) {
-        LegacyArtifactPath value = new LegacyArtifactPath();
-
-        //String path = registry.getString( prefix + "path", value.getPath() );
-
-        List<String> pathList = registry.getList(prefix + "path");
-        String path = value.getPath();
-        if (pathList != null && !pathList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = pathList.size(); i < size; i++) {
-                sb.append(pathList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            path = sb.toString();
-        }
-
-        value.setPath(path);
-        //String artifact = registry.getString( prefix + "artifact", value.getArtifact() );
-
-        List<String> artifactList = registry.getList(prefix + "artifact");
-        String artifact = value.getArtifact();
-        if (artifactList != null && !artifactList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = artifactList.size(); i < size; i++) {
-                sb.append(artifactList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            artifact = sb.toString();
-        }
-
-        value.setArtifact(artifact);
-
-        return value;
-    }
-
-    private RepositoryGroupConfiguration readRepositoryGroupConfiguration(String prefix, Registry registry) {
-        RepositoryGroupConfiguration value = new RepositoryGroupConfiguration();
-
-        //String id = registry.getString( prefix + "id", value.getId() );
-
-        List<String> idList = registry.getList(prefix + "id");
-        String id = value.getId();
-        if (idList != null && !idList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = idList.size(); i < size; i++) {
-                sb.append(idList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            id = sb.toString();
-        }
-
-        value.setId(id);
-
-        value.setName(registry.getString(prefix + "name"));
-        value.setType(registry.getString(prefix + "type"));
-
-        //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() );
-
-        List<String> mergedIndexPathList = registry.getList(prefix + "mergedIndexPath");
-        String mergedIndexPath = value.getMergedIndexPath();
-        if (mergedIndexPathList != null && !mergedIndexPathList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = mergedIndexPathList.size(); i < size; i++) {
-                sb.append(mergedIndexPathList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            mergedIndexPath = sb.toString();
-        }
-
-        value.setMergedIndexPath(mergedIndexPath);
-        int mergedIndexTtl = registry.getInt(prefix + "mergedIndexTtl", value.getMergedIndexTtl());
-        value.setMergedIndexTtl(mergedIndexTtl);
-        //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
-
-        value.setLocation( registry.getString( prefix + "location" ) );
-
-        List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
-        String cronExpression = value.getCronExpression();
-        if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
-                sb.append(cronExpressionList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            cronExpression = sb.toString();
-        }
-
-        value.setCronExpression(cronExpression);
-        java.util.List repositories = new java.util.ArrayList/*<String>*/();
-        repositories.addAll(registry.getList(prefix + "repositories.repository"));
-        value.setRepositories(repositories);
-
-        return value;
-    }
-
-    private RepositoryCheckPath readRepositoryCheckPath(String prefix, Registry registry) {
-        RepositoryCheckPath value = new RepositoryCheckPath();
-
-        //String url = registry.getString( prefix + "url", value.getUrl() );
-
-        List<String> urlList = registry.getList(prefix + "url");
-        String url = value.getUrl();
-        if (urlList != null && !urlList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = urlList.size(); i < size; i++) {
-                sb.append(urlList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            url = sb.toString();
-        }
-
-        value.setUrl(url);
-        //String path = registry.getString( prefix + "path", value.getPath() );
-
-        List<String> pathList = registry.getList(prefix + "path");
-        String path = value.getPath();
-        if (pathList != null && !pathList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = pathList.size(); i < size; i++) {
-                sb.append(pathList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            path = sb.toString();
-        }
-
-        value.setPath(path);
-
-        return value;
-    }
-
-    private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration(String prefix, Registry registry) {
-        AbstractRepositoryConnectorConfiguration value = new AbstractRepositoryConnectorConfiguration();
-
-        //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
-
-        List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
-        String sourceRepoId = value.getSourceRepoId();
-        if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
-                sb.append(sourceRepoIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            sourceRepoId = sb.toString();
-        }
-
-        value.setSourceRepoId(sourceRepoId);
-        //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
-
-        List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
-        String targetRepoId = value.getTargetRepoId();
-        if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
-                sb.append(targetRepoIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            targetRepoId = sb.toString();
-        }
-
-        value.setTargetRepoId(targetRepoId);
-        //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
-
-        List<String> proxyIdList = registry.getList(prefix + "proxyId");
-        String proxyId = value.getProxyId();
-        if (proxyIdList != null && !proxyIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = proxyIdList.size(); i < size; i++) {
-                sb.append(proxyIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            proxyId = sb.toString();
-        }
-
-        value.setProxyId(proxyId);
-        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
-        blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
-        value.setBlackListPatterns(blackListPatterns);
-        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
-        whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
-        value.setWhiteListPatterns(whiteListPatterns);
-        java.util.Map policies = registry.getProperties(prefix + "policies");
-        value.setPolicies(policies);
-        java.util.Map properties = registry.getProperties(prefix + "properties");
-        value.setProperties(properties);
-        boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
-        value.setDisabled(disabled);
-
-        return value;
-    }
-
-    private ProxyConnectorRuleConfiguration readProxyConnectorRuleConfiguration(String prefix, Registry registry) {
-        ProxyConnectorRuleConfiguration value = new ProxyConnectorRuleConfiguration();
-
-        //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() );
-
-        List<String> ruleTypeList = registry.getList(prefix + "ruleType");
-        String ruleType = value.getRuleType();
-        if (ruleTypeList != null && !ruleTypeList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = ruleTypeList.size(); i < size; i++) {
-                sb.append(ruleTypeList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            ruleType = sb.toString();
-        }
-
-        value.setRuleType(ruleType);
-        //String pattern = registry.getString( prefix + "pattern", value.getPattern() );
-
-        List<String> patternList = registry.getList(prefix + "pattern");
-        String pattern = value.getPattern();
-        if (patternList != null && !patternList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = patternList.size(); i < size; i++) {
-                sb.append(patternList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            pattern = sb.toString();
-        }
-
-        value.setPattern(pattern);
-        java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
-        List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
-        for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
-            ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
-            proxyConnectors.add(v);
-        }
-        value.setProxyConnectors(proxyConnectors);
-
-        return value;
-    }
-
-    private ProxyConnectorConfiguration readProxyConnectorConfiguration(String prefix, Registry registry) {
-        ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();
-
-        int order = registry.getInt(prefix + "order", value.getOrder());
-        value.setOrder(order);
-        //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
-
-        List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
-        String sourceRepoId = value.getSourceRepoId();
-        if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
-                sb.append(sourceRepoIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            sourceRepoId = sb.toString();
-        }
-
-        value.setSourceRepoId(sourceRepoId);
-        //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
-
-        List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
-        String targetRepoId = value.getTargetRepoId();
-        if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
-                sb.append(targetRepoIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            targetRepoId = sb.toString();
-        }
-
-        value.setTargetRepoId(targetRepoId);
-        //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
-
-        List<String> proxyIdList = registry.getList(prefix + "proxyId");
-        String proxyId = value.getProxyId();
-        if (proxyIdList != null && !proxyIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = proxyIdList.size(); i < size; i++) {
-                sb.append(proxyIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            proxyId = sb.toString();
-        }
-
-        value.setProxyId(proxyId);
-        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
-        blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
-        value.setBlackListPatterns(blackListPatterns);
-        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
-        whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
-        value.setWhiteListPatterns(whiteListPatterns);
-        java.util.Map policies = registry.getProperties(prefix + "policies");
-        value.setPolicies(policies);
-        java.util.Map properties = registry.getProperties(prefix + "properties");
-        value.setProperties(properties);
-        boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
-        value.setDisabled(disabled);
-
-        return value;
-    }
-
-    private SyncConnectorConfiguration readSyncConnectorConfiguration(String prefix, Registry registry) {
-        SyncConnectorConfiguration value = new SyncConnectorConfiguration();
-
-        //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
-
-        List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
-        String cronExpression = value.getCronExpression();
-        if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
-                sb.append(cronExpressionList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            cronExpression = sb.toString();
-        }
-
-        value.setCronExpression(cronExpression);
-        //String method = registry.getString( prefix + "method", value.getMethod() );
-
-        List<String> methodList = registry.getList(prefix + "method");
-        String method = value.getMethod();
-        if (methodList != null && !methodList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = methodList.size(); i < size; i++) {
-                sb.append(methodList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            method = sb.toString();
-        }
-
-        value.setMethod(method);
-        //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
-
-        List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
-        String sourceRepoId = value.getSourceRepoId();
-        if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
-                sb.append(sourceRepoIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            sourceRepoId = sb.toString();
-        }
-
-        value.setSourceRepoId(sourceRepoId);
-        //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
-
-        List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
-        String targetRepoId = value.getTargetRepoId();
-        if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
-                sb.append(targetRepoIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            targetRepoId = sb.toString();
-        }
-
-        value.setTargetRepoId(targetRepoId);
-        //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
-
-        List<String> proxyIdList = registry.getList(prefix + "proxyId");
-        String proxyId = value.getProxyId();
-        if (proxyIdList != null && !proxyIdList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = proxyIdList.size(); i < size; i++) {
-                sb.append(proxyIdList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            proxyId = sb.toString();
-        }
-
-        value.setProxyId(proxyId);
-        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
-        blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
-        value.setBlackListPatterns(blackListPatterns);
-        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
-        whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
-        value.setWhiteListPatterns(whiteListPatterns);
-        java.util.Map policies = registry.getProperties(prefix + "policies");
-        value.setPolicies(policies);
-        java.util.Map properties = registry.getProperties(prefix + "properties");
-        value.setProperties(properties);
-        boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
-        value.setDisabled(disabled);
-
-        return value;
-    }
-
-    private NetworkProxyConfiguration readNetworkProxyConfiguration(String prefix, Registry registry) {
-        NetworkProxyConfiguration value = new NetworkProxyConfiguration();
-
-        //String id = registry.getString( prefix + "id", value.getId() );
-
-        List<String> idList = registry.getList(prefix + "id");
-        String id = value.getId();
-        if (idList != null && !idList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = idList.size(); i < size; i++) {
-                sb.append(idList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            id = sb.toString();
-        }
-
-        value.setId(id);
-        //String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
-
-        List<String> protocolList = registry.getList(prefix + "protocol");
-        String protocol = value.getProtocol();
-        if (protocolList != null && !protocolList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = protocolList.size(); i < size; i++) {
-                sb.append(protocolList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            protocol = sb.toString();
-        }
-
-        value.setProtocol(protocol);
-        //String host = registry.getString( prefix + "host", value.getHost() );
-
-        List<String> hostList = registry.getList(prefix + "host");
-        String host = value.getHost();
-        if (hostList != null && !hostList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = hostList.size(); i < size; i++) {
-                sb.append(hostList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            host = sb.toString();
-        }
-
-        value.setHost(host);
-        int port = registry.getInt(prefix + "port", value.getPort());
-        value.setPort(port);
-        //String username = registry.getString( prefix + "username", value.getUsername() );
-
-        List<String> usernameList = registry.getList(prefix + "username");
-        String username = value.getUsername();
-        if (usernameList != null && !usernameList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = usernameList.size(); i < size; i++) {
-                sb.append(usernameList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            username = sb.toString();
-        }
-
-        value.setUsername(username);
-        //String password = registry.getString( prefix + "password", value.getPassword() );
-
-        List<String> passwordList = registry.getList(prefix + "password");
-        String password = value.getPassword();
-        if (passwordList != null && !passwordList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = passwordList.size(); i < size; i++) {
-                sb.append(passwordList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            password = sb.toString();
-        }
-
-        value.setPassword(password);
-        boolean useNtlm = registry.getBoolean(prefix + "useNtlm", value.isUseNtlm());
-        value.setUseNtlm(useNtlm);
-
-        return value;
-    }
-
-    private RepositoryScanningConfiguration readRepositoryScanningConfiguration(String prefix, Registry registry) {
-        RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();
-
-        java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
-        List fileTypesSubsets = registry.getSubsetList(prefix + "fileTypes.fileType");
-        for (Iterator i = fileTypesSubsets.iterator(); i.hasNext(); ) {
-            FileType v = readFileType("", (Registry) i.next());
-            fileTypes.add(v);
-        }
-        value.setFileTypes(fileTypes);
-        java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
-        knownContentConsumers.addAll(registry.getList(prefix + "knownContentConsumers.knownContentConsumer"));
-        value.setKnownContentConsumers(knownContentConsumers);
-        java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
-        invalidContentConsumers.addAll(registry.getList(prefix + "invalidContentConsumers.invalidContentConsumer"));
-        value.setInvalidContentConsumers(invalidContentConsumers);
-
-        return value;
-    }
-
-    private FileType readFileType(String prefix, Registry registry) {
-        FileType value = new FileType();
-
-        //String id = registry.getString( prefix + "id", value.getId() );
-
-        List<String> idList = registry.getList(prefix + "id");
-        String id = value.getId();
-        if (idList != null && !idList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = idList.size(); i < size; i++) {
-                sb.append(idList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            id = sb.toString();
-        }
-
-        value.setId(id);
-        java.util.List patterns = new java.util.ArrayList/*<String>*/();
-        patterns.addAll(registry.getList(prefix + "patterns.pattern"));
-        value.setPatterns(patterns);
-
-        return value;
-    }
-
-    private OrganisationInformation readOrganisationInformation(String prefix, Registry registry) {
-        OrganisationInformation value = new OrganisationInformation();
-
-        //String name = registry.getString( prefix + "name", value.getName() );
-
-        List<String> nameList = registry.getList(prefix + "name");
-        String name = value.getName();
-        if (nameList != null && !nameList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = nameList.size(); i < size; i++) {
-                sb.append(nameList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            name = sb.toString();
-        }
-
-        value.setName(name);
-        //String url = registry.getString( prefix + "url", value.getUrl() );
-
-        List<String> urlList = registry.getList(prefix + "url");
-        String url = value.getUrl();
-        if (urlList != null && !urlList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = urlList.size(); i < size; i++) {
-                sb.append(urlList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            url = sb.toString();
-        }
-
-        value.setUrl(url);
-        //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() );
-
-        List<String> logoLocationList = registry.getList(prefix + "logoLocation");
-        String logoLocation = value.getLogoLocation();
-        if (logoLocationList != null && !logoLocationList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = logoLocationList.size(); i < size; i++) {
-                sb.append(logoLocationList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            logoLocation = sb.toString();
-        }
-
-        value.setLogoLocation(logoLocation);
-
-        return value;
-    }
-
-    private WebappConfiguration readWebappConfiguration(String prefix, Registry registry) {
-        WebappConfiguration value = new WebappConfiguration();
-
-        UserInterfaceOptions ui = readUserInterfaceOptions(prefix + "ui.", registry);
-        value.setUi(ui);
-
-        return value;
-    }
-
-    private UserInterfaceOptions readUserInterfaceOptions(String prefix, Registry registry) {
-        UserInterfaceOptions value = new UserInterfaceOptions();
-
-        boolean showFindArtifacts = registry.getBoolean(prefix + "showFindArtifacts", value.isShowFindArtifacts());
-        value.setShowFindArtifacts(showFindArtifacts);
-        boolean appletFindEnabled = registry.getBoolean(prefix + "appletFindEnabled", value.isAppletFindEnabled());
-        value.setAppletFindEnabled(appletFindEnabled);
-        boolean disableEasterEggs = registry.getBoolean(prefix + "disableEasterEggs", value.isDisableEasterEggs());
-        value.setDisableEasterEggs(disableEasterEggs);
-        //String applicationUrl = registry.getString( prefix + "applicationUrl", value.getApplicationUrl() );
-
-        List<String> applicationUrlList = registry.getList(prefix + "applicationUrl");
-        String applicationUrl = value.getApplicationUrl();
-        if (applicationUrlList != null && !applicationUrlList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = applicationUrlList.size(); i < size; i++) {
-                sb.append(applicationUrlList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            applicationUrl = sb.toString();
-        }
-
-        value.setApplicationUrl(applicationUrl);
-        boolean disableRegistration = registry.getBoolean(prefix + "disableRegistration", value.isDisableRegistration());
-        value.setDisableRegistration(disableRegistration);
-
-        return value;
-    }
-
-    private NetworkConfiguration readNetworkConfiguration(String prefix, Registry registry) {
-        NetworkConfiguration value = new NetworkConfiguration();
-
-        int maxTotal = registry.getInt(prefix + "maxTotal", value.getMaxTotal());
-        value.setMaxTotal(maxTotal);
-        int maxTotalPerHost = registry.getInt(prefix + "maxTotalPerHost", value.getMaxTotalPerHost());
-        value.setMaxTotalPerHost(maxTotalPerHost);
-        boolean usePooling = registry.getBoolean(prefix + "usePooling", value.isUsePooling());
-        value.setUsePooling(usePooling);
-
-        return value;
-    }
-
-    private ArchivaRuntimeConfiguration readArchivaRuntimeConfiguration(String prefix, Registry registry) {
-        ArchivaRuntimeConfiguration value = new ArchivaRuntimeConfiguration();
-
-        CacheConfiguration urlFailureCacheConfiguration = readCacheConfiguration(prefix + "urlFailureCacheConfiguration.", registry);
-        value.setUrlFailureCacheConfiguration(urlFailureCacheConfiguration);
-        FileLockConfiguration fileLockConfiguration = readFileLockConfiguration(prefix + "fileLockConfiguration.", registry);
-        value.setFileLockConfiguration(fileLockConfiguration);
-        //String dataDirectory = registry.getString( prefix + "dataDirectory", value.getDataDirectory() );
-
-        List<String> dataDirectoryList = registry.getList(prefix + "dataDirectory");
-        String dataDirectory = value.getDataDirectory();
-        if (dataDirectoryList != null && !dataDirectoryList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = dataDirectoryList.size(); i < size; i++) {
-                sb.append(dataDirectoryList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            dataDirectory = sb.toString();
-        }
-
-        value.setDataDirectory(dataDirectory);
-        //String repositoryBaseDirectory = registry.getString( prefix + "repositoryBaseDirectory", value.getRepositoryBaseDirectory() );
-
-        List<String> repositoryBaseDirectoryList = registry.getList(prefix + "repositoryBaseDirectory");
-        String repositoryBaseDirectory = value.getRepositoryBaseDirectory();
-        if (repositoryBaseDirectoryList != null && !repositoryBaseDirectoryList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = repositoryBaseDirectoryList.size(); i < size; i++) {
-                sb.append(repositoryBaseDirectoryList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            repositoryBaseDirectory = sb.toString();
-        }
-
-        value.setRepositoryBaseDirectory(repositoryBaseDirectory);
-        //String remoteRepositoryBaseDirectory = registry.getString( prefix + "remoteRepositoryBaseDirectory", value.getRemoteRepositoryBaseDirectory() );
-
-        List<String> remoteRepositoryBaseDirectoryList = registry.getList(prefix + "remoteRepositoryBaseDirectory");
-        String remoteRepositoryBaseDirectory = value.getRemoteRepositoryBaseDirectory();
-        if (remoteRepositoryBaseDirectoryList != null && !remoteRepositoryBaseDirectoryList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = remoteRepositoryBaseDirectoryList.size(); i < size; i++) {
-                sb.append(remoteRepositoryBaseDirectoryList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            remoteRepositoryBaseDirectory = sb.toString();
-        }
-
-        value.setRemoteRepositoryBaseDirectory(remoteRepositoryBaseDirectory);
-        //String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() );
-
-
-        List<String> repositoryGroupBaseDirectoryList = registry.getList(prefix + "repositoryGroupBaseDirectory");
-        String repositoryGroupBaseDirectory = value.getRepositoryGroupBaseDirectory();
-        if (repositoryGroupBaseDirectoryList != null && !repositoryGroupBaseDirectoryList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = repositoryGroupBaseDirectoryList.size(); i < size; i++) {
-                sb.append(repositoryGroupBaseDirectoryList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            repositoryGroupBaseDirectory = sb.toString();
-        }
-
-        value.setRepositoryGroupBaseDirectory(repositoryGroupBaseDirectory);
-
-        List<String> defaultLanguageList = registry.getList(prefix + "defaultLanguage");
-        String defaultLanguage = value.getDefaultLanguage();
-        if (defaultLanguageList != null && !defaultLanguageList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = defaultLanguageList.size(); i < size; i++) {
-                sb.append(defaultLanguageList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            defaultLanguage = sb.toString();
-        }
-
-        value.setDefaultLanguage(defaultLanguage);
-        //String languageRange = registry.getString( prefix + "languageRange", value.getLanguageRange() );
-
-        List<String> languageRangeList = registry.getList(prefix + "languageRange");
-        String languageRange = value.getLanguageRange();
-        if (languageRangeList != null && !languageRangeList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = languageRangeList.size(); i < size; i++) {
-                sb.append(languageRangeList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            languageRange = sb.toString();
-        }
-
-        value.setLanguageRange(languageRange);
-
-        List<String> checksumTypeList = registry.getList(prefix + "checksumTypes.type");
-        value.setChecksumTypes(checksumTypeList);
-
-        return value;
-    }
-
-    private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration(String prefix, Registry registry) {
-        RedbackRuntimeConfiguration value = new RedbackRuntimeConfiguration();
-
-        boolean migratedFromRedbackConfiguration = registry.getBoolean(prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration());
-        value.setMigratedFromRedbackConfiguration(migratedFromRedbackConfiguration);
-        java.util.List userManagerImpls = new java.util.ArrayList/*<String>*/();
-        userManagerImpls.addAll(registry.getList(prefix + "userManagerImpls.userManagerImpl"));
-        value.setUserManagerImpls(userManagerImpls);
-        java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
-        rbacManagerImpls.addAll(registry.getList(prefix + "rbacManagerImpls.rbacManagerImpl"));
-        value.setRbacManagerImpls(rbacManagerImpls);
-        LdapConfiguration ldapConfiguration = readLdapConfiguration(prefix + "ldapConfiguration.", registry);
-        value.setLdapConfiguration(ldapConfiguration);
-        java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
-        List ldapGroupMappingsSubsets = registry.getSubsetList(prefix + "ldapGroupMappings.ldapGroupMapping");
-        for (Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); ) {
-            LdapGroupMapping v = readLdapGroupMapping("", (Registry) i.next());
-            ldapGroupMappings.add(v);
-        }
-        value.setLdapGroupMappings(ldapGroupMappings);
-        java.util.Map configurationProperties = registry.getProperties(prefix + "configurationProperties");
-        value.setConfigurationProperties(configurationProperties);
-        boolean useUsersCache = registry.getBoolean(prefix + "useUsersCache", value.isUseUsersCache());
-        value.setUseUsersCache(useUsersCache);
-        CacheConfiguration usersCacheConfiguration = readCacheConfiguration(prefix + "usersCacheConfiguration.", registry);
-        value.setUsersCacheConfiguration(usersCacheConfiguration);
-
-        return value;
-    }
-
-    private ArchivaDefaultConfiguration readArchivaDefaultConfiguration(String prefix, Registry registry) {
-        ArchivaDefaultConfiguration value = new ArchivaDefaultConfiguration();
-
-        java.util.List defaultCheckPaths = new java.util.ArrayList/*<RepositoryCheckPath>*/();
-        List defaultCheckPathsSubsets = registry.getSubsetList(prefix + "defaultCheckPaths.defaultCheckPath");
-        for (Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); ) {
-            RepositoryCheckPath v = readRepositoryCheckPath("", (Registry) i.next());
-            defaultCheckPaths.add(v);
-        }
-        value.setDefaultCheckPaths(defaultCheckPaths);
-
-        return value;
-    }
-
-    private LdapConfiguration readLdapConfiguration(String prefix, Registry registry) {
-        LdapConfiguration value = new LdapConfiguration();
-
-        //String hostName = registry.getString( prefix + "hostName", value.getHostName() );
-
-        List<String> hostNameList = registry.getList(prefix + "hostName");
-        String hostName = value.getHostName();
-        if (hostNameList != null && !hostNameList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = hostNameList.size(); i < size; i++) {
-                sb.append(hostNameList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            hostName = sb.toString();
-        }
-
-        value.setHostName(hostName);
-        int port = registry.getInt(prefix + "port", value.getPort());
-        value.setPort(port);
-        boolean ssl = registry.getBoolean(prefix + "ssl", value.isSsl());
-        value.setSsl(ssl);
-        //String baseDn = registry.getString( prefix + "baseDn", value.getBaseDn() );
-
-        List<String> baseDnList = registry.getList(prefix + "baseDn");
-        String baseDn = value.getBaseDn();
-        if (baseDnList != null && !baseDnList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = baseDnList.size(); i < size; i++) {
-                sb.append(baseDnList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            baseDn = sb.toString();
-        }
-
-        value.setBaseDn(baseDn);
-        //String baseGroupsDn = registry.getString( prefix + "baseGroupsDn", value.getBaseGroupsDn() );
-
-        List<String> baseGroupsDnList = registry.getList(prefix + "baseGroupsDn");
-        String baseGroupsDn = value.getBaseGroupsDn();
-        if (baseGroupsDnList != null && !baseGroupsDnList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = baseGroupsDnList.size(); i < size; i++) {
-                sb.append(baseGroupsDnList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            baseGroupsDn = sb.toString();
-        }
-
-        value.setBaseGroupsDn(baseGroupsDn);
-        //String contextFactory = registry.getString( prefix + "contextFactory", value.getContextFactory() );
-
-        List<String> contextFactoryList = registry.getList(prefix + "contextFactory");
-        String contextFactory = value.getContextFactory();
-        if (contextFactoryList != null && !contextFactoryList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = contextFactoryList.size(); i < size; i++) {
-                sb.append(contextFactoryList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            contextFactory = sb.toString();
-        }
-
-        value.setContextFactory(contextFactory);
-        //String bindDn = registry.getString( prefix + "bindDn", value.getBindDn() );
-
-        List<String> bindDnList = registry.getList(prefix + "bindDn");
-        String bindDn = value.getBindDn();
-        if (bindDnList != null && !bindDnList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = bindDnList.size(); i < size; i++) {
-                sb.append(bindDnList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            bindDn = sb.toString();
-        }
-
-        value.setBindDn(bindDn);
-        //String password = registry.getString( prefix + "password", value.getPassword() );
-
-        List<String> passwordList = registry.getList(prefix + "password");
-        String password = value.getPassword();
-        if (passwordList != null && !passwordList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = passwordList.size(); i < size; i++) {
-                sb.append(passwordList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            password = sb.toString();
-        }
-
-        value.setPassword(password);
-        //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() );
-
-        List<String> authenticationMethodList = registry.getList(prefix + "authenticationMethod");
-        String authenticationMethod = value.getAuthenticationMethod();
-        if (authenticationMethodList != null && !authenticationMethodList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = authenticationMethodList.size(); i < size; i++) {
-                sb.append(authenticationMethodList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            authenticationMethod = sb.toString();
-        }
-
-        value.setAuthenticationMethod(authenticationMethod);
-        boolean bindAuthenticatorEnabled = registry.getBoolean(prefix + "bindAuthenticatorEnabled", value.isBindAuthenticatorEnabled());
-        value.setBindAuthenticatorEnabled(bindAuthenticatorEnabled);
-        boolean writable = registry.getBoolean(prefix + "writable", value.isWritable());
-        value.setWritable(writable);
-        boolean useRoleNameAsGroup = registry.getBoolean(prefix + "useRoleNameAsGroup", value.isUseRoleNameAsGroup());
-        value.setUseRoleNameAsGroup(useRoleNameAsGroup);
-        java.util.Map extraProperties = registry.getProperties(prefix + "extraProperties");
-        value.setExtraProperties(extraProperties);
-
-        return value;
-    }
-
-    private FileLockConfiguration readFileLockConfiguration(String prefix, Registry registry) {
-        FileLockConfiguration value = new FileLockConfiguration();
-
-        boolean skipLocking = registry.getBoolean(prefix + "skipLocking", value.isSkipLocking());
-        value.setSkipLocking(skipLocking);
-        int lockingTimeout = registry.getInt(prefix + "lockingTimeout", value.getLockingTimeout());
-        value.setLockingTimeout(lockingTimeout);
-
-        return value;
-    }
-
-    private CacheConfiguration readCacheConfiguration(String prefix, Registry registry) {
-        CacheConfiguration value = new CacheConfiguration();
-
-        int timeToIdleSeconds = registry.getInt(prefix + "timeToIdleSeconds", value.getTimeToIdleSeconds());
-        value.setTimeToIdleSeconds(timeToIdleSeconds);
-        int timeToLiveSeconds = registry.getInt(prefix + "timeToLiveSeconds", value.getTimeToLiveSeconds());
-        value.setTimeToLiveSeconds(timeToLiveSeconds);
-        int maxElementsInMemory = registry.getInt(prefix + "maxElementsInMemory", value.getMaxElementsInMemory());
-        value.setMaxElementsInMemory(maxElementsInMemory);
-        int maxElementsOnDisk = registry.getInt(prefix + "maxElementsOnDisk", value.getMaxElementsOnDisk());
-        value.setMaxElementsOnDisk(maxElementsOnDisk);
-
-        return value;
-    }
-
-    private LdapGroupMapping readLdapGroupMapping(String prefix, Registry registry) {
-        LdapGroupMapping value = new LdapGroupMapping();
-
-        //String group = registry.getString( prefix + "group", value.getGroup() );
-
-        List<String> groupList = registry.getList(prefix + "group");
-        String group = value.getGroup();
-        if (groupList != null && !groupList.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0, size = groupList.size(); i < size; i++) {
-                sb.append(groupList.get(i));
-                if (i < size - 1) {
-                    sb.append(',');
-                }
-            }
-            group = sb.toString();
-        }
-
-        value.setGroup(group);
-        java.util.List roleNames = new java.util.ArrayList/*<String>*/();
-        roleNames.addAll(registry.getList(prefix + "roleNames.roleName"));
-        value.setRoleNames(roleNames);
-
-        return value;
-    }
-
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryWriter.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryWriter.java
deleted file mode 100644 (file)
index 83202f5..0000000
+++ /dev/null
@@ -1,1118 +0,0 @@
-
-package org.apache.archiva.configuration.io.registry;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.*;
-import org.apache.archiva.components.registry.Registry;
-
-import java.util.Iterator;
-import java.util.List;
-
-// Util imports
-// Model class imports
-
-
-/**
- * Generate Plexus Registry output mechanism for model 'Configuration'.
- */
-public class ConfigurationRegistryWriter {
-    public void write(Configuration model, Registry registry) {
-        writeConfiguration("", model, registry);
-    }
-
-    private void writeList(Registry registry, List<String> subList, String subsetPath, String elementName) {
-        if (subList != null && subList.size() > 0
-        ) {
-            registry.removeSubset(subsetPath);
-
-            int count = 0;
-            for (Iterator<String> iter = subList.iterator(); iter.hasNext(); count++) {
-                String name = subsetPath + "." + elementName + "(" + count + ")";
-                String value = iter.next();
-                registry.setString(name, value);
-            }
-        }
-    }
-
-    private void writeConfiguration(String prefix, Configuration value, Registry registry) {
-        if (value != null) {
-            if (value.getVersion() != null
-            ) {
-                String version = "version";
-                registry.setString(prefix + version, value.getVersion());
-            }
-            if (value.getMetadataStore() != null && !value.getMetadataStore().equals("jcr")
-            ) {
-                String metadataStore = "metadataStore";
-                registry.setString(prefix + metadataStore, value.getMetadataStore());
-            }
-            if (value.getRepositoryGroups() != null && value.getRepositoryGroups().size() > 0
-            ) {
-                registry.removeSubset(prefix + "repositoryGroups");
-
-                int count = 0;
-                for (Iterator iter = value.getRepositoryGroups().iterator(); iter.hasNext(); count++) {
-                    String name = "repositoryGroups.repositoryGroup(" + count + ")";
-                    RepositoryGroupConfiguration o = (RepositoryGroupConfiguration) iter.next();
-                    writeRepositoryGroupConfiguration(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getManagedRepositories() != null && value.getManagedRepositories().size() > 0
-            ) {
-                registry.removeSubset(prefix + "managedRepositories");
-
-                int count = 0;
-                for (Iterator iter = value.getManagedRepositories().iterator(); iter.hasNext(); count++) {
-                    String name = "managedRepositories.managedRepository(" + count + ")";
-                    ManagedRepositoryConfiguration o = (ManagedRepositoryConfiguration) iter.next();
-                    writeManagedRepositoryConfiguration(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getRemoteRepositories() != null && value.getRemoteRepositories().size() > 0
-            ) {
-                registry.removeSubset(prefix + "remoteRepositories");
-
-                int count = 0;
-                for (Iterator iter = value.getRemoteRepositories().iterator(); iter.hasNext(); count++) {
-                    String name = "remoteRepositories.remoteRepository(" + count + ")";
-                    RemoteRepositoryConfiguration o = (RemoteRepositoryConfiguration) iter.next();
-                    writeRemoteRepositoryConfiguration(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getProxyConnectors() != null && value.getProxyConnectors().size() > 0
-            ) {
-                registry.removeSubset(prefix + "proxyConnectors");
-
-                int count = 0;
-                for (Iterator iter = value.getProxyConnectors().iterator(); iter.hasNext(); count++) {
-                    String name = "proxyConnectors.proxyConnector(" + count + ")";
-                    ProxyConnectorConfiguration o = (ProxyConnectorConfiguration) iter.next();
-                    writeProxyConnectorConfiguration(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getNetworkProxies() != null && value.getNetworkProxies().size() > 0
-            ) {
-                registry.removeSubset(prefix + "networkProxies");
-
-                int count = 0;
-                for (Iterator iter = value.getNetworkProxies().iterator(); iter.hasNext(); count++) {
-                    String name = "networkProxies.networkProxy(" + count + ")";
-                    NetworkProxyConfiguration o = (NetworkProxyConfiguration) iter.next();
-                    writeNetworkProxyConfiguration(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getLegacyArtifactPaths() != null && value.getLegacyArtifactPaths().size() > 0
-            ) {
-                registry.removeSubset(prefix + "legacyArtifactPaths");
-
-                int count = 0;
-                for (Iterator iter = value.getLegacyArtifactPaths().iterator(); iter.hasNext(); count++) {
-                    String name = "legacyArtifactPaths.legacyArtifactPath(" + count + ")";
-                    LegacyArtifactPath o = (LegacyArtifactPath) iter.next();
-                    writeLegacyArtifactPath(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getRepositoryScanning() != null
-            ) {
-                writeRepositoryScanningConfiguration(prefix + "repositoryScanning.", value.getRepositoryScanning(), registry);
-            }
-            if (value.getWebapp() != null
-            ) {
-                writeWebappConfiguration(prefix + "webapp.", value.getWebapp(), registry);
-            }
-            if (value.getOrganisationInfo() != null
-            ) {
-                writeOrganisationInformation(prefix + "organisationInfo.", value.getOrganisationInfo(), registry);
-            }
-            if (value.getNetworkConfiguration() != null
-            ) {
-                writeNetworkConfiguration(prefix + "networkConfiguration.", value.getNetworkConfiguration(), registry);
-            }
-            if (value.getRedbackRuntimeConfiguration() != null
-            ) {
-                writeRedbackRuntimeConfiguration(prefix + "redbackRuntimeConfiguration.", value.getRedbackRuntimeConfiguration(), registry);
-            }
-            if (value.getArchivaRuntimeConfiguration() != null
-            ) {
-                writeArchivaRuntimeConfiguration(prefix + "archivaRuntimeConfiguration.", value.getArchivaRuntimeConfiguration(), registry);
-            }
-            if (value.getProxyConnectorRuleConfigurations() != null && value.getProxyConnectorRuleConfigurations().size() > 0
-            ) {
-                registry.removeSubset(prefix + "proxyConnectorRuleConfigurations");
-
-                int count = 0;
-                for (Iterator iter = value.getProxyConnectorRuleConfigurations().iterator(); iter.hasNext(); count++) {
-                    String name = "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration(" + count + ")";
-                    ProxyConnectorRuleConfiguration o = (ProxyConnectorRuleConfiguration) iter.next();
-                    writeProxyConnectorRuleConfiguration(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getArchivaDefaultConfiguration() != null
-            ) {
-                writeArchivaDefaultConfiguration(prefix + "archivaDefaultConfiguration.", value.getArchivaDefaultConfiguration(), registry);
-            }
-        }
-    }
-
-    private void writeAbstractRepositoryConfiguration(String prefix, AbstractRepositoryConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getId() != null
-            ) {
-                String id = "id";
-                registry.setString(prefix + id, value.getId());
-            }
-            if (value.getType() != null && !value.getType().equals("MAVEN")
-            ) {
-                String type = "type";
-                registry.setString(prefix + type, value.getType());
-            }
-            if (value.getName() != null
-            ) {
-                String name = "name";
-                registry.setString(prefix + name, value.getName());
-            }
-            if (value.getLayout() != null && !value.getLayout().equals("default")
-            ) {
-                String layout = "layout";
-                registry.setString(prefix + layout, value.getLayout());
-            }
-            if (value.getIndexDir() != null && !value.getIndexDir().equals("")
-            ) {
-                String indexDir = "indexDir";
-                registry.setString(prefix + indexDir, value.getIndexDir());
-            }
-            if (value.getPackedIndexDir() != null && !value.getPackedIndexDir().equals("")
-            ) {
-                String packedIndexDir = "packedIndexDir";
-                registry.setString(prefix + packedIndexDir, value.getPackedIndexDir());
-            }
-            if (value.getDescription() != null && !value.getDescription().equals("")
-            ) {
-                String description = "description";
-                registry.setString(prefix + description, value.getDescription());
-            }
-        }
-    }
-
-    private void writeRemoteRepositoryConfiguration(String prefix, RemoteRepositoryConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getUrl() != null
-            ) {
-                String url = "url";
-                registry.setString(prefix + url, value.getUrl());
-            }
-            if (value.getUsername() != null
-            ) {
-                String username = "username";
-                registry.setString(prefix + username, value.getUsername());
-            }
-            if (value.getPassword() != null
-            ) {
-                String password = "password";
-                registry.setString(prefix + password, value.getPassword());
-            }
-            if (value.getTimeout() != 60
-            ) {
-                String timeout = "timeout";
-                registry.setInt(prefix + timeout, value.getTimeout());
-            }
-            if (value.getRefreshCronExpression() != null && !value.getRefreshCronExpression().equals("0 0 08 ? * SUN")
-            ) {
-                String refreshCronExpression = "refreshCronExpression";
-                registry.setString(prefix + refreshCronExpression, value.getRefreshCronExpression());
-            }
-            String downloadRemoteIndex = "downloadRemoteIndex";
-            registry.setBoolean(prefix + downloadRemoteIndex, value.isDownloadRemoteIndex());
-            if (value.getRemoteIndexUrl() != null
-            ) {
-                String remoteIndexUrl = "remoteIndexUrl";
-                registry.setString(prefix + remoteIndexUrl, value.getRemoteIndexUrl());
-            }
-            if (value.getRemoteDownloadNetworkProxyId() != null
-            ) {
-                String remoteDownloadNetworkProxyId = "remoteDownloadNetworkProxyId";
-                registry.setString(prefix + remoteDownloadNetworkProxyId, value.getRemoteDownloadNetworkProxyId());
-            }
-            if (value.getRemoteDownloadTimeout() != 300
-            ) {
-                String remoteDownloadTimeout = "remoteDownloadTimeout";
-                registry.setInt(prefix + remoteDownloadTimeout, value.getRemoteDownloadTimeout());
-            }
-            String downloadRemoteIndexOnStartup = "downloadRemoteIndexOnStartup";
-            registry.setBoolean(prefix + downloadRemoteIndexOnStartup, value.isDownloadRemoteIndexOnStartup());
-            if (value.getExtraParameters() != null && value.getExtraParameters().size() > 0
-            ) {
-                registry.removeSubset(prefix + "extraParameters");
-
-                for (Iterator iter = value.getExtraParameters().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getExtraParameters().get(key);
-
-                    registry.setString(prefix + "extraParameters." + key, v);
-                }
-            }
-            if (value.getExtraHeaders() != null && value.getExtraHeaders().size() > 0
-            ) {
-                registry.removeSubset(prefix + "extraHeaders");
-
-                for (Iterator iter = value.getExtraHeaders().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getExtraHeaders().get(key);
-
-                    registry.setString(prefix + "extraHeaders." + key, v);
-                }
-            }
-            if (value.getCheckPath() != null
-            ) {
-                String checkPath = "checkPath";
-                registry.setString(prefix + checkPath, value.getCheckPath());
-            }
-            if (value.getId() != null
-            ) {
-                String id = "id";
-                registry.setString(prefix + id, value.getId());
-            }
-            if (value.getType() != null && !value.getType().equals("MAVEN")
-            ) {
-                String type = "type";
-                registry.setString(prefix + type, value.getType());
-            }
-            if (value.getName() != null
-            ) {
-                String name = "name";
-                registry.setString(prefix + name, value.getName());
-            }
-            if (value.getLayout() != null && !value.getLayout().equals("default")
-            ) {
-                String layout = "layout";
-                registry.setString(prefix + layout, value.getLayout());
-            }
-            if (value.getIndexDir() != null && !value.getIndexDir().equals("")
-            ) {
-                String indexDir = "indexDir";
-                registry.setString(prefix + indexDir, value.getIndexDir());
-            }
-            if (value.getPackedIndexDir() != null && !value.getPackedIndexDir().equals("")
-            ) {
-                String packedIndexDir = "packedIndexDir";
-                registry.setString(prefix + packedIndexDir, value.getPackedIndexDir());
-            }
-            if (value.getDescription() != null && !value.getDescription().equals("")
-            ) {
-                String description = "description";
-                registry.setString(prefix + description, value.getDescription());
-            }
-        }
-    }
-
-    private void writeManagedRepositoryConfiguration(String prefix, ManagedRepositoryConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getLocation() != null
-            ) {
-                String location = "location";
-                registry.setString(prefix + location, value.getLocation());
-            }
-            String releases = "releases";
-            registry.setBoolean(prefix + releases, value.isReleases());
-            String blockRedeployments = "blockRedeployments";
-            registry.setBoolean(prefix + blockRedeployments, value.isBlockRedeployments());
-            String snapshots = "snapshots";
-            registry.setBoolean(prefix + snapshots, value.isSnapshots());
-            String scanned = "scanned";
-            registry.setBoolean(prefix + scanned, value.isScanned());
-            if (value.getRefreshCronExpression() != null && !value.getRefreshCronExpression().equals("0 0 * * * ?")
-            ) {
-                String refreshCronExpression = "refreshCronExpression";
-                registry.setString(prefix + refreshCronExpression, value.getRefreshCronExpression());
-            }
-            if (value.getRetentionCount() != 2
-            ) {
-                String retentionCount = "retentionCount";
-                registry.setInt(prefix + retentionCount, value.getRetentionCount());
-            }
-            if (value.getRetentionPeriod() != 100
-            ) {
-                String retentionPeriod = "retentionPeriod";
-                registry.setInt(prefix + retentionPeriod, value.getRetentionPeriod());
-            }
-            String deleteReleasedSnapshots = "deleteReleasedSnapshots";
-            registry.setBoolean(prefix + deleteReleasedSnapshots, value.isDeleteReleasedSnapshots());
-            String skipPackedIndexCreation = "skipPackedIndexCreation";
-            registry.setBoolean(prefix + skipPackedIndexCreation, value.isSkipPackedIndexCreation());
-            String stageRepoNeeded = "stageRepoNeeded";
-            registry.setBoolean(prefix + stageRepoNeeded, value.isStageRepoNeeded());
-            if (value.getId() != null
-            ) {
-                String id = "id";
-                registry.setString(prefix + id, value.getId());
-            }
-            if (value.getType() != null && !value.getType().equals("MAVEN")
-            ) {
-                String type = "type";
-                registry.setString(prefix + type, value.getType());
-            }
-            if (value.getName() != null
-            ) {
-                String name = "name";
-                registry.setString(prefix + name, value.getName());
-            }
-            if (value.getLayout() != null && !value.getLayout().equals("default")
-            ) {
-                String layout = "layout";
-                registry.setString(prefix + layout, value.getLayout());
-            }
-            if (value.getIndexDir() != null && !value.getIndexDir().equals("")
-            ) {
-                String indexDir = "indexDir";
-                registry.setString(prefix + indexDir, value.getIndexDir());
-            }
-            if (value.getPackedIndexDir() != null && !value.getPackedIndexDir().equals("")
-            ) {
-                String packedIndexDir = "packedIndexDir";
-                registry.setString(prefix + packedIndexDir, value.getPackedIndexDir());
-            }
-            if (value.getDescription() != null && !value.getDescription().equals("")
-            ) {
-                String description = "description";
-                registry.setString(prefix + description, value.getDescription());
-            }
-        }
-    }
-
-    private void writeLegacyArtifactPath(String prefix, LegacyArtifactPath value, Registry registry) {
-        if (value != null) {
-            if (value.getPath() != null
-            ) {
-                String path = "path";
-                registry.setString(prefix + path, value.getPath());
-            }
-            if (value.getArtifact() != null
-            ) {
-                String artifact = "artifact";
-                registry.setString(prefix + artifact, value.getArtifact());
-            }
-        }
-    }
-
-    private void writeRepositoryGroupConfiguration(String prefix, RepositoryGroupConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getId() != null
-            ) {
-                String id = "id";
-                registry.setString(prefix + id, value.getId());
-            }
-            if (value.getName() != null) {
-                registry.setString(prefix + "name", value.getName());
-            }
-            if (value.getType() != null) {
-                registry.setString(prefix + "type", value.getType());
-            }
-            if (value.getLocation()!=null) {
-                registry.setString( prefix+"location", value.getType( ) );
-            }
-            if (value.getMergedIndexPath() != null && !value.getMergedIndexPath().equals(".indexer")
-            ) {
-                String mergedIndexPath = "mergedIndexPath";
-                registry.setString(prefix + mergedIndexPath, value.getMergedIndexPath());
-            }
-            if (value.getMergedIndexTtl() != 30
-            ) {
-                String mergedIndexTtl = "mergedIndexTtl";
-                registry.setInt(prefix + mergedIndexTtl, value.getMergedIndexTtl());
-            }
-            if (value.getCronExpression() != null && !value.getCronExpression().equals("")
-            ) {
-                String cronExpression = "cronExpression";
-                registry.setString(prefix + cronExpression, value.getCronExpression());
-            }
-            if (value.getRepositories() != null && value.getRepositories().size() > 0
-            ) {
-                registry.removeSubset(prefix + "repositories");
-
-                int count = 0;
-                for (Iterator iter = value.getRepositories().iterator(); iter.hasNext(); count++) {
-                    String name = "repositories.repository(" + count + ")";
-                    String repository = (String) iter.next();
-                    registry.setString(prefix + name, repository);
-                }
-            }
-        }
-    }
-
-    private void writeRepositoryCheckPath(String prefix, RepositoryCheckPath value, Registry registry) {
-        if (value != null) {
-            if (value.getUrl() != null
-            ) {
-                String url = "url";
-                registry.setString(prefix + url, value.getUrl());
-            }
-            if (value.getPath() != null
-            ) {
-                String path = "path";
-                registry.setString(prefix + path, value.getPath());
-            }
-        }
-    }
-
-    private void writeAbstractRepositoryConnectorConfiguration(String prefix, AbstractRepositoryConnectorConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getSourceRepoId() != null
-            ) {
-                String sourceRepoId = "sourceRepoId";
-                registry.setString(prefix + sourceRepoId, value.getSourceRepoId());
-            }
-            if (value.getTargetRepoId() != null
-            ) {
-                String targetRepoId = "targetRepoId";
-                registry.setString(prefix + targetRepoId, value.getTargetRepoId());
-            }
-            if (value.getProxyId() != null
-            ) {
-                String proxyId = "proxyId";
-                registry.setString(prefix + proxyId, value.getProxyId());
-            }
-            if (value.getBlackListPatterns() != null && value.getBlackListPatterns().size() > 0
-            ) {
-                registry.removeSubset(prefix + "blackListPatterns");
-
-                int count = 0;
-                for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) {
-                    String name = "blackListPatterns.blackListPattern(" + count + ")";
-                    String blackListPattern = (String) iter.next();
-                    registry.setString(prefix + name, blackListPattern);
-                }
-            }
-            if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0
-            ) {
-                registry.removeSubset(prefix + "whiteListPatterns");
-
-                int count = 0;
-                for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) {
-                    String name = "whiteListPatterns.whiteListPattern(" + count + ")";
-                    String whiteListPattern = (String) iter.next();
-                    registry.setString(prefix + name, whiteListPattern);
-                }
-            }
-            if (value.getPolicies() != null && value.getPolicies().size() > 0
-            ) {
-                registry.removeSubset(prefix + "policies");
-
-                for (Iterator iter = value.getPolicies().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getPolicies().get(key);
-
-                    registry.setString(prefix + "policies." + key, v);
-                }
-            }
-            if (value.getProperties() != null && value.getProperties().size() > 0
-            ) {
-                registry.removeSubset(prefix + "properties");
-
-                for (Iterator iter = value.getProperties().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getProperties().get(key);
-
-                    registry.setString(prefix + "properties." + key, v);
-                }
-            }
-            String disabled = "disabled";
-            registry.setBoolean(prefix + disabled, value.isDisabled());
-        }
-    }
-
-    private void writeProxyConnectorRuleConfiguration(String prefix, ProxyConnectorRuleConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getRuleType() != null
-            ) {
-                String ruleType = "ruleType";
-                registry.setString(prefix + ruleType, value.getRuleType());
-            }
-            if (value.getPattern() != null
-            ) {
-                String pattern = "pattern";
-                registry.setString(prefix + pattern, value.getPattern());
-            }
-            if (value.getProxyConnectors() != null && value.getProxyConnectors().size() > 0
-            ) {
-                registry.removeSubset(prefix + "proxyConnectors");
-
-                int count = 0;
-                for (Iterator iter = value.getProxyConnectors().iterator(); iter.hasNext(); count++) {
-                    String name = "proxyConnectors.proxyConnector(" + count + ")";
-                    ProxyConnectorConfiguration o = (ProxyConnectorConfiguration) iter.next();
-                    writeProxyConnectorConfiguration(prefix + name + ".", o, registry);
-                }
-            }
-        }
-    }
-
-    private void writeProxyConnectorConfiguration(String prefix, ProxyConnectorConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getOrder() != 0
-            ) {
-                String order = "order";
-                registry.setInt(prefix + order, value.getOrder());
-            }
-            if (value.getSourceRepoId() != null
-            ) {
-                String sourceRepoId = "sourceRepoId";
-                registry.setString(prefix + sourceRepoId, value.getSourceRepoId());
-            }
-            if (value.getTargetRepoId() != null
-            ) {
-                String targetRepoId = "targetRepoId";
-                registry.setString(prefix + targetRepoId, value.getTargetRepoId());
-            }
-            if (value.getProxyId() != null
-            ) {
-                String proxyId = "proxyId";
-                registry.setString(prefix + proxyId, value.getProxyId());
-            }
-            if (value.getBlackListPatterns() != null && value.getBlackListPatterns().size() > 0
-            ) {
-                registry.removeSubset(prefix + "blackListPatterns");
-
-                int count = 0;
-                for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) {
-                    String name = "blackListPatterns.blackListPattern(" + count + ")";
-                    String blackListPattern = (String) iter.next();
-                    registry.setString(prefix + name, blackListPattern);
-                }
-            }
-            if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0
-            ) {
-                registry.removeSubset(prefix + "whiteListPatterns");
-
-                int count = 0;
-                for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) {
-                    String name = "whiteListPatterns.whiteListPattern(" + count + ")";
-                    String whiteListPattern = (String) iter.next();
-                    registry.setString(prefix + name, whiteListPattern);
-                }
-            }
-            if (value.getPolicies() != null && value.getPolicies().size() > 0
-            ) {
-                registry.removeSubset(prefix + "policies");
-
-                for (Iterator iter = value.getPolicies().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getPolicies().get(key);
-
-                    registry.setString(prefix + "policies." + key, v);
-                }
-            }
-            if (value.getProperties() != null && value.getProperties().size() > 0
-            ) {
-                registry.removeSubset(prefix + "properties");
-
-                for (Iterator iter = value.getProperties().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getProperties().get(key);
-
-                    registry.setString(prefix + "properties." + key, v);
-                }
-            }
-            String disabled = "disabled";
-            registry.setBoolean(prefix + disabled, value.isDisabled());
-        }
-    }
-
-    private void writeSyncConnectorConfiguration(String prefix, SyncConnectorConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getCronExpression() != null && !value.getCronExpression().equals("0 0 * * * ?")
-            ) {
-                String cronExpression = "cronExpression";
-                registry.setString(prefix + cronExpression, value.getCronExpression());
-            }
-            if (value.getMethod() != null && !value.getMethod().equals("rsync")
-            ) {
-                String method = "method";
-                registry.setString(prefix + method, value.getMethod());
-            }
-            if (value.getSourceRepoId() != null
-            ) {
-                String sourceRepoId = "sourceRepoId";
-                registry.setString(prefix + sourceRepoId, value.getSourceRepoId());
-            }
-            if (value.getTargetRepoId() != null
-            ) {
-                String targetRepoId = "targetRepoId";
-                registry.setString(prefix + targetRepoId, value.getTargetRepoId());
-            }
-            if (value.getProxyId() != null
-            ) {
-                String proxyId = "proxyId";
-                registry.setString(prefix + proxyId, value.getProxyId());
-            }
-            if (value.getBlackListPatterns() != null && value.getBlackListPatterns().size() > 0
-            ) {
-                registry.removeSubset(prefix + "blackListPatterns");
-
-                int count = 0;
-                for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) {
-                    String name = "blackListPatterns.blackListPattern(" + count + ")";
-                    String blackListPattern = (String) iter.next();
-                    registry.setString(prefix + name, blackListPattern);
-                }
-            }
-            if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0
-            ) {
-                registry.removeSubset(prefix + "whiteListPatterns");
-
-                int count = 0;
-                for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) {
-                    String name = "whiteListPatterns.whiteListPattern(" + count + ")";
-                    String whiteListPattern = (String) iter.next();
-                    registry.setString(prefix + name, whiteListPattern);
-                }
-            }
-            if (value.getPolicies() != null && value.getPolicies().size() > 0
-            ) {
-                registry.removeSubset(prefix + "policies");
-
-                for (Iterator iter = value.getPolicies().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getPolicies().get(key);
-
-                    registry.setString(prefix + "policies." + key, v);
-                }
-            }
-            if (value.getProperties() != null && value.getProperties().size() > 0
-            ) {
-                registry.removeSubset(prefix + "properties");
-
-                for (Iterator iter = value.getProperties().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getProperties().get(key);
-
-                    registry.setString(prefix + "properties." + key, v);
-                }
-            }
-            String disabled = "disabled";
-            registry.setBoolean(prefix + disabled, value.isDisabled());
-        }
-    }
-
-    private void writeNetworkProxyConfiguration(String prefix, NetworkProxyConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getId() != null
-            ) {
-                String id = "id";
-                registry.setString(prefix + id, value.getId());
-            }
-            if (value.getProtocol() != null && !value.getProtocol().equals("http")
-            ) {
-                String protocol = "protocol";
-                registry.setString(prefix + protocol, value.getProtocol());
-            }
-            if (value.getHost() != null
-            ) {
-                String host = "host";
-                registry.setString(prefix + host, value.getHost());
-            }
-            if (value.getPort() != 8080
-            ) {
-                String port = "port";
-                registry.setInt(prefix + port, value.getPort());
-            }
-            if (value.getUsername() != null
-            ) {
-                String username = "username";
-                registry.setString(prefix + username, value.getUsername());
-            }
-            if (value.getPassword() != null
-            ) {
-                String password = "password";
-                registry.setString(prefix + password, value.getPassword());
-            }
-            String useNtlm = "useNtlm";
-            registry.setBoolean(prefix + useNtlm, value.isUseNtlm());
-        }
-    }
-
-    private void writeRepositoryScanningConfiguration(String prefix, RepositoryScanningConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getFileTypes() != null && value.getFileTypes().size() > 0
-            ) {
-                registry.removeSubset(prefix + "fileTypes");
-
-                int count = 0;
-                for (Iterator iter = value.getFileTypes().iterator(); iter.hasNext(); count++) {
-                    String name = "fileTypes.fileType(" + count + ")";
-                    FileType o = (FileType) iter.next();
-                    writeFileType(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getKnownContentConsumers() != null && value.getKnownContentConsumers().size() > 0
-            ) {
-                registry.removeSubset(prefix + "knownContentConsumers");
-
-                int count = 0;
-                for (Iterator iter = value.getKnownContentConsumers().iterator(); iter.hasNext(); count++) {
-                    String name = "knownContentConsumers.knownContentConsumer(" + count + ")";
-                    String knownContentConsumer = (String) iter.next();
-                    registry.setString(prefix + name, knownContentConsumer);
-                }
-            }
-            if (value.getInvalidContentConsumers() != null && value.getInvalidContentConsumers().size() > 0
-            ) {
-                registry.removeSubset(prefix + "invalidContentConsumers");
-
-                int count = 0;
-                for (Iterator iter = value.getInvalidContentConsumers().iterator(); iter.hasNext(); count++) {
-                    String name = "invalidContentConsumers.invalidContentConsumer(" + count + ")";
-                    String invalidContentConsumer = (String) iter.next();
-                    registry.setString(prefix + name, invalidContentConsumer);
-                }
-            }
-        }
-    }
-
-    private void writeFileType(String prefix, FileType value, Registry registry) {
-        if (value != null) {
-            if (value.getId() != null
-            ) {
-                String id = "id";
-                registry.setString(prefix + id, value.getId());
-            }
-            if (value.getPatterns() != null && value.getPatterns().size() > 0
-            ) {
-                registry.removeSubset(prefix + "patterns");
-
-                int count = 0;
-                for (Iterator iter = value.getPatterns().iterator(); iter.hasNext(); count++) {
-                    String name = "patterns.pattern(" + count + ")";
-                    String pattern = (String) iter.next();
-                    registry.setString(prefix + name, pattern);
-                }
-            }
-        }
-    }
-
-    private void writeOrganisationInformation(String prefix, OrganisationInformation value, Registry registry) {
-        if (value != null) {
-            if (value.getName() != null
-            ) {
-                String name = "name";
-                registry.setString(prefix + name, value.getName());
-            }
-            if (value.getUrl() != null
-            ) {
-                String url = "url";
-                registry.setString(prefix + url, value.getUrl());
-            }
-            if (value.getLogoLocation() != null
-            ) {
-                String logoLocation = "logoLocation";
-                registry.setString(prefix + logoLocation, value.getLogoLocation());
-            }
-        }
-    }
-
-    private void writeWebappConfiguration(String prefix, WebappConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getUi() != null
-            ) {
-                writeUserInterfaceOptions(prefix + "ui.", value.getUi(), registry);
-            }
-        }
-    }
-
-    private void writeUserInterfaceOptions(String prefix, UserInterfaceOptions value, Registry registry) {
-        if (value != null) {
-            String showFindArtifacts = "showFindArtifacts";
-            registry.setBoolean(prefix + showFindArtifacts, value.isShowFindArtifacts());
-            String appletFindEnabled = "appletFindEnabled";
-            registry.setBoolean(prefix + appletFindEnabled, value.isAppletFindEnabled());
-            String disableEasterEggs = "disableEasterEggs";
-            registry.setBoolean(prefix + disableEasterEggs, value.isDisableEasterEggs());
-            if (value.getApplicationUrl() != null
-            ) {
-                String applicationUrl = "applicationUrl";
-                registry.setString(prefix + applicationUrl, value.getApplicationUrl());
-            }
-            String disableRegistration = "disableRegistration";
-            registry.setBoolean(prefix + disableRegistration, value.isDisableRegistration());
-        }
-    }
-
-    private void writeNetworkConfiguration(String prefix, NetworkConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getMaxTotal() != 30
-            ) {
-                String maxTotal = "maxTotal";
-                registry.setInt(prefix + maxTotal, value.getMaxTotal());
-            }
-            if (value.getMaxTotalPerHost() != 30
-            ) {
-                String maxTotalPerHost = "maxTotalPerHost";
-                registry.setInt(prefix + maxTotalPerHost, value.getMaxTotalPerHost());
-            }
-            String usePooling = "usePooling";
-            registry.setBoolean(prefix + usePooling, value.isUsePooling());
-        }
-    }
-
-    private void writeArchivaRuntimeConfiguration(String prefix, ArchivaRuntimeConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getUrlFailureCacheConfiguration() != null
-            ) {
-                writeCacheConfiguration(prefix + "urlFailureCacheConfiguration.", value.getUrlFailureCacheConfiguration(), registry);
-            }
-            if (value.getFileLockConfiguration() != null
-            ) {
-                writeFileLockConfiguration(prefix + "fileLockConfiguration.", value.getFileLockConfiguration(), registry);
-            }
-            if (value.getDataDirectory() != null
-            ) {
-                String dataDirectory = "dataDirectory";
-                registry.setString(prefix + dataDirectory, value.getDataDirectory());
-            }
-            if (value.getRepositoryBaseDirectory() != null
-            ) {
-                String repositoryBaseDirectory = "repositoryBaseDirectory";
-                registry.setString(prefix + repositoryBaseDirectory, value.getRepositoryBaseDirectory());
-            }
-            if (value.getRemoteRepositoryBaseDirectory() != null
-            ) {
-                String remoteRepositoryBaseDirectory = "remoteRepositoryBaseDirectory";
-                registry.setString(prefix + remoteRepositoryBaseDirectory, value.getRemoteRepositoryBaseDirectory());
-            }
-            if (value.getRepositoryGroupBaseDirectory() != null
-            ) {
-                String repositoryGroupBaseDirectory = "repositoryGroupBaseDirectory";
-                registry.setString(prefix + repositoryGroupBaseDirectory, value.getRepositoryGroupBaseDirectory());
-            }
-
-            if (value.getDefaultLanguage() != null && !value.getDefaultLanguage().equals("en-US")
-            ) {
-                String defaultLanguage = "defaultLanguage";
-                registry.setString(prefix + defaultLanguage, value.getDefaultLanguage());
-            }
-            if (value.getLanguageRange() != null && !value.getLanguageRange().equals("en,fr,de")
-            ) {
-                String languageRange = "languageRange";
-                registry.setString(prefix + languageRange, value.getLanguageRange());
-            }
-            writeList(registry, value.getChecksumTypes(), prefix+"checksumTypes", "type");
-        }
-    }
-
-    private void writeRedbackRuntimeConfiguration(String prefix, RedbackRuntimeConfiguration value, Registry registry) {
-        if (value != null) {
-            String migratedFromRedbackConfiguration = "migratedFromRedbackConfiguration";
-            registry.setBoolean(prefix + migratedFromRedbackConfiguration, value.isMigratedFromRedbackConfiguration());
-            if (value.getUserManagerImpls() != null && value.getUserManagerImpls().size() > 0
-            ) {
-                registry.removeSubset(prefix + "userManagerImpls");
-
-                int count = 0;
-                for (Iterator iter = value.getUserManagerImpls().iterator(); iter.hasNext(); count++) {
-                    String name = "userManagerImpls.userManagerImpl(" + count + ")";
-                    String userManagerImpl = (String) iter.next();
-                    registry.setString(prefix + name, userManagerImpl);
-                }
-            }
-            if (value.getRbacManagerImpls() != null && value.getRbacManagerImpls().size() > 0
-            ) {
-                registry.removeSubset(prefix + "rbacManagerImpls");
-
-                int count = 0;
-                for (Iterator iter = value.getRbacManagerImpls().iterator(); iter.hasNext(); count++) {
-                    String name = "rbacManagerImpls.rbacManagerImpl(" + count + ")";
-                    String rbacManagerImpl = (String) iter.next();
-                    registry.setString(prefix + name, rbacManagerImpl);
-                }
-            }
-            if (value.getLdapConfiguration() != null
-            ) {
-                writeLdapConfiguration(prefix + "ldapConfiguration.", value.getLdapConfiguration(), registry);
-            }
-            if (value.getLdapGroupMappings() != null && value.getLdapGroupMappings().size() > 0
-            ) {
-                registry.removeSubset(prefix + "ldapGroupMappings");
-
-                int count = 0;
-                for (Iterator iter = value.getLdapGroupMappings().iterator(); iter.hasNext(); count++) {
-                    String name = "ldapGroupMappings.ldapGroupMapping(" + count + ")";
-                    LdapGroupMapping o = (LdapGroupMapping) iter.next();
-                    writeLdapGroupMapping(prefix + name + ".", o, registry);
-                }
-            }
-            if (value.getConfigurationProperties() != null && value.getConfigurationProperties().size() > 0
-            ) {
-                registry.removeSubset(prefix + "configurationProperties");
-
-                for (Iterator iter = value.getConfigurationProperties().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getConfigurationProperties().get(key);
-
-                    registry.setString(prefix + "configurationProperties." + key, v);
-                }
-            }
-            String useUsersCache = "useUsersCache";
-            registry.setBoolean(prefix + useUsersCache, value.isUseUsersCache());
-            if (value.getUsersCacheConfiguration() != null
-            ) {
-                writeCacheConfiguration(prefix + "usersCacheConfiguration.", value.getUsersCacheConfiguration(), registry);
-            }
-        }
-    }
-
-    private void writeArchivaDefaultConfiguration(String prefix, ArchivaDefaultConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getDefaultCheckPaths() != null && value.getDefaultCheckPaths().size() > 0
-            ) {
-                registry.removeSubset(prefix + "defaultCheckPaths");
-
-                int count = 0;
-                for (Iterator iter = value.getDefaultCheckPaths().iterator(); iter.hasNext(); count++) {
-                    String name = "defaultCheckPaths.defaultCheckPath(" + count + ")";
-                    RepositoryCheckPath o = (RepositoryCheckPath) iter.next();
-                    writeRepositoryCheckPath(prefix + name + ".", o, registry);
-                }
-            }
-        }
-    }
-
-    private void writeLdapConfiguration(String prefix, LdapConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getHostName() != null
-            ) {
-                String hostName = "hostName";
-                registry.setString(prefix + hostName, value.getHostName());
-            }
-            if (value.getPort() != 0
-            ) {
-                String port = "port";
-                registry.setInt(prefix + port, value.getPort());
-            }
-            String ssl = "ssl";
-            registry.setBoolean(prefix + ssl, value.isSsl());
-            if (value.getBaseDn() != null
-            ) {
-                String baseDn = "baseDn";
-                registry.setString(prefix + baseDn, value.getBaseDn());
-            }
-            if (value.getBaseGroupsDn() != null
-            ) {
-                String baseGroupsDn = "baseGroupsDn";
-                registry.setString(prefix + baseGroupsDn, value.getBaseGroupsDn());
-            }
-            if (value.getContextFactory() != null
-            ) {
-                String contextFactory = "contextFactory";
-                registry.setString(prefix + contextFactory, value.getContextFactory());
-            }
-            if (value.getBindDn() != null
-            ) {
-                String bindDn = "bindDn";
-                registry.setString(prefix + bindDn, value.getBindDn());
-            }
-            if (value.getPassword() != null
-            ) {
-                String password = "password";
-                registry.setString(prefix + password, value.getPassword());
-            }
-            if (value.getAuthenticationMethod() != null
-            ) {
-                String authenticationMethod = "authenticationMethod";
-                registry.setString(prefix + authenticationMethod, value.getAuthenticationMethod());
-            }
-            String bindAuthenticatorEnabled = "bindAuthenticatorEnabled";
-            registry.setBoolean(prefix + bindAuthenticatorEnabled, value.isBindAuthenticatorEnabled());
-            String writable = "writable";
-            registry.setBoolean(prefix + writable, value.isWritable());
-            String useRoleNameAsGroup = "useRoleNameAsGroup";
-            registry.setBoolean(prefix + useRoleNameAsGroup, value.isUseRoleNameAsGroup());
-            if (value.getExtraProperties() != null && value.getExtraProperties().size() > 0
-            ) {
-                registry.removeSubset(prefix + "extraProperties");
-
-                for (Iterator iter = value.getExtraProperties().keySet().iterator(); iter.hasNext(); ) {
-                    String key = (String) iter.next();
-                    String v = (String) value.getExtraProperties().get(key);
-
-                    registry.setString(prefix + "extraProperties." + key, v);
-                }
-            }
-        }
-    }
-
-    private void writeFileLockConfiguration(String prefix, FileLockConfiguration value, Registry registry) {
-        if (value != null) {
-            String skipLocking = "skipLocking";
-            registry.setBoolean(prefix + skipLocking, value.isSkipLocking());
-            if (value.getLockingTimeout() != 0
-            ) {
-                String lockingTimeout = "lockingTimeout";
-                registry.setInt(prefix + lockingTimeout, value.getLockingTimeout());
-            }
-        }
-    }
-
-    private void writeCacheConfiguration(String prefix, CacheConfiguration value, Registry registry) {
-        if (value != null) {
-            if (value.getTimeToIdleSeconds() != -1
-            ) {
-                String timeToIdleSeconds = "timeToIdleSeconds";
-                registry.setInt(prefix + timeToIdleSeconds, value.getTimeToIdleSeconds());
-            }
-            if (value.getTimeToLiveSeconds() != -1
-            ) {
-                String timeToLiveSeconds = "timeToLiveSeconds";
-                registry.setInt(prefix + timeToLiveSeconds, value.getTimeToLiveSeconds());
-            }
-            if (value.getMaxElementsInMemory() != -1
-            ) {
-                String maxElementsInMemory = "maxElementsInMemory";
-                registry.setInt(prefix + maxElementsInMemory, value.getMaxElementsInMemory());
-            }
-            if (value.getMaxElementsOnDisk() != -1
-            ) {
-                String maxElementsOnDisk = "maxElementsOnDisk";
-                registry.setInt(prefix + maxElementsOnDisk, value.getMaxElementsOnDisk());
-            }
-        }
-    }
-
-    private void writeLdapGroupMapping(String prefix, LdapGroupMapping value, Registry registry) {
-        if (value != null) {
-            if (value.getGroup() != null
-            ) {
-                String group = "group";
-                registry.setString(prefix + group, value.getGroup());
-            }
-            if (value.getRoleNames() != null && value.getRoleNames().size() > 0
-            ) {
-                registry.removeSubset(prefix + "roleNames");
-
-                int count = 0;
-                for (Iterator iter = value.getRoleNames().iterator(); iter.hasNext(); count++) {
-                    String name = "roleNames.roleName(" + count + ")";
-                    String roleName = (String) iter.next();
-                    registry.setString(prefix + name, roleName);
-                }
-            }
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/util/ConfigMapper.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/util/ConfigMapper.java
deleted file mode 100644 (file)
index f55dbbc..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.apache.archiva.configuration.util;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-/**
- * Helper class that can be used for mapping configuration keys (e.g. user configuration keys) to
- * archiva configuration objects.
- *
- * @param <T> The class used to retrieve the attribute data
- * @param <K> The class used to retrieve the data that is for prefix matching
- * @author Martin Stockhammer <martin_s@apache.org>
- * @since 3.0
- */
-public class ConfigMapper<T, K>
-{
-    private final Map<String, Function<T,  String>> stringFunctionMap = new HashMap<>( );
-    private final Map<String, Function<T,  Integer>> intFunctionMap = new HashMap<>( );
-    private final Map<String, Function<T,  Boolean>> booleanFunctionMap = new HashMap<>( );
-    private final Map<String, BiFunction<String, K, String>> prefixStringFunctionMap = new HashMap<>( );
-
-    public void addStringMapping( String attributeName, Function<T, String> mapping) {
-        this.stringFunctionMap.put( attributeName, mapping );
-    }
-
-    public void  addPrefixStringMapping(String prefix, BiFunction<String, K, String> mapping) {
-        prefixStringFunctionMap.put( prefix, mapping );
-    }
-
-    public String getString( String attributeName, T instance) {
-        return stringFunctionMap.get( attributeName ).apply( instance );
-    }
-
-    public String getPrefixString(String attributeName, K instance) {
-        BiFunction<String, K, String> function = prefixStringFunctionMap.entrySet( ).stream( ).filter( entry -> attributeName.startsWith( entry.getKey( ) ) ).findFirst( )
-            .map( entry -> entry.getValue( ) )
-            .get( );
-        return function.apply( attributeName, instance );
-    }
-
-    public boolean isStringMapping(String attributeName) {
-        return stringFunctionMap.containsKey( attributeName );
-    }
-
-    public boolean isIntMapping(String attributeName) {
-        return intFunctionMap.containsKey( attributeName );
-    }
-
-    public boolean isBooleanMapping(String attributeName) {
-        return booleanFunctionMap.containsKey( attributeName );
-    }
-
-    public boolean isPrefixMapping(String attributeName) {
-        return prefixStringFunctionMap.keySet( ).stream( ).anyMatch( prefix -> attributeName.startsWith( prefix ) );
-    }
-
-    public boolean isMapping(String attributeName) {
-        return isStringMapping( attributeName ) || isIntMapping( attributeName ) || isBooleanMapping( attributeName );
-    }
-
-    public void addIntMapping( String attributeName, Function<T, Integer> mapping) {
-        this.intFunctionMap.put( attributeName, mapping );
-    }
-
-    public int getInt( String attributeName, T instance) {
-        return this.intFunctionMap.get( attributeName ).apply( instance );
-    }
-
-    public void addBooleanMapping( String attributeName, Function<T, Boolean> mapping) {
-        this.booleanFunctionMap.put( attributeName, mapping );
-    }
-
-    public boolean getBoolean( String attributeName, T instance) {
-        return this.booleanFunctionMap.get( attributeName ).apply( instance );
-    }
-
-    public List<String> getStringAttributes() {
-        return new ArrayList<>( stringFunctionMap.keySet( ) );
-    }
-
-    public List<String> getIntAttributes() {
-        return new ArrayList<>( intFunctionMap.keySet( ) );
-    }
-
-    public List<String> getBooleanAttributes() {
-        return new ArrayList<>( booleanFunctionMap.keySet( ) );
-    }
-
-    public List<String> getAllAttributes() {
-        return Arrays.asList( stringFunctionMap,intFunctionMap, booleanFunctionMap).stream()
-            .flatMap( map->map.keySet().stream() ).collect( Collectors.toList());
-    }
-
-}
index 746f2c472bfb12ef15d5167803c476f3fc58f985..b8c5a7104191d0c97a32817d3d595dc13782f6da 100644 (file)
 
                 connectors.add( proxyConfig );
                 java.util.Collections.sort( connectors,
-                    org.apache.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator.getInstance() );
+                    org.apache.archiva.configuration.provider.functors.ProxyConnectorConfigurationOrderComparator.getInstance() );
             }
         }
 
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-configuration/src/main/resources/META-INF/spring-context.xml
deleted file mode 100644 (file)
index 3fe1e38..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
-       default-lazy-init="true">
-
-  <context:annotation-config/>
-  <context:component-scan base-package="org.apache.archiva.configuration"/>
-  <!-- olamy could be removed as only here temporary for plexus-spring -->
-  <alias name="archivaConfiguration#default" alias="archivaConfiguration"/>
-
-</beans>
\ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/archiva/configuration/default-archiva.xml b/archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/archiva/configuration/default-archiva.xml
deleted file mode 100644 (file)
index 5f3731d..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-  <version>3.0.0</version>
-  <managedRepositories>
-    <managedRepository>
-      <id>internal</id>
-      <name>Archiva Managed Internal Repository</name>
-      <location>${appserver.base}/repositories/internal</location>
-      <indexDir>${appserver.base}/repositories/internal/.indexer</indexDir>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <blockRedeployments>true</blockRedeployments>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
-      <retentionPeriod>30</retentionPeriod>
-    </managedRepository>
-    <managedRepository>
-      <id>snapshots</id>
-      <name>Archiva Managed Snapshot Repository</name>
-      <location>${appserver.base}/repositories/snapshots</location>
-      <indexDir>${appserver.base}/repositories/snapshots/.indexer</indexDir>
-      <layout>default</layout>
-      <releases>false</releases>
-      <snapshots>true</snapshots>
-      <blockRedeployments>false</blockRedeployments>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
-      <retentionPeriod>30</retentionPeriod>
-    </managedRepository>
-  </managedRepositories>
-  <remoteRepositories>
-    <remoteRepository>
-      <id>central</id>
-      <name>Central Repository</name>
-      <url>https://repo.maven.apache.org/maven2</url>
-      <layout>default</layout>
-    </remoteRepository>
-  </remoteRepositories>
-
-  <proxyConnectors>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>central</targetRepoId>
-      <proxyId/>
-      <policies>
-        <snapshots>disabled</snapshots>
-        <releases>once</releases>
-        <checksum>fix</checksum>
-        <cache-failures>cached</cache-failures>
-      </policies>
-      <whiteListPatterns>
-        <whiteListPattern>**/*</whiteListPattern>
-      </whiteListPatterns>
-    </proxyConnector>
-  </proxyConnectors>
-
-  <legacyArtifactPaths>
-    <legacyArtifactPath>
-        <path>jaxen/jars/jaxen-1.0-FCS-full.jar</path>
-        <artifact>jaxen:jaxen:1.0-FCS:full:jar</artifact>
-    </legacyArtifactPath>
-  </legacyArtifactPaths>
-
-  <repositoryScanning>
-    <fileTypes>
-      <fileType>
-        <id>artifacts</id>
-        <patterns>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.jar</pattern>
-          <pattern>**/*.ear</pattern>
-          <pattern>**/*.war</pattern>
-          <pattern>**/*.car</pattern>
-          <pattern>**/*.sar</pattern>
-          <pattern>**/*.mar</pattern>
-          <pattern>**/*.rar</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-          <pattern>**/*.tar.gz</pattern>
-          <pattern>**/*.tar.bz2</pattern>
-          <pattern>**/*.zip</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>indexable-content</id>
-        <patterns>
-          <pattern>**/*.txt</pattern>
-          <pattern>**/*.TXT</pattern>
-          <pattern>**/*.block</pattern>
-          <pattern>**/*.config</pattern>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.xml</pattern>
-          <pattern>**/*.xsd</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>auto-remove</id>
-        <patterns>
-          <pattern>**/*.bak</pattern>
-          <pattern>**/*~</pattern>
-          <pattern>**/*-</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>ignored</id>
-        <patterns>
-          <pattern>**/.htaccess</pattern>
-          <pattern>**/KEYS</pattern>
-          <pattern>**/*.rb</pattern>
-          <pattern>**/*.sh</pattern>
-          <pattern>**/.svn/**</pattern>
-          <pattern>**/.DAV/**</pattern>
-          <pattern>.index/**</pattern>
-          <pattern>.indexer/**</pattern>
-        </patterns>
-      </fileType>
-    </fileTypes>
-    <knownContentConsumers>
-      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
-      <knownContentConsumer>validate-checksum</knownContentConsumer>
-      <knownContentConsumer>validate-signature</knownContentConsumer>
-      <knownContentConsumer>index-content</knownContentConsumer>
-      <knownContentConsumer>auto-remove</knownContentConsumer>
-      <knownContentConsumer>auto-rename</knownContentConsumer>
-      <knownContentConsumer>metadata-updater</knownContentConsumer>
-      <knownContentConsumer>create-archiva-metadata</knownContentConsumer>
-      <knownContentConsumer>duplicate-artifacts</knownContentConsumer>
-      <!--knownContentConsumer>repository-purge</knownContentConsumer-->
-    </knownContentConsumers>
-    <invalidContentConsumers>
-      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
-    </invalidContentConsumers>
-  </repositoryScanning>
-
-  <webapp>
-    <ui>
-      <showFindArtifacts>true</showFindArtifacts>
-      <appletFindEnabled>true</appletFindEnabled>
-    </ui>
-  </webapp>
-
-  <archivaRuntimeConfiguration>
-    <checksumTypes>
-      <type>MD5</type>
-      <type>SHA1</type>
-      <type>SHA256</type>
-    </checksumTypes>
-  </archivaRuntimeConfiguration>
-
-  <redbackRuntimeConfiguration>
-    <userManagerImpls>
-      <userManagerImpl>jpa</userManagerImpl>
-    </userManagerImpls>
-    <rbacManagerImpls>
-      <rbacManagerImpl>cached</rbacManagerImpl>
-    </rbacManagerImpls>
-  </redbackRuntimeConfiguration>
-
-  <archivaDefaultConfiguration>
-    <defaultCheckPaths>
-      <defaultCheckPath>
-        <url>http://download.oracle.com/maven</url>
-        <path>com/sleepycat/je/license.txt</path>
-      </defaultCheckPath>
-      <defaultCheckPath>
-        <url>https://download.oracle.com/maven</url>
-        <path>com/sleepycat/je/license.txt</path>
-      </defaultCheckPath>
-    </defaultCheckPaths>
-  </archivaDefaultConfiguration>
-
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml
deleted file mode 100644 (file)
index c803243..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<configuration>
-  <repositories>
-    <repository>
-      <directory>managed-repository</directory>
-      <id>local</id>
-      <name>local</name>
-    </repository>
-  </repositories>
-  <proxiedRepositories>
-    <proxiedRepository>
-      <url>http://www.ibiblio.org/maven2/</url>
-      <managedRepository>local</managedRepository>
-      <useNetworkProxy>true</useNetworkProxy>
-      <id>ibiblio</id>
-      <name>Ibiblio</name>
-    </proxiedRepository>
-    <proxiedRepository>
-      <url>http://repository.codehaus.org/</url>
-      <managedRepository>local</managedRepository>
-      <id>codehaus</id>
-      <name>Codehaus</name>
-    </proxiedRepository>
-  </proxiedRepositories>
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-1.3.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-1.3.xml
deleted file mode 100644 (file)
index 8575ebd..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<configuration>
-<version>2</version>
-<repositoryScanning>
-<fileTypes>
-<fileType>
-<id>artifacts</id>
-<patterns>
-<pattern>**/*.pom</pattern>
-<pattern>**/*.jar</pattern>
-<pattern>**/*.ear</pattern>
-<pattern>**/*.war</pattern>
-<pattern>**/*.car</pattern>
-<pattern>**/*.sar</pattern>
-<pattern>**/*.mar</pattern>
-<pattern>**/*.rar</pattern>
-<pattern>**/*.dtd</pattern>
-<pattern>**/*.tld</pattern>
-<pattern>**/*.tar.gz</pattern>
-<pattern>**/*.tar.bz2</pattern>
-<pattern>**/*.zip</pattern>
-</patterns>
-</fileType>
-<fileType>
-<id>indexable-content</id>
-<patterns>
-<pattern>**/*.txt</pattern>
-<pattern>**/*.TXT</pattern>
-<pattern>**/*.block</pattern>
-<pattern>**/*.config</pattern>
-<pattern>**/*.pom</pattern>
-<pattern>**/*.xml</pattern>
-<pattern>**/*.xsd</pattern>
-<pattern>**/*.dtd</pattern>
-<pattern>**/*.tld</pattern>
-</patterns>
-</fileType>
-<fileType>
-<id>auto-remove</id>
-<patterns>
-<pattern>**/*.bak</pattern>
-<pattern>**/*~</pattern>
-<pattern>**/*-</pattern>
-</patterns>
-</fileType>
-<fileType>
-<id>ignored</id>
-<patterns>
-<pattern>**/.htaccess</pattern>
-<pattern>**/KEYS</pattern>
-<pattern>**/*.rb</pattern>
-<pattern>**/*.sh</pattern>
-<pattern>**/.svn/**</pattern>
-<pattern>**/.DAV/**</pattern>
-</patterns>
-</fileType>
-</fileTypes>
-<knownContentConsumers>
-<knownContentConsumer>update-db-artifact</knownContentConsumer>
-<knownContentConsumer>create-missing-checksums</knownContentConsumer>
-<knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
-<knownContentConsumer>validate-checksum</knownContentConsumer>
-<knownContentConsumer>validate-signature</knownContentConsumer>
-<knownContentConsumer>index-content</knownContentConsumer>
-<knownContentConsumer>auto-remove</knownContentConsumer>
-<knownContentConsumer>auto-rename</knownContentConsumer>
-<knownContentConsumer>metadata-updater</knownContentConsumer>
-</knownContentConsumers>
-<invalidContentConsumers>
-<invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
-</invalidContentConsumers>
-</repositoryScanning>
-<databaseScanning>
-<cronExpression>0 0 * * * ?</cronExpression>
-<unprocessedConsumers>
-<unprocessedConsumer>update-db-project</unprocessedConsumer>
-</unprocessedConsumers>
-<cleanupConsumers>
-<cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
-<cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
-<cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
-</cleanupConsumers>
-</databaseScanning>
-<managedRepositories>
-<managedRepository>
-<location>${appserver.base}/data/repositories/internal</location>
-<blockRedeployments>true</blockRedeployments>
-<retentionPeriod>30</retentionPeriod>
-<id>internal</id>
-<name>Archiva Managed Internal Repository</name>
-</managedRepository>
-<managedRepository>
-<location>${appserver.base}/data/repositories/snapshots</location>
-<releases>false</releases>
-<snapshots>true</snapshots>
-<refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
-<retentionPeriod>30</retentionPeriod>
-<id>snapshots</id>
-<name>Archiva Managed Snapshot Repository</name>
-</managedRepository>
-</managedRepositories>
-<remoteRepositories>
-<remoteRepository>
-<url>http://repo1.maven.org/maven2</url>
-<id>central</id>
-<name>Central Repository</name>
-</remoteRepository>
-<remoteRepository>
-<url>http://download.java.net/maven/2/</url>
-<id>maven2-repository.dev.java.net</id>
-<name>Java.net Repository for Maven 2</name>
-</remoteRepository>
-</remoteRepositories>
-<proxyConnectors>
-<proxyConnector>
-<order>1</order>
-<sourceRepoId>internal</sourceRepoId>
-<targetRepoId>central</targetRepoId>
-<proxyId/>
-<whiteListPatterns>
-<whiteListPattern>**/*</whiteListPattern>
-</whiteListPatterns>
-<policies>
-<releases>once</releases>
-<checksum>fix</checksum>
-<snapshots>never</snapshots>
-<cache-failures>yes</cache-failures>
-</policies>
-</proxyConnector>
-<proxyConnector>
-<order>2</order>
-<sourceRepoId>internal</sourceRepoId>
-<targetRepoId>maven2-repository.dev.java.net</targetRepoId>
-<proxyId/>
-<whiteListPatterns>
-<whiteListPattern>javax/**</whiteListPattern>
-<whiteListPattern>org/jvnet/**</whiteListPattern>
-<whiteListPattern>com/sun/**</whiteListPattern>
-</whiteListPatterns>
-<policies>
-<releases>once</releases>
-<checksum>fix</checksum>
-<snapshots>never</snapshots>
-<cache-failures>yes</cache-failures>
-</policies>
-</proxyConnector>
-</proxyConnectors>
-<legacyArtifactPaths>
-<legacyArtifactPath>
-<path>jaxen/jars/jaxen-1.0-FCS-full.jar</path>
-<artifact>jaxen:jaxen:1.0-FCS:full:jar</artifact>
-</legacyArtifactPath>
-</legacyArtifactPaths>
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-v1.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-v1.xml
deleted file mode 100644 (file)
index 2b05c92..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<configuration>
-  <repositories>
-    <repository>
-      <id>internal</id>
-      <name>Archiva Managed Internal Repository</name>
-      <url>file://${appserver.base}/repositories/internal</url>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <indexed>true</indexed>
-      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
-    </repository>
-    <repository>
-      <id>snapshots</id>
-      <name>Archiva Managed Snapshot Repository</name>
-      <url>file://${appserver.base}/repositories/snapshots</url>
-      <layout>default</layout>
-      <releases>false</releases>
-      <snapshots>true</snapshots>
-      <indexed>false</indexed>
-      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
-    </repository>
-    <repository>
-      <id>central</id>
-      <name>Central Repository</name>
-      <url>http://repo1.maven.org/maven2</url>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <indexed>false</indexed>
-    </repository>
-    <repository>
-      <id>maven2-repository.dev.java.net</id>
-      <name>Java.net Repository for Maven 2</name>
-      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <indexed>false</indexed>
-    </repository>
-  </repositories>
-
-  <proxyConnectors>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>central</targetRepoId>
-      <proxyId/>
-      <snapshotsPolicy>disabled</snapshotsPolicy>
-      <releasePolicy>never</releasePolicy>
-      <failurePolicy>not-found</failurePolicy>
-    </proxyConnector>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
-      <proxyId/>
-      <snapshotsPolicy>disabled</snapshotsPolicy>
-      <releasePolicy>never</releasePolicy>
-      <failurePolicy>not-found</failurePolicy>
-      <whiteListPatterns>
-        <whiteListPattern>javax/**</whiteListPattern>
-      </whiteListPatterns>
-    </proxyConnector>
-  </proxyConnectors>
-
-  <networkProxies>
-    <networkProxy>
-      <id>example</id>
-      <protocol>http</protocol>
-      <host>proxy.mycompany.com</host>
-      <port>8080</port>
-      <username>myself</username>
-      <password>mypass</password>
-    </networkProxy>
-  </networkProxies>
-
-  <repositoryScanning>
-    <fileTypes>
-      <fileType>
-        <id>artifacts</id>
-        <patterns>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.jar</pattern>
-          <pattern>**/*.ear</pattern>
-          <pattern>**/*.war</pattern>
-          <pattern>**/*.car</pattern>
-          <pattern>**/*.sar</pattern>
-          <pattern>**/*.mar</pattern>
-          <pattern>**/*.rar</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-          <pattern>**/*.tar.gz</pattern>
-          <pattern>**/*.tar.bz2</pattern>
-          <pattern>**/*.zip</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>indexable-content</id>
-        <patterns>
-          <pattern>**/*.txt</pattern>
-          <pattern>**/*.TXT</pattern>
-          <pattern>**/*.block</pattern>
-          <pattern>**/*.config</pattern>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.xml</pattern>
-          <pattern>**/*.xsd</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>auto-remove</id>
-        <patterns>
-          <pattern>**/*.bak</pattern>
-          <pattern>**/*~</pattern>
-          <pattern>**/*-</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>ignored</id>
-        <patterns>
-          <pattern>**/.htaccess</pattern>
-          <pattern>**/KEYS</pattern>
-          <pattern>**/*.rb</pattern>
-          <pattern>**/*.sh</pattern>
-          <pattern>**/.svn/**</pattern>
-          <pattern>**/.DAV/**</pattern>
-        </patterns>
-      </fileType>
-    </fileTypes>
-    <knownContentConsumers>
-      <knownContentConsumer>update-db-artifact</knownContentConsumer>
-      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
-      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
-      <knownContentConsumer>validate-checksum</knownContentConsumer>
-      <knownContentConsumer>validate-signature</knownContentConsumer>
-      <knownContentConsumer>index-content</knownContentConsumer>
-      <knownContentConsumer>auto-remove</knownContentConsumer>
-      <knownContentConsumer>auto-rename</knownContentConsumer>
-      <knownContentConsumer>metadata-updater</knownContentConsumer>
-      <!--knownContentConsumer>repository-purge</knownContentConsumer-->
-    </knownContentConsumers>
-    <invalidContentConsumers>
-      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
-    </invalidContentConsumers>
-  </repositoryScanning>
-
-  <databaseScanning>
-    <cronExpression>0 0 * * * ?</cronExpression>
-    <unprocessedConsumers>
-      <unprocessedConsumer>index-artifact</unprocessedConsumer>
-      <unprocessedConsumer>update-db-project</unprocessedConsumer>
-      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
-      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
-      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
-      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
-    </unprocessedConsumers>
-    <cleanupConsumers>
-      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
-    </cleanupConsumers>
-  </databaseScanning>
-
-  <webapp>
-    <ui>
-      <showFindArtifacts>true</showFindArtifacts>
-      <appletFindEnabled>true</appletFindEnabled>
-    </ui>
-  </webapp>
-
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml
deleted file mode 100644 (file)
index 29f3775..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<configuration>
-  <repositories>
-    <repository>
-      <id>internal</id>
-      <name>Archiva Managed Internal Repository</name>
-      <url>file://${appserver.base}/repositories/internal</url>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <indexed>true</indexed>
-      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
-    </repository>
-    <repository>
-      <id>snapshots</id>
-      <name>Archiva Managed Snapshot Repository</name>
-      <url>file:${appserver.base}/repositories/snapshots</url>
-      <layout>default</layout>
-      <releases>false</releases>
-      <snapshots>true</snapshots>
-      <indexed>true</indexed>
-      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
-    </repository>
-    <repository>
-      <id>central</id>
-      <name>Central Repository</name>
-      <url>http://repo1.maven.org/maven2</url>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <indexed>false</indexed>
-    </repository>
-    <repository>
-      <id>maven2-repository.dev.java.net</id>
-      <name>Java.net Repository for Maven 2</name>
-      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <indexed>false</indexed>
-    </repository>
-  </repositories>
-
-  <proxyConnectors>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>central</targetRepoId>
-      <proxyId/>
-      <snapshotsPolicy>disabled</snapshotsPolicy>
-      <releasePolicy>never</releasePolicy>
-      <failurePolicy>not-found</failurePolicy>
-    </proxyConnector>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
-      <proxyId/>
-      <snapshotsPolicy>disabled</snapshotsPolicy>
-      <releasePolicy>never</releasePolicy>
-      <failurePolicy>not-found</failurePolicy>
-      <whiteListPatterns>
-        <whiteListPattern>javax/**</whiteListPattern>
-      </whiteListPatterns>
-    </proxyConnector>
-  </proxyConnectors>
-
-  <networkProxies>
-    <networkProxy>
-      <id>example</id>
-      <protocol>http</protocol>
-      <host>proxy.mycompany.com</host>
-      <port>8080</port>
-      <username>myself</username>
-      <password>mypass</password>
-    </networkProxy>
-  </networkProxies>
-
-  <repositoryScanning>
-    <fileTypes>
-      <fileType>
-        <id>artifacts</id>
-        <patterns>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.jar</pattern>
-          <pattern>**/*.ear</pattern>
-          <pattern>**/*.war</pattern>
-          <pattern>**/*.car</pattern>
-          <pattern>**/*.sar</pattern>
-          <pattern>**/*.mar</pattern>
-          <pattern>**/*.rar</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-          <pattern>**/*.tar.gz</pattern>
-          <pattern>**/*.tar.bz2</pattern>
-          <pattern>**/*.zip</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>indexable-content</id>
-        <patterns>
-          <pattern>**/*.txt</pattern>
-          <pattern>**/*.TXT</pattern>
-          <pattern>**/*.block</pattern>
-          <pattern>**/*.config</pattern>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.xml</pattern>
-          <pattern>**/*.xsd</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>auto-remove</id>
-        <patterns>
-          <pattern>**/*.bak</pattern>
-          <pattern>**/*~</pattern>
-          <pattern>**/*-</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>ignored</id>
-        <patterns>
-          <pattern>**/.htaccess</pattern>
-          <pattern>**/KEYS</pattern>
-          <pattern>**/*.rb</pattern>
-          <pattern>**/*.sh</pattern>
-          <pattern>**/.svn/**</pattern>
-          <pattern>**/.DAV/**</pattern>
-        </patterns>
-      </fileType>
-    </fileTypes>
-    <knownContentConsumers>
-      <knownContentConsumer>update-db-artifact</knownContentConsumer>
-      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
-      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
-      <knownContentConsumer>validate-checksum</knownContentConsumer>
-      <knownContentConsumer>validate-signature</knownContentConsumer>
-      <knownContentConsumer>index-content</knownContentConsumer>
-      <knownContentConsumer>auto-remove</knownContentConsumer>
-      <knownContentConsumer>auto-rename</knownContentConsumer>
-      <knownContentConsumer>metadata-updater</knownContentConsumer>
-    </knownContentConsumers>
-    <invalidContentConsumers>
-      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
-    </invalidContentConsumers>
-  </repositoryScanning>
-
-  <databaseScanning>
-    <cronExpression>0 0 * * * ?</cronExpression>
-    <unprocessedConsumers>
-      <unprocessedConsumer>index-artifact</unprocessedConsumer>
-      <unprocessedConsumer>update-db-project</unprocessedConsumer>
-      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
-      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
-      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
-      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
-    </unprocessedConsumers>
-    <cleanupConsumers>
-      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
-    </cleanupConsumers>
-  </databaseScanning>
-
-  <webapp>
-    <ui>
-      <showFindArtifacts>true</showFindArtifacts>
-      <appletFindEnabled>true</appletFindEnabled>
-    </ui>
-  </webapp>
-
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-base.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-base.xml
deleted file mode 100644 (file)
index 84ab085..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<configuration>
-  <version>2</version>
-  <managedRepositories>
-    <managedRepository>
-      <id>internal</id>
-      <name>Archiva Managed Internal Repository</name>
-      <location>${appserver.base}/repositories/internal</location>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
-    </managedRepository>
-    <managedRepository>
-      <id>snapshots</id>
-      <name>Archiva Managed Snapshot Repository</name>
-      <location>${appserver.base}/repositories/snapshots</location>
-      <layout>default</layout>
-      <releases>false</releases>
-      <snapshots>true</snapshots>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
-    </managedRepository>
-  </managedRepositories>
-  <remoteRepositories>
-    <remoteRepository>
-      <id>central</id>
-      <name>Central Repository</name>
-      <url>http://repo1.maven.org/maven2</url>
-      <layout>default</layout>
-    </remoteRepository>
-    <remoteRepository>
-      <id>maven2-repository.dev.java.net</id>
-      <name>Java.net Repository for Maven 2</name>
-      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
-      <layout>default</layout>
-    </remoteRepository>
-  </remoteRepositories>
-
-  <webapp>
-    <ui>
-      <showFindArtifacts>false</showFindArtifacts>
-    </ui>
-  </webapp>
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml
deleted file mode 100644 (file)
index 3e3d4dc..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<configuration>
-  <version>2</version>
-  <repositoryGroups>
-    <repositoryGroup>
-      <id>default</id>
-      <repositories>
-        <repository>snapshots</repository>
-      </repositories>
-    </repositoryGroup>
-  </repositoryGroups>
-  <managedRepositories>
-    <managedRepository>
-      <id>snapshots</id>
-      <name>Archiva Managed Snapshot Repository</name>
-      <location>${appserver.base}/repositories/snapshots</location>
-      <layout>default</layout>
-      <releases>false</releases>
-      <snapshots>true</snapshots>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
-    </managedRepository>
-  </managedRepositories>
-  <remoteRepositories>
-    <remoteRepository>
-      <id>central</id>
-      <name>Central Repository</name>
-      <url>http://repo1.maven.org/maven2</url>
-      <layout>default</layout>
-    </remoteRepository>
-  </remoteRepositories>
-  <proxyConnectors>
-    <proxyConnector>
-      <order>2</order>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
-      <proxyId/>
-      <whiteListPatterns>
-        <whiteListPattern>javax/**</whiteListPattern>
-      </whiteListPatterns>
-      <policies>
-        <releases>once</releases>
-        <checksum>fix</checksum>
-        <snapshots>never</snapshots>
-        <cache-failures>yes</cache-failures>
-      </policies>
-    </proxyConnector>
-  </proxyConnectors>
-  <networkProxies>
-    <networkProxy>
-      <id>proxy</id>
-      <host>proxy</host>
-      <port>8080</port>
-    </networkProxy>
-  </networkProxies>
-  <legacyArtifactPaths>
-    <legacyArtifactPath>
-      <path>jaxen/jars/jaxen-1.0-FCS-full.jar</path>
-      <artifact>jaxen:jaxen:1.0-FCS:full:jar</artifact>
-    </legacyArtifactPath>
-  </legacyArtifactPaths>
-  <repositoryScanning>
-    <knownContentConsumers>
-      <knownContentConsumer>auto-remove</knownContentConsumer>
-    </knownContentConsumers>
-    <invalidContentConsumers>
-      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
-    </invalidContentConsumers>
-  </repositoryScanning>
-  <databaseScanning>
-    <unprocessedConsumers>
-      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
-    </unprocessedConsumers>
-    <cleanupConsumers>
-      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
-    </cleanupConsumers>
-  </databaseScanning>
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-user.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-user.xml
deleted file mode 100644 (file)
index 61c4dad..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<configuration>
-  <version>2</version>
-  <proxyConnectors>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>central</targetRepoId>
-      <proxyId/>
-      <snapshotsPolicy>disabled</snapshotsPolicy>
-      <releasePolicy>never</releasePolicy>
-      <failurePolicy>not-found</failurePolicy>
-    </proxyConnector>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
-      <proxyId/>
-      <snapshotsPolicy>disabled</snapshotsPolicy>
-      <releasePolicy>never</releasePolicy>
-      <failurePolicy>not-found</failurePolicy>
-      <whiteListPatterns>
-        <whiteListPattern>javax/**</whiteListPattern>
-      </whiteListPatterns>
-    </proxyConnector>
-  </proxyConnectors>
-
-  <webapp>
-    <ui>
-      <appletFindEnabled>false</appletFindEnabled>
-    </ui>
-  </webapp>
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/corrupt.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/corrupt.xml
deleted file mode 100644 (file)
index b446928..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/escape-cron-expressions.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/escape-cron-expressions.xml
deleted file mode 100644 (file)
index 547e8c0..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<configuration>
-  <version>2</version>
-  <managedRepositories>
-    <managedRepository>
-      <id>snapshots</id>
-      <name>Archiva Managed Snapshot Repository</name>
-      <location>file://${appserver.base}/repositories/internal</location>
-      <releases>false</releases>
-      <snapshots>true</snapshots>
-      <refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
-    </managedRepository>
-  </managedRepositories>
-  <databaseScanning>
-    <cronExpression>0 0 0 * * ?</cronExpression>
-    <unprocessedConsumers>
-      <unprocessedConsumer>index-artifact</unprocessedConsumer>
-      <unprocessedConsumer>update-db-project</unprocessedConsumer>
-      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
-      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
-      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
-      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
-    </unprocessedConsumers>
-    <cleanupConsumers>
-      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
-    </cleanupConsumers>
-  </databaseScanning>
-
-  <webapp>
-    <ui>
-      <showFindArtifacts>false</showFindArtifacts>
-    </ui>
-  </webapp>
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/maven-proxy-complete.conf b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/maven-proxy-complete.conf
deleted file mode 100644 (file)
index dd98bba..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-################ GLOBAL SETTINGS
-# This is where maven-proxy stores files it has downloaded
-repo.local.store=target
-
-#The port to listen on - not used if loaded as a webapp
-port=9999
-
-#This is the base area that all files are loaded from. While it is possible to leave this blank, this behaviour
-#is deprecated and will be disabled in version 2.0.  There are too many namespace conflicts caused by not using
-#a prefix.
-#The repository will be shown at http://localhost:9999/repository/
-#for the .war loaded into a webapp server, the default prefix is "repository" (edit the web.xml to change)
-# As maven doesn't like a trailing slash, this address shouldn't have one either.
-prefix=repository
-
-#This is the simple date format used to display the last modified date while browsing the repository.
-lastModifiedDateFormat=yyyy/MM/dd HH:mm:ss
-
-################ SNAPSHOT HANDLING
-#If you want the proxy to look for newer snapshots, set to true
-snapshot.update=true
-
-################ M2 METADATA HANDLING
-#If you want the proxy to prevent looking for newer metadata, set to false (default is true)
-#metadata.update=false
-
-################ M2 POM HANDLING
-#If you want the proxy to look for newer POMs, set to true (default is false)
-pom.update=true
-
-################ PROMOTION HANDLING
-# ***** NOT CURRENTLY IMPLEMENTED *****
-#Promotion describes the process by which new artifacts are loaded to global maven-proxy repository.  It
-# is designed to be used by "higher security installations" that do not want to acquire artifacts from
-# remote repositories without approval.
-#
-#If promotion handling is enabled, then the proxy will not download remote artifacts without permission
-# (local repositories with copy=false are considered to be local)
-#
-#Permission to download is granted via the Promotion menu which will be enabled
-#  when promotion handling is enabled.
-#
-#If promotion is false, artifacts are sourced from any repository as per normal.
-#
-#Promotion and snapshots:  If promotion is enabled, snapshots are not downloadable.  The concept of using
-# a snapshot in a production build (which is primarily what promotion is for) is counterintuitive.
-##
-promotion=false
-
-################ WEB INTERFACE
-# This defines the absolute URL the server should use to identify itself.
-# This can often be determined automatically, but we recommend you specify
-# it explicitly to prevent problems during startup.
-# The prefix will be added to this for the actual repository
-# i.e. proxy available at http://localhost:9999/, repository at http://localhost:9999/repository
-serverName=http://localhost:9999
-
-#If true, the repository can be browsed
-browsable=true
-
-#If true, the repository can be searched
-searchable=true
-
-#Not currently implemented. Will allow webdav access to the repository at some point.
-webdav=true
-
-#Stylesheet - if configured, will override the default stylesheet shipped with maven-proxy - absolute URLs only
-#eg.  /maven-proxy/style.css, http://www.example.com/style.css
-stylesheet=/maven-proxy/style.css
-
-#bgColor / bgColorHighlight are replaced in the built in stylesheet to produce a simple color scheme.
-#If a stylesheet is set, these are not used.
-bgColor=#14B
-bgColorHighlight=#94B
-
-#rowColor / rowColorHighlight are replaced in the built in stylesheet to produce a simple color scheme.
-#If a stylesheet is set, these are not used.
-rowColor=#CCF
-rowColorHighlight=#DDF
-
-
-################ PROXIES
-#This is just a hack, it should auto discover them
-proxy.list=one,two,three
-
-#Unauthenticated proxy
-proxy.one.host=proxy1.example.com
-proxy.one.port=3128
-
-#Authenticated proxy
-proxy.two.host=proxy2.example.org
-proxy.two.port=80
-proxy.two.username=username2
-proxy.two.password=password2
-
-#Authenticated proxy
-proxy.three.host=proxy3.example.net
-proxy.three.port=3129
-proxy.three.username=username3
-proxy.three.password=password3
-
-
-################# REPOSITORIES
-#This is not just a hack, it specifies the order repositories should be checked
-#Note that the proxy adds a "/" which is why the urls aren't suffixed with a "/"
-repo.list=local-repo,www-ibiblio-org,dist-codehaus-org,private-example-com
-
-#local-store
-# The local store represents a location that local jars you host can be located.
-# This could also be achieved by having a local http repository, but this is less cumbersome
-repo.local-repo.url=file://target
-repo.local-repo.description=Super Secret Custom Repository
-#If copy is true, jars are copied from the store to the proxy-repo. Only configurable for file:/// repos
-repo.local-repo.copy=false
-#If hardfail is true, any unexpected errors from the repository will cause
-#the client download to fail (typically with a 500 error)
-repo.local-repo.hardfail=true
-#Don't cache a file repository
-repo.local-repo.cache.period=0
-
-
-#www.ibiblio.org
-repo.www-ibiblio-org.url=http://www.ibiblio.org/maven2
-repo.www-ibiblio-org.description=www.ibiblio.org
-repo.www-ibiblio-org.proxy=one
-repo.www-ibiblio-org.hardfail=true
-#Cache this repository for 1 hour
-repo.www-ibiblio-org.cache.period=3600
-repo.www-ibiblio-org.cache.failures=true
-
-#dist.codehaus.org
-repo.dist-codehaus-org.url=http://dist.codehaus.org
-repo.dist-codehaus-org.proxy=two
-repo.dist-codehaus-org.hardfail=false
-repo.dist-codehaus-org.cache.period=3600
-repo.dist-codehaus-org.cache.failures=true
-
-#private.example.com
-repo.private-example-com.url=http://private.example.com/internal
-repo.private-example-com.description=Commercial In Confidence Repository
-repo.private-example-com.username=username1
-repo.private-example-com.password=password1
-repo.private-example-com.proxy=three
-repo.private-example-com.cache.period=3600
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml
deleted file mode 100644 (file)
index 8fabacf..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<configuration>
-  <version>2</version>
-  <managedRepositories>
-    <managedRepository>
-      <id>internal</id>
-      <name>Archiva Managed Internal Repository</name>
-      <location>${appserver.base}/repositories/internal</location>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
-    </managedRepository>
-    <managedRepository>
-      <id>snapshots</id>
-      <name>Archiva Managed Snapshot Repository</name>
-      <location>${appserver.base}/repositories/internal</location>
-      <layout>default</layout>
-      <releases>false</releases>
-      <snapshots>true</snapshots>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0,30 * * * ?</refreshCronExpression>
-    </managedRepository>
-  </managedRepositories>
-  <remoteRepositories>
-    <remoteRepository>
-      <id>central</id>
-      <name>Central Repository</name>
-      <url>http://repo1.maven.org/maven2</url>
-      <layout>default</layout>
-    </remoteRepository>
-    <remoteRepository>
-      <id>maven2-repository.dev.java.net</id>
-      <name>Java.net Repository for Maven 2</name>
-      <url>https://maven2-repository.dev.java.net/nonav/repository</url>
-      <layout>default</layout>
-      <username></username>
-      <password></password>
-    </remoteRepository>
-  </remoteRepositories>
-
-  <proxyConnectors>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>central</targetRepoId>
-      <proxyId/>
-      <policies>
-        <releases>ignored</releases>
-        <snapshots>disabled</snapshots>
-        <cache-failures>cached</cache-failures>
-      </policies>
-    </proxyConnector>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
-      <proxyId/>
-      <policies>
-        <releases>ignored</releases>
-        <snapshots>disabled</snapshots>
-        <cache-failures>cached</cache-failures>
-      </policies>
-      <whiteListPatterns>
-        <whiteListPattern>javax/**</whiteListPattern>
-      </whiteListPatterns>
-    </proxyConnector>
-  </proxyConnectors>
-
-  <networkProxies>
-    <networkProxy>
-      <id>example</id>
-      <protocol>http</protocol>
-      <host>proxy.mycompany.com</host>
-      <port>8080</port>
-      <username>myself</username>
-      <password>mypass</password>
-    </networkProxy>
-  </networkProxies>
-
-  <repositoryScanning>
-    <fileTypes>
-      <fileType>
-        <id>artifacts</id>
-        <patterns>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.jar</pattern>
-          <pattern>**/*.ear</pattern>
-          <pattern>**/*.war</pattern>
-          <pattern>**/*.car</pattern>
-          <pattern>**/*.sar</pattern>
-          <pattern>**/*.mar</pattern>
-          <pattern>**/*.rar</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-          <pattern>**/*.tar.gz</pattern>
-          <pattern>**/*.tar.bz2</pattern>
-          <pattern>**/*.zip</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>indexable-content</id>
-        <patterns>
-          <pattern>**/*.txt</pattern>
-          <pattern>**/*.TXT</pattern>
-          <pattern>**/*.block</pattern>
-          <pattern>**/*.config</pattern>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.xml</pattern>
-          <pattern>**/*.xsd</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>auto-remove</id>
-        <patterns>
-          <pattern>**/*.bak</pattern>
-          <pattern>**/*~</pattern>
-          <pattern>**/*-</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>ignored</id>
-        <patterns>
-          <pattern>**/.htaccess</pattern>
-          <pattern>**/KEYS</pattern>
-          <pattern>**/*.rb</pattern>
-          <pattern>**/*.sh</pattern>
-          <pattern>**/.svn/**</pattern>
-          <pattern>**/.DAV/**</pattern>
-        </patterns>
-      </fileType>
-    </fileTypes>
-    <knownContentConsumers>
-      <knownContentConsumer>update-db-artifact</knownContentConsumer>
-      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
-      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
-      <knownContentConsumer>validate-checksum</knownContentConsumer>
-      <knownContentConsumer>validate-signature</knownContentConsumer>
-      <knownContentConsumer>index-content</knownContentConsumer>
-      <knownContentConsumer>auto-remove</knownContentConsumer>
-      <knownContentConsumer>auto-rename</knownContentConsumer>
-      <knownContentConsumer>metadata-updater</knownContentConsumer>
-    </knownContentConsumers>
-    <invalidContentConsumers>
-      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
-    </invalidContentConsumers>
-  </repositoryScanning>
-
-  <databaseScanning>
-    <cronExpression>0 0 * * * ?</cronExpression>
-    <unprocessedConsumers>
-      <unprocessedConsumer>index-artifact</unprocessedConsumer>
-      <unprocessedConsumer>update-db-project</unprocessedConsumer>
-      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
-      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
-      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
-      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
-    </unprocessedConsumers>
-    <cleanupConsumers>
-      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
-    </cleanupConsumers>
-  </databaseScanning>
-
-  <webapp>
-    <ui>
-      <showFindArtifacts>true</showFindArtifacts>
-      <appletFindEnabled>true</appletFindEnabled>
-    </ui>
-  </webapp>
-
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationMRM789Test.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationMRM789Test.java
deleted file mode 100644 (file)
index d7b4c6f..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.context.ApplicationContext;
-import org.springframework.test.context.ContextConfiguration;
-
-import javax.inject.Inject;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.List;
-
-import static org.junit.Assert.*;
-
-/**
- * Test the configuration store.
- */
-@RunWith( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
-public class ArchivaConfigurationMRM789Test
-{
-
-    private static String FILE_ENCODING = "UTF-8";
-
-    @Inject
-    protected ApplicationContext applicationContext;
-
-    @Inject
-    FileTypes filetypes;
-
-    public static Path getTestFile( String path )
-    {
-        return Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), path );
-    }
-
-    @SuppressWarnings( "unchecked" )
-    protected <T> T lookup( Class<T> clazz, String hint )
-    {
-        return (T) applicationContext.getBean( "archivaConfiguration#" + hint, ArchivaConfiguration.class );
-    }
-   
-    // test for [MRM-789]
-    @Test
-    public void testGetConfigurationFromDefaultsWithDefaultRepoLocationAlreadyExisting()
-        throws Exception
-    {
-        Path repo = Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "target/test-classes/existing_snapshots" );
-        Files.createDirectories(repo);
-
-        repo = Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), "target/test-classes/existing_internal" );
-        Files.createDirectories(repo);
-
-        String existingTestDefaultArchivaConfigFile = FileUtils.readFileToString(
-            getTestFile( "target/test-classes/org/apache/archiva/configuration/test-default-archiva.xml" ).toFile(), FILE_ENCODING );
-        existingTestDefaultArchivaConfigFile =
-            StringUtils.replace( existingTestDefaultArchivaConfigFile, "${appserver.base}", org.apache.archiva.common.utils.FileUtils.getBasedir() );
-
-        Path generatedTestDefaultArchivaConfigFile = Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(),
-                                                               "target/test-classes/org/apache/archiva/configuration/default-archiva.xml" );
-
-        FileUtils.writeStringToFile( generatedTestDefaultArchivaConfigFile.toFile(), existingTestDefaultArchivaConfigFile,
-                                     Charset.forName(FILE_ENCODING) );
-
-        ArchivaConfiguration archivaConfiguration =
-            lookup( ArchivaConfiguration.class, "test-defaults-default-repo-location-exists" );
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        assertConfiguration( configuration, 2, 2, 2 );
-
-        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
-        assertTrue( "check managed repositories", repository.getLocation().endsWith( "data/repositories/internal" ) );
-
-        Files.deleteIfExists(generatedTestDefaultArchivaConfigFile);
-        assertFalse( Files.exists(generatedTestDefaultArchivaConfigFile) );
-    }
-
-
-    /**
-     * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
-     */
-    private void assertConfiguration( Configuration configuration, int managedExpected, int remoteExpected,
-                                      int proxyConnectorExpected )
-        throws Exception
-    {
-
-        assertEquals( "check managed repositories: " + configuration.getManagedRepositories(), managedExpected,
-                      configuration.getManagedRepositories().size() );
-        assertEquals( "check remote repositories: " + configuration.getRemoteRepositories(), remoteExpected,
-                      configuration.getRemoteRepositories().size() );
-        assertEquals( "check proxy connectors:" + configuration.getProxyConnectors(), proxyConnectorExpected,
-                      configuration.getProxyConnectors().size() );
-
-        RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning();
-        assertNotNull( "check repository scanning", repoScanning );
-        assertEquals( "check file types", 4, repoScanning.getFileTypes().size() );
-        assertEquals( "check known consumers", 9, repoScanning.getKnownContentConsumers().size() );
-        assertEquals( "check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size() );
-
-        List<String> patterns = filetypes.getFileTypePatterns( "artifacts" );
-        assertNotNull( "check 'artifacts' file type", patterns );
-        assertEquals( "check 'artifacts' patterns", 13, patterns.size() );
-
-        WebappConfiguration webapp = configuration.getWebapp();
-        assertNotNull( "check webapp", webapp );
-
-        UserInterfaceOptions ui = webapp.getUi();
-        assertNotNull( "check webapp ui", ui );
-        assertTrue( "check showFindArtifacts", ui.isShowFindArtifacts() );
-        assertTrue( "check appletFindEnabled", ui.isAppletFindEnabled() );
-    }
-
-   
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java
deleted file mode 100644 (file)
index 9a882d3..0000000
+++ /dev/null
@@ -1,734 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.annotation.DirtiesContext.ClassMode;
-import org.springframework.test.context.ContextConfiguration;
-
-import javax.inject.Inject;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.List;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.mock;
-
-/**
- * Test the configuration store.
- */
-@RunWith(ArchivaSpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" })
-@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
-public class ArchivaConfigurationTest
-{
-
-    private Logger log = LoggerFactory.getLogger( getClass() );
-
-    @Inject
-    protected ApplicationContext applicationContext;
-
-    @Inject
-    FileTypes filetypes;
-
-    public static Path getTestFile( String path )
-    {
-        return Paths.get( org.apache.archiva.common.utils.FileUtils.getBasedir(), path );
-    }
-
-    @SuppressWarnings( "unchecked" )
-    protected <T> T lookup( Class<T> clazz, String hint )
-    {
-        return (T) applicationContext.getBean( "archivaConfiguration#" + hint, ArchivaConfiguration.class );
-    }
-
-    @Test
-    public void testGetConfigurationFromDefaults()
-        throws Exception
-    {
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-defaults" );
-        Configuration configuration = archivaConfiguration.getConfiguration();
-
-        assertConfiguration( configuration, 2, 1, 1 );
-        assertEquals( "check network proxies", 0, configuration.getNetworkProxies().size() );
-
-        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
-
-        assertEquals( "check managed repositories", "${appserver.base}/repositories/internal",
-                      repository.getLocation() );
-        assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
-        assertEquals( "check managed repositories", "internal", repository.getId() );
-        assertEquals( "check managed repositories", "default", repository.getLayout() );
-        assertTrue( "check managed repositories", repository.isScanned() );
-    }
-
-    @Test
-    public void testGetConfigurationFromRegistryWithASingleNamedConfigurationResource()
-        throws Exception
-    {
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-configuration" );
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        assertConfiguration( configuration, 2, 2, 2 );
-        assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() );
-
-        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
-
-        assertEquals( "check managed repositories", "${appserver.base}/repositories/internal",
-                      repository.getLocation() );
-        assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
-        assertEquals( "check managed repositories", "internal", repository.getId() );
-        assertEquals( "check managed repositories", "default", repository.getLayout() );
-        assertTrue( "check managed repositories", repository.isScanned() );
-    }
-
-    /**
-     * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
-     */
-    private void assertConfiguration( Configuration configuration, int managedExpected, int remoteExpected,
-                                      int proxyConnectorExpected )
-        throws Exception
-    {
-
-        assertEquals( "check managed repositories: " + configuration.getManagedRepositories(), managedExpected,
-                      configuration.getManagedRepositories().size() );
-        assertEquals( "check remote repositories: " + configuration.getRemoteRepositories(), remoteExpected,
-                      configuration.getRemoteRepositories().size() );
-        assertEquals( "check proxy connectors:" + configuration.getProxyConnectors(), proxyConnectorExpected,
-                      configuration.getProxyConnectors().size() );
-
-        RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning();
-        assertNotNull( "check repository scanning", repoScanning );
-        assertEquals( "check file types", 4, repoScanning.getFileTypes().size() );
-        assertEquals( "check known consumers", 9, repoScanning.getKnownContentConsumers().size() );
-        assertEquals( "check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size() );
-
-        List<String> patterns = filetypes.getFileTypePatterns( "artifacts" );
-        assertNotNull( "check 'artifacts' file type", patterns );
-        assertEquals( "check 'artifacts' patterns", 13, patterns.size() );
-
-        WebappConfiguration webapp = configuration.getWebapp();
-        assertNotNull( "check webapp", webapp );
-
-        UserInterfaceOptions ui = webapp.getUi();
-        assertNotNull( "check webapp ui", ui );
-        assertTrue( "check showFindArtifacts", ui.isShowFindArtifacts() );
-        assertTrue( "check appletFindEnabled", ui.isAppletFindEnabled() );
-    }
-
-    @Test
-    public void testGetConfigurationFromRegistryWithTwoConfigurationResources()
-        throws Exception
-    {
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-configuration-both" );
-
-        Configuration configuration = archivaConfiguration.getConfiguration();
-
-        // from base
-        assertEquals( "check repositories", 2, configuration.getManagedRepositories().size() );
-        assertEquals( "check repositories", 2, configuration.getRemoteRepositories().size() );
-        // from user
-        assertEquals( "check proxy connectors", 2, configuration.getProxyConnectors().size() );
-
-        WebappConfiguration webapp = configuration.getWebapp();
-        assertNotNull( "check webapp", webapp );
-
-        UserInterfaceOptions ui = webapp.getUi();
-        assertNotNull( "check webapp ui", ui );
-        // from base
-        assertFalse( "check showFindArtifacts", ui.isShowFindArtifacts() );
-        // from user
-        assertFalse( "check appletFindEnabled", ui.isAppletFindEnabled() );
-    }
-
-    @Test
-    public void testGetConfigurationSystemOverride()
-        throws Exception
-    {
-
-        System.setProperty( "org.apache.archiva.webapp.ui.appletFindEnabled", "false" );
-
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-configuration" );
-
-        archivaConfiguration.reload();
-
-        try
-        {
-            Configuration configuration = archivaConfiguration.getConfiguration();
-
-            assertFalse( "check boolean", configuration.getWebapp().getUi().isAppletFindEnabled() );
-        }
-        finally
-        {
-            System.getProperties().remove( "org.apache.archiva.webapp.ui.appletFindEnabled" );
-            archivaConfiguration.reload();
-            Configuration configuration = archivaConfiguration.getConfiguration();
-            assertTrue( "check boolean", configuration.getWebapp().getUi().isAppletFindEnabled() );
-        }
-    }
-
-    @Test
-    public void testStoreConfiguration()
-        throws Exception
-    {
-        Path file = getTestFile( "target/test/test-file.xml" );
-        Files.deleteIfExists(file);
-        assertFalse( Files.exists(file) );
-
-        // TODO: remove with commons-configuration 1.4
-        //file.getParentFile().mkdirs();
-        //FileUtils.writeStringToFile( file, "<configuration/>", null );
-
-        DefaultArchivaConfiguration archivaConfiguration =
-            (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-save" );
-
-        archivaConfiguration.reload();
-
-        Configuration configuration = new Configuration();
-        configuration.setVersion( "1" );
-        configuration.setWebapp( new WebappConfiguration() );
-        configuration.getWebapp().setUi( new UserInterfaceOptions() );
-        configuration.getWebapp().getUi().setAppletFindEnabled( false );
-
-        // add a change listener
-        ConfigurationListener listener = mock( ConfigurationListener.class );
-        archivaConfiguration.addListener( listener );
-
-        listener.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED ) );
-
-        archivaConfiguration.save( configuration );
-
-        assertTrue( "Check file exists", Files.exists(file) );
-
-        // check it
-        configuration = archivaConfiguration.getConfiguration();
-        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-
-        // read it back
-        archivaConfiguration = (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-read-saved" );
-
-        archivaConfiguration.reload();
-        configuration = archivaConfiguration.getConfiguration();
-        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-    }
-
-    private static ConfigurationListener createConfigurationListenerMockControl()
-    {
-        return mock( ConfigurationListener.class );// MockControl.createControl( ConfigurationListener.class );
-    }
-
-    @Test
-    public void testStoreConfigurationUser()
-        throws Exception
-    {
-        Path baseFile = getTestFile( "target/test/test-file.xml" );
-        Files.deleteIfExists( baseFile );
-        assertFalse( Files.exists(baseFile) );
-
-        Path userFile = getTestFile( "target/test/test-file-user.xml" );
-        Files.deleteIfExists( userFile );
-        assertFalse( Files.exists(userFile) );
-
-        Files.createDirectories(userFile.getParent());
-        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
-
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user" );
-
-        Configuration configuration = new Configuration();
-        configuration.setWebapp( new WebappConfiguration() );
-        configuration.getWebapp().setUi( new UserInterfaceOptions() );
-        configuration.getWebapp().getUi().setAppletFindEnabled( false );
-
-        archivaConfiguration.save( configuration );
-
-        assertTrue( "Check file exists", Files.exists(userFile) );
-        assertFalse( "Check file not created", Files.exists(baseFile) );
-
-        // check it
-        configuration = archivaConfiguration.getConfiguration();
-        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-    }
-
-    @Test
-    public void testStoreConfigurationLoadedFromDefaults()
-        throws Exception
-    {
-        Path baseFile = getTestFile( "target/test/test-file.xml" );
-        Files.delete(baseFile);
-        assertFalse( Files.exists(baseFile) );
-
-        Path userFile = getTestFile( "target/test/test-file-user.xml" );
-        Files.deleteIfExists(userFile);
-        assertFalse( Files.exists(userFile) );
-
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user-defaults" );
-
-        archivaConfiguration.reload();
-
-        Configuration configuration = new Configuration();
-        configuration.setWebapp( new WebappConfiguration() );
-        configuration.getWebapp().setUi( new UserInterfaceOptions() );
-        configuration.getWebapp().getUi().setAppletFindEnabled( false );
-
-        // add a change listener
-        ConfigurationListener listener = createConfigurationListenerMockControl();
-        archivaConfiguration.addListener( listener );
-
-        listener.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED ) );
-
-        archivaConfiguration.save( configuration );
-
-        assertTrue( "Check file exists", Files.exists(userFile) );
-        assertFalse( "Check file not created", Files.exists(baseFile) );
-
-        // check it
-        configuration = archivaConfiguration.getConfiguration();
-        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-    }
-
-    @Test
-    public void testDefaultUserConfigFilename()
-        throws Exception
-    {
-        DefaultArchivaConfiguration archivaConfiguration =
-            (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class, "default" );
-        String expectedFile = System.getProperty( "user.home" ) + "/.m2/archiva.xml";
-        String systemFile = System.getProperty(ArchivaConfiguration.USER_CONFIG_PROPERTY);
-        if (StringUtils.isNotEmpty( systemFile )) {
-            expectedFile = systemFile;
-        } else
-        {
-            String envFile = System.getenv( ArchivaConfiguration.USER_CONFIG_ENVVAR );
-            if ( StringUtils.isNotEmpty( envFile ) )
-                expectedFile = envFile;
-        }
-
-        archivaConfiguration.reload();
-
-        assertEquals( expectedFile,
-                      archivaConfiguration.getUserConfigFilename() );
-        assertEquals( System.getProperty( "appserver.base", "${appserver.base}" ) + "/conf/archiva.xml",
-                      archivaConfiguration.getAltConfigFilename() );
-    }
-
-    @Test
-    public void testStoreConfigurationFallback()
-        throws Exception
-    {
-        Path baseFile = getTestFile( "target/test/test-file.xml" );
-        Files.deleteIfExists(baseFile);
-        assertFalse( Files.exists(baseFile) );
-
-        Path userFile = getTestFile( "target/test/test-file-user.xml" );
-        Files.deleteIfExists(userFile);
-        assertFalse( Files.exists(userFile) );
-
-        Files.createDirectories( baseFile.getParent());
-        FileUtils.writeStringToFile( baseFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
-
-        ArchivaConfiguration archivaConfiguration =
-            (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-save-user-fallback" );
-
-        archivaConfiguration.reload();
-
-        Configuration configuration = new Configuration();
-        configuration.setWebapp( new WebappConfiguration() );
-        configuration.getWebapp().setUi( new UserInterfaceOptions() );
-        configuration.getWebapp().getUi().setAppletFindEnabled( false );
-
-        archivaConfiguration.save( configuration );
-
-        assertTrue( "Check file exists", Files.exists(baseFile) );
-        assertFalse( "Check file not created", Files.exists(userFile) );
-
-        // check it
-        configuration = archivaConfiguration.getConfiguration();
-        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-    }
-
-    @Test
-    public void testStoreConfigurationFailsWhenReadFromBothLocationsNoLists()
-        throws Exception
-    {
-        Path baseFile = getTestFile( "target/test/test-file.xml" );
-        Files.deleteIfExists(baseFile);
-        assertFalse( Files.exists(baseFile) );
-
-        Path userFile = getTestFile( "target/test/test-file-user.xml" );
-        Files.deleteIfExists(userFile);
-        assertFalse( Files.exists(userFile) );
-
-        Files.createDirectories( baseFile.getParent() );
-        FileUtils.writeStringToFile( baseFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
-
-        Files.createDirectories( userFile.getParent());
-        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
-
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user" );
-
-        archivaConfiguration.reload();
-
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-
-        configuration.getWebapp().getUi().setAppletFindEnabled( false );
-
-        archivaConfiguration.save( configuration );
-
-        assertTrue( "Check file exists", Files.exists(baseFile) );
-        assertEquals( "Check base file is unchanged", "<configuration/>",
-                      FileUtils.readFileToString( baseFile.toFile(), Charset.forName( "UTF-8" ) ) );
-        assertTrue( "Check file exists", Files.exists(userFile) );
-        assertFalse( "Check base file is changed",
-                     "<configuration/>".equals( FileUtils.readFileToString( userFile.toFile(), Charset.forName( "UTF-8" ) ) ) );
-
-        // check it
-        configuration = archivaConfiguration.getConfiguration();
-        assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-    }
-
-    @Test
-    public void testStoreConfigurationFailsWhenReadFromBothLocationsUserHasLists()
-        throws Exception
-    {
-        Path baseFile = getTestFile( "target/test/test-file.xml" );
-        Files.deleteIfExists(baseFile);
-        assertFalse( Files.exists(baseFile) );
-
-        Path userFile = getTestFile( "target/test/test-file-user.xml" );
-        Files.deleteIfExists(userFile);
-        assertFalse( Files.exists(userFile) );
-
-        Files.createDirectories( userFile.getParent() );
-        FileUtils.copyFile( getTestFile( "src/test/conf/conf-user.xml" ).toFile(), userFile.toFile() );
-
-        Files.createDirectories(baseFile.getParent());
-        FileUtils.writeStringToFile( baseFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
-
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user" );
-
-        archivaConfiguration.reload();
-
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        assertTrue( "check value", configuration.getWebapp().getUi().isShowFindArtifacts() );
-
-        configuration.getWebapp().getUi().setShowFindArtifacts( false );
-
-        archivaConfiguration.save( configuration );
-
-        assertTrue( "Check file exists", Files.exists(baseFile) );
-        assertEquals( "Check base file is unchanged", "<configuration/>",
-                      FileUtils.readFileToString( baseFile.toFile(), Charset.forName( "UTF-8" ) ) );
-        assertTrue( "Check file exists", Files.exists(userFile) );
-        assertFalse( "Check base file is changed",
-                     "<configuration/>".equals( FileUtils.readFileToString( userFile.toFile(), Charset.forName( "UTF-8" ) ) ) );
-
-        // check it
-        configuration = archivaConfiguration.getConfiguration();
-        assertFalse( "check value", configuration.getWebapp().getUi().isShowFindArtifacts() );
-    }
-
-    @Test
-    public void testStoreConfigurationFailsWhenReadFromBothLocationsAppserverHasLists()
-        throws Exception
-    {
-        Path baseFile = getTestFile( "target/test/test-file.xml" );
-        Files.deleteIfExists(baseFile);
-        assertFalse( Files.exists(baseFile) );
-
-        Path userFile = getTestFile( "target/test/test-file-user.xml" );
-        Files.deleteIfExists(userFile);
-        assertFalse( Files.exists(userFile) );
-
-        Files.createDirectories(baseFile.getParent());
-        FileUtils.copyFile( getTestFile( "src/test/conf/conf-base.xml" ).toFile(), baseFile.toFile() );
-
-        Files.createDirectories(userFile.getParent());
-        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
-
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-save-user" );
-
-        archivaConfiguration.reload();
-
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-
-        configuration.getWebapp().getUi().setAppletFindEnabled( false );
-
-        try
-        {
-            archivaConfiguration.save( configuration );
-            fail( "Configuration saving should not succeed if it was loaded from two locations" );
-        }
-        catch ( IndeterminateConfigurationException e )
-        {
-            // check it was reverted
-            configuration = archivaConfiguration.getConfiguration();
-            assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() );
-        }
-    }
-
-    @Test
-    public void testLoadConfigurationFromInvalidBothLocationsOnDisk()
-        throws Exception
-    {
-        String propFile = System.getProperty( ArchivaConfiguration.USER_CONFIG_PROPERTY );
-        System.setProperty( ArchivaConfiguration.USER_CONFIG_PROPERTY, "/../../..//*intentionally:invalid*/.m2/archiva-user.xml" );
-        ArchivaConfiguration archivaConfiguration =
-            lookup( ArchivaConfiguration.class, "test-not-allowed-to-write-to-both" );
-        Configuration config = archivaConfiguration.getConfiguration();
-
-        try
-        {
-            archivaConfiguration.save( config );
-            fail( "Should have thrown a RegistryException because the configuration can't be saved." );
-        }
-        catch ( RegistryException e )
-        {
-            /* expected exception */
-        }
-        if (propFile!=null)
-        {
-            System.setProperty( ArchivaConfiguration.USER_CONFIG_PROPERTY, propFile );
-        }
-    }
-
-    @Test
-    public void testLoadConfigurationFromInvalidUserLocationOnDisk()
-        throws Exception
-    {
-        Path testConfDir = getTestFile( "target/test-appserver-base/conf/" );
-        Files.createDirectories( testConfDir );
-
-        ArchivaConfiguration archivaConfiguration =
-            lookup( ArchivaConfiguration.class, "test-not-allowed-to-write-to-user" );
-        Configuration config = archivaConfiguration.getConfiguration();
-        archivaConfiguration.save( config );
-        // No Exception == test passes.
-        // Expected Path is: Should not have thrown an exception.
-    }
-
-
-    @Test
-    public void testConfigurationUpgradeFrom13()
-        throws Exception
-    {
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-upgrade-1.3" );
-
-        // we just use the defaults when upgrading from 1.3 at this point.
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        assertConfiguration( configuration, 2, 2, 2 );
-        assertEquals( "check network proxies", 0, configuration.getNetworkProxies().size() );
-
-        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
-
-        assertEquals( "check managed repositories", "${appserver.base}/data/repositories/internal",
-                      repository.getLocation() );
-        assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() );
-        assertEquals( "check managed repositories", "internal", repository.getId() );
-        assertEquals( "check managed repositories", "default", repository.getLayout() );
-        assertTrue( "check managed repositories", repository.isScanned() );
-
-        log.info( "knowContentConsumers {}", configuration.getRepositoryScanning().getKnownContentConsumers() );
-
-        assertFalse(
-            configuration.getRepositoryScanning().getKnownContentConsumers().contains( "update-db-artifact" ) );
-        assertFalse( configuration.getRepositoryScanning().getKnownContentConsumers().contains(
-            "update-db-repository-metadata" ) );
-
-        assertTrue(
-            configuration.getRepositoryScanning().getKnownContentConsumers().contains( "create-archiva-metadata" ) );
-
-        assertTrue(
-            configuration.getRepositoryScanning().getKnownContentConsumers().contains( "duplicate-artifacts" ) );
-    }
-
-
-    @Test
-    public void testCronExpressionsWithComma()
-        throws Exception
-    {
-        Path baseFile = getTestFile( "target/test/test-file.xml" );
-        Files.deleteIfExists(baseFile);
-        assertFalse( Files.exists(baseFile) );
-
-        Path userFile = getTestFile( "target/test/test-file-user.xml" );
-        Files.deleteIfExists(userFile);
-        assertFalse( Files.exists(userFile) );
-
-        Files.createDirectories(baseFile.getParent());
-        FileUtils.copyFile( getTestFile( "src/test/conf/escape-cron-expressions.xml" ).toFile(), baseFile.toFile() );
-
-        Files.createDirectories(userFile.getParent());
-        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.defaultCharset() );
-
-        final ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-cron-expressions" );
-
-        archivaConfiguration.reload();
-
-        Configuration configuration = archivaConfiguration.getConfiguration();
-
-        ManagedRepositoryConfiguration repository = configuration.getManagedRepositories().get( 0 );
-
-        assertEquals( "check cron expression", "0 0,30 * * * ?", repository.getRefreshCronExpression().trim() );
-
-        // add a test listener to confirm it doesn't see the escaped format. We don't need to test the number of calls,
-        // etc. as it's done in other tests
-        archivaConfiguration.addListener( new ConfigurationListener()
-        {
-            @Override
-            public void configurationEvent( ConfigurationEvent event )
-            {
-                assertEquals( ConfigurationEvent.SAVED, event.getType() );
-
-            }
-        } );
-
-        archivaConfiguration.save( configuration );
-
-        configuration = archivaConfiguration.getConfiguration();
-
-        // test for the escape character '\' showing up on repositories.jsp
-        repository.setRefreshCronExpression( "0 0,20 0 * * ?" );
-
-        archivaConfiguration.save( configuration );
-
-        repository = archivaConfiguration.getConfiguration().findManagedRepositoryById( "snapshots" );
-
-        assertEquals( "check cron expression", "0 0,20 0 * * ?", repository.getRefreshCronExpression() );
-    }
-
-    @Test
-    public void testRemoveLastElements()
-        throws Exception
-    {
-        Path baseFile = getTestFile( "target/test/test-file.xml" );
-        Files.deleteIfExists(baseFile);
-        assertFalse( Files.exists(baseFile) );
-
-        Path userFile = getTestFile( "target/test/test-file-user.xml" );
-        Files.deleteIfExists(userFile);
-        assertFalse( Files.exists(userFile) );
-
-        Files.createDirectories( baseFile.getParent() );
-        FileUtils.copyFile( getTestFile( "src/test/conf/conf-single-list-elements.xml" ).toFile(), baseFile.toFile() );
-
-        Files.createDirectories( userFile.getParent());
-        FileUtils.writeStringToFile( userFile.toFile(), "<configuration/>", Charset.forName( "UTF-8" ) );
-
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-remove-central" );
-
-        archivaConfiguration.reload();
-
-        Configuration configuration = archivaConfiguration.getConfiguration();
-
-        RepositoryGroupConfiguration repositoryGroup = configuration.getRepositoryGroups().get( 0 );
-        assertNotNull( repositoryGroup );
-        configuration.removeRepositoryGroup( repositoryGroup );
-        assertTrue( configuration.getRepositoryGroups().isEmpty() );
-
-        RemoteRepositoryConfiguration repository = configuration.getRemoteRepositoriesAsMap().get( "central" );
-        assertNotNull( repository );
-        configuration.removeRemoteRepository( repository );
-        assertTrue( configuration.getRemoteRepositories().isEmpty() );
-
-        ManagedRepositoryConfiguration managedRepository =
-            configuration.getManagedRepositoriesAsMap().get( "snapshots" );
-        assertNotNull( managedRepository );
-        configuration.removeManagedRepository( managedRepository );
-        assertTrue( configuration.getManagedRepositories().isEmpty() );
-
-        ProxyConnectorConfiguration proxyConnector = configuration.getProxyConnectors().get( 0 );
-        assertNotNull( proxyConnector );
-        configuration.removeProxyConnector( proxyConnector );
-        assertTrue( configuration.getProxyConnectors().isEmpty() );
-
-        NetworkProxyConfiguration networkProxy = configuration.getNetworkProxiesAsMap().get( "proxy" );
-        assertNotNull( networkProxy );
-        configuration.removeNetworkProxy( networkProxy );
-        assertTrue( configuration.getNetworkProxies().isEmpty() );
-
-        LegacyArtifactPath path = configuration.getLegacyArtifactPaths().get( 0 );
-        assertNotNull( path );
-        configuration.removeLegacyArtifactPath( path );
-        assertTrue( configuration.getLegacyArtifactPaths().isEmpty() );
-
-        RepositoryScanningConfiguration scanning = configuration.getRepositoryScanning();
-        String consumer = scanning.getKnownContentConsumers().get( 0 );
-        assertNotNull( consumer );
-        scanning.removeKnownContentConsumer( consumer );
-        // default values
-        assertFalse( scanning.getKnownContentConsumers().isEmpty() );
-        consumer = scanning.getInvalidContentConsumers().get( 0 );
-        assertNotNull( consumer );
-        scanning.removeInvalidContentConsumer( consumer );
-        assertTrue( scanning.getInvalidContentConsumers().isEmpty() );
-
-        archivaConfiguration.save( configuration );
-
-        archivaConfiguration = lookup( ArchivaConfiguration.class, "test-read-saved" );
-        configuration = archivaConfiguration.getConfiguration();
-        assertNull( configuration.getRemoteRepositoriesAsMap().get( "central" ) );
-        assertTrue( configuration.getRepositoryGroups().isEmpty() );
-        assertNull( configuration.getManagedRepositoriesAsMap().get( "snapshots" ) );
-        assertTrue( configuration.getProxyConnectors().isEmpty() );
-        assertNull( configuration.getNetworkProxiesAsMap().get( "proxy" ) );
-        assertTrue( configuration.getLegacyArtifactPaths().isEmpty() );
-        scanning = configuration.getRepositoryScanning();
-        assertFalse( scanning.getKnownContentConsumers().isEmpty() );
-        assertTrue( scanning.getInvalidContentConsumers().isEmpty() );
-    }
-
-    /**
-     * [MRM-582] Remote Repositories with empty <username> and <password> fields shouldn't be created in configuration.
-     */
-    @Test
-    public void testGetConfigurationFixEmptyRemoteRepoUsernamePassword()
-        throws Exception
-    {
-        ArchivaConfiguration archivaConfiguration = lookup( ArchivaConfiguration.class, "test-configuration" );
-
-        Configuration configuration = archivaConfiguration.getConfiguration();
-        assertConfiguration( configuration, 2, 2, 2 );
-        assertEquals( "check remote repositories", 2, configuration.getRemoteRepositories().size() );
-
-        RemoteRepositoryConfiguration repository =
-            configuration.getRemoteRepositoriesAsMap().get( "maven2-repository.dev.java.net" );
-
-        assertEquals( "remote repository.url", "https://maven2-repository.dev.java.net/nonav/repository",
-                      repository.getUrl() );
-        assertEquals( "remote repository.name", "Java.net Repository for Maven 2", repository.getName() );
-        assertEquals( "remote repository.id", "maven2-repository.dev.java.net", repository.getId() );
-        assertEquals( "remote repository.layout", "default", repository.getLayout() );
-        assertNull( "remote repository.username == null", repository.getUsername() );
-        assertNull( "remote repository.password == null", repository.getPassword() );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ConfigurationTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ConfigurationTest.java
deleted file mode 100644 (file)
index 2a5e9b4..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Map;
-
-import static org.junit.Assert.*;
-
-/**
- * Test the generated Configuration class from Modello. This is primarily to test the hand coded methods.
- */
-@RunWith( ArchivaBlockJUnit4ClassRunner.class )
-public class ConfigurationTest
-{
-    private Configuration configuration = new Configuration();
-
-    @Test
-    public void testNetworkProxyRetrieval()
-    {
-        NetworkProxyConfiguration proxy1 = createNetworkProxy( "id1", "host1", 8080 );
-        configuration.addNetworkProxy( proxy1 );
-        NetworkProxyConfiguration proxy2 = createNetworkProxy( "id2", "host2", 9090 );
-        configuration.addNetworkProxy( proxy2 );
-
-        Map<String, NetworkProxyConfiguration> map = configuration.getNetworkProxiesAsMap();
-        assertNotNull( map );
-        assertEquals( 2, map.size() );
-        assertEquals( new HashSet<String>( Arrays.asList( "id1", "id2" ) ), map.keySet() );
-        assertEquals( new HashSet<NetworkProxyConfiguration>( Arrays.asList( proxy1, proxy2 ) ),
-                      new HashSet<NetworkProxyConfiguration>( map.values() ) );
-    }
-
-    private NetworkProxyConfiguration createNetworkProxy( String id, String host, int port )
-    {
-        NetworkProxyConfiguration proxy = new NetworkProxyConfiguration();
-        proxy.setId( id );
-        proxy.setHost( host );
-        proxy.setPort( port );
-        proxy.setProtocol( "http" );
-        return proxy;
-    }
-
-    @Test
-    public void testRemoteRepositoryRetrieval()
-    {
-        RemoteRepositoryConfiguration repo1 = createRemoteRepository( "id1", "name 1", "url 1" );
-        configuration.addRemoteRepository( repo1 );
-        RemoteRepositoryConfiguration repo2 = createRemoteRepository( "id2", "name 2", "url 2" );
-        configuration.addRemoteRepository( repo2 );
-
-        Map<String, RemoteRepositoryConfiguration> map = configuration.getRemoteRepositoriesAsMap();
-        assertNotNull( map );
-        assertEquals( 2, map.size() );
-        assertEquals( new HashSet<String>( Arrays.asList( "id1", "id2" ) ), map.keySet() );
-        assertEquals( new HashSet<RemoteRepositoryConfiguration>( Arrays.asList( repo1, repo2 ) ),
-                      new HashSet<RemoteRepositoryConfiguration>( map.values() ) );
-
-        assertEquals( repo1, configuration.findRemoteRepositoryById( "id1" ) );
-        assertEquals( repo2, configuration.findRemoteRepositoryById( "id2" ) );
-        assertNull( configuration.findRemoteRepositoryById( "id3" ) );
-    }
-
-    private RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url )
-    {
-        RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration();
-        repo.setId( id );
-        repo.setName( name );
-        repo.setLayout( "default" );
-        repo.setUrl( url );
-        return repo;
-    }
-
-    @Test
-    public void testManagedRepositoryRetrieval()
-    {
-        ManagedRepositoryConfiguration repo1 = createManagedRepository( "id1", "name 1", "path 1", false );
-        configuration.addManagedRepository( repo1 );
-        ManagedRepositoryConfiguration repo2 = createManagedRepository( "id2", "name 2", "path 2", true );
-        configuration.addManagedRepository( repo2 );
-
-        Map<String, ManagedRepositoryConfiguration> map = configuration.getManagedRepositoriesAsMap();
-        assertNotNull( map );
-        assertEquals( 2, map.size() );
-        assertEquals( new HashSet<String>( Arrays.asList( "id1", "id2" ) ), map.keySet() );
-        assertEquals( new HashSet<ManagedRepositoryConfiguration>( Arrays.asList( repo1, repo2 ) ),
-                      new HashSet<ManagedRepositoryConfiguration>( map.values() ) );
-
-        assertEquals( repo1, configuration.findManagedRepositoryById( "id1" ) );
-        assertEquals( repo2, configuration.findManagedRepositoryById( "id2" ) );
-        assertNull( configuration.findManagedRepositoryById( "id3" ) );
-    }
-
-    private ManagedRepositoryConfiguration createManagedRepository( String id, String name, String location,
-                                                                    boolean scanned )
-    {
-        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
-        repo.setId( id );
-        repo.setName( name );
-        repo.setLocation( location );
-        repo.setScanned( scanned );
-        return repo;
-    }
-
-    @Test
-    public void testNetworkProxyRetrievalWhenEmpty()
-    {
-        Map<String, NetworkProxyConfiguration> map = configuration.getNetworkProxiesAsMap();
-        assertNotNull( map );
-        assertTrue( map.isEmpty() );
-    }
-
-    @Test
-    public void testRemoteRepositoryRetrievalWhenEmpty()
-    {
-        Map<String, RemoteRepositoryConfiguration> map = configuration.getRemoteRepositoriesAsMap();
-        assertNotNull( map );
-        assertTrue( map.isEmpty() );
-
-        assertNull( configuration.findRemoteRepositoryById( "id" ) );
-    }
-
-    @Test
-    public void testManagedRepositoryRetrievalWhenEmpty()
-    {
-        Map<String, ManagedRepositoryConfiguration> map = configuration.getManagedRepositoriesAsMap();
-        assertNotNull( map );
-        assertTrue( map.isEmpty() );
-
-        assertNull( configuration.findManagedRepositoryById( "id" ) );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/FileTypesTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/FileTypesTest.java
deleted file mode 100644 (file)
index 83874b7..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-
-import javax.inject.Inject;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-@RunWith( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml" } )
-public class FileTypesTest
-{
-    @Inject
-    private FileTypes filetypes;
-
-    @Test
-    public void testIsArtifact()
-    {
-        assertTrue( filetypes.matchesArtifactPattern( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom" ) );
-        assertTrue( filetypes.matchesArtifactPattern(
-            "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.jar" ) );
-        assertTrue( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) );
-
-        assertFalse(
-            filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) );
-        assertFalse(
-            filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) );
-        assertFalse(
-            filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.asc" ) );
-        assertFalse(
-            filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.pgp" ) );
-        assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) );
-        assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/maven-metadata.xml" ) );
-    }
-
-    @Test
-    public void testDefaultExclusions()
-    {
-        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.gz" ) );
-        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.zip" ) );
-        assertTrue( filetypes.matchesDefaultExclusions(
-            "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) );
-        assertTrue( filetypes.matchesDefaultExclusions(
-            "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) );
-        assertTrue( filetypes.matchesDefaultExclusions(
-            "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) );
-        assertTrue( filetypes.matchesDefaultExclusions(
-            "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) );
-        assertTrue( filetypes.matchesDefaultExclusions(
-            "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.md5" ) );
-
-        assertFalse( filetypes.matchesDefaultExclusions(
-            "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.zip" ) );
-        assertFalse( filetypes.matchesDefaultExclusions(
-            "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/LegacyArtifactPathTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/LegacyArtifactPathTest.java
deleted file mode 100644 (file)
index c36a93b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-/**
- * Test the generated LegacyArtifactPath class from Modello. This is primarily to test the hand coded methods.
- *
- * @since 1.1
- */
-@RunWith( ArchivaBlockJUnit4ClassRunner.class )
-public class LegacyArtifactPathTest
-{
-
-    private LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath();
-
-    @Test
-    public void testLegacyArtifactPathWithClassifierResolution()
-    {
-        legacyArtifactPath.setArtifact( "groupId:artifactId:version:classifier:type" );
-
-        assertEquals( "groupId", legacyArtifactPath.getGroupId() );
-        assertEquals( "artifactId", legacyArtifactPath.getArtifactId() );
-        assertEquals( "version", legacyArtifactPath.getVersion() );
-        assertEquals( "classifier", legacyArtifactPath.getClassifier() );
-        assertEquals( "type", legacyArtifactPath.getType() );
-    }
-
-    @Test
-    public void testLegacyArtifactPathWithoutClassifierResolution()
-    {
-        legacyArtifactPath.setArtifact( "groupId:artifactId:version::type" );
-
-        assertEquals( "groupId", legacyArtifactPath.getGroupId() );
-        assertEquals( "artifactId", legacyArtifactPath.getArtifactId() );
-        assertEquals( "version", legacyArtifactPath.getVersion() );
-        assertNull( legacyArtifactPath.getClassifier() );
-        assertEquals( "type", legacyArtifactPath.getType() );
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/MavenProxyPropertyLoaderTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/MavenProxyPropertyLoaderTest.java
deleted file mode 100644 (file)
index dfc41e9..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.apache.archiva.configuration;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Map;
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-/**
- */
-@RunWith( ArchivaBlockJUnit4ClassRunner.class )
-public class MavenProxyPropertyLoaderTest
-{
-    private MavenProxyPropertyLoader loader;
-
-    @Test
-    public void testLoadValidMavenProxyConfiguration()
-        throws IOException, InvalidConfigurationException
-    {
-        Path confFile = ArchivaConfigurationTest.getTestFile( "src/test/conf/maven-proxy-complete.conf" );
-
-        Configuration configuration = new Configuration();
-        NetworkProxyConfiguration proxy = new NetworkProxyConfiguration();
-        proxy.setHost( "original-host" );
-        configuration.addNetworkProxy( proxy ); // overwritten
-
-        loader.load( Files.newInputStream(confFile), configuration );
-
-        Map<String, ManagedRepositoryConfiguration> repositoryIdMap = configuration.getManagedRepositoriesAsMap();
-        assertEquals( "Count repositories", 1, repositoryIdMap.size() );
-        assertRepositoryExists( "maven-proxy", "target", repositoryIdMap.get( "maven-proxy" ) );
-
-        Map<String, RemoteRepositoryConfiguration> remoteRepositoryMap = configuration.getRemoteRepositoriesAsMap();
-        assertEquals( "Count repositories", 4, remoteRepositoryMap.size() );
-        assertRepositoryExists( "local-repo", "file://target", remoteRepositoryMap.get( "local-repo" ) );
-        assertRepositoryExists( "www-ibiblio-org", "http://www.ibiblio.org/maven2",
-                                remoteRepositoryMap.get( "www-ibiblio-org" ) );
-        assertRepositoryExists( "dist-codehaus-org", "http://dist.codehaus.org",
-                                remoteRepositoryMap.get( "dist-codehaus-org" ) );
-        assertRepositoryExists( "private-example-com", "http://private.example.com/internal",
-                                remoteRepositoryMap.get( "private-example-com" ) );
-    }
-
-    private void assertRepositoryExists( String id, String expectedLocation, ManagedRepositoryConfiguration repo )
-    {
-        assertNotNull( "Repository id [" + id + "] should not be null", repo );
-        assertEquals( "Repository id", id, repo.getId() );
-        assertEquals( "Repository url", expectedLocation, repo.getLocation() );
-    }
-
-    private void assertRepositoryExists( String id, String expectedUrl, RemoteRepositoryConfiguration repo )
-    {
-        assertNotNull( "Repository id [" + id + "] should not be null", repo );
-        assertEquals( "Repository id", id, repo.getId() );
-        assertEquals( "Repository url", expectedUrl, repo.getUrl() );
-    }
-
-    @Test( expected=InvalidConfigurationException.class )
-    public void testInvalidConfiguration() 
-        throws InvalidConfigurationException
-    {
-        Configuration configuration = new Configuration();
-        loader.load( new Properties(), configuration );
-        //fail( "Incomplete config should have failed" );
-    }
-
-    @Before
-    public void setUp()
-        throws Exception
-    {
-        loader = new MavenProxyPropertyLoader();
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java
deleted file mode 100644 (file)
index 458014f..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-import org.apache.commons.lang3.StringUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-/**
- * ProxyConnectorConfigurationOrderComparatorTest
- *
- *
- */
-@SuppressWarnings( "deprecation" )
-@RunWith( ArchivaBlockJUnit4ClassRunner.class )
-public class ProxyConnectorConfigurationOrderComparatorTest
-{
-    @Test
-    public void testSortOfAllZeros()
-    {
-        List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
-
-        proxies.add( createConnector( "corporate", 0 ) );
-        proxies.add( createConnector( "snapshots", 0 ) );
-        proxies.add( createConnector( "3rdparty", 0 ) );
-        proxies.add( createConnector( "sandbox", 0 ) );
-
-        Collections.sort( proxies, ProxyConnectorConfigurationOrderComparator.getInstance() );
-
-        assertProxyOrder( new String[]{ "corporate", "snapshots", "3rdparty", "sandbox" }, proxies );
-    }
-
-    @Test
-    public void testSortNormal()
-    {
-        List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
-
-        proxies.add( createConnector( "corporate", 3 ) );
-        proxies.add( createConnector( "snapshots", 1 ) );
-        proxies.add( createConnector( "3rdparty", 2 ) );
-        proxies.add( createConnector( "sandbox", 4 ) );
-
-        Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() );
-
-        assertProxyOrder( new String[]{ "snapshots", "3rdparty", "corporate", "sandbox" }, proxies );
-    }
-
-    @Test
-    public void testSortPartial()
-    {
-        List<ProxyConnectorConfiguration> proxies = new ArrayList<>();
-
-        proxies.add( createConnector( "corporate", 3 ) );
-        proxies.add( createConnector( "snapshots", 0 ) );
-        proxies.add( createConnector( "3rdparty", 2 ) );
-        proxies.add( createConnector( "sandbox", 0 ) );
-
-        Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() );
-
-        assertProxyOrder( new String[]{ "3rdparty", "corporate", "snapshots", "sandbox" }, proxies );
-    }
-
-    private void assertProxyOrder( String[] ids, List<ProxyConnectorConfiguration> proxies )
-    {
-        assertEquals( "Proxies.size() == ids.length", ids.length, proxies.size() );
-
-        int orderFailedAt = -1;
-
-        for ( int i = 0; i < ids.length; i++ )
-        {
-            if ( !StringUtils.equals( ids[i], proxies.get( i ).getProxyId() ) )
-            {
-                orderFailedAt = i;
-                break;
-            }
-        }
-
-        if ( orderFailedAt >= 0 )
-        {
-            StringBuilder msg = new StringBuilder();
-
-            msg.append( "Failed expected order of the proxies <" );
-            msg.append( StringUtils.join( ids, ", " ) );
-            msg.append( ">, actual <" );
-
-            boolean needsComma = false;
-            for ( ProxyConnectorConfiguration proxy : proxies )
-            {
-                if ( needsComma )
-                {
-                    msg.append( ", " );
-                }
-                msg.append( proxy.getProxyId() );
-                needsComma = true;
-            }
-            msg.append( "> failure at index <" ).append( orderFailedAt ).append( ">." );
-
-            fail( msg.toString() );
-        }
-    }
-
-    private ProxyConnectorConfiguration createConnector( String id, int order )
-    {
-        ProxyConnectorConfiguration proxy = new ProxyConnectorConfiguration();
-        proxy.setProxyId( id );
-        proxy.setOrder( order );
-        proxy.setSourceRepoId( id + "_m" );
-        proxy.setTargetRepoId( id + "_r" );
-
-        return proxy;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/RepositoryConfigurationComparatorTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/RepositoryConfigurationComparatorTest.java
deleted file mode 100644 (file)
index 2dd659c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.apache.archiva.configuration.functors;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.Comparator;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * Test the repositry comparator.
- */
-@RunWith( ArchivaBlockJUnit4ClassRunner.class )
-public class RepositoryConfigurationComparatorTest
-{
-    @Test
-    public void testComparator()
-    {
-        Comparator<AbstractRepositoryConfiguration> comparator = new RepositoryConfigurationComparator();
-
-        assertEquals( 0, comparator.compare( null, null ) );
-        assertEquals( 1, comparator.compare( createRepository( "id" ), null ) );
-        assertEquals( -1, comparator.compare( null, createRepository( "id" ) ) );
-        assertEquals( 0, comparator.compare( createRepository( "id1" ), createRepository( "id1" ) ) );
-        assertEquals( -1, comparator.compare( createRepository( "id1" ), createRepository( "id2" ) ) );
-        assertEquals( 1, comparator.compare( createRepository( "id2" ), createRepository( "id1" ) ) );
-    }
-
-    private ManagedRepositoryConfiguration createRepository( String id )
-    {
-        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
-        repo.setId( id );
-        return repo;
-    }
-}
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/resources/log4j2-test.xml
deleted file mode 100644 (file)
index 03547df..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<configuration>
-  <Properties>
-
-  </Properties>
-  <appenders>
-    <Console name="console" target="SYSTEM_OUT">
-      <PatternLayout pattern="%d{ISO8601_PERIOD} [%L] [%t] %-5level %logger{3} - %msg%n"/>
-    </Console>
-    <!--
-    <RandomAccessFile name="LogFile" fileName="target/test.log">
-      <PatternLayout pattern="%d{ISO8601_PERIOD} [%L] [%t] %-5level %logger{3} - %msg%n"/>
-    </RandomAccessFile>
-    -->
-  </appenders>
-  <loggers>
-    <logger name="org.apache.archiva" level="info"/>
-    <logger name="org.apache.archiva.repository.scanner" level="info"/>
-    <root level="error" includeLocation="true">
-      <appender-ref ref="console"/>
-    </root>
-  </loggers>
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml
deleted file mode 100755 (executable)
index dc1215e..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-<configuration>
-  <version>3.0.0</version>
-  <managedRepositories>
-    <managedRepository>
-      <id>internal</id>
-      <name>Archiva Managed Internal Repository</name>
-      <location>${appserver.base}/target/test-classes/existing_internal</location>
-      <layout>default</layout>
-      <releases>true</releases>
-      <snapshots>false</snapshots>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0 * * * ?</refreshCronExpression>
-      <retentionPeriod>30</retentionPeriod>
-    </managedRepository>
-    <managedRepository>
-      <id>snapshots</id>
-      <name>Archiva Managed Snapshot Repository</name>
-      <location>${appserver.base}/target/test-classes/existing_snapshots</location>
-      <layout>default</layout>
-      <releases>false</releases>
-      <snapshots>true</snapshots>
-      <scanned>true</scanned>
-      <refreshCronExpression>0 0\,30 * * * ?</refreshCronExpression>
-      <retentionPeriod>30</retentionPeriod>
-    </managedRepository>
-  </managedRepositories>
-  <remoteRepositories>
-    <remoteRepository>
-      <id>central</id>
-      <name>Central Repository</name>
-      <url>http://repo1.maven.org/maven2</url>
-      <layout>default</layout>
-    </remoteRepository>
-    <remoteRepository>
-      <id>maven2-repository.dev.java.net</id>
-      <name>Java.net Repository for Maven 2</name>
-      <url>http://download.java.net/maven/2/</url>
-      <layout>default</layout>
-    </remoteRepository>
-  </remoteRepositories>
-
-  <proxyConnectors>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>central</targetRepoId>
-      <proxyId/>
-      <policies>
-        <snapshots>disabled</snapshots>
-        <releases>once</releases>
-        <checksum>fix</checksum>
-        <cache-failures>cached</cache-failures>
-      </policies>
-      <whiteListPatterns>
-        <whiteListPattern>**/*</whiteListPattern>
-      </whiteListPatterns>
-    </proxyConnector>
-    <proxyConnector>
-      <sourceRepoId>internal</sourceRepoId>
-      <targetRepoId>maven2-repository.dev.java.net</targetRepoId>
-      <proxyId/>
-      <policies>
-        <snapshots>disabled</snapshots>
-        <releases>once</releases>
-        <checksum>fix</checksum>
-        <cache-failures>cached</cache-failures>
-      </policies>
-      <whiteListPatterns>
-        <whiteListPattern>javax/**</whiteListPattern>
-        <whiteListPattern>org/jvnet/**</whiteListPattern>
-        <whiteListPattern>com/sun/**</whiteListPattern>
-      </whiteListPatterns>
-    </proxyConnector>
-  </proxyConnectors>
-
-  <legacyArtifactPaths>
-    <legacyArtifactPath>
-        <path>jaxen/jars/jaxen-1.0-FCS-full.jar</path>
-        <artifact>jaxen:jaxen:1.0-FCS:full:jar</artifact>
-    </legacyArtifactPath>
-  </legacyArtifactPaths>
-
-  <repositoryScanning>
-    <fileTypes>
-      <fileType>
-        <id>artifacts</id>
-        <patterns>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.jar</pattern>
-          <pattern>**/*.ear</pattern>
-          <pattern>**/*.war</pattern>
-          <pattern>**/*.car</pattern>
-          <pattern>**/*.sar</pattern>
-          <pattern>**/*.mar</pattern>
-          <pattern>**/*.rar</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-          <pattern>**/*.tar.gz</pattern>
-          <pattern>**/*.tar.bz2</pattern>
-          <pattern>**/*.zip</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>indexable-content</id>
-        <patterns>
-          <pattern>**/*.txt</pattern>
-          <pattern>**/*.TXT</pattern>
-          <pattern>**/*.block</pattern>
-          <pattern>**/*.config</pattern>
-          <pattern>**/*.pom</pattern>
-          <pattern>**/*.xml</pattern>
-          <pattern>**/*.xsd</pattern>
-          <pattern>**/*.dtd</pattern>
-          <pattern>**/*.tld</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>auto-remove</id>
-        <patterns>
-          <pattern>**/*.bak</pattern>
-          <pattern>**/*~</pattern>
-          <pattern>**/*-</pattern>
-        </patterns>
-      </fileType>
-      <fileType>
-        <id>ignored</id>
-        <patterns>
-          <pattern>**/.htaccess</pattern>
-          <pattern>**/KEYS</pattern>
-          <pattern>**/*.rb</pattern>
-          <pattern>**/*.sh</pattern>
-          <pattern>**/.svn/**</pattern>
-          <pattern>**/.DAV/**</pattern>
-        </patterns>
-      </fileType>
-    </fileTypes>
-    <knownContentConsumers>
-      <knownContentConsumer>update-db-artifact</knownContentConsumer>
-      <knownContentConsumer>create-missing-checksums</knownContentConsumer>
-      <knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
-      <knownContentConsumer>validate-checksum</knownContentConsumer>
-      <knownContentConsumer>validate-signature</knownContentConsumer>
-      <knownContentConsumer>index-content</knownContentConsumer>
-      <knownContentConsumer>auto-remove</knownContentConsumer>
-      <knownContentConsumer>auto-rename</knownContentConsumer>
-      <knownContentConsumer>metadata-updater</knownContentConsumer>
-      <!--knownContentConsumer>repository-purge</knownContentConsumer-->
-    </knownContentConsumers>
-    <invalidContentConsumers>
-      <invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
-    </invalidContentConsumers>
-  </repositoryScanning>
-
-  <databaseScanning>
-    <cronExpression>0 0 * * * ?</cronExpression>
-    <unprocessedConsumers>
-      <unprocessedConsumer>index-artifact</unprocessedConsumer>
-      <unprocessedConsumer>update-db-project</unprocessedConsumer>
-      <unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
-      <unprocessedConsumer>index-archive-toc</unprocessedConsumer>
-      <unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
-      <unprocessedConsumer>index-public-methods</unprocessedConsumer>
-    </unprocessedConsumers>
-    <cleanupConsumers>
-      <cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
-      <cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
-    </cleanupConsumers>
-  </databaseScanning>
-
-  <webapp>
-    <ui>
-      <showFindArtifacts>true</showFindArtifacts>
-      <appletFindEnabled>true</appletFindEnabled>
-    </ui>
-  </webapp>
-</configuration>
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/resources/spring-context.xml
deleted file mode 100755 (executable)
index 4eb7b5b..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
-       default-lazy-init="true">
-
-  <context:property-placeholder system-properties-mode="OVERRIDE"/>
-
-  <bean name="archivaConfiguration#test-defaults-default-repo-location-exists" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#empty"/>
-  </bean>
-  <bean name="registry#empty" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry"/>
-
-  <bean name="archivaConfiguration#test-defaults" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#emptydef"/>
-  </bean>
-  <bean name="registry#emptydef" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry"/>
-
-  <bean name="archivaConfiguration#test-upgrade-09"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-upgrade-09"/>
-  </bean>
-
-
-
-  <bean name="registry#test-upgrade-09" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-        <configuration>
-            <xml fileName="${basedir}/src/test/conf/archiva-0.9.xml"
-                 config-name="org.apache.archiva" config-at="org.apache.archiva"/>
-        </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="archivaConfiguration#test-upgrade-1.3"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-upgrade-1.3"/>
-  </bean>
-
-  <bean name="registry#test-upgrade-1.3" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-        <configuration>
-            <xml fileName="${basedir}/src/test/conf/archiva-1.3.xml"
-                 config-name="org.apache.archiva" config-at="org.apache.archiva"/>
-        </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="archivaConfiguration#test-configuration"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#configured"/>
-  </bean>
-
-  <bean name="registry#configured" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-        <configuration>
-            <system/>
-            <xml fileName="${basedir}/src/test/conf/repository-manager.xml"
-                 config-name="org.apache.archiva" config-at="org.apache.archiva"/>
-        </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-
-  <bean name="archivaConfiguration#test-autodetect-v1"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-autodetect-v1"/>
-  </bean>
-
-  <bean name="registry#test-autodetect-v1" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-        <configuration>
-            <system/>
-            <xml fileName="${basedir}/target/test-autodetect-v1/archiva-user.xml" config-optional="true"
-                 config-name="org.apache.archiva.user"
-                 config-at="org.apache.archiva"/>
-        </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="archivaConfiguration#test-archiva-v1"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-archiva-v1"/>
-  </bean>
-
-  <bean name="registry#test-archiva-v1" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-        <configuration>
-            <system/>
-            <xml fileName="${basedir}/src/test/conf/archiva-v1.xml"
-                 config-name="org.apache.archiva" config-at="org.apache.archiva"/>
-        </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="archivaConfiguration#test-save"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-save"/>
-  </bean>
-
-  <bean name="registry#test-save" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-        <configuration>
-            <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
-                 config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
-        </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="archivaConfiguration#test-save-user-defaults"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-save-user-defaults"/>
-  </bean>
-
-  <bean name="registry#test-save-user-defaults" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-      <configuration>
-          <xml fileName="${basedir}/target/test/test-file-user.xml" config-optional="true" config-forceCreate="true"
-               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
-          <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="false"
-               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
-      </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="archivaConfiguration#test-save-user-fallback"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-save-user-fallback"/>
-  </bean>
-
-  <bean name="registry#test-save-user-fallback" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-      <configuration>
-          <xml fileName="${basedir}/target/test/test-file-user.xml" config-optional="true" config-forceCreate="false"
-               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
-          <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
-               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
-      </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="archivaConfiguration#test-save-user"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-save-user"/>
-  </bean>
-
-  <bean name="registry#test-save-user" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-      <configuration>
-          <xml fileName="${basedir}/target/test/test-file-user.xml" config-optional="true" config-forceCreate="true"
-               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
-          <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="false"
-               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
-      </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-
-  <bean name="archivaConfiguration#test-configuration-both"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-configuration-both"/>
-  </bean>
-
-  <bean name="registry#test-configuration-both" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-      <configuration>
-          <xml fileName="${basedir}/src/test/conf/conf-user.xml" config-optional="true" config-forceCreate="true"
-               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
-          <xml fileName="${basedir}/src/test/conf/conf-base.xml" config-optional="true" config-forceCreate="true"
-               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
-      </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-
-  <bean name="archivaConfiguration#test-read-saved"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-read-saved"/>
-  </bean>
-
-  <bean name="registry#test-read-saved" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-        <configuration>
-            <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
-                 config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
-        </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-
-  <bean name="archivaConfiguration#test-cron-expressions"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-cron-expressions"/>
-    <property name="userConfigFilename" value="${basedir}/target/test/test-file.xml"/>
-  </bean>
-
-  <bean name="registry#test-cron-expressions" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-        <configuration>
-            <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
-                 config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
-        </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-
-  <bean name="archivaConfiguration#test-remove-central"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-remove-central"/>
-  </bean>
-
-  <bean name="registry#test-remove-central" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-      <configuration>
-          <xml fileName="${basedir}/target/test/test-file.xml" config-optional="true" config-forceCreate="true"
-               config-name="org.apache.archiva.base" config-at="org.apache.archiva"/>
-      </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-
-  <bean name="archivaConfiguration#test-not-allowed-to-write-to-both"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-not-allowed-to-write-to-both"/>
-    <property name="userConfigFilename" value="/../../..//target/*intentionally:invalid*/.m2/archiva-user.xml"/>
-    <property name="altConfigFilename" value="/../../..//target/*intentionally:invalid*/conf/archiva.xml"/>
-  </bean>
-
-  <bean name="registry#test-not-allowed-to-write-to-both" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-      <configuration>
-          <xml fileName="/../../..//*intentionally:invalid*/.m2/archiva-user.xml" config-optional="true"
-               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
-          <xml fileName="/../../..//*intentionally:invalid*/conf/archiva.xml" config-optional="true"
-               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
-      </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="archivaConfiguration#test-not-allowed-to-write-to-user"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
-    <property name="registry" ref="registry#test-not-allowed-to-write-to-user"/>
-    <property name="userConfigFilename" value="${basedir}/target/*intentionally:invalid*/.m2/archiva-user.xml"/>
-    <property name="altConfigFilename" value="${basedir}/target/test-appserver-base/conf/archiva.xml"/>
-  </bean>
-
-  <bean name="registry#test-not-allowed-to-write-to-user" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
-    <property name="initialConfiguration">
-      <value>
-        <![CDATA[
-      <configuration>
-          <xml fileName="${basedir}/target/*intentionally:invalid*/.m2/archiva-user.xml" config-optional="true"
-               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
-          <xml fileName="${basedir}/target/test-appserver-base/conf/archiva.xml" config-optional="true"
-               config-name="org.apache.archiva.user" config-at="org.apache.archiva"/>
-      </configuration>
-        ]]>
-      </value>
-    </property>
-  </bean>
-
-  <bean name="cache#url-failures-cache" class="org.apache.archiva.components.cache.ehcache.EhcacheCache">
-    <constructor-arg index="0" value="java.lang.String"/>
-    <constructor-arg index="1" value="java.util.Date"/>
-    <property name="diskExpiryThreadIntervalSeconds" value="600"/>
-    <property name="diskPersistent" value="false"/>
-    <property name="eternal" value="false"/>
-    <property name="maxElementsInMemory" value="1000"/>
-    <property name="memoryEvictionPolicy" value="LRU"/>
-    <property name="name" value="url-failures-cache"/>
-    <property name="overflowToDisk" value="false"/>
-    <property name="timeToIdleSeconds" value="2700"/>
-    <property name="timeToLiveSeconds" value="1800"/>
-  </bean>
-
-</beans>
\ No newline at end of file
index a86d0a1fe70495e23e0f08688787b5fe6d0bad68..42844565ebc7d4b641c35283660bec822d3bebfe 100644 (file)
@@ -82,8 +82,8 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
index e9f0cc036ad43baddd26f4102efdd03c27f9a7c7..c6dab353832bf1eb15a5e271a6bf97e8559c1a30 100644 (file)
@@ -21,8 +21,8 @@ package $package;
 
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.components.registry.RegistryListener;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index 10f9f2d45f3d2291710a7ee99e53c7c3fafaa200..a77d0ebc4bb646a33a5b3953eaf1c3c2e3151733 100644 (file)
@@ -19,9 +19,9 @@ package $package;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.EventHandler;
 import org.apache.archiva.repository.base.managed.BasicManagedRepository;
 import org.apache.archiva.repository.base.remote.BasicRemoteRepository;
index 81a77435a3ab296619a38fce3c72b5fd381a9614..ac5f5ba2c3ac955d062e8f9c869bf0a4e954bda3 100644 (file)
@@ -52,8 +52,8 @@
       <version>${archiva.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
       <version>${archiva.version}</version>
     </dependency>
     <dependency>
index 3502aa3eee6f6c69b53cd121338e7b33811b1c03..abad21899047750a5673ad0587cd45760bba123b 100644 (file)
@@ -34,8 +34,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 559de35e023265232c7b72c791799fc84f3ecd52..cbb7a2ac4169a399feb29e4db8759a0bb3373714 100644 (file)
@@ -20,8 +20,8 @@ package org.apache.archiva.consumers.core;
  */
 
 import org.apache.archiva.checksum.*;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index 89b014a7b7b639f7f47d87b89f740e4d4604f938..ffa022e40b3cff3fbf9e1e3d68547a3a5b8ff43f 100644 (file)
@@ -19,9 +19,9 @@ package org.apache.archiva.consumers.core;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationNames;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ConfigurationNames;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index 5c79854917f5f5147a418712df110a2a7db335e1..4410c547780b08fbc758b0bdc93e60301b7c7844 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.consumers.core;
  * under the License.
  */
 
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index 24779a77ee0a957ace6537c87238f6a331cbe7ae..86bf774bf1308990ff165f594634c7a3000344a9 100644 (file)
@@ -19,9 +19,9 @@ package org.apache.archiva.consumers.core.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationNames;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ConfigurationNames;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index 8a50d78a4db66dab14afc818347c7f2eef7bda98..721f270a43fbd23b60c6ebfa30c68682ed038b31 100644 (file)
@@ -20,9 +20,9 @@ package org.apache.archiva.consumers.core;
  */
 
 import org.apache.archiva.common.utils.BaseFile;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.FileType;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.archiva.consumers.functors.ConsumerWantsFilePredicate;
 import org.apache.archiva.repository.RepositoryRegistry;
index a74ae2461c3d224254f147277974133d7de8ad9e..3cb612339bb33b2c8e0ca17075003998f72c0d53 100644 (file)
@@ -18,9 +18,9 @@ package org.apache.archiva.consumers.core.mock.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.EventHandler;
 import org.apache.archiva.repository.base.managed.BasicManagedRepository;
 import org.apache.archiva.repository.base.remote.BasicRemoteRepository;
index 2a60d710c9d1e17894c13d708e5dfa5df94244ab..c3273cf6f578ea2cc436b1433cb206a343d6fa21 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.consumers.core.repository;
 
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.MetadataFacet;
 import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
index 209d050d39285b3acc274912f9148392d92597bd..ba5568ad38d7e2d54fd4602cedf2f8d68938fe03 100644 (file)
@@ -20,9 +20,9 @@ package org.apache.archiva.consumers.core.repository;
  */
 
 import org.apache.archiva.common.utils.BaseFile;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.FileType;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.archiva.consumers.functors.ConsumerWantsFilePredicate;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
index 95c203340100270300a466277c80ba90fa24f50b..32eb6357df269941d2ee2b269cf941bafa262b74 100644 (file)
@@ -27,7 +27,7 @@
            http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
        default-lazy-init="true">
 
-  <bean name="archivaConfiguration#cleanup-released-snapshots" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#cleanup-released-snapshots" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#cleanup-released-snapshots"/>
   </bean>
   <alias name="archivaConfiguration#cleanup-released-snapshots" alias="archivaConfiguration"/>
index 0657f95518172aaa4c732a69a48c802fe7ba0937..4b970df9cb0a770feeb218db542193627ad75c03 100644 (file)
@@ -38,7 +38,7 @@
     <property name="filetypes" ref="filetypes#retention-count"/>
   </bean>
 
-  <bean name="archivaConfiguration#retention-count" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#retention-count" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#retention-count"/>
   </bean>
 
@@ -62,7 +62,7 @@
     </property>
   </bean>
 
-  <bean name="filetypes#retention-count" class="org.apache.archiva.configuration.FileTypes">
+  <bean name="filetypes#retention-count" class="org.apache.archiva.configuration.provider.FileTypes">
     <property name="archivaConfiguration" ref="archivaConfiguration#retention-count"/>
   </bean>
 
@@ -75,7 +75,7 @@
     <property name="filetypes" ref="filetypes#days-old"/>
   </bean>
 
-  <bean name="archivaConfiguration#days-old" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#days-old" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#days-old"/>
   </bean>
 
@@ -96,7 +96,7 @@
     </property>
   </bean>
 
-  <bean name="filetypes#days-old" class="org.apache.archiva.configuration.FileTypes">
+  <bean name="filetypes#days-old" class="org.apache.archiva.configuration.provider.FileTypes">
     <property name="archivaConfiguration" ref="archivaConfiguration#days-old"/>
   </bean>
 
index 84c50165156e55ef981c559511ef4a9dc82123f5..261ddf8714d43a509ed01d23da7c02750ee15d00 100644 (file)
@@ -34,8 +34,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index e03557ebf8188c2ba6e392fb664ac6791a3c4ee8..e4673205ef1af6469c23b0f40c20eae645864921 100644 (file)
@@ -20,9 +20,9 @@ package org.apache.archiva.consumers.lucene;
  */
 
 import org.apache.archiva.common.utils.PathUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationNames;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ConfigurationNames;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index cf2768584eb8922deba1ab2827e0ac072de4262f..d5bcb077f52891a1d30feac23e2c44e56ef99c23 100644 (file)
@@ -22,8 +22,8 @@ package org.apache.archiva.consumers.lucene;
 import junit.framework.TestCase;
 import org.apache.archiva.common.utils.PathUtil;
 import org.apache.archiva.components.taskqueue.TaskQueueException;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.repository.ReleaseScheme;
 import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
 import org.apache.archiva.repository.base.RepositoryHandlerDependencies;
index f23955a1c372cf2d4fc2e4c8058602e857800d15..3c552e672a9aeeef071e8cb2f579582951c0a13e 100644 (file)
@@ -38,8 +38,8 @@
       <artifactId>archiva-consumer-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index f694d5af4a09c432d322e220b24e52c6e8600eab..9234108fc283e91151bcaf8046ca53e885386a8c 100644 (file)
@@ -20,9 +20,9 @@ package org.apache.archiva.consumers.metadata;
  */
 
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationNames;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ConfigurationNames;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index 2a63d5041d96f4694914f8d087d8ef2fddfb384a..dc3c7da0df5d5f6e1139074fa58ddb3524b27854 100644 (file)
@@ -34,8 +34,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index a86cb3701c6e04fb8b17f8d75329e5065ff1ff54..02a2c1bf2941117884d0a38a5cc4cfccae95b30c 100644 (file)
@@ -18,9 +18,9 @@ package org.apache.archiva.proxy.base;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.NetworkProxyConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.policies.Policy;
 import org.apache.archiva.policies.PolicyOption;
 import org.apache.archiva.policies.PolicyUtil;
index 44c6c92b0120039d3720e742dd9dce5c260d21e8..f0bfe6baa6b44ddf06c7a14d843035c6dfc30a16 100644 (file)
@@ -23,9 +23,9 @@ import org.apache.archiva.checksum.ChecksumUtil;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.PathUtil;
 import org.apache.archiva.components.taskqueue.TaskQueueException;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorRuleConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorRuleConfiguration;
 import org.apache.archiva.policies.DownloadErrorPolicy;
 import org.apache.archiva.policies.DownloadPolicy;
 import org.apache.archiva.policies.Policy;
index 341d2a3c316474d97a1204c883bbd31e8d18263c..8c231f2c1183404831d7e8761530d619ecd77bc1 100644 (file)
@@ -34,8 +34,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index f1c9475727ecf71b16e13a8c3b2c0be9245e8f08..d2cbb499add1ce159a5fb94bdec81a7f1b3e6b65 100644 (file)
@@ -22,10 +22,10 @@ import org.apache.archiva.admin.model.AuditInformation;
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.RepositoryCommonValidator;
 import org.apache.archiva.admin.model.beans.AbstractRepository;
-import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.redback.users.User;
index 7375942fefe119259e652e6f9788ec38baae0450..df739e7a8060d963624c4326f22a809f4dfe05b0 100644 (file)
@@ -23,8 +23,8 @@ import org.apache.archiva.admin.model.RepositoryCommonValidator;
 import org.apache.archiva.admin.model.beans.AbstractRepository;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.components.scheduler.CronExpressionValidator;
 import org.apache.commons.lang3.StringUtils;
index dec2caa86c55328ba7255cd60455bfe02013098e..8db4ebe728105f31813c39c2e50d60b3b2083b59 100644 (file)
@@ -23,9 +23,9 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.admin.ArchivaAdministration;
 import org.apache.archiva.admin.model.beans.*;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.UserInterfaceOptions;
-import org.apache.archiva.configuration.WebappConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.UserInterfaceOptions;
+import org.apache.archiva.configuration.model.WebappConfiguration;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -54,7 +54,7 @@ public class DefaultArchivaAdministration
     {
         List<LegacyArtifactPath> legacyArtifactPaths = new ArrayList<>(
             getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths().size() );
-        for ( org.apache.archiva.configuration.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() )
+        for ( org.apache.archiva.configuration.model.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() )
         {
             legacyArtifactPaths.add(
                 getModelMapper().map( legacyArtifactPath, LegacyArtifactPath.class ) );
@@ -69,7 +69,7 @@ public class DefaultArchivaAdministration
         Configuration configuration = getArchivaConfiguration().getConfiguration();
 
         configuration.addLegacyArtifactPath( getModelMapper().map( legacyArtifactPath,
-                                                                   org.apache.archiva.configuration.LegacyArtifactPath.class ) );
+                                                                   org.apache.archiva.configuration.model.LegacyArtifactPath.class ) );
 
         saveConfiguration( configuration );
         triggerAuditEvent( "", "", AuditEvent.ADD_LEGACY_PATH, auditInformation );
@@ -80,8 +80,8 @@ public class DefaultArchivaAdministration
         throws RepositoryAdminException
     {
         Configuration configuration = getArchivaConfiguration().getConfiguration();
-        org.apache.archiva.configuration.LegacyArtifactPath legacyArtifactPath =
-            new org.apache.archiva.configuration.LegacyArtifactPath();
+        org.apache.archiva.configuration.model.LegacyArtifactPath legacyArtifactPath =
+            new org.apache.archiva.configuration.model.LegacyArtifactPath();
 
         legacyArtifactPath.setPath( path );
         configuration.removeLegacyArtifactPath( legacyArtifactPath );
@@ -97,7 +97,7 @@ public class DefaultArchivaAdministration
     {
         Configuration configuration = getArchivaConfiguration().getConfiguration();
 
-        org.apache.archiva.configuration.FileType fileType = getFileTypeById( fileTypeId, configuration );
+        org.apache.archiva.configuration.model.FileType fileType = getFileTypeById( fileTypeId, configuration );
         if ( fileType == null )
         {
             return;
@@ -120,7 +120,7 @@ public class DefaultArchivaAdministration
     {
         Configuration configuration = getArchivaConfiguration().getConfiguration();
 
-        org.apache.archiva.configuration.FileType fileType = getFileTypeById( fileTypeId, configuration );
+        org.apache.archiva.configuration.model.FileType fileType = getFileTypeById( fileTypeId, configuration );
         if ( fileType == null )
         {
             return;
@@ -135,7 +135,7 @@ public class DefaultArchivaAdministration
     public FileType getFileType( String fileTypeId )
         throws RepositoryAdminException
     {
-        org.apache.archiva.configuration.FileType fileType =
+        org.apache.archiva.configuration.model.FileType fileType =
             getFileTypeById( fileTypeId, getArchivaConfiguration().getConfiguration() );
         if ( fileType == null )
         {
@@ -156,7 +156,7 @@ public class DefaultArchivaAdministration
         }
 
         configuration.getRepositoryScanning().addFileType(
-            getModelMapper().map( fileType, org.apache.archiva.configuration.FileType.class ) );
+            getModelMapper().map( fileType, org.apache.archiva.configuration.model.FileType.class ) );
         saveConfiguration( configuration );
     }
 
@@ -165,7 +165,7 @@ public class DefaultArchivaAdministration
         throws RepositoryAdminException
     {
         Configuration configuration = getArchivaConfiguration().getConfiguration();
-        org.apache.archiva.configuration.FileType fileType = new org.apache.archiva.configuration.FileType();
+        org.apache.archiva.configuration.model.FileType fileType = new org.apache.archiva.configuration.model.FileType();
         fileType.setId( fileTypeId );
         configuration.getRepositoryScanning().removeFileType( fileType );
         saveConfiguration( configuration );
@@ -253,14 +253,14 @@ public class DefaultArchivaAdministration
     public List<FileType> getFileTypes()
         throws RepositoryAdminException
     {
-        List<org.apache.archiva.configuration.FileType> configFileTypes =
+        List<org.apache.archiva.configuration.model.FileType> configFileTypes =
             getArchivaConfiguration().getConfiguration().getRepositoryScanning().getFileTypes();
         if ( configFileTypes == null || configFileTypes.isEmpty() )
         {
             return Collections.emptyList();
         }
         List<FileType> fileTypes = new ArrayList<>( configFileTypes.size() );
-        for ( org.apache.archiva.configuration.FileType fileType : configFileTypes )
+        for ( org.apache.archiva.configuration.model.FileType fileType : configFileTypes )
         {
             fileTypes.add( getModelMapper().map( fileType, FileType.class ) );
         }
@@ -287,7 +287,7 @@ public class DefaultArchivaAdministration
     public OrganisationInformation getOrganisationInformation()
         throws RepositoryAdminException
     {
-        org.apache.archiva.configuration.OrganisationInformation organisationInformation =
+        org.apache.archiva.configuration.model.OrganisationInformation organisationInformation =
             getArchivaConfiguration().getConfiguration().getOrganisationInfo();
         if ( organisationInformation == null )
         {
@@ -329,9 +329,9 @@ public class DefaultArchivaAdministration
         if ( organisationInformation != null )
         {
             organisationInformation.setName( convertName( organisationInformation.getName() ));
-            org.apache.archiva.configuration.OrganisationInformation organisationInformationModel =
+            org.apache.archiva.configuration.model.OrganisationInformation organisationInformationModel =
                 getModelMapper( ).map( organisationInformation,
-                    org.apache.archiva.configuration.OrganisationInformation.class );
+                    org.apache.archiva.configuration.model.OrganisationInformation.class );
             configuration.setOrganisationInfo( organisationInformationModel );
         }
         else
@@ -382,7 +382,7 @@ public class DefaultArchivaAdministration
     public NetworkConfiguration getNetworkConfiguration()
         throws RepositoryAdminException
     {
-        org.apache.archiva.configuration.NetworkConfiguration networkConfiguration =
+        org.apache.archiva.configuration.model.NetworkConfiguration networkConfiguration =
             getArchivaConfiguration().getConfiguration().getNetworkConfiguration();
 
         if ( networkConfiguration == null )
@@ -404,7 +404,7 @@ public class DefaultArchivaAdministration
         else
         {
             configuration.setNetworkConfiguration( getModelMapper().map( networkConfiguration,
-                                                                         org.apache.archiva.configuration.NetworkConfiguration.class ) );
+                                                                         org.apache.archiva.configuration.model.NetworkConfiguration.class ) );
         }
         // setupWagon( networkConfiguration );
         saveConfiguration( configuration );
@@ -415,9 +415,9 @@ public class DefaultArchivaAdministration
     //
     //-------------------------
 
-    private org.apache.archiva.configuration.FileType getFileTypeById( String id, Configuration configuration )
+    private org.apache.archiva.configuration.model.FileType getFileTypeById( String id, Configuration configuration )
     {
-        for ( org.apache.archiva.configuration.FileType fileType : configuration.getRepositoryScanning().getFileTypes() )
+        for ( org.apache.archiva.configuration.model.FileType fileType : configuration.getRepositoryScanning().getFileTypes() )
         {
             if ( StringUtils.equals( id, fileType.getId() ) )
             {
index a6276a84411ca3aa053574345c38d5dca4211840..f30c849a6259a72f24ecce13989b6fb48b876e6a 100644 (file)
@@ -27,13 +27,12 @@ import org.apache.archiva.admin.model.beans.RepositoryGroup;
 import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.Event;
 import org.apache.archiva.event.EventHandler;
 import org.apache.archiva.event.EventType;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
-import org.apache.archiva.indexer.merger.MergedRemoteIndexesScheduler;
 import org.apache.archiva.repository.EditableRepositoryGroup;
 import org.apache.archiva.repository.RepositoryException;
 import org.apache.archiva.repository.RepositoryRegistry;
@@ -47,11 +46,6 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
-import javax.inject.Named;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
index 7a8a98291107dfbc671545126c83e45846d71a1c..5b6dae25b9d89783900ecf6d24bd5694531eb855 100644 (file)
@@ -25,9 +25,9 @@ import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
 import org.apache.archiva.components.cache.Cache;
 import org.apache.archiva.components.taskqueue.TaskQueueException;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexManager;
 import org.apache.archiva.indexer.IndexManagerFactory;
 import org.apache.archiva.indexer.IndexUpdateFailedException;
@@ -63,7 +63,6 @@ import java.io.IOException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
index b6ccc73ff6d9a9243c456059aae0787ce1df12f5..7fd43ec3c0beade6c32a4c103a9f82dbaeb659bb 100644 (file)
@@ -23,8 +23,8 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.NetworkProxy;
 import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.repository.RemoteRepository;
 import org.apache.archiva.repository.RepositoryException;
index 4a8f452ba21610bb7897666e1cf8fe81ebd9e6c0..e6ec28b42c34cd00af97035db1162ff1bae804b4 100644 (file)
@@ -24,9 +24,9 @@ import org.apache.archiva.admin.model.beans.ProxyConnector;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorOrderComparator;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.functors.ProxyConnectorSelectionPredicate;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.functors.ProxyConnectorSelectionPredicate;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.commons.collections4.IterableUtils;
index 9dbc37429542aef7bd7697dbd206537736ec7313..b6dd64bcc24db70e2704e7b9343773a7e733cbd8 100644 (file)
@@ -25,9 +25,9 @@ import org.apache.archiva.admin.model.beans.ProxyConnectorRule;
 import org.apache.archiva.proxy.model.ProxyConnectorRuleType;
 import org.apache.archiva.admin.model.proxyconnectorrule.ProxyConnectorRuleAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorRuleConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorRuleConfiguration;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 4a845beeaa760beacc25f7faacf4bd269265e68a..427f52e27af6cde2077d67562e0b17dc906bed7c 100644 (file)
@@ -23,9 +23,9 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
 import org.apache.archiva.common.utils.PathUtil;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryCheckPath;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryCheckPath;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.repository.RemoteRepository;
 import org.apache.archiva.repository.RepositoryCredentials;
index b6b1eb41bfabcd8be00cda571f6bc824652ff5ce..2413c71940d17debc867c1f15313cfed8b00bab3 100644 (file)
@@ -24,9 +24,9 @@ import org.apache.archiva.admin.model.beans.CacheConfiguration;
 import org.apache.archiva.admin.model.beans.FileLockConfiguration;
 import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
 import org.apache.archiva.components.cache.Cache;
 import org.apache.archiva.components.registry.RegistryException;
 import org.springframework.stereotype.Service;
@@ -146,7 +146,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
     }
 
     protected ArchivaRuntimeConfiguration build(
-        org.apache.archiva.configuration.ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
+        org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
     {
         if ( archivaRuntimeConfiguration == null )
         {
@@ -175,24 +175,24 @@ public class DefaultArchivaRuntimeConfigurationAdmin
         return res;
     }
 
-    protected org.apache.archiva.configuration.ArchivaRuntimeConfiguration build(
+    protected org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration build(
         ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
     {
         if ( archivaRuntimeConfiguration == null )
         {
-            return new org.apache.archiva.configuration.ArchivaRuntimeConfiguration();
+            return new org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration();
         }
 
-        org.apache.archiva.configuration.ArchivaRuntimeConfiguration res =
+        org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration res =
             getModelMapper().map( archivaRuntimeConfiguration,
-                                  org.apache.archiva.configuration.ArchivaRuntimeConfiguration.class );
+                                  org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration.class );
 
         if ( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration() != null )
         {
 
             res.setUrlFailureCacheConfiguration(
                 getModelMapper().map( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
-                                      org.apache.archiva.configuration.CacheConfiguration.class ) );
+                                      org.apache.archiva.configuration.model.CacheConfiguration.class ) );
 
         }
 
@@ -200,7 +200,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
         {
             res.setFileLockConfiguration(
                 getModelMapper().map( archivaRuntimeConfiguration.getFileLockConfiguration(),
-                                      org.apache.archiva.configuration.FileLockConfiguration.class ) );
+                                      org.apache.archiva.configuration.model.FileLockConfiguration.class ) );
         }
 
         return res;
index d15990189db858aacf141c950ea192bc0e16eb35..9c6afe65977287b51de3be7c4a90254b9e1c9eb7 100644 (file)
@@ -25,15 +25,14 @@ import org.apache.archiva.admin.model.beans.LdapGroupMapping;
 import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
 import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
 import org.apache.archiva.components.cache.Cache;
 import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.configuration.util.ConfigMapper;
+import org.apache.archiva.configuration.provider.util.ConfigMapper;
 import org.apache.archiva.redback.configuration.UserConfiguration;
 import org.apache.archiva.redback.configuration.UserConfigurationException;
-import org.apache.archiva.redback.configuration.UserConfigurationKeys;
 import org.apache.archiva.redback.users.User;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -349,7 +348,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin
     public void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
         throws RepositoryAdminException
     {
-        org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration =
+        org.apache.archiva.configuration.model.RedbackRuntimeConfiguration runtimeConfiguration =
             build( redbackRuntimeConfiguration );
         Configuration configuration = archivaConfiguration.getConfiguration();
         configuration.setRedbackRuntimeConfiguration( runtimeConfiguration );
@@ -368,7 +367,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin
     }
 
     private RedbackRuntimeConfiguration build(
-        org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration )
+        org.apache.archiva.configuration.model.RedbackRuntimeConfiguration runtimeConfiguration )
     {
         RedbackRuntimeConfiguration redbackRuntimeConfiguration =
             getModelMapper().map( runtimeConfiguration, RedbackRuntimeConfiguration.class );
@@ -396,13 +395,13 @@ public class DefaultRedbackRuntimeConfigurationAdmin
             redbackRuntimeConfiguration.setUsersCacheConfiguration( new CacheConfiguration() );
         }
 
-        List<org.apache.archiva.configuration.LdapGroupMapping> mappings = runtimeConfiguration.getLdapGroupMappings();
+        List<org.apache.archiva.configuration.model.LdapGroupMapping> mappings = runtimeConfiguration.getLdapGroupMappings();
 
         if ( mappings != null && mappings.size() > 0 )
         {
             List<LdapGroupMapping> ldapGroupMappings = new ArrayList<>( mappings.size() );
 
-            for ( org.apache.archiva.configuration.LdapGroupMapping mapping : mappings )
+            for ( org.apache.archiva.configuration.model.LdapGroupMapping mapping : mappings )
             {
                 ldapGroupMappings.add( new LdapGroupMapping( mapping.getGroup(), mapping.getRoleNames() ) );
             }
@@ -426,19 +425,19 @@ public class DefaultRedbackRuntimeConfigurationAdmin
         LDAP_MAPPER.getAllAttributes( ).stream( ).forEach( att -> properties.remove( att ) );
     }
 
-    private org.apache.archiva.configuration.RedbackRuntimeConfiguration build(
+    private org.apache.archiva.configuration.model.RedbackRuntimeConfiguration build(
         RedbackRuntimeConfiguration redbackRuntimeConfiguration )
     {
-        org.apache.archiva.configuration.RedbackRuntimeConfiguration res =
+        org.apache.archiva.configuration.model.RedbackRuntimeConfiguration res =
             getModelMapper().map( redbackRuntimeConfiguration,
-                                  org.apache.archiva.configuration.RedbackRuntimeConfiguration.class );
+                                  org.apache.archiva.configuration.model.RedbackRuntimeConfiguration.class );
 
         if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
         {
             redbackRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
         }
         res.setLdapConfiguration( getModelMapper().map( redbackRuntimeConfiguration.getLdapConfiguration(),
-                                                        org.apache.archiva.configuration.LdapConfiguration.class ) );
+                                                        org.apache.archiva.configuration.model.LdapConfiguration.class ) );
 
         if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
         {
@@ -446,21 +445,21 @@ public class DefaultRedbackRuntimeConfigurationAdmin
         }
 
         res.setUsersCacheConfiguration( getModelMapper().map( redbackRuntimeConfiguration.getUsersCacheConfiguration(),
-                                                              org.apache.archiva.configuration.CacheConfiguration.class ) );
+                                                              org.apache.archiva.configuration.model.CacheConfiguration.class ) );
 
         List<LdapGroupMapping> ldapGroupMappings = redbackRuntimeConfiguration.getLdapGroupMappings();
 
         if ( ldapGroupMappings != null && ldapGroupMappings.size() > 0 )
         {
 
-            List<org.apache.archiva.configuration.LdapGroupMapping> mappings =
+            List<org.apache.archiva.configuration.model.LdapGroupMapping> mappings =
                 new ArrayList<>( ldapGroupMappings.size() );
 
             for ( LdapGroupMapping ldapGroupMapping : ldapGroupMappings )
             {
 
-                org.apache.archiva.configuration.LdapGroupMapping mapping =
-                    new org.apache.archiva.configuration.LdapGroupMapping();
+                org.apache.archiva.configuration.model.LdapGroupMapping mapping =
+                    new org.apache.archiva.configuration.model.LdapGroupMapping();
                 mapping.setGroup( ldapGroupMapping.getGroup() );
                 mapping.setRoleNames( new ArrayList<>( ldapGroupMapping.getRoleNames() ) );
                 mappings.add( mapping );
index 6fbfa958959c5ee0a1471ae261c6709897f21bab..0557fdb7b4d6b276add5ea83f6626a9be1d78f3c 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.admin.mock;
 
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.PathUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexManager;
 import org.apache.archiva.indexer.ArchivaIndexingContext;
 import org.apache.archiva.indexer.IndexCreationFailedException;
index 2d84e474f6606771e8d50bca3f86f9b77c1a0d24..9d7a9661f5390da2fc9ef445837d69f635ea5812 100644 (file)
@@ -27,7 +27,7 @@ import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
 import org.apache.archiva.admin.model.proxyconnectorrule.ProxyConnectorRuleAdmin;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.redback.role.RoleManager;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.memory.SimpleUser;
index 2e542d5cc2eeba88ad963df26dd8cc410606e136..2378d49e5b634d0ac86e4f1bdee6db050891c0e4 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.admin.repository.managed;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
index be94705fef132693355e60d49ac375ce4b82af39..4ae27d9e3fb0d0c89f3f5e0032e38229dcc6e00e 100644 (file)
@@ -52,8 +52,8 @@
       <artifactId>archiva-model</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
index 537a043a604ff2ecc3e3226f027946a9654ca021..3ea75b26635580dae464e188ba5e03daa65a8514 100644 (file)
@@ -19,10 +19,10 @@ package org.apache.archiva.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationNames;
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.components.registry.RegistryListener;
+import org.apache.archiva.configuration.model.ConfigurationNames;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
 
index ee7f1e4e1db53c84570f46bae7b110e8e5e0bab8..8ed6c37da020d91a4a790506d17e2d55fd045494 100644 (file)
@@ -17,8 +17,8 @@ package org.apache.archiva.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
-import org.apache.archiva.configuration.Configuration;
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
 import org.apache.archiva.repository.validation.CheckedResult;
 import org.apache.archiva.repository.validation.RepositoryChecker;
 import org.apache.archiva.repository.validation.RepositoryValidator;
@@ -140,6 +140,19 @@ public interface RepositoryHandler<R extends Repository, C extends AbstractRepos
     <D> CheckedResult<R, D>
     putWithCheck( C repositoryConfiguration, RepositoryChecker<R, D> checker ) throws RepositoryException;
 
+    /**
+     * Adds or updates a repository from the given configuration data. The resulting repository is
+     * checked by the default repository checker of the handler instance and the result is returned.
+     * If the checker returns a valid result, the registry is updated and configuration is saved.
+     *
+     * @param repositoryConfiguration the repository configuration
+     * @return the repository and the check result as map of attributes -> list of validation errors
+     * @throws RepositoryException if the creation or update failed
+     */
+    CheckedResult<R, Map<String, List<ValidationError>>>
+    putWithCheck( C repositoryConfiguration ) throws RepositoryException;
+
+
     /**
      * Removes the given repository from the registry and updates references and saves the new configuration.
      *
index d3270d184c1919ae65e82cf35bc76a987dba947d..f47bb184a9be9f5123fbc5215a546a585141080c 100644 (file)
@@ -17,7 +17,7 @@ package org.apache.archiva.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
 import org.apache.archiva.event.Event;
 import org.apache.archiva.event.EventHandler;
 
index 813acb61de0098117aceb5f2622270c323c26325..89005f662247c9d3150eff5de2c89c7349fabf7a 100644 (file)
@@ -19,9 +19,9 @@ package org.apache.archiva.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.EventHandler;
 import org.apache.archiva.repository.event.RepositoryEvent;
 
index 718045e29321351bcbd669a452f62bef2486e804..1c6123a83f7f3bb26291c0a2fcabccdbb0da577d 100644 (file)
@@ -19,11 +19,11 @@ package org.apache.archiva.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.EventSource;
 import org.apache.archiva.indexer.ArchivaIndexManager;
 import org.apache.archiva.indexer.IndexUpdateFailedException;
@@ -190,6 +190,16 @@ public interface RepositoryRegistry extends EventSource, RepositoryHandlerManage
      */
     ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration, Configuration configuration ) throws RepositoryException;
 
+    /**
+     * Validates the given repository configuration and adds the repository persistent to the registry, if it is valid.
+     * If the validation was not successful, the repository will not be added or persistet, and it will return the list of validation errors.
+     *
+     * @param configuration the managed repository configuration
+     * @return the managed repository or a list of validation errors
+     * @throws RepositoryException if there are errors while adding the repository
+     */
+    CheckedResult<ManagedRepository, Map<String, List<ValidationError>>> putRepositoryAndValidate( ManagedRepositoryConfiguration configuration) throws RepositoryException;
+
     /**
      * Adds or updates the given repository group. If a repository group with the given id exists already, it is updated
      * from the data of the given instance. Otherwise a new repository is created and updated by the data of the given instance.
@@ -261,6 +271,19 @@ public interface RepositoryRegistry extends EventSource, RepositoryHandlerManage
      */
     RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration ) throws RepositoryException;
 
+    /**
+     * Adds or updates the given remote repository. If a remote repository with the given id exists already, it is updated
+     * from the data of the given configuration. Otherwise a new repository is created and updated by the data of the given configuration.
+     *
+     * The remoteRepositoryConfiguration is validated before adding to the registry and persisting. If the validation fails,
+     * it is not registered or updated.
+     *
+     * @param remoteRepositoryConfiguration the remote repository configuration
+     * @return the repository instance, that was created or updated
+     * @throws RepositoryException if an error occurred while creating or updating the instance
+     */
+    CheckedResult<RemoteRepository, Map<String, List<ValidationError>>>  putRepositoryAndValidate( RemoteRepositoryConfiguration remoteRepositoryConfiguration ) throws RepositoryException;
+
     /**
      * Adds or updates the given remote repository. If a remote repository with the given id exists already, it is updated
      * from the data of the given configuration. Otherwise a new repository is created and updated by the data of the given configuration.
index c68e4bce6142253e72cc91a1d2f2513b8b631634..b9b6f45588d76c85b4890332598b082e4e22773b 100644 (file)
@@ -54,8 +54,8 @@
       <artifactId>archiva-repository-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 9e316a7fe9a9180f05e2616031c9592960ba93d8..0e17aacd6428c55c08453fb8c421c0d354d0830c 100644 (file)
@@ -18,9 +18,9 @@ package org.apache.archiva.repository.base;
  */
 
 import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
 import org.apache.archiva.event.Event;
 import org.apache.archiva.event.EventManager;
 import org.apache.archiva.event.EventType;
@@ -214,7 +214,13 @@ public abstract class AbstractRepositoryHandler<R extends Repository, C extends
 
     }
 
-    protected abstract C findRepositoryConfiguration(Configuration configuration, String id);
+    @Override
+    public CheckedResult<R, Map<String, List<ValidationError>>> putWithCheck( C repositoryConfiguration ) throws RepositoryException
+    {
+        return putWithCheck( repositoryConfiguration, getValidator( ) );
+    }
+
+    protected abstract C findRepositoryConfiguration( Configuration configuration, String id);
 
     protected abstract void removeRepositoryConfiguration(Configuration configuration, C repoConfiguration );
 
index a2c7dc39f7fffa63d12f1bd5c02b821160857d35..1d0c32207dab3ec57014f186bce95c9458dd76d8 100644 (file)
@@ -20,15 +20,15 @@ package org.apache.archiva.repository.base;
  */
 
 import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ConfigurationEvent;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.ConfigurationEvent;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.Event;
 import org.apache.archiva.event.EventHandler;
 import org.apache.archiva.event.EventManager;
@@ -563,6 +563,17 @@ public class ArchivaRepositoryRegistry implements ConfigurationListener, EventHa
         }
     }
 
+    @Override
+    public CheckedResult<ManagedRepository, Map<String, List<ValidationError>>> putRepositoryAndValidate( ManagedRepositoryConfiguration configuration ) throws RepositoryException
+    {
+        rwLock.writeLock().lock();
+        try {
+            return managedRepositoryHandler.putWithCheck( configuration );
+        } finally
+        {
+            rwLock.writeLock( ).unlock( );
+        }
+    }
 
     /**
      * Adds a new repository group to the current list, or replaces the repository group definition with
@@ -620,7 +631,7 @@ public class ArchivaRepositoryRegistry implements ConfigurationListener, EventHa
         rwLock.writeLock( ).lock( );
         try
         {
-            return groupHandler.putWithCheck( repositoryGroupConfiguration, groupHandler.getValidator( ) );
+            return groupHandler.putWithCheck( repositoryGroupConfiguration );
         }
         finally
         {
@@ -695,6 +706,18 @@ public class ArchivaRepositoryRegistry implements ConfigurationListener, EventHa
         }
     }
 
+    @Override
+    public CheckedResult<RemoteRepository, Map<String, List<ValidationError>>> putRepositoryAndValidate( RemoteRepositoryConfiguration remoteRepositoryConfiguration ) throws RepositoryException
+    {
+        rwLock.writeLock().lock();
+        try {
+            return remoteRepositoryHandler.putWithCheck( remoteRepositoryConfiguration );
+        } finally
+        {
+            rwLock.writeLock().unlock();
+        }
+    }
+
     /**
      * Adds a new repository or updates the repository with the same id. The given configuration object is updated, but
      * the configuration is not saved.
index 9278e022a085cd42b6fcdb3455d0df8279c71172..b54e385a1a114c174f61a0c2e72df0689227f8a1 100644 (file)
@@ -18,10 +18,10 @@ package org.apache.archiva.repository.base;
  */
 
 import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
 import org.springframework.stereotype.Service;
 
 import java.util.concurrent.locks.ReentrantReadWriteLock;
index 9285de888addd31ac236499fbbbea293e2c51e9d..547a666597ce7d49a8fc26691a045041ff2cca97 100644 (file)
@@ -18,10 +18,10 @@ package org.apache.archiva.repository.base.group;
  */
 
 import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.indexer.merger.MergedRemoteIndexesScheduler;
 import org.apache.archiva.repository.EditableRepository;
 import org.apache.archiva.repository.EditableRepositoryGroup;
index 0ed99ecc7ce37450d3a74c4eecd595893dad665f..bdcbf04d80342673264bfbd8820d7496bb559087 100644 (file)
@@ -18,9 +18,9 @@ package org.apache.archiva.repository.base.managed;
  */
 
 import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexManager;
 import org.apache.archiva.indexer.IndexCreationFailedException;
 import org.apache.archiva.indexer.IndexManagerFactory;
index ea1f19c91d4fea2f1c857fdd4d23c26615f8e2e6..9d9417f864c2db7bf6ee3145cc351eeff26378fc 100644 (file)
@@ -18,10 +18,10 @@ package org.apache.archiva.repository.base.remote;
  */
 
 import org.apache.archiva.components.registry.RegistryException;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexManager;
 import org.apache.archiva.indexer.IndexCreationFailedException;
 import org.apache.archiva.indexer.IndexManagerFactory;
index cb8b6eb4d0dc3184ae8fd124c602be9022f669fe..2a385ba5d5ec7d2bf155cad73e82f32558f30c3d 100644 (file)
@@ -25,12 +25,12 @@ import org.apache.archiva.common.utils.VersionComparator;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.components.registry.RegistryListener;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationEvent;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.ConfigurationNames;
-import org.apache.archiva.configuration.FileTypes;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ConfigurationEvent;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
+import org.apache.archiva.configuration.model.ConfigurationNames;
+import org.apache.archiva.configuration.provider.FileTypes;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.Plugin;
 import org.apache.archiva.model.SnapshotVersion;
index e4bb05230328469ea4ad92ac0f84f12111f7a8aa..d1f58e2636ec62ab7e45cf4ba82a76d40783ee90 100644 (file)
@@ -19,10 +19,10 @@ package org.apache.archiva.repository.base;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.ReleaseScheme;
 import org.apache.archiva.repository.RemoteRepository;
index ea65a2e0e5a7b315c692113198bf2c0c5c92eb4a..fb607e427d30775816d9e705da15e8003d9b1f21 100644 (file)
@@ -21,11 +21,11 @@ package org.apache.archiva.repository.base.group;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.indexer.merger.MergedRemoteIndexesScheduler;
 import org.apache.archiva.repository.EditableRepositoryGroup;
 import org.apache.archiva.repository.ManagedRepository;
index 2fe4f671e524336cdbc50851500f4ebe7d8c1c11..a5ed4b5b005eceea1fc3f5351ddb1fa33b30b65e 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.repository.base.managed;
 
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.filelock.FileLockManager;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.repository.EditableManagedRepository;
 import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.RepositoryException;
index 8811d4a46d42f35af66e79406201bb61acbcbe64..fb6505de76c517af6143e70968e65d9689d4def2 100644 (file)
@@ -21,11 +21,10 @@ package org.apache.archiva.repository.base.managed;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.indexer.IndexManagerFactory;
-import org.apache.archiva.indexer.merger.MergedRemoteIndexesScheduler;
 import org.apache.archiva.repository.EditableManagedRepository;
 import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.Repository;
@@ -41,7 +40,6 @@ import org.apache.archiva.repository.validation.RepositoryValidator;
 import org.apache.archiva.repository.validation.ValidationError;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
index f596b8e23e5895080d58fe491ad0c08ff78089b5..b23c7f92f94879221ad7cb24911417d055ffbd79 100644 (file)
@@ -21,9 +21,9 @@ package org.apache.archiva.repository.base.remote;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.archiva.indexer.IndexManagerFactory;
 import org.apache.archiva.repository.EditableRemoteRepository;
 import org.apache.archiva.repository.RemoteRepository;
index 5a3a4736d82c07d74f5f79ad1064e714c89691d4..3a07073677d74cf32e39be54e87c79ef16a68e55 100644 (file)
@@ -19,9 +19,9 @@ package org.apache.archiva.repository.mock;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.EventHandler;
 import org.apache.archiva.repository.*;
 import org.apache.archiva.event.Event;
index c57a4ba1efd882b985e5da151832c1b5bbb60194..11131f74d6da37deb0c8ce14648a0d6d5a87fea1 100644 (file)
@@ -38,8 +38,8 @@
       <artifactId>archiva-consumer-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 650162bd5ebe07abb02507c5016c9cb073a49fc7..0fd0c3cac2f24122f5e0562d1009bcf9c125d612 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.repository.scanner;
  * under the License.
  */
 
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index 0795fa557767db6ee791a9b1d615fb1ee15de433..5457202a2c117b7a5f624f4e39a2a6f523f9f980 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.admin.ArchivaAdministration;
 import org.apache.archiva.common.utils.BaseFile;
 import org.apache.archiva.common.utils.PathUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
index d3eadfdfaf3f00dd8148b017a989d6fc5db1ef75..ca43b65697e515b539be5b0beb6422401b1bcf4b 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
 import org.apache.archiva.admin.model.beans.NetworkConfiguration;
 import org.apache.archiva.admin.model.beans.OrganisationInformation;
 import org.apache.archiva.admin.model.beans.UiConfiguration;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
index b2bfd519157f667a00f3c6638e2b9ef4784f2ff4..40b0e9e77db90554a1d15d98b923ef2e77e59146 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.repository.scanner;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.archiva.repository.base.managed.BasicManagedRepository;
index 219f7144a1ef8c127d278b1236e6754036898133..a77f925e27a30ba4bfea89c70d3088f7ac46a32f 100644 (file)
@@ -24,7 +24,7 @@
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
        default-lazy-init="true">
 
-  <bean name="archivaConfiguration#test-conf" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#test-conf" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#configured"/>
   </bean>
 
index f2855f68150f50f63943762f74defcef1e3002a6..b49e39c7d22c47afaef8cda8de696d02608c3fe1 100644 (file)
@@ -77,8 +77,8 @@
       <artifactId>archiva-model</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
 
 
index 512c74194cf762621b4c2e219c3c288e467dc2f3..da4d1b779b5d5c3dcb06839d5832c8c579a1b20a 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.maven.indexer;
 
 import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.common.utils.PathUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexManager;
 import org.apache.archiva.indexer.ArchivaIndexingContext;
 import org.apache.archiva.indexer.IndexCreationFailedException;
index 4cdc10dba2835cde39e75ebac501bcec079150bf..3ff27e37952a7f568d078297c9edc26d42b729fd 100644 (file)
@@ -20,10 +20,9 @@ package org.apache.archiva.maven.indexer.search;
 
 import junit.framework.TestCase;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexingContext;
 import org.apache.archiva.indexer.search.SearchResultHit;
 import org.apache.archiva.indexer.search.SearchResults;
index 611964236038c4df36c76e3b3c6435406af86905..653256609876fcb217912e9cc367e7b01430004f 100644 (file)
@@ -78,8 +78,8 @@
       <artifactId>archiva-model</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index ae35893330338670f5fc13a8ade7fc692fc0f3cd..5fd12f264b981544dd2224410f4dca1a1c636428 100644 (file)
@@ -18,11 +18,11 @@ package org.apache.archiva.maven.proxy;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ArchivaRuntimeConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.archiva.policies.CachedFailuresPolicy;
 import org.apache.archiva.policies.ChecksumPolicy;
 import org.apache.archiva.policies.PolicyOption;
index 9d47b1bc78ef99590255025f8ce4551b0cba4356..f8ec13f006fcfe567c04ae84d493895e4b5869dc 100644 (file)
@@ -18,10 +18,10 @@ package org.apache.archiva.maven.proxy;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.NetworkProxyConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.NetworkProxyConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.archiva.policies.CachedFailuresPolicy;
 import org.apache.archiva.policies.ChecksumPolicy;
 import org.apache.archiva.policies.PropagateErrorsDownloadPolicy;
index 530b0561f38339cd8ea26fc31a5e56bd53ac78fa..bec37cf1bccf9f3a1d50116662e914d5cbd1c489 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.maven.proxy;
 
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.Plugin;
 import org.apache.archiva.model.SnapshotVersion;
index 2cf6a105a73369f0d34c6ab8058f6cc851541d5f..5116078ec03e50d8f12140a35654bb3792c18f0e 100644 (file)
@@ -18,12 +18,15 @@ package org.apache.archiva.maven.proxy;
  * under the License.
  */
 
-import org.apache.archiva.configuration.*;
+import org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.provider.*;
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.components.registry.RegistryException;
 import org.apache.archiva.components.registry.RegistryListener;
+import org.apache.archiva.configuration.model.Configuration;
 import org.apache.commons.lang3.StringUtils;
-import org.mockito.Mockito;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
index 3c9efe8a69ff26a5fe5b0f616d3e9e09017b4982..90dfb58242c4a257186f9fb785576d4e5fe2f5fb 100644 (file)
@@ -18,9 +18,9 @@ package org.apache.archiva.maven.proxy.mock.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.EventHandler;
 import org.apache.archiva.repository.base.managed.BasicManagedRepository;
 import org.apache.archiva.repository.base.remote.BasicRemoteRepository;
index f415c77e37cd7aec3ab72f627f287c118a5fa68b..7c042b5c7e79d3ec73af8125bb9b781408c362a1 100644 (file)
     </dependency>
 
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva.maven</groupId>
index 636b8c9887b1ec782b319a7a23c6b0fd8514b4d9..87a263a03fe12a5f00dd81801072da16de4fb834 100644 (file)
@@ -19,11 +19,11 @@ package org.apache.archiva.maven.repository;
  */
 
 import org.apache.archiva.common.filelock.FileLockManager;
-import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.AbstractRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.event.Event;
 import org.apache.archiva.event.EventHandler;
 import org.apache.archiva.repository.EditableManagedRepository;
index e9818dc632848a56f15e562fa79eede9fbd716f0..4b9d27d51bbf5f4e46ae0ec1c74536b61b2edf77 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.maven.repository.content;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.repository.EditableManagedRepository;
 import org.apache.archiva.repository.ItemDeleteStatus;
index eb80f7746f04640de1484a14f55b07d6ac0586b4..bea96aa0feeb0c84cd74c5b6e9e0c2a0cd774d85 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.maven.repository.content;
  */
 
 import org.apache.archiva.common.filelock.FileLockManager;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.maven.repository.metadata.storage.ArtifactMappingProvider;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.repository.ManagedRepository;
index 4bb7fb9a40080892c9a56dd991d09c3e6faed0df..1bc75f21d2269f7ab018fe9c94a91d73b6120700 100644 (file)
@@ -21,9 +21,9 @@ package org.apache.archiva.maven.repository.merge;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.VersionComparator;
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.filter.Filter;
 import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
index dcd3b7f3710118a0a8459d5edbcd845bc9fbf83d..98472de02b6c3a94a027e0ab603ed668d29416fb 100644 (file)
@@ -19,10 +19,10 @@ package org.apache.archiva.maven.repository;
  */
 
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ArchivaRuntimeConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.repository.EditableRepositoryGroup;
 import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.ReleaseScheme;
index 83930a1cd344519b87543c608a71c46b86839128..5cebdf53a39f10d5282a1a618ee41c8b8964cf7c 100644 (file)
@@ -20,9 +20,9 @@ package org.apache.archiva.maven.repository.content;
 
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.VersionComparator;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.FileType;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.maven.repository.MavenManagedRepository;
 import org.apache.archiva.maven.repository.metadata.storage.ArtifactMappingProvider;
index 1cfdc47099de23ae28480b5d183c0bea693d71e4..764a571138e90f0b197b926cb6b3965e8884dcaf 100644 (file)
@@ -20,9 +20,9 @@ package org.apache.archiva.maven.repository.content;
 
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.FileType;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.maven.repository.MavenManagedRepository;
 import org.apache.archiva.maven.repository.metadata.storage.ArtifactMappingProvider;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
index c78ae5f9d8e3f46efe24c5e87cd9f829f12333a4..b5e251373914b825e7f54f1c930814af948ac88b 100644 (file)
@@ -19,9 +19,9 @@ package org.apache.archiva.maven.repository.dependency.tree;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.maven.model.Artifact;
 import org.apache.archiva.maven.model.TreeEntry;
 import org.apache.archiva.repository.RepositoryRegistry;
index 780d1b729db456dce98d397c792d3b115ddabf6c..a36891a7c2e87a097d9745c35564811697abd294 100644 (file)
@@ -19,10 +19,10 @@ package org.apache.archiva.maven.repository.merge;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
index 03d94f346475bfbda4cee72e3eceac34fb1d03d4..e7557ccc3eacf801738bf2ccb7206fb912a8fadc 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.maven.repository.metadata;
  */
 
 import org.apache.archiva.common.utils.VersionComparator;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.maven.repository.AbstractRepositoryLayerTestCase;
 import org.apache.archiva.maven.repository.MavenManagedRepository;
 import org.apache.archiva.maven.repository.metadata.storage.mock.MockConfiguration;
index 730593083fa94b92d95bf60afb11c773e283389c..0e33ad1d44913648e16d6b4dddeab6003255ca4a 100644 (file)
@@ -19,12 +19,12 @@ package org.apache.archiva.maven.repository.metadata.storage;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.filter.AllFilter;
 import org.apache.archiva.filter.Filter;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
index c9d5c02222bddf784ed5a2ca5b4119aa651c69b6..5c2a6cd5571c57141a2196598ed43704876193cf 100644 (file)
@@ -19,11 +19,11 @@ package org.apache.archiva.maven.repository.metadata.storage;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.archiva.filter.AllFilter;
 import org.apache.archiva.filter.Filter;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
index 109ccacb1475a1ba266384ed71954bdd51dbfbc4..6f5f72c1d6e5ba0aa0606ffe13fefc0b7fd85c5f 100644 (file)
@@ -19,12 +19,12 @@ package org.apache.archiva.maven.repository.metadata.storage;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
 import org.apache.archiva.filter.AllFilter;
 import org.apache.archiva.filter.ExcludesFilter;
 import org.apache.archiva.filter.Filter;
index a5de3eaeb1fc5b43054cd4b527b154a9ce22dc34..41a1368c3b8148b2b1f8d2a8a3e600955e1976c8 100644 (file)
@@ -21,13 +21,13 @@ package org.apache.archiva.maven.repository.metadata.storage.mock;
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.components.registry.RegistryException;
 import org.apache.archiva.components.registry.RegistryListener;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ArchivaRuntimeConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.FileType;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
-import org.apache.archiva.configuration.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
+import org.apache.archiva.configuration.model.FileType;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
index 0fadd50b3d06e3883ffe1fabd113f017413204f1..e10df31488106570e4327bcb63d750654fdc2b29 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.maven.repository.mock;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.common.utils.PathUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexManager;
 import org.apache.archiva.indexer.ArchivaIndexingContext;
 import org.apache.archiva.indexer.IndexCreationFailedException;
index f069d8374afcf1e920451cf3fa8d75b6fd759829..814ca06246dd797c6b4379bb33ba52b69ea4042e 100644 (file)
@@ -29,10 +29,10 @@ import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorOrderComparator;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.commons.lang3.StringUtils;
 import org.modelmapper.ModelMapper;
 import org.springframework.stereotype.Service;
index 474fd4a7b3bc13ed2770db2b90e4fe4db91142b9..71416f32b85fa3403eff6b68946c805fc27fceb1 100644 (file)
@@ -21,11 +21,11 @@ package org.apache.archiva.maven.repository.mock.configuration;
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.components.registry.RegistryException;
 import org.apache.archiva.components.registry.RegistryListener;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
-import org.apache.archiva.configuration.RepositoryScanningConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.model.RepositoryScanningConfiguration;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
index d398be9d0aae3a8ad6a707799d1d247d99d13252..59758f7ea02899025b371af0f20e6d3a1474b7d1 100644 (file)
@@ -3,10 +3,10 @@ package org.apache.archiva.maven.repository.mock.configuration;
 import org.apache.archiva.components.registry.Registry;
 import org.apache.archiva.components.registry.RegistryException;
 import org.apache.archiva.components.registry.RegistryListener;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
+import org.apache.archiva.configuration.provider.IndeterminateConfigurationException;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
index 40d036ee4cfb943541ae61bc88ce1ac102d6619d..7c6966d914f18f0771b2f45b50e42946980d682a 100644 (file)
@@ -28,7 +28,7 @@
 
   <context:property-placeholder system-properties-mode="OVERRIDE"/>
   <context:component-scan base-package="org.apache.archiva.maven.repository.content" />
-  <bean name="archivaConfiguration#repo-request-test" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#repo-request-test" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#configured"/>
   </bean>
 
index bd9567de8627f023ee2a4eb8f6d7d05cf63a610c..866d1193b31217aaf0c9fdacbb559bd4006d3f23 100644 (file)
@@ -55,7 +55,7 @@
     <property name="configuration" ref="archivaConfiguration#default"/>
   </bean>
 
-  <bean name="filetypes" class="org.apache.archiva.configuration.FileTypes">
+  <bean name="filetypes" class="org.apache.archiva.configuration.provider.FileTypes">
     <property name="archivaConfiguration" ref="archivaConfiguration#default"/>
   </bean>
 
index 63dc0de2ee0e2dd17106c953f6c330416c0dc833..f976c34694481d3f85bc909657c233620978f3c4 100644 (file)
@@ -31,7 +31,7 @@
   <context:component-scan base-package="org.apache.archiva.repository,org.apache.archiva.configuration,org.apache.archiva.metadata.repository,org.apache.archiva.maven.repository.mock"/>
 
 
-  <bean name="archivaConfiguration#test" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#test" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
   </bean>
   <alias name="archivaConfiguration#test" alias="archivaConfiguration#default"/>
   <alias name="archivaConfiguration#test" alias="archivaConfiguration"/>
@@ -56,7 +56,7 @@
     <property name="configuration" ref="archivaConfiguration#default"/>
   </bean>
 
-  <bean name="filetypes" class="org.apache.archiva.configuration.FileTypes">
+  <bean name="filetypes" class="org.apache.archiva.configuration.provider.FileTypes">
     <property name="archivaConfiguration" ref="archivaConfiguration#default"/>
   </bean>
 
index e9f49ec722554323f06cdf6b088683d344451102..d0105b39d2729751123456a23794ba0de36e1774 100644 (file)
@@ -53,8 +53,8 @@
       <artifactId>archiva-storage-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 7ff7e086967df8631d31dd7b51bc7d44c6c365be..a5aee2ebe91a0b4cba324ff72bd7b27ebadb7bd8 100644 (file)
@@ -21,9 +21,9 @@ import org.apache.archiva.proxy.ProxyRegistry;
 import org.apache.archiva.proxy.model.NetworkProxy;
 import org.apache.archiva.scheduler.indexing.DownloadRemoteIndexException;
 import org.apache.archiva.scheduler.indexing.DownloadRemoteIndexScheduler;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationEvent;
-import org.apache.archiva.configuration.ConfigurationListener;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ConfigurationEvent;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
 import org.apache.archiva.indexer.UnsupportedBaseContextException;
 import org.apache.archiva.maven.common.proxy.WagonFactory;
 import org.apache.archiva.repository.RepositoryRegistry;
index 3393cdf0206c0ef5279cf20dcd01cd3e30925cd1..1b759eebbcf3eaf9b8201a79861b49e71528ae1a 100644 (file)
@@ -39,7 +39,7 @@
   </bean>
 
   <!-- wire up more basic configuration so it doesn't overwrite any config files -->
-  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index 1908333fd762afdb7fab3557f09de0b56f1a15d7..5f086d81b365774eee6f3a594a2610566a095ed9 100644 (file)
@@ -42,8 +42,8 @@
     </dependency>
     <!--
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     -->
     <dependency>
index 73e987ece3f1a964af757c2de9a1d00d15cd4d26..38227f5492131a3c034fba079b93260c8c73ee0b 100644 (file)
@@ -71,8 +71,8 @@
     -->
     <!--
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
index 019d52b2d0dd9b82f87e4c4f3df77efb25062159..d144661886f38c8d6f2b8948dfeefe06e075c31d 100644 (file)
@@ -61,8 +61,8 @@
       <artifactId>archiva-model</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index da624e214d95844f11cfb06a97c7a409c946f670..e11b5369fd298ece6adaa8564490fd8e866af0a5 100644 (file)
@@ -20,10 +20,10 @@ package org.apache.archiva.scheduler.repository;
  */
 
 import org.apache.archiva.common.ArchivaException;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationEvent;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ConfigurationEvent;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.RepositorySession;
index bbe99bb34242eaffb16ee1d42ab7da6fd262a23b..b282a5800ae793349d660873b7ec0955fbcf10d8 100644 (file)
@@ -21,8 +21,8 @@ package org.apache.archiva.scheduler.repository;
 
 import junit.framework.TestCase;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.stats.model.RepositoryStatisticsManager;
 import org.apache.archiva.mock.MockRepositorySessionFactory;
index 296262d0b1105f53d128e8d69d38ad2aee0f6344..25e5c1a35d54ce86f1611069be1eb0559b822b32 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.scheduler.repository.mock;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.utils.FileUtils;
 import org.apache.archiva.common.utils.PathUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexManager;
 import org.apache.archiva.indexer.ArchivaIndexingContext;
 import org.apache.archiva.indexer.IndexCreationFailedException;
index a6894839fb81b75b01d675dd5b651d66aff29dc4..ff7188a689fae665fb34a004dd505a6087e056d0 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
 import org.apache.archiva.admin.model.beans.NetworkConfiguration;
 import org.apache.archiva.admin.model.beans.OrganisationInformation;
 import org.apache.archiva.admin.model.beans.UiConfiguration;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 
 import java.util.ArrayList;
 import java.util.List;
index 4db51d33d40066b632035262274808c8d16b7bf1..26b85c7012ba063c9982cfd911e076573e9631e1 100644 (file)
@@ -21,7 +21,7 @@ import org.apache.archiva.admin.model.AuditInformation;
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 
 import java.util.List;
 import java.util.Map;
index cdb04cd34227fe0a8d991e96c253c9e16391b66b..e9b43114173f76aaa2748e9751e33676fde468fb 100755 (executable)
@@ -47,7 +47,7 @@
 
   <alias name="repositoryStatisticsManager#test" alias="repositoryStatisticsManager#default"/>
 
-  <bean name="archivaConfiguration#test-repository-scanning" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#test-repository-scanning" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#test-configured"/>
   </bean>
 
index ac1b0623cfbff7a9be18d819a30228b34828ac76..3075d15be22de031ae90ee1b84e7efed6eb063ae 100644 (file)
       <groupId>jakarta.annotation</groupId>
       <artifactId>jakarta.annotation-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>jakarta.inject</groupId>
+      <artifactId>jakarta.inject-api</artifactId>
+    </dependency>
 
 
       <dependency>
index 980bab270e31aa20077e0e78493d027df7d6c50a..8bde0819000be3e514790467f6192955000ed0e5 100644 (file)
@@ -25,7 +25,7 @@ import java.io.Serializable;
  * @author Martin Stockhammer <martin_s@apache.org>
  */
 @Schema(name="Artifact", description = "Information about artifacts")
-public class Artifact implements Serializable
+public class Artifact implements Serializable, RestModel
 {
     private static final long serialVersionUID = 7581578317346876555L;
     private String name;
index 5a517786f6078cb5959665f50c3afab020e6c238..f9477b7a50599486496241651d7ae9c28f47e42e 100644 (file)
@@ -24,7 +24,7 @@ import java.io.Serializable;
 /**
  * @author Martin Stockhammer <martin_s@apache.org>
  */
-public class ArtifactTransferRequest implements Serializable
+public class ArtifactTransferRequest implements Serializable, RestModel
 {
     private static final long serialVersionUID = -7377281345536573342L;
 
index 0d28a539d5f4cb22e9fceeefd89884364f76805f..ce8ec07a7e2c29dfb1c416174b4713a38a3545ef 100644 (file)
@@ -45,7 +45,7 @@ import java.util.Objects;
  */
 @XmlRootElement(name="beanInformation")
 @Schema(name="BeanInformation",description = "Information about a bean instance.")
-public class BeanInformation implements Serializable
+public class BeanInformation implements Serializable, RestModel
 {
     private static final long serialVersionUID = -432385743277355987L;
     private String id;
index 1e58a678003974978d75f1acb2f1dbc38cc93103..56cbaa2ab9024a7f1323606d1ccc8ea5324793fa 100644 (file)
@@ -30,7 +30,7 @@ import java.io.Serializable;
 @XmlRootElement( name = "cacheConfiguration" )
 @Schema(name="CacheConfiguration",description = "Cache configuration attributes")
 public class CacheConfiguration
-    implements Serializable
+    implements Serializable, RestModel
 {
     private static final long serialVersionUID = 5479989049980673894L;
     /**
index 359d1cbe8c15cd1a8ce356a856f2a12d37099a47..52105d6b210f2e397986029b614de961937f4591 100644 (file)
@@ -45,7 +45,7 @@ import java.time.ZoneOffset;
  * @author Martin Stockhammer <martin_s@apache.org>
  */
 @Schema(name="FileInfo",description = "Information about a file stored in the repository")
-public class FileInfo implements Serializable
+public class FileInfo implements Serializable, RestModel
 {
     private static final long serialVersionUID = 900497784542880195L;
     private OffsetDateTime modified;
index 42f25cb24be01524286ad7ab217101c65f56f6f5..abd0c16da2afb1c5805b655b38accf9a593413c2 100644 (file)
@@ -25,7 +25,7 @@ import java.io.Serializable;
  * @author Martin Stockhammer <martin_s@apache.org>
  */
 @Schema(name="IndexingTask",description = "Information about indexing tasks")
-public class IndexingTask implements Serializable
+public class IndexingTask implements Serializable, RestModel
 {
     private static final long serialVersionUID = -1947200162602613310L;
     private String repositoryId = "";
index 15372cd5a163faca86784fde63211ec76f9d1ed1..c93c448182a65ccaa9c3a64a6a0fca28215463ba 100644 (file)
@@ -50,7 +50,7 @@ import java.util.TreeMap;
  */
 @XmlRootElement(name="ldapConfiguration")
 @Schema(name="LdapConfiguration", description = "LDAP configuration attributes")
-public class LdapConfiguration implements Serializable
+public class LdapConfiguration implements Serializable, RestModel
 {
     private static final long serialVersionUID = -4736767846016398583L;
 
index 053e12993dcc13b65498abaa6f4fc86670effacf..6340a6df45d9f37e31b5c479074218bbfa03f33a 100644 (file)
@@ -50,7 +50,7 @@ import static org.apache.archiva.indexer.ArchivaIndexManager.DEFAULT_INDEX_PATH;
  */
 @XmlRootElement(name="mergeConfiguration")
 @Schema(name="MergeConfiguration", description = "Configuration settings for index merge of remote repositories.")
-public class MergeConfiguration implements Serializable
+public class MergeConfiguration implements Serializable, RestModel
 {
     private static final long serialVersionUID = -3629274059574459133L;
 
index d0979649ff31096373bde1f5bcfdccead545f9eb..be5aeebbd73025ea0174e1b555918f4ee2b45c65 100644 (file)
@@ -46,7 +46,7 @@ import java.util.Locale;
  * @since 3.0
  */
 @Schema(description = "Repository data")
-public class Repository implements Serializable
+public class Repository implements Serializable, RestModel
 {
     private static final long serialVersionUID = -4741025877287175182L;
 
index 6f64a5191a748488a758671a6bbe8bd85134935f..1572d7cd6fca6c557177962859e64c6cfc65d2be 100644 (file)
@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
  */
 @XmlRootElement(name="repositoryGroup")
 @Schema(name="RepositoryGroup", description = "Information about a repository group, which combines multiple repositories as one virtual repository.")
-public class RepositoryGroup implements Serializable
+public class RepositoryGroup implements Serializable, RestModel
 {
     private static final long serialVersionUID = -7319687481737616081L;
     private String id;
index ab2c916f7973567200f39ec80116f73d4ff4d77c..bb8afcb6f5914e036ff65b97b31d4f70f9e65d31 100644 (file)
@@ -51,7 +51,7 @@ import java.util.TreeMap;
  */
 @XmlRootElement(name="repositoryStatistics")
 @Schema(name="RepositoryStatistics", description = "Statistics data")
-public class RepositoryStatistics implements Serializable
+public class RepositoryStatistics implements Serializable, RestModel
 {
     private static final long serialVersionUID = 7943367882738452531L;
 
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RestModel.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/RestModel.java
new file mode 100644 (file)
index 0000000..1f06328
--- /dev/null
@@ -0,0 +1,26 @@
+package org.apache.archiva.rest.api.v2.model;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Marker interface that represents a model instance for REST services
+ * @author Martin Schreier <martin_s@apache.org>
+ */
+public interface RestModel
+{
+}
index 4e46594875a22a423238c7c506a52776f6081cc4..8023126dacf03d4fd804dd50ba256068d3cc5d9e 100644 (file)
@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
  * @author Martin Stockhammer <martin_s@apache.org>
  */
 @Schema(name="ScanStatus", description = "Status of repository scan tasks")
-public class ScanStatus implements Serializable
+public class ScanStatus implements Serializable, RestModel
 {
     private boolean scanRunning = false;
     private int scanQueued = 0;
index 15e42d8e5f4c7e8302758c909a3e56bd37df89dc..c9efa01080dc8f362d5c90d9694646afc3169c58 100644 (file)
@@ -26,7 +26,7 @@ import java.io.Serializable;
  * @author Martin Stockhammer <martin_s@apache.org>
  */
 @Schema(name="ScanTask", description = "Repository scan task information")
-public class ScanTask implements Serializable
+public class ScanTask implements Serializable, RestModel
 {
     private static final long serialVersionUID = -681163357370848098L;
     private String repositoryId="";
index a3c06292005159bc7dd1cbf7638a7ff71625ec42..b955e139cd4c959b64ab3434a16b9027c99b9499 100644 (file)
@@ -49,7 +49,7 @@ import java.util.TreeMap;
  */
 @XmlRootElement(name = "securityConfiguration")
 @Schema(name = "SecurityConfiguration", description = "Security configuration attributes.")
-public class SecurityConfiguration implements Serializable
+public class SecurityConfiguration implements Serializable, RestModel
 {
     private static final long serialVersionUID = -4186866365979053029L;
 
index d8e51cb70833b6b1212167dafe25be04a519cfe0..4e741a62ab670e11d2dce45155492ebaf144750a 100644 (file)
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
  */
 @XmlRootElement(name = "validationError")
 @Schema(name = "ValidationError", description = "A validation error.")
-public class ValidationError implements Serializable
+public class ValidationError implements Serializable, RestModel
 {
     private static final long serialVersionUID = 2079020598090660171L;
 
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/MavenRepositoryMapper.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/MavenRepositoryMapper.java
new file mode 100644 (file)
index 0000000..d95dae4
--- /dev/null
@@ -0,0 +1,72 @@
+package org.apache.archiva.rest.api.v2.model.map;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.common.ModelMapper;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.rest.api.v2.model.MavenManagedRepository;
+
+/**
+ * @author Martin Schreier <martin_s@apache.org>
+ */
+public class MavenRepositoryMapper implements RestMapper<MavenManagedRepository, ManagedRepositoryConfiguration>
+{
+    @Override
+    public ManagedRepositoryConfiguration map( MavenManagedRepository source )
+    {
+        return null;
+    }
+
+    @Override
+    public void update( MavenManagedRepository source, ManagedRepositoryConfiguration target )
+    {
+
+    }
+
+    @Override
+    public MavenManagedRepository reverseMap( ManagedRepositoryConfiguration target )
+    {
+        return null;
+    }
+
+    @Override
+    public void reverseUpdate( ManagedRepositoryConfiguration target, MavenManagedRepository source )
+    {
+
+    }
+
+    @Override
+    public Class<MavenManagedRepository> getSourceType( )
+    {
+        return MavenManagedRepository.class;
+    }
+
+    @Override
+    public Class<ManagedRepositoryConfiguration> getTargetType( )
+    {
+        return ManagedRepositoryConfiguration.class;
+    }
+
+    @Override
+    public <S, T> boolean supports( Class<S> sourceType, Class<T> targetType )
+    {
+        return (
+            sourceType.isAssignableFrom( getSourceType() ) &&
+                targetType.isAssignableFrom( getTargetType() ) );
+    }
+}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/RestMapper.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/RestMapper.java
new file mode 100644 (file)
index 0000000..36e6ee1
--- /dev/null
@@ -0,0 +1,29 @@
+package org.apache.archiva.rest.api.v2.model.map;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.common.ModelMapper;
+import org.apache.archiva.configuration.model.ConfigurationModel;
+import org.apache.archiva.rest.api.v2.model.RestModel;
+
+/**
+ * @author Martin Schreier <martin_s@apache.org>
+ */
+public interface RestMapper<S extends RestModel, T extends ConfigurationModel> extends ModelMapper<S,T>
+{
+}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/ServiceMapperFactory.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/v2/model/map/ServiceMapperFactory.java
new file mode 100644 (file)
index 0000000..7d9ee87
--- /dev/null
@@ -0,0 +1,76 @@
+package org.apache.archiva.rest.api.v2.model.map;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.common.ModelMapper;
+import org.apache.archiva.common.ModelMapperFactory;
+import org.apache.archiva.configuration.model.ConfigurationModel;
+import org.apache.archiva.rest.api.v2.model.RestModel;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Martin Schreier <martin_s@apache.org>
+ */
+@Service("modelMapperFactory#rest")
+public class ServiceMapperFactory implements ModelMapperFactory<RestModel, ConfigurationModel>
+{
+    @Inject
+    List<ModelMapper> modelMapperList;
+
+    Map<Class<? extends RestModel>, Map<Class<? extends ConfigurationModel>,ModelMapper<? extends RestModel, ? extends ConfigurationModel>>> modelMap;
+
+    @PostConstruct
+    void initMapper() {
+        modelMap = new HashMap<>( );
+        for ( ModelMapper<?, ?> mapper : modelMapperList )
+        {
+            if (!mapper.supports( RestModel.class, ConfigurationModel.class )) {
+                continue;
+            }
+            Class<? extends RestModel> sType = (Class<? extends RestModel>) mapper.getSourceType( );
+            Class<? extends ConfigurationModel> tType = (Class<? extends ConfigurationModel>) mapper.getTargetType( );
+            Map<Class<? extends ConfigurationModel>, ModelMapper<? extends RestModel, ? extends ConfigurationModel>> tMap;
+            if (modelMap.containsKey( sType )) {
+                tMap = modelMap.get( sType );
+            } else {
+                tMap = new HashMap<>( );
+            }
+            tMap.put( tType, (ModelMapper<? extends RestModel, ? extends ConfigurationModel>) mapper );
+        }
+    }
+
+    @Override
+    public <S extends RestModel, T extends ConfigurationModel> ModelMapper<S, T> getMapper( Class<S> sourceType, Class<T> targetType ) throws IllegalArgumentException
+    {
+        if (!modelMap.containsKey( sourceType )) {
+            throw new IllegalArgumentException( "No mapper defined for the given source type "+sourceType );
+        }
+        Map<Class<? extends ConfigurationModel>, ModelMapper<? extends RestModel, ? extends ConfigurationModel>> tMap = modelMap.get( sourceType );
+        if ( !tMap.containsKey( targetType ) )
+        {
+            throw new IllegalArgumentException( "No mapper defined for the given target type "+targetType );
+        }
+        return (ModelMapper<S, T>) tMap.get( targetType );
+    }
+}
index ede4fbb46e0ae2108b0051134e9293299d299026..5a681ff54856861f34a102b839c3c465171aa03b 100644 (file)
@@ -36,7 +36,7 @@ package org.apache.archiva.rest.v2.svc;/*
 
 import org.apache.archiva.components.rest.model.PagedResult;
 import org.apache.archiva.components.rest.util.QueryHelper;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.repository.EditableRepositoryGroup;
 import org.apache.archiva.repository.RepositoryException;
 import org.apache.archiva.repository.RepositoryRegistry;
index 498000f612dfcf1835b43c7a65ca3e109f6403c2..f62fef2e0b8942f1add6968ed7b692d38fffe7d8 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.components.rest.model.PagedResult;
 import org.apache.archiva.components.rest.util.QueryHelper;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authorization.AuthorizationException;
 import org.apache.archiva.redback.rest.services.RedbackAuthenticationThreadLocal;
@@ -121,6 +122,12 @@ public class DefaultMavenManagedRepositoryService implements MavenManagedReposit
         return new AuditInformation( user, remoteAddr );
     }
 
+    public static ManagedRepositoryConfiguration toConfig(MavenManagedRepository repo) {
+        ManagedRepositoryConfiguration cfg = new ManagedRepositoryConfiguration( );
+        return cfg;
+
+    }
+
     @Override
     public PagedResult<MavenManagedRepository> getManagedRepositories( final String searchTerm, final Integer offset,
                                                                        final Integer limit, final List<String> orderBy,
@@ -188,7 +195,10 @@ public class DefaultMavenManagedRepositoryService implements MavenManagedReposit
         repoBean.setDeleteReleasedSnapshots( repository.isDeleteSnapshotsOfRelease() );
         repoBean.setSkipPackedIndexCreation( repository.isSkipPackedIndexCreation() );
         repoBean.setRetentionCount( repository.getRetentionCount() );
-        repoBean.setRetentionPeriod( repository.getRetentionPeriod().getDays() );
+        if (repository.getRetentionPeriod()!=null)
+        {
+            repoBean.setRetentionPeriod( repository.getRetentionPeriod( ).getDays( ) );
+        }
         repoBean.setIndexDirectory( repository.getIndexPath() );
         repoBean.setPackedIndexDirectory( repository.getPackedIndexPath() );
         repoBean.setLayout( repository.getLayout() );
index 9a8f932be9bd8069f0d7adce88d877cb34ac7d7d..3dffabed1dfc2cfb67ebd3c899e9af7c4f99930e 100644 (file)
@@ -25,6 +25,7 @@ import org.apache.archiva.rest.api.v2.svc.RestConfiguration;
 import org.apache.archiva.rest.v2.svc.AbstractNativeRestServices;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.MethodOrderer;
 import org.junit.jupiter.api.Order;
@@ -33,7 +34,9 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.TestMethodOrder;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import static io.restassured.RestAssured.given;
 import static io.restassured.http.ContentType.JSON;
@@ -84,6 +87,34 @@ public class NativeMavenManagedRepositoryServiceTest extends AbstractNativeRestS
         assertEquals( "snapshots", repositories.get( 1 ).getId( ) );
     }
 
+    private Response createRepository(String id, String name, String description, String token) {
+        Map<String, Object> jsonAsMap = new HashMap<>( );
+        jsonAsMap.put( "id", id );
+        jsonAsMap.put( "name", name );
+        jsonAsMap.put( "description", description );
+        return given( ).spec( getRequestSpec( token ) ).contentType( JSON )
+            .when( )
+            .body( jsonAsMap )
+            .post( "" )
+            .then( ).statusCode( 201 ).extract( ).response( );
+    }
+
+
+    @Disabled
+    @Test
+    @Order( 2 )
+    void testCreateRepository() {
+        String token = getAdminToken( );
+        Response response = createRepository( "repo001", "Repository 001", "This is repository 001", token );
+        assertNotNull( response );
+        JsonPath json = response.getBody( ).jsonPath( );
+        assertNotNull( json );
+        assertEquals( "repo001", json.get( "id" ) );
+        assertEquals( "Repository 001", json.get( "name" ) );
+        assertEquals( "maven", json.get( "type" ) );
+        assertEquals( "This is repository 001", json.get( "description" ) );
+    }
+
 
 
 }
index 79379ad65a57e58011695a302a7d25c831041dd2..226af84245d6126f01ad12bb1d89c8b093ef432b 100644 (file)
@@ -47,7 +47,7 @@
   </bean>
 
   <!-- wire up more basic configuration so it doesn't overwrite any config files -->
-  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index 19eba026f420fff9f18b1d06c24c9c54ed016458..4f3750ccb5e6e8d0954e40a79744987697cd7543 100644 (file)
@@ -47,7 +47,7 @@
   </bean>
 
   <!-- wire up more basic configuration so it doesn't overwrite any config files -->
-  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index d2484a08e562ead577006a47cf17790f04e832f3..f5f9bce4a0107e5c8933550c22cba7cd12872dcc 100644 (file)
@@ -33,8 +33,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 550745d206a609bd37fc6d514f94b85e82dcb1d4..06debd40ffc752fa0db9b30beaae2215444264d2 100644 (file)
@@ -20,8 +20,8 @@ package org.apache.archiva.security;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.redback.rbac.RBACManager;
 import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
 import org.apache.archiva.redback.rbac.UserAssignment;
index c94f9c6d5c63bcf9d443e64fce3355e29f133505..22793a3fb32ff7cd9d702085da0463cfad3a5583 100644 (file)
@@ -79,7 +79,7 @@
 
   <alias name="servletAuthenticator" alias="servletAuthenticator#test"/>
 
-  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#test"/>
   </bean>
   <alias name="archivaConfiguration#default" alias="archivaConfiguration"/>
index cd16ed653b8ac99d42118cccf88a7a2d0eb6fd9a..dc73e13a5c8956176b530567b0e14a0c7371fe69 100644 (file)
@@ -40,8 +40,8 @@
       <artifactId>metadata-repository-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 72df50cf59d5295170fd6248135f8f57777b972c..8c85c97e4713afa8e25219326bf3e1db7474c4a7 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.archiva.checksum.ChecksummedFile;
 import org.apache.archiva.common.utils.VersionComparator;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.components.taskqueue.TaskQueueException;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.archiva.model.SnapshotVersion;
index dc0d2e882a0c582d804b876a84b56a2d7e64edd3..9e255a63c85cbfc384b2733f29e279a9923ce7fe 100644 (file)
@@ -20,9 +20,9 @@ package org.apache.archiva.web.startup;
  */
 
 import org.apache.archiva.common.ArchivaException;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationNames;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ConfigurationNames;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.components.registry.RegistryListener;
 import org.apache.archiva.redback.rbac.RBACManager;
 import org.apache.archiva.redback.rbac.RbacManagerException;
index 746c5ec82ae94e1a5824477f35ff126aaa92628a..0dfd1d957175781d3ff1416705d8ab5d315ed2c3 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.archiva.web.rss;
 
 import junit.framework.TestCase;
 import org.apache.archiva.common.filelock.DefaultFileLockManager;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.repository.base.managed.BasicManagedRepository;
 import org.apache.archiva.repository.RepositoryRegistry;
 import org.apache.archiva.repository.storage.fs.FilesystemStorage;
index 0487368db12031353f7011f0788494341479e513..a8b23cd7d1d7484ea8e299b97b314340efb5e555 100644 (file)
@@ -18,7 +18,7 @@ package org.apache.archiva.web.upload;
  */
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
 import org.apache.archiva.web.AbstractRestServicesTest;
index ae84b969777972350e77c6fa584ecefffd131973..7ec43de90bc36e1458e43b7adaaa0f0063d830da 100644 (file)
@@ -43,7 +43,7 @@
 
   <alias name="securitySystem#test" alias="securitySystem"/>
 
-  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index 5bbaa7f22baf9541a3e636adac14f9db48971770..dd98b2f938e33508bd1066d17cc2aa606597941b 100644 (file)
@@ -44,7 +44,7 @@
   </bean>
 
   <!-- wire up more basic configuration so it doesn't overwrite any config files -->
-  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index fb1d5213d1a1b5305700799af3c63ff4f06fef0d..ee24fb4f0d63c307fc89f6ec99ee49d666ba487e 100644 (file)
@@ -46,7 +46,7 @@
   </bean>
 
   <!-- wire up more basic configuration so it doesn't overwrite any config files -->
-  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index c2a2a94bb16c8810bbc1e848f03e52f97da7f2be..1418bec90a9c59dd35a65032826615e8436834ec 100644 (file)
       <scope>runtime</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
       <scope>runtime</scope>
     </dependency>
     <dependency>
index 8bb9fbb2fbd26aa3e7946d486b19eb585bc8addd..8efc940c7ba7150be1e2671d738c348767f3a3f7 100644 (file)
@@ -53,8 +53,8 @@
       <artifactId>archiva-repository-scanner</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
       <!-- should be runtime but currently not possible due ConfigurationListener
       <scope>runtime</scope>
       -->
index f3e8737e8ac93ced98c6fd89d15400cc893fed0d..ec79dd5e1fd5686260739f618eca81fbab989f27 100644 (file)
@@ -29,7 +29,7 @@ import org.apache.archiva.common.filelock.DefaultFileLockManager;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.utils.PathUtil;
 import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.indexer.ArchivaIndexingContext;
 import org.apache.archiva.indexer.merger.IndexMerger;
 import org.apache.archiva.indexer.merger.IndexMergerException;
index ba7517fd8e694ce1492e9645ac08b3af8cae11a5..763eb2454a8eb9ec3ac85c6e7dedef92fe2d2abb 100644 (file)
@@ -20,9 +20,9 @@ package org.apache.archiva.webdav;
  */
 
 import org.apache.archiva.admin.model.RepositoryAdminException;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ConfigurationEvent;
-import org.apache.archiva.configuration.ConfigurationListener;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ConfigurationEvent;
+import org.apache.archiva.configuration.provider.ConfigurationListener;
 import org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator;
 import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
 import org.apache.archiva.repository.ManagedRepository;
index 3637bc40ad32eb18d5633435120a91b0756d7060..90605f526b600e818a0f5a711ac0287f088e7982 100644 (file)
@@ -22,8 +22,8 @@ package org.apache.archiva.webdav;
 
 import com.gargoylesoftware.htmlunit.WebClient;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.archiva.policies.*;
 import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jetty.server.HttpConnectionFactory;
index dd699581dc48fada7a7481b129d55c2164b31a02..adf58469454519a201400649fa2ffb943678339c 100644 (file)
@@ -25,10 +25,10 @@ import com.gargoylesoftware.htmlunit.WebClient;
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RemoteRepositoryConfiguration;
 import org.apache.archiva.repository.ManagedRepository;
 import org.apache.archiva.repository.RepositoryException;
 import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
index 3650a9704f5789a6e4047a29441e86121207072f..1afc784257a6eb8a7a37d4f7131fc7361460a862 100644 (file)
@@ -28,10 +28,10 @@ import org.apache.archiva.admin.repository.DefaultRepositoryCommonValidator;
 import org.apache.archiva.admin.repository.group.DefaultRepositoryGroupAdmin;
 import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
 import org.apache.archiva.common.filelock.FileLockManager;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.FileTypes;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.provider.FileTypes;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.proxy.ProxyRegistry;
 import org.apache.archiva.repository.EditableManagedRepository;
@@ -60,7 +60,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Mockito;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ConfigurableApplicationContext;
index e29190aac39714eefac2eec16795ade3221753e8..20ee8ec72bad25a5cd8aa888a77beef35c0d42d1 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.webdav;
 
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.webdav.mock.httpunit.MkColMethodWebRequest;
 import org.junit.After;
 import org.junit.Before;
index a532de1a699d2174022f06c82bc11486c6ae72eb..d45fbc2ccca8580879c298b5ad47d66a0b34fb03 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.archiva.webdav;
 
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
index 67d112f11b0bf0a0004d229c5ac45802e7be729e..6a2eaacfa2240cc4534d4974d3831de1fc12a656 100644 (file)
@@ -22,7 +22,7 @@ package org.apache.archiva.webdav;
 
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.policies.PolicyOption;
 import org.apache.archiva.policies.SnapshotsPolicy;
 import org.junit.Test;
index 25643a03bdb7d1f663b0ac2c680e04944b389215..6b05673bbe8f48be889512f3fa6b810c34446895 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.webdav;
 
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.policies.PolicyOption;
 import org.apache.archiva.policies.ReleasesPolicy;
 import org.junit.Test;
index 67e50880f7026553a970904bdf5345a50cc84a2c..3f5697d51672b3d1b37c505cf9a48cf674930f05 100644 (file)
@@ -21,8 +21,8 @@ package org.apache.archiva.webdav;
 
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.policies.PolicyOption;
 import org.apache.archiva.policies.SnapshotsPolicy;
 import org.junit.After;
index 58fe15b462997f4b74a65aaebbe3dc1394e1ad09..3f968a6588053805c19320046b9d13035cb7b076 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.webdav;
 
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
-import org.apache.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.archiva.configuration.model.ProxyConnectorConfiguration;
 import org.apache.archiva.policies.PolicyOption;
 import org.apache.archiva.policies.SnapshotsPolicy;
 import org.junit.After;
index 8ec608b2f1079f60897d14f8222b8b13d22f4e10..62af4e4e5f21883880a7c79aaa816654e0ffcbb4 100644 (file)
@@ -23,9 +23,9 @@ package org.apache.archiva.webdav;
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
 import org.apache.archiva.common.utils.FileUtils;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.RepositoryGroupConfiguration;
 import org.apache.archiva.maven.metadata.MavenMetadataReader;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.commons.lang3.StringUtils;
index 48ce7f04b8ca00fe0db6043770d173e92d491412..465a4028df31fa88139183e58a27ab27342e183a 100644 (file)
@@ -21,9 +21,9 @@ package org.apache.archiva.webdav;
 
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authorization.UnauthorizedException;
@@ -47,7 +47,6 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Mockito;
 import org.springframework.context.ApplicationContext;
 import org.springframework.mock.web.MockHttpServletRequest;
 import org.springframework.mock.web.MockHttpServletResponse;
@@ -58,9 +57,7 @@ import org.springframework.web.context.WebApplicationContext;
 
 import javax.inject.Inject;
 import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
 import java.io.InputStream;
 import java.nio.charset.Charset;
 import java.nio.file.Files;
index 909d9c7c5ad3974fb3ab9432f51aacd8fa6df146..5682c0b44e7a368261506dcef73dcaef8bf97e86 100644 (file)
@@ -21,9 +21,9 @@ package org.apache.archiva.webdav;
 
 import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebResponse;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.repository.ManagedRepository;
 import org.junit.Before;
 import org.junit.Test;
index 5aadd4653827557908bc21a4abc023a041425de7..4dfaed64d0a7f4c85b35a7151137d4bd9ab8a6db 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.webdav;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavServletRequest;
 import org.springframework.context.ApplicationContext;
index 781df5998140182af5a2503661e09cc631281c8c..c3a4f909a7b057a813bba8fe3f9c3c3948473c80 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.webdav.util;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.springframework.context.ApplicationContext;
 import org.springframework.web.context.support.WebApplicationContextUtils;
 
index 59545f71a507ae163fac4ddfabf279bfcf2a2155..09ecbacb0c03dde4ebb7c95458af1664714e6703 100644 (file)
@@ -31,7 +31,7 @@
   <context:annotation-config/>
   <context:component-scan base-package="org.apache.archiva.webdav.util,org.apache.archiva.common.plexusbridge"/>
 
-  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index 9714ece353cc71cf78025d962ba1ef239566f72f..450ceef4a72d456ce8c3d2e2dd95858df224147d 100644 (file)
@@ -47,7 +47,7 @@
 
   <bean name="servletAuthenticator" class="org.apache.archiva.webdav.MockServletAuthenticator"/>
 
-  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default" class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index c54f37936899bb38056ff1948618d0c12caf95f8..1aba2f9f227acfd2adfdc59291150f824af10492 100644 (file)
@@ -46,7 +46,7 @@
 
   <bean name="servletAuthenticator" class="org.apache.archiva.webdav.MockServletAuthenticator"/>
 
-  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.DefaultArchivaConfiguration">
+  <bean name="archivaConfiguration#default"  class="org.apache.archiva.configuration.provider.DefaultArchivaConfiguration">
     <property name="registry" ref="registry#default"/>
   </bean>
 
index c5be4d834144a1f8b2afe36e8d81b54fd5bda33f..0bd36566125d4a923706b6986b577fa445db2787 100644 (file)
@@ -55,8 +55,8 @@
       <artifactId>archiva-common</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 2f3077b3cd0c7e17f1a15407e0709a0891d7777f..1790ce01ffa42304b9a5374e9d91a29c9332a389 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.metadata.repository.cassandra;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.metadata.repository.AbstractRepositorySessionFactory;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.MetadataResolver;
index 1ecb1ac4e8df4d55d9f0bbef1eef154fe90cb411..ea561448a73778bd8c22d92f4d58e4f288687f91 100644 (file)
@@ -34,8 +34,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 00e68c1180c40efe348fa1e64534c826e64698f7..3cc3d2451a02b3cf95daae500b3916a3b5c65141 100644 (file)
@@ -20,8 +20,8 @@ package org.apache.archiva.metadata.repository.file;
  */
 
 import org.apache.archiva.checksum.ChecksumAlgorithm;
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.metadata.QueryParameter;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.CiManagement;
index 911dea07151d8faae5bfb2f9861957e707adb772..717f68409f4ff884dc96e817b23d9150f51dd04c 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.metadata.repository.file;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
 import org.apache.archiva.metadata.model.MetadataFacetFactory;
 import org.apache.archiva.metadata.repository.AbstractRepositorySessionFactory;
 import org.apache.archiva.metadata.repository.MetadataRepository;
index 4fd4bab269a74b8be3d8d55f8b582dd56f0fa978..0246b2ee8790f53d7635f4a87d7c9763edbdbbc7 100644 (file)
@@ -19,9 +19,9 @@ package org.apache.archiva.metadata.repository.file;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.provider.ArchivaConfiguration;
+import org.apache.archiva.configuration.model.Configuration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.metadata.model.MetadataFacetFactory;
 import org.apache.archiva.metadata.repository.AbstractMetadataRepositoryTest;
 import org.apache.archiva.metadata.repository.MetadataRepository;
index 06f38aa5a13524424af8bf4ceb8a90509c6d4559..961fe0d169d7af9f5c1df4703537022bc3fc81a2 100644 (file)
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>${jdk.version}</source>
-          <target>${jdk.version}</target>
-        </configuration>
       </plugin>
 
       <!-- Maven Shade Plugin -->
index af5c0b949cfd595dcfeebbc9b8f094058ad058ba..aea14fc965072c1b7f3a94a1a5014b3997fa1e32 100644 (file)
@@ -33,8 +33,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index f0cb5d2cc3746895107919a579005459a449d760..8209c50609821db6461027e002b4845e55f3e239 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.audit;
  */
 
 import junit.framework.TestCase;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.configuration.model.ManagedRepositoryConfiguration;
 import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.RepositorySession;
index 3da850155fb7d56e798ff5322b7f949cecb79fa0..8b30065c035a686d0b9efdac1e487bc64eb61b27 100644 (file)
@@ -38,8 +38,8 @@
     </dependency>
     <!-- FIXME this deps must be removed -->
     <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-configuration</artifactId>
+      <groupId>org.apache.archiva.configuration</groupId>
+      <artifactId>archiva-configuration-provider</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 0e167a52365326b503c785ebbb2b8b35850d0e3d..cd9c6cbf343915073f9d8a5b6a0d63dd317153b9 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.reports.consumers;
 
 import org.apache.archiva.checksum.ChecksumAlgorithm;
 import org.apache.archiva.checksum.ChecksummedFile;
-import org.apache.archiva.configuration.FileTypes;
+import org.apache.archiva.configuration.provider.FileTypes;
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
diff --git a/pom.xml b/pom.xml
index 22b24d5e5f21050832106cfbde7dd9c719382592..4eaa74622f00ff6d9ff4446e9b63d73f9dd2e8dc 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <version>${project.version}</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.archiva</groupId>
+        <groupId>org.apache.archiva.configuration</groupId>
+        <artifactId>archiva-configuration-model</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.archiva.configuration</groupId>
+        <artifactId>archiva-configuration-provider</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.archiva.configuration</groupId>
         <artifactId>archiva-configuration</artifactId>
         <version>${project.version}</version>
       </dependency>