From 9b22c397c2de4082344cf1d324efeb217f025fc0 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Sat, 4 May 2019 13:25:55 +0200 Subject: [PATCH] Reformatting configuration reader writer --- .../registry/ConfigurationRegistryReader.java | 2838 ++++++++--------- .../registry/ConfigurationRegistryWriter.java | 1956 +++++------- 2 files changed, 2129 insertions(+), 2665 deletions(-) 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 index 102c40333..0abe06aa9 100644 --- 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 @@ -20,1925 +20,1637 @@ package org.apache.archiva.configuration.io.registry; * under the License. */ +import org.apache.archiva.configuration.*; import org.apache.archiva.redback.components.registry.Registry; -// Util imports -import java.util.*; +import java.util.Iterator; +import java.util.List; +// Util imports // Model class imports -import org.apache.archiva.configuration.Configuration; -import org.apache.archiva.configuration.AbstractRepositoryConfiguration; -import org.apache.archiva.configuration.RemoteRepositoryConfiguration; -import org.apache.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.archiva.configuration.LegacyArtifactPath; -import org.apache.archiva.configuration.RepositoryGroupConfiguration; -import org.apache.archiva.configuration.RepositoryCheckPath; -import org.apache.archiva.configuration.AbstractRepositoryConnectorConfiguration; -import org.apache.archiva.configuration.ProxyConnectorRuleConfiguration; -import org.apache.archiva.configuration.ProxyConnectorConfiguration; -import org.apache.archiva.configuration.SyncConnectorConfiguration; -import org.apache.archiva.configuration.NetworkProxyConfiguration; -import org.apache.archiva.configuration.RepositoryScanningConfiguration; -import org.apache.archiva.configuration.FileType; -import org.apache.archiva.configuration.OrganisationInformation; -import org.apache.archiva.configuration.WebappConfiguration; -import org.apache.archiva.configuration.UserInterfaceOptions; -import org.apache.archiva.configuration.NetworkConfiguration; -import org.apache.archiva.configuration.ArchivaRuntimeConfiguration; -import org.apache.archiva.configuration.RedbackRuntimeConfiguration; -import org.apache.archiva.configuration.ArchivaDefaultConfiguration; -import org.apache.archiva.configuration.LdapConfiguration; -import org.apache.archiva.configuration.FileLockConfiguration; -import org.apache.archiva.configuration.CacheConfiguration; -import org.apache.archiva.configuration.LdapGroupMapping; - - /** * Generate Redback Registry input mechanism for model 'Configuration'. */ -public class ConfigurationRegistryReader -{ - public Configuration read( Registry registry ) - { - return readConfiguration( "", registry ); +public class ConfigurationRegistryReader { + public Configuration read(Registry registry) { + return readConfiguration("", registry); } - private Configuration readConfiguration( String prefix, Registry registry ) - { + private Configuration readConfiguration(String prefix, Registry registry) { Configuration value = new Configuration(); - //String version = registry.getString( prefix + "version", value.getVersion() ); + //String version = registry.getString( prefix + "version", value.getVersion() ); - List 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 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(); } - version = sb.toString(); - } - value.setVersion( version ); - //String metadataStore = registry.getString( prefix + "metadataStore", value.getMetadataStore() ); + value.setVersion(version); + //String metadataStore = registry.getString( prefix + "metadataStore", value.getMetadataStore() ); - List 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 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(); } - metadataStore = sb.toString(); - } - value.setMetadataStore( metadataStore ); + value.setMetadataStore(metadataStore); java.util.List repositoryGroups = new java.util.ArrayList/**/(); - List repositoryGroupsSubsets = registry.getSubsetList( prefix + "repositoryGroups.repositoryGroup" ); - for ( Iterator i = repositoryGroupsSubsets.iterator(); i.hasNext(); ) - { - RepositoryGroupConfiguration v = readRepositoryGroupConfiguration( "", (Registry) i.next() ); - repositoryGroups.add( v ); + 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 ); + value.setRepositoryGroups(repositoryGroups); java.util.List managedRepositories = new java.util.ArrayList/**/(); - List managedRepositoriesSubsets = registry.getSubsetList( prefix + "managedRepositories.managedRepository" ); - for ( Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); ) - { - ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration( "", (Registry) i.next() ); - managedRepositories.add( v ); + 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 ); + value.setManagedRepositories(managedRepositories); java.util.List remoteRepositories = new java.util.ArrayList/**/(); - List remoteRepositoriesSubsets = registry.getSubsetList( prefix + "remoteRepositories.remoteRepository" ); - for ( Iterator i = remoteRepositoriesSubsets.iterator(); i.hasNext(); ) - { - RemoteRepositoryConfiguration v = readRemoteRepositoryConfiguration( "", (Registry) i.next() ); - remoteRepositories.add( v ); + 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 ); + value.setRemoteRepositories(remoteRepositories); java.util.List proxyConnectors = new java.util.ArrayList/**/(); - List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" ); - for ( Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) - { - ProxyConnectorConfiguration v = readProxyConnectorConfiguration( "", (Registry) i.next() ); - proxyConnectors.add( v ); + 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 ); + value.setProxyConnectors(proxyConnectors); java.util.List networkProxies = new java.util.ArrayList/**/(); - List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" ); - for ( Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); ) - { - NetworkProxyConfiguration v = readNetworkProxyConfiguration( "", (Registry) i.next() ); - networkProxies.add( v ); + 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 ); + value.setNetworkProxies(networkProxies); java.util.List legacyArtifactPaths = new java.util.ArrayList/**/(); - 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 ); + 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/**/(); - List proxyConnectorRuleConfigurationsSubsets = registry.getSubsetList( prefix + "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration" ); - for ( Iterator i = proxyConnectorRuleConfigurationsSubsets.iterator(); i.hasNext(); ) - { - ProxyConnectorRuleConfiguration v = readProxyConnectorRuleConfiguration( "", (Registry) i.next() ); - proxyConnectorRuleConfigurations.add( v ); + 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 ); + value.setProxyConnectorRuleConfigurations(proxyConnectorRuleConfigurations); + ArchivaDefaultConfiguration archivaDefaultConfiguration = readArchivaDefaultConfiguration(prefix + "archivaDefaultConfiguration.", registry); + value.setArchivaDefaultConfiguration(archivaDefaultConfiguration); return value; } - - private AbstractRepositoryConfiguration readAbstractRepositoryConfiguration( String prefix, Registry registry ) - { + + private AbstractRepositoryConfiguration readAbstractRepositoryConfiguration(String prefix, Registry registry) { AbstractRepositoryConfiguration value = new AbstractRepositoryConfiguration(); - //String id = registry.getString( prefix + "id", value.getId() ); + //String id = registry.getString( prefix + "id", value.getId() ); - List 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 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(); } - id = sb.toString(); - } - value.setId( id ); - //String type = registry.getString( prefix + "type", value.getType() ); + value.setId(id); + //String type = registry.getString( prefix + "type", value.getType() ); - List 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 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(); } - type = sb.toString(); - } - value.setType( type ); - //String name = registry.getString( prefix + "name", value.getName() ); + value.setType(type); + //String name = registry.getString( prefix + "name", value.getName() ); - List 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 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(); } - name = sb.toString(); - } - value.setName( name ); - //String layout = registry.getString( prefix + "layout", value.getLayout() ); + value.setName(name); + //String layout = registry.getString( prefix + "layout", value.getLayout() ); - List 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 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(); } - layout = sb.toString(); - } - value.setLayout( layout ); - //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() ); + value.setLayout(layout); + //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() ); - List 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 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(); } - indexDir = sb.toString(); - } - value.setIndexDir( indexDir ); - //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() ); + value.setIndexDir(indexDir); + //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() ); - List 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 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(); } - packedIndexDir = sb.toString(); - } - value.setPackedIndexDir( packedIndexDir ); - //String description = registry.getString( prefix + "description", value.getDescription() ); + value.setPackedIndexDir(packedIndexDir); + //String description = registry.getString( prefix + "description", value.getDescription() ); - List 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 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(); } - description = sb.toString(); - } - value.setDescription( description ); + 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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(); + } - List 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 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 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(); } - indexDir = sb.toString(); - } - value.setIndexDir( indexDir ); - //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() ); + value.setPackedIndexDir(packedIndexDir); + //String description = registry.getString( prefix + "description", value.getDescription() ); - List 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 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(); } - packedIndexDir = sb.toString(); - } - value.setPackedIndexDir( packedIndexDir ); - //String description = registry.getString( prefix + "description", value.getDescription() ); - - List 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 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 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 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 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 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 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 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 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 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 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 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 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.setType( type ); - //String name = registry.getString( prefix + "name", value.getName() ); + value.setPackedIndexDir(packedIndexDir); + //String description = registry.getString( prefix + "description", value.getDescription() ); - List 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 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(); } - name = sb.toString(); - } - value.setName( name ); - //String layout = registry.getString( prefix + "layout", value.getLayout() ); + value.setDescription(description); - List 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 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 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 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(); } - packedIndexDir = sb.toString(); - } - value.setPackedIndexDir( packedIndexDir ); - //String description = registry.getString( prefix + "description", value.getDescription() ); + value.setPath(path); + //String artifact = registry.getString( prefix + "artifact", value.getArtifact() ); - List 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 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(); } - description = sb.toString(); - } - value.setDescription( description ); + value.setArtifact(artifact); return value; } - - private LegacyArtifactPath readLegacyArtifactPath( String prefix, Registry registry ) - { - LegacyArtifactPath value = new LegacyArtifactPath(); - //String path = registry.getString( prefix + "path", value.getPath() ); - - List 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 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 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(); } - artifact = sb.toString(); - } - value.setArtifact( artifact ); + value.setId(id); + //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() ); - return value; - } - - private RepositoryGroupConfiguration readRepositoryGroupConfiguration( String prefix, Registry registry ) - { - RepositoryGroupConfiguration value = new RepositoryGroupConfiguration(); - - //String id = registry.getString( prefix + "id", value.getId() ); - - List 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 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(); } - id = sb.toString(); - } - value.setId( id ); - //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() ); + value.setMergedIndexPath(mergedIndexPath); + int mergedIndexTtl = registry.getInt(prefix + "mergedIndexTtl", value.getMergedIndexTtl()); + value.setMergedIndexTtl(mergedIndexTtl); + //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() ); - List 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 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(); } - 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() ); - - List 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*/(); - repositories.addAll( registry.getList( prefix + "repositories.repository" ) ); - value.setRepositories( repositories ); + repositories.addAll(registry.getList(prefix + "repositories.repository")); + value.setRepositories(repositories); return value; } - - private RepositoryCheckPath readRepositoryCheckPath( String prefix, Registry registry ) - { + + private RepositoryCheckPath readRepositoryCheckPath(String prefix, Registry registry) { RepositoryCheckPath value = new RepositoryCheckPath(); - //String url = registry.getString( prefix + "url", value.getUrl() ); + //String url = registry.getString( prefix + "url", value.getUrl() ); - List 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 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(); } - url = sb.toString(); - } - value.setUrl( url ); - //String path = registry.getString( prefix + "path", value.getPath() ); + value.setUrl(url); + //String path = registry.getString( prefix + "path", value.getPath() ); - List 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 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(); } - path = sb.toString(); - } - value.setPath( path ); + value.setPath(path); return value; } - - private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration( String prefix, Registry registry ) - { + + private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration(String prefix, Registry registry) { AbstractRepositoryConnectorConfiguration value = new AbstractRepositoryConnectorConfiguration(); - //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() ); + //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() ); - List 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 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(); } - sourceRepoId = sb.toString(); - } - value.setSourceRepoId( sourceRepoId ); - //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() ); + value.setSourceRepoId(sourceRepoId); + //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() ); - List 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 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(); } - targetRepoId = sb.toString(); - } - value.setTargetRepoId( targetRepoId ); - //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() ); + value.setTargetRepoId(targetRepoId); + //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() ); - List 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 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(); } - proxyId = sb.toString(); - } - value.setProxyId( proxyId ); + value.setProxyId(proxyId); java.util.List blackListPatterns = new java.util.ArrayList/**/(); - blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) ); - value.setBlackListPatterns( blackListPatterns ); + blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern")); + value.setBlackListPatterns(blackListPatterns); java.util.List whiteListPatterns = new java.util.ArrayList/**/(); - 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 ); + 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 ) - { + + private ProxyConnectorRuleConfiguration readProxyConnectorRuleConfiguration(String prefix, Registry registry) { ProxyConnectorRuleConfiguration value = new ProxyConnectorRuleConfiguration(); - //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() ); + //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() ); - List 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 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(); } - ruleType = sb.toString(); - } - value.setRuleType( ruleType ); - //String pattern = registry.getString( prefix + "pattern", value.getPattern() ); + value.setRuleType(ruleType); + //String pattern = registry.getString( prefix + "pattern", value.getPattern() ); - List 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 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(); } - pattern = sb.toString(); - } - value.setPattern( pattern ); + value.setPattern(pattern); java.util.List proxyConnectors = new java.util.ArrayList/**/(); - List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" ); - for ( Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) - { - ProxyConnectorConfiguration v = readProxyConnectorConfiguration( "", (Registry) i.next() ); - proxyConnectors.add( v ); + 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 ); + value.setProxyConnectors(proxyConnectors); return value; } - - private ProxyConnectorConfiguration readProxyConnectorConfiguration( String prefix, Registry registry ) - { + + 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() ); + int order = registry.getInt(prefix + "order", value.getOrder()); + value.setOrder(order); + //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() ); - List 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 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(); } - sourceRepoId = sb.toString(); - } - value.setSourceRepoId( sourceRepoId ); - //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() ); + value.setSourceRepoId(sourceRepoId); + //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() ); - List 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 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(); } - targetRepoId = sb.toString(); - } - value.setTargetRepoId( targetRepoId ); - //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() ); + value.setTargetRepoId(targetRepoId); + //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() ); - List 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 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(); } - proxyId = sb.toString(); - } - value.setProxyId( proxyId ); + value.setProxyId(proxyId); java.util.List blackListPatterns = new java.util.ArrayList/**/(); - blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) ); - value.setBlackListPatterns( blackListPatterns ); + blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern")); + value.setBlackListPatterns(blackListPatterns); java.util.List whiteListPatterns = new java.util.ArrayList/**/(); - 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 ); + 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 ) - { + + private SyncConnectorConfiguration readSyncConnectorConfiguration(String prefix, Registry registry) { SyncConnectorConfiguration value = new SyncConnectorConfiguration(); - //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() ); + //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() ); - List 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 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(); } - cronExpression = sb.toString(); - } - value.setCronExpression( cronExpression ); - //String method = registry.getString( prefix + "method", value.getMethod() ); + value.setCronExpression(cronExpression); + //String method = registry.getString( prefix + "method", value.getMethod() ); - List 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 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(); } - method = sb.toString(); - } - value.setMethod( method ); - //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() ); + value.setMethod(method); + //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() ); - List 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 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(); } - sourceRepoId = sb.toString(); - } - value.setSourceRepoId( sourceRepoId ); - //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() ); + value.setSourceRepoId(sourceRepoId); + //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() ); - List 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 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(); } - targetRepoId = sb.toString(); - } - value.setTargetRepoId( targetRepoId ); - //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() ); + value.setTargetRepoId(targetRepoId); + //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() ); - List 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 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(); } - proxyId = sb.toString(); - } - value.setProxyId( proxyId ); + value.setProxyId(proxyId); java.util.List blackListPatterns = new java.util.ArrayList/**/(); - blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) ); - value.setBlackListPatterns( blackListPatterns ); + blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern")); + value.setBlackListPatterns(blackListPatterns); java.util.List whiteListPatterns = new java.util.ArrayList/**/(); - 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 ); + 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 ) - { + + private NetworkProxyConfiguration readNetworkProxyConfiguration(String prefix, Registry registry) { NetworkProxyConfiguration value = new NetworkProxyConfiguration(); - //String id = registry.getString( prefix + "id", value.getId() ); + //String id = registry.getString( prefix + "id", value.getId() ); - List 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 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(); } - id = sb.toString(); - } - value.setId( id ); - //String protocol = registry.getString( prefix + "protocol", value.getProtocol() ); + value.setId(id); + //String protocol = registry.getString( prefix + "protocol", value.getProtocol() ); - List 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 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(); } - protocol = sb.toString(); - } - value.setProtocol( protocol ); - //String host = registry.getString( prefix + "host", value.getHost() ); + value.setProtocol(protocol); + //String host = registry.getString( prefix + "host", value.getHost() ); - List 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 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(); } - 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 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 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() ); + value.setUsername(username); + //String password = registry.getString( prefix + "password", value.getPassword() ); - List 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 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(); } - password = sb.toString(); - } - value.setPassword( password ); - boolean useNtlm = registry.getBoolean( prefix + "useNtlm", value.isUseNtlm() ); - value.setUseNtlm( useNtlm ); + value.setPassword(password); + boolean useNtlm = registry.getBoolean(prefix + "useNtlm", value.isUseNtlm()); + value.setUseNtlm(useNtlm); return value; } - - private RepositoryScanningConfiguration readRepositoryScanningConfiguration( String prefix, Registry registry ) - { + + private RepositoryScanningConfiguration readRepositoryScanningConfiguration(String prefix, Registry registry) { RepositoryScanningConfiguration value = new RepositoryScanningConfiguration(); java.util.List fileTypes = new java.util.ArrayList/**/(); - List fileTypesSubsets = registry.getSubsetList( prefix + "fileTypes.fileType" ); - for ( Iterator i = fileTypesSubsets.iterator(); i.hasNext(); ) - { - FileType v = readFileType( "", (Registry) i.next() ); - fileTypes.add( v ); + 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 ); + value.setFileTypes(fileTypes); java.util.List knownContentConsumers = new java.util.ArrayList/**/(); - knownContentConsumers.addAll( registry.getList( prefix + "knownContentConsumers.knownContentConsumer" ) ); - value.setKnownContentConsumers( knownContentConsumers ); + knownContentConsumers.addAll(registry.getList(prefix + "knownContentConsumers.knownContentConsumer")); + value.setKnownContentConsumers(knownContentConsumers); java.util.List invalidContentConsumers = new java.util.ArrayList/**/(); - invalidContentConsumers.addAll( registry.getList( prefix + "invalidContentConsumers.invalidContentConsumer" ) ); - value.setInvalidContentConsumers( invalidContentConsumers ); + invalidContentConsumers.addAll(registry.getList(prefix + "invalidContentConsumers.invalidContentConsumer")); + value.setInvalidContentConsumers(invalidContentConsumers); return value; } - - private FileType readFileType( String prefix, Registry registry ) - { + + private FileType readFileType(String prefix, Registry registry) { FileType value = new FileType(); - //String id = registry.getString( prefix + "id", value.getId() ); + //String id = registry.getString( prefix + "id", value.getId() ); - List 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 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(); } - id = sb.toString(); - } - value.setId( id ); + value.setId(id); java.util.List patterns = new java.util.ArrayList/**/(); - patterns.addAll( registry.getList( prefix + "patterns.pattern" ) ); - value.setPatterns( patterns ); + patterns.addAll(registry.getList(prefix + "patterns.pattern")); + value.setPatterns(patterns); return value; } - - private OrganisationInformation readOrganisationInformation( String prefix, Registry registry ) - { + + private OrganisationInformation readOrganisationInformation(String prefix, Registry registry) { OrganisationInformation value = new OrganisationInformation(); - //String name = registry.getString( prefix + "name", value.getName() ); + //String name = registry.getString( prefix + "name", value.getName() ); - List 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 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(); } - name = sb.toString(); - } - value.setName( name ); - //String url = registry.getString( prefix + "url", value.getUrl() ); + value.setName(name); + //String url = registry.getString( prefix + "url", value.getUrl() ); - List 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 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(); } - url = sb.toString(); - } - value.setUrl( url ); - //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() ); + value.setUrl(url); + //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() ); - List 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 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(); } - logoLocation = sb.toString(); - } - value.setLogoLocation( logoLocation ); + value.setLogoLocation(logoLocation); return value; } - - private WebappConfiguration readWebappConfiguration( String prefix, Registry registry ) - { + + private WebappConfiguration readWebappConfiguration(String prefix, Registry registry) { WebappConfiguration value = new WebappConfiguration(); - UserInterfaceOptions ui = readUserInterfaceOptions( prefix + "ui.", registry ); - value.setUi( ui ); + UserInterfaceOptions ui = readUserInterfaceOptions(prefix + "ui.", registry); + value.setUi(ui); return value; } - - private UserInterfaceOptions readUserInterfaceOptions( String prefix, Registry registry ) - { + + 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 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 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 ) - { + + 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 ); + 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 ) - { + + 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 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 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() ); + value.setDataDirectory(dataDirectory); + //String repositoryBaseDirectory = registry.getString( prefix + "repositoryBaseDirectory", value.getRepositoryBaseDirectory() ); - List 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 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(); } - repositoryBaseDirectory = sb.toString(); - } - value.setRepositoryBaseDirectory( repositoryBaseDirectory ); - //String remoteRepositoryBaseDirectory = registry.getString( prefix + "remoteRepositoryBaseDirectory", value.getRemoteRepositoryBaseDirectory() ); + value.setRepositoryBaseDirectory(repositoryBaseDirectory); + //String remoteRepositoryBaseDirectory = registry.getString( prefix + "remoteRepositoryBaseDirectory", value.getRemoteRepositoryBaseDirectory() ); - List 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 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(); } - remoteRepositoryBaseDirectory = sb.toString(); - } - value.setRemoteRepositoryBaseDirectory( remoteRepositoryBaseDirectory ); - //String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() ); + value.setRemoteRepositoryBaseDirectory(remoteRepositoryBaseDirectory); + //String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() ); - List 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 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(); } - defaultLanguage = sb.toString(); - } - value.setDefaultLanguage( defaultLanguage ); - //String languageRange = registry.getString( prefix + "languageRange", value.getLanguageRange() ); + value.setDefaultLanguage(defaultLanguage); + //String languageRange = registry.getString( prefix + "languageRange", value.getLanguageRange() ); - List 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 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(); } - languageRange = sb.toString(); - } - value.setLanguageRange( languageRange ); + value.setLanguageRange(languageRange); return value; } - - private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration( String prefix, Registry registry ) - { + + private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration(String prefix, Registry registry) { RedbackRuntimeConfiguration value = new RedbackRuntimeConfiguration(); - boolean migratedFromRedbackConfiguration = registry.getBoolean( prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration() ); - value.setMigratedFromRedbackConfiguration( migratedFromRedbackConfiguration ); + boolean migratedFromRedbackConfiguration = registry.getBoolean(prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration()); + value.setMigratedFromRedbackConfiguration(migratedFromRedbackConfiguration); java.util.List userManagerImpls = new java.util.ArrayList/**/(); - userManagerImpls.addAll( registry.getList( prefix + "userManagerImpls.userManagerImpl" ) ); - value.setUserManagerImpls( userManagerImpls ); + userManagerImpls.addAll(registry.getList(prefix + "userManagerImpls.userManagerImpl")); + value.setUserManagerImpls(userManagerImpls); java.util.List rbacManagerImpls = new java.util.ArrayList/**/(); - rbacManagerImpls.addAll( registry.getList( prefix + "rbacManagerImpls.rbacManagerImpl" ) ); - value.setRbacManagerImpls( rbacManagerImpls ); - LdapConfiguration ldapConfiguration = readLdapConfiguration( prefix + "ldapConfiguration.", registry ); - value.setLdapConfiguration( ldapConfiguration ); + 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/**/(); - 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 ); + 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 ) - { + + private ArchivaDefaultConfiguration readArchivaDefaultConfiguration(String prefix, Registry registry) { ArchivaDefaultConfiguration value = new ArchivaDefaultConfiguration(); java.util.List defaultCheckPaths = new java.util.ArrayList/**/(); - List defaultCheckPathsSubsets = registry.getSubsetList( prefix + "defaultCheckPaths.defaultCheckPath" ); - for ( Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); ) - { - RepositoryCheckPath v = readRepositoryCheckPath( "", (Registry) i.next() ); - defaultCheckPaths.add( v ); + 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 ); + 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 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 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 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 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 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 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 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(); } - password = sb.toString(); - } - value.setPassword( password ); - //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() ); - - List 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 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 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 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 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 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 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 ); + 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 ) - { + + 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 ); + 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 ) - { + + 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 ); + 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 ) - { + + private LdapGroupMapping readLdapGroupMapping(String prefix, Registry registry) { LdapGroupMapping value = new LdapGroupMapping(); - //String group = registry.getString( prefix + "group", value.getGroup() ); + //String group = registry.getString( prefix + "group", value.getGroup() ); - List 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 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(); } - group = sb.toString(); - } - value.setGroup( group ); + value.setGroup(group); java.util.List roleNames = new java.util.ArrayList/**/(); - roleNames.addAll( registry.getList( prefix + "roleNames.roleName" ) ); - value.setRoleNames( roleNames ); + 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 index ce696ebe6..bb94913c0 100644 --- 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 @@ -20,1316 +20,1068 @@ package org.apache.archiva.configuration.io.registry; * under the License. */ +import org.apache.archiva.configuration.*; import org.apache.archiva.redback.components.registry.Registry; -// Util imports -import java.util.*; +import java.util.Iterator; +// Util imports // Model class imports -import org.apache.archiva.configuration.Configuration; -import org.apache.archiva.configuration.AbstractRepositoryConfiguration; -import org.apache.archiva.configuration.RemoteRepositoryConfiguration; -import org.apache.archiva.configuration.ManagedRepositoryConfiguration; -import org.apache.archiva.configuration.LegacyArtifactPath; -import org.apache.archiva.configuration.RepositoryGroupConfiguration; -import org.apache.archiva.configuration.RepositoryCheckPath; -import org.apache.archiva.configuration.AbstractRepositoryConnectorConfiguration; -import org.apache.archiva.configuration.ProxyConnectorRuleConfiguration; -import org.apache.archiva.configuration.ProxyConnectorConfiguration; -import org.apache.archiva.configuration.SyncConnectorConfiguration; -import org.apache.archiva.configuration.NetworkProxyConfiguration; -import org.apache.archiva.configuration.RepositoryScanningConfiguration; -import org.apache.archiva.configuration.FileType; -import org.apache.archiva.configuration.OrganisationInformation; -import org.apache.archiva.configuration.WebappConfiguration; -import org.apache.archiva.configuration.UserInterfaceOptions; -import org.apache.archiva.configuration.NetworkConfiguration; -import org.apache.archiva.configuration.ArchivaRuntimeConfiguration; -import org.apache.archiva.configuration.RedbackRuntimeConfiguration; -import org.apache.archiva.configuration.ArchivaDefaultConfiguration; -import org.apache.archiva.configuration.LdapConfiguration; -import org.apache.archiva.configuration.FileLockConfiguration; -import org.apache.archiva.configuration.CacheConfiguration; -import org.apache.archiva.configuration.LdapGroupMapping; - - /** * Generate Plexus Registry output mechanism for model 'Configuration'. */ -public class ConfigurationRegistryWriter -{ - public void write( Configuration model, Registry registry ) - { - writeConfiguration( "", model, registry ); +public class ConfigurationRegistryWriter { + public void write(Configuration model, Registry registry) { + writeConfiguration("", model, registry); } - 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" ); + 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++ ) - { + for (Iterator iter = value.getRepositoryGroups().iterator(); iter.hasNext(); count++) { String name = "repositoryGroups.repositoryGroup(" + count + ")"; - RepositoryGroupConfiguration o = ( RepositoryGroupConfiguration ) iter.next(); - writeRepositoryGroupConfiguration( prefix + name + ".", o, registry ); + RepositoryGroupConfiguration o = (RepositoryGroupConfiguration) iter.next(); + writeRepositoryGroupConfiguration(prefix + name + ".", o, registry); } } - if ( value.getManagedRepositories() != null && value.getManagedRepositories().size() > 0 - ) - { - registry.removeSubset( prefix + "managedRepositories" ); + if (value.getManagedRepositories() != null && value.getManagedRepositories().size() > 0 + ) { + registry.removeSubset(prefix + "managedRepositories"); int count = 0; - for ( Iterator iter = value.getManagedRepositories().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getManagedRepositories().iterator(); iter.hasNext(); count++) { String name = "managedRepositories.managedRepository(" + count + ")"; - ManagedRepositoryConfiguration o = ( ManagedRepositoryConfiguration ) iter.next(); - writeManagedRepositoryConfiguration( prefix + name + ".", o, registry ); + ManagedRepositoryConfiguration o = (ManagedRepositoryConfiguration) iter.next(); + writeManagedRepositoryConfiguration(prefix + name + ".", o, registry); } } - if ( value.getRemoteRepositories() != null && value.getRemoteRepositories().size() > 0 - ) - { - registry.removeSubset( prefix + "remoteRepositories" ); + if (value.getRemoteRepositories() != null && value.getRemoteRepositories().size() > 0 + ) { + registry.removeSubset(prefix + "remoteRepositories"); int count = 0; - for ( Iterator iter = value.getRemoteRepositories().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getRemoteRepositories().iterator(); iter.hasNext(); count++) { String name = "remoteRepositories.remoteRepository(" + count + ")"; - RemoteRepositoryConfiguration o = ( RemoteRepositoryConfiguration ) iter.next(); - writeRemoteRepositoryConfiguration( prefix + name + ".", o, registry ); + RemoteRepositoryConfiguration o = (RemoteRepositoryConfiguration) iter.next(); + writeRemoteRepositoryConfiguration(prefix + name + ".", o, registry); } } - if ( value.getProxyConnectors() != null && value.getProxyConnectors().size() > 0 - ) - { - registry.removeSubset( prefix + "proxyConnectors" ); + if (value.getProxyConnectors() != null && value.getProxyConnectors().size() > 0 + ) { + registry.removeSubset(prefix + "proxyConnectors"); int count = 0; - for ( Iterator iter = value.getProxyConnectors().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getProxyConnectors().iterator(); iter.hasNext(); count++) { String name = "proxyConnectors.proxyConnector(" + count + ")"; - ProxyConnectorConfiguration o = ( ProxyConnectorConfiguration ) iter.next(); - writeProxyConnectorConfiguration( prefix + name + ".", o, registry ); + ProxyConnectorConfiguration o = (ProxyConnectorConfiguration) iter.next(); + writeProxyConnectorConfiguration(prefix + name + ".", o, registry); } } - if ( value.getNetworkProxies() != null && value.getNetworkProxies().size() > 0 - ) - { - registry.removeSubset( prefix + "networkProxies" ); + if (value.getNetworkProxies() != null && value.getNetworkProxies().size() > 0 + ) { + registry.removeSubset(prefix + "networkProxies"); int count = 0; - for ( Iterator iter = value.getNetworkProxies().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getNetworkProxies().iterator(); iter.hasNext(); count++) { String name = "networkProxies.networkProxy(" + count + ")"; - NetworkProxyConfiguration o = ( NetworkProxyConfiguration ) iter.next(); - writeNetworkProxyConfiguration( prefix + name + ".", o, registry ); + NetworkProxyConfiguration o = (NetworkProxyConfiguration) iter.next(); + writeNetworkProxyConfiguration(prefix + name + ".", o, registry); } } - if ( value.getLegacyArtifactPaths() != null && value.getLegacyArtifactPaths().size() > 0 - ) - { - registry.removeSubset( prefix + "legacyArtifactPaths" ); + if (value.getLegacyArtifactPaths() != null && value.getLegacyArtifactPaths().size() > 0 + ) { + registry.removeSubset(prefix + "legacyArtifactPaths"); int count = 0; - for ( Iterator iter = value.getLegacyArtifactPaths().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getLegacyArtifactPaths().iterator(); iter.hasNext(); count++) { String name = "legacyArtifactPaths.legacyArtifactPath(" + count + ")"; - LegacyArtifactPath o = ( LegacyArtifactPath ) iter.next(); - writeLegacyArtifactPath( prefix + name + ".", o, registry ); + 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" ); + 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++ ) - { + for (Iterator iter = value.getProxyConnectorRuleConfigurations().iterator(); iter.hasNext(); count++) { String name = "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration(" + count + ")"; - ProxyConnectorRuleConfiguration o = ( ProxyConnectorRuleConfiguration ) iter.next(); - writeProxyConnectorRuleConfiguration( prefix + name + ".", o, registry ); + ProxyConnectorRuleConfiguration o = (ProxyConnectorRuleConfiguration) iter.next(); + writeProxyConnectorRuleConfiguration(prefix + name + ".", o, registry); } } - if ( value.getArchivaDefaultConfiguration() != null - ) - { - writeArchivaDefaultConfiguration( prefix + "archivaDefaultConfiguration.", value.getArchivaDefaultConfiguration(), 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 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(); ) - { + + 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 ); + String v = (String) value.getExtraParameters().get(key); - registry.setString( prefix + "extraParameters." + key, v ); + 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(); ) - { + 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 ); + String v = (String) value.getExtraHeaders().get(key); - registry.setString( prefix + "extraHeaders." + key, v ); + 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() ); - } - } + 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 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 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.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" ); + + 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.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++ ) - { + for (Iterator iter = value.getRepositories().iterator(); iter.hasNext(); count++) { String name = "repositories.repository(" + count + ")"; - String repository = ( String ) iter.next(); - registry.setString( prefix + name, repository ); + 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 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" ); + + 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++ ) - { + for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) { String name = "blackListPatterns.blackListPattern(" + count + ")"; - String blackListPattern = ( String ) iter.next(); - registry.setString( prefix + name, blackListPattern ); + String blackListPattern = (String) iter.next(); + registry.setString(prefix + name, blackListPattern); } } - if ( value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0 - ) - { - registry.removeSubset( prefix + "whiteListPatterns" ); + if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0 + ) { + registry.removeSubset(prefix + "whiteListPatterns"); int count = 0; - for ( Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) { String name = "whiteListPatterns.whiteListPattern(" + count + ")"; - String whiteListPattern = ( String ) iter.next(); - registry.setString( prefix + name, whiteListPattern ); + 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(); ) - { + 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 ); + String v = (String) value.getPolicies().get(key); - registry.setString( prefix + "policies." + key, v ); + 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(); ) - { + 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 ); + String v = (String) value.getProperties().get(key); - registry.setString( prefix + "properties." + key, v ); + registry.setString(prefix + "properties." + key, v); } } - String disabled = "disabled"; - registry.setBoolean( prefix + disabled, value.isDisabled() ); - } + 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" ); + + 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++ ) - { + for (Iterator iter = value.getProxyConnectors().iterator(); iter.hasNext(); count++) { String name = "proxyConnectors.proxyConnector(" + count + ")"; - ProxyConnectorConfiguration o = ( ProxyConnectorConfiguration ) iter.next(); - writeProxyConnectorConfiguration( prefix + name + ".", o, registry ); + 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" ); + + 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++ ) - { + for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) { String name = "blackListPatterns.blackListPattern(" + count + ")"; - String blackListPattern = ( String ) iter.next(); - registry.setString( prefix + name, blackListPattern ); + String blackListPattern = (String) iter.next(); + registry.setString(prefix + name, blackListPattern); } } - if ( value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0 - ) - { - registry.removeSubset( prefix + "whiteListPatterns" ); + if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0 + ) { + registry.removeSubset(prefix + "whiteListPatterns"); int count = 0; - for ( Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) { String name = "whiteListPatterns.whiteListPattern(" + count + ")"; - String whiteListPattern = ( String ) iter.next(); - registry.setString( prefix + name, whiteListPattern ); + 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(); ) - { + 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 ); + String v = (String) value.getPolicies().get(key); - registry.setString( prefix + "policies." + key, v ); + 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(); ) - { + 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 ); + String v = (String) value.getProperties().get(key); - registry.setString( prefix + "properties." + key, v ); + registry.setString(prefix + "properties." + key, v); } } - String disabled = "disabled"; - registry.setBoolean( prefix + disabled, value.isDisabled() ); - } + 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" ); + + 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++ ) - { + for (Iterator iter = value.getBlackListPatterns().iterator(); iter.hasNext(); count++) { String name = "blackListPatterns.blackListPattern(" + count + ")"; - String blackListPattern = ( String ) iter.next(); - registry.setString( prefix + name, blackListPattern ); + String blackListPattern = (String) iter.next(); + registry.setString(prefix + name, blackListPattern); } } - if ( value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0 - ) - { - registry.removeSubset( prefix + "whiteListPatterns" ); + if (value.getWhiteListPatterns() != null && value.getWhiteListPatterns().size() > 0 + ) { + registry.removeSubset(prefix + "whiteListPatterns"); int count = 0; - for ( Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getWhiteListPatterns().iterator(); iter.hasNext(); count++) { String name = "whiteListPatterns.whiteListPattern(" + count + ")"; - String whiteListPattern = ( String ) iter.next(); - registry.setString( prefix + name, whiteListPattern ); + 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(); ) - { + 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 ); + String v = (String) value.getPolicies().get(key); - registry.setString( prefix + "policies." + key, v ); + 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(); ) - { + 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 ); + String v = (String) value.getProperties().get(key); - registry.setString( prefix + "properties." + key, v ); + registry.setString(prefix + "properties." + key, v); } } - String disabled = "disabled"; - registry.setBoolean( prefix + disabled, value.isDisabled() ); - } + 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 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" ); + + 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++ ) - { + for (Iterator iter = value.getFileTypes().iterator(); iter.hasNext(); count++) { String name = "fileTypes.fileType(" + count + ")"; - FileType o = ( FileType ) iter.next(); - writeFileType( prefix + name + ".", o, registry ); + FileType o = (FileType) iter.next(); + writeFileType(prefix + name + ".", o, registry); } } - if ( value.getKnownContentConsumers() != null && value.getKnownContentConsumers().size() > 0 - ) - { - registry.removeSubset( prefix + "knownContentConsumers" ); + if (value.getKnownContentConsumers() != null && value.getKnownContentConsumers().size() > 0 + ) { + registry.removeSubset(prefix + "knownContentConsumers"); int count = 0; - for ( Iterator iter = value.getKnownContentConsumers().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getKnownContentConsumers().iterator(); iter.hasNext(); count++) { String name = "knownContentConsumers.knownContentConsumer(" + count + ")"; - String knownContentConsumer = ( String ) iter.next(); - registry.setString( prefix + name, knownContentConsumer ); + String knownContentConsumer = (String) iter.next(); + registry.setString(prefix + name, knownContentConsumer); } } - if ( value.getInvalidContentConsumers() != null && value.getInvalidContentConsumers().size() > 0 - ) - { - registry.removeSubset( prefix + "invalidContentConsumers" ); + if (value.getInvalidContentConsumers() != null && value.getInvalidContentConsumers().size() > 0 + ) { + registry.removeSubset(prefix + "invalidContentConsumers"); int count = 0; - for ( Iterator iter = value.getInvalidContentConsumers().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getInvalidContentConsumers().iterator(); iter.hasNext(); count++) { String name = "invalidContentConsumers.invalidContentConsumer(" + count + ")"; - String invalidContentConsumer = ( String ) iter.next(); - registry.setString( prefix + name, invalidContentConsumer ); + 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" ); + + 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++ ) - { + for (Iterator iter = value.getPatterns().iterator(); iter.hasNext(); count++) { String name = "patterns.pattern(" + count + ")"; - String pattern = ( String ) iter.next(); - registry.setString( prefix + name, pattern ); + 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 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 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 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 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.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() ); - } - } + + 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.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()); + } + } } - - 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" ); + + 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++ ) - { + for (Iterator iter = value.getUserManagerImpls().iterator(); iter.hasNext(); count++) { String name = "userManagerImpls.userManagerImpl(" + count + ")"; - String userManagerImpl = ( String ) iter.next(); - registry.setString( prefix + name, userManagerImpl ); + String userManagerImpl = (String) iter.next(); + registry.setString(prefix + name, userManagerImpl); } } - if ( value.getRbacManagerImpls() != null && value.getRbacManagerImpls().size() > 0 - ) - { - registry.removeSubset( prefix + "rbacManagerImpls" ); + if (value.getRbacManagerImpls() != null && value.getRbacManagerImpls().size() > 0 + ) { + registry.removeSubset(prefix + "rbacManagerImpls"); int count = 0; - for ( Iterator iter = value.getRbacManagerImpls().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getRbacManagerImpls().iterator(); iter.hasNext(); count++) { String name = "rbacManagerImpls.rbacManagerImpl(" + count + ")"; - String rbacManagerImpl = ( String ) iter.next(); - registry.setString( prefix + name, rbacManagerImpl ); + String rbacManagerImpl = (String) iter.next(); + registry.setString(prefix + name, rbacManagerImpl); } } - if ( value.getLdapConfiguration() != null - ) - { - writeLdapConfiguration( prefix + "ldapConfiguration.", value.getLdapConfiguration(), registry ); + if (value.getLdapConfiguration() != null + ) { + writeLdapConfiguration(prefix + "ldapConfiguration.", value.getLdapConfiguration(), registry); } - if ( value.getLdapGroupMappings() != null && value.getLdapGroupMappings().size() > 0 - ) - { - registry.removeSubset( prefix + "ldapGroupMappings" ); + if (value.getLdapGroupMappings() != null && value.getLdapGroupMappings().size() > 0 + ) { + registry.removeSubset(prefix + "ldapGroupMappings"); int count = 0; - for ( Iterator iter = value.getLdapGroupMappings().iterator(); iter.hasNext(); count++ ) - { + for (Iterator iter = value.getLdapGroupMappings().iterator(); iter.hasNext(); count++) { String name = "ldapGroupMappings.ldapGroupMapping(" + count + ")"; - LdapGroupMapping o = ( LdapGroupMapping ) iter.next(); - writeLdapGroupMapping( prefix + name + ".", o, registry ); + 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(); ) - { + 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 ); + String v = (String) value.getConfigurationProperties().get(key); - registry.setString( prefix + "configurationProperties." + key, v ); + 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 ); + 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" ); + + 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++ ) - { + for (Iterator iter = value.getDefaultCheckPaths().iterator(); iter.hasNext(); count++) { String name = "defaultCheckPaths.defaultCheckPath(" + count + ")"; - RepositoryCheckPath o = ( RepositoryCheckPath ) iter.next(); - writeRepositoryCheckPath( prefix + name + ".", o, registry ); + 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(); ) - { + + 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 ); + String v = (String) value.getExtraProperties().get(key); - registry.setString( prefix + "extraProperties." + key, v ); + 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 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 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" ); + + 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++ ) - { + for (Iterator iter = value.getRoleNames().iterator(); iter.hasNext(); count++) { String name = "roleNames.roleName(" + count + ")"; - String roleName = ( String ) iter.next(); - registry.setString( prefix + name, roleName ); + String roleName = (String) iter.next(); + registry.setString(prefix + name, roleName); } } } } - + } \ No newline at end of file -- 2.39.5