2 package org.apache.archiva.configuration.io.registry;
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
23 import org.apache.archiva.configuration.*;
24 import org.apache.archiva.redback.components.registry.Registry;
26 import java.util.Iterator;
27 import java.util.List;
30 // Model class imports
34 * Generate Redback Registry input mechanism for model 'Configuration'.
36 public class ConfigurationRegistryReader {
37 public Configuration read(Registry registry) {
38 return readConfiguration("", registry);
41 private Configuration readConfiguration(String prefix, Registry registry) {
42 Configuration value = new Configuration();
44 //String version = registry.getString( prefix + "version", value.getVersion() );
46 List<String> versionList = registry.getList(prefix + "version");
47 String version = value.getVersion();
48 if (versionList != null && !versionList.isEmpty()) {
49 StringBuilder sb = new StringBuilder();
50 for (int i = 0, size = versionList.size(); i < size; i++) {
51 sb.append(versionList.get(i));
56 version = sb.toString();
59 value.setVersion(version);
60 //String metadataStore = registry.getString( prefix + "metadataStore", value.getMetadataStore() );
62 List<String> metadataStoreList = registry.getList(prefix + "metadataStore");
63 String metadataStore = value.getMetadataStore();
64 if (metadataStoreList != null && !metadataStoreList.isEmpty()) {
65 StringBuilder sb = new StringBuilder();
66 for (int i = 0, size = metadataStoreList.size(); i < size; i++) {
67 sb.append(metadataStoreList.get(i));
72 metadataStore = sb.toString();
75 value.setMetadataStore(metadataStore);
76 java.util.List repositoryGroups = new java.util.ArrayList/*<RepositoryGroupConfiguration>*/();
77 List repositoryGroupsSubsets = registry.getSubsetList(prefix + "repositoryGroups.repositoryGroup");
78 for (Iterator i = repositoryGroupsSubsets.iterator(); i.hasNext(); ) {
79 RepositoryGroupConfiguration v = readRepositoryGroupConfiguration("", (Registry) i.next());
80 repositoryGroups.add(v);
82 value.setRepositoryGroups(repositoryGroups);
83 java.util.List managedRepositories = new java.util.ArrayList/*<ManagedRepositoryConfiguration>*/();
84 List managedRepositoriesSubsets = registry.getSubsetList(prefix + "managedRepositories.managedRepository");
85 for (Iterator i = managedRepositoriesSubsets.iterator(); i.hasNext(); ) {
86 ManagedRepositoryConfiguration v = readManagedRepositoryConfiguration("", (Registry) i.next());
87 managedRepositories.add(v);
89 value.setManagedRepositories(managedRepositories);
90 java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
91 List remoteRepositoriesSubsets = registry.getSubsetList(prefix + "remoteRepositories.remoteRepository");
92 for (Iterator i = remoteRepositoriesSubsets.iterator(); i.hasNext(); ) {
93 RemoteRepositoryConfiguration v = readRemoteRepositoryConfiguration("", (Registry) i.next());
94 remoteRepositories.add(v);
96 value.setRemoteRepositories(remoteRepositories);
97 java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
98 List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
99 for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
100 ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
101 proxyConnectors.add(v);
103 value.setProxyConnectors(proxyConnectors);
104 java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
105 List networkProxiesSubsets = registry.getSubsetList(prefix + "networkProxies.networkProxy");
106 for (Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); ) {
107 NetworkProxyConfiguration v = readNetworkProxyConfiguration("", (Registry) i.next());
108 networkProxies.add(v);
110 value.setNetworkProxies(networkProxies);
111 java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
112 List legacyArtifactPathsSubsets = registry.getSubsetList(prefix + "legacyArtifactPaths.legacyArtifactPath");
113 for (Iterator i = legacyArtifactPathsSubsets.iterator(); i.hasNext(); ) {
114 LegacyArtifactPath v = readLegacyArtifactPath("", (Registry) i.next());
115 legacyArtifactPaths.add(v);
117 value.setLegacyArtifactPaths(legacyArtifactPaths);
118 RepositoryScanningConfiguration repositoryScanning = readRepositoryScanningConfiguration(prefix + "repositoryScanning.", registry);
119 value.setRepositoryScanning(repositoryScanning);
120 WebappConfiguration webapp = readWebappConfiguration(prefix + "webapp.", registry);
121 value.setWebapp(webapp);
122 OrganisationInformation organisationInfo = readOrganisationInformation(prefix + "organisationInfo.", registry);
123 value.setOrganisationInfo(organisationInfo);
124 NetworkConfiguration networkConfiguration = readNetworkConfiguration(prefix + "networkConfiguration.", registry);
125 value.setNetworkConfiguration(networkConfiguration);
126 RedbackRuntimeConfiguration redbackRuntimeConfiguration = readRedbackRuntimeConfiguration(prefix + "redbackRuntimeConfiguration.", registry);
127 value.setRedbackRuntimeConfiguration(redbackRuntimeConfiguration);
128 ArchivaRuntimeConfiguration archivaRuntimeConfiguration = readArchivaRuntimeConfiguration(prefix + "archivaRuntimeConfiguration.", registry);
129 value.setArchivaRuntimeConfiguration(archivaRuntimeConfiguration);
130 java.util.List proxyConnectorRuleConfigurations = new java.util.ArrayList/*<ProxyConnectorRuleConfiguration>*/();
131 List proxyConnectorRuleConfigurationsSubsets = registry.getSubsetList(prefix + "proxyConnectorRuleConfigurations.proxyConnectorRuleConfiguration");
132 for (Iterator i = proxyConnectorRuleConfigurationsSubsets.iterator(); i.hasNext(); ) {
133 ProxyConnectorRuleConfiguration v = readProxyConnectorRuleConfiguration("", (Registry) i.next());
134 proxyConnectorRuleConfigurations.add(v);
136 value.setProxyConnectorRuleConfigurations(proxyConnectorRuleConfigurations);
137 ArchivaDefaultConfiguration archivaDefaultConfiguration = readArchivaDefaultConfiguration(prefix + "archivaDefaultConfiguration.", registry);
138 value.setArchivaDefaultConfiguration(archivaDefaultConfiguration);
143 private AbstractRepositoryConfiguration readAbstractRepositoryConfiguration(String prefix, Registry registry) {
144 AbstractRepositoryConfiguration value = new AbstractRepositoryConfiguration();
146 //String id = registry.getString( prefix + "id", value.getId() );
148 List<String> idList = registry.getList(prefix + "id");
149 String id = value.getId();
150 if (idList != null && !idList.isEmpty()) {
151 StringBuilder sb = new StringBuilder();
152 for (int i = 0, size = idList.size(); i < size; i++) {
153 sb.append(idList.get(i));
162 //String type = registry.getString( prefix + "type", value.getType() );
164 List<String> typeList = registry.getList(prefix + "type");
165 String type = value.getType();
166 if (typeList != null && !typeList.isEmpty()) {
167 StringBuilder sb = new StringBuilder();
168 for (int i = 0, size = typeList.size(); i < size; i++) {
169 sb.append(typeList.get(i));
174 type = sb.toString();
178 //String name = registry.getString( prefix + "name", value.getName() );
180 List<String> nameList = registry.getList(prefix + "name");
181 String name = value.getName();
182 if (nameList != null && !nameList.isEmpty()) {
183 StringBuilder sb = new StringBuilder();
184 for (int i = 0, size = nameList.size(); i < size; i++) {
185 sb.append(nameList.get(i));
190 name = sb.toString();
194 //String layout = registry.getString( prefix + "layout", value.getLayout() );
196 List<String> layoutList = registry.getList(prefix + "layout");
197 String layout = value.getLayout();
198 if (layoutList != null && !layoutList.isEmpty()) {
199 StringBuilder sb = new StringBuilder();
200 for (int i = 0, size = layoutList.size(); i < size; i++) {
201 sb.append(layoutList.get(i));
206 layout = sb.toString();
209 value.setLayout(layout);
210 //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
212 List<String> indexDirList = registry.getList(prefix + "indexDir");
213 String indexDir = value.getIndexDir();
214 if (indexDirList != null && !indexDirList.isEmpty()) {
215 StringBuilder sb = new StringBuilder();
216 for (int i = 0, size = indexDirList.size(); i < size; i++) {
217 sb.append(indexDirList.get(i));
222 indexDir = sb.toString();
225 value.setIndexDir(indexDir);
226 //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
228 List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
229 String packedIndexDir = value.getPackedIndexDir();
230 if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
231 StringBuilder sb = new StringBuilder();
232 for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
233 sb.append(packedIndexDirList.get(i));
238 packedIndexDir = sb.toString();
241 value.setPackedIndexDir(packedIndexDir);
242 //String description = registry.getString( prefix + "description", value.getDescription() );
244 List<String> descriptionList = registry.getList(prefix + "description");
245 String description = value.getDescription();
246 if (descriptionList != null && !descriptionList.isEmpty()) {
247 StringBuilder sb = new StringBuilder();
248 for (int i = 0, size = descriptionList.size(); i < size; i++) {
249 sb.append(descriptionList.get(i));
254 description = sb.toString();
257 value.setDescription(description);
262 private RemoteRepositoryConfiguration readRemoteRepositoryConfiguration(String prefix, Registry registry) {
263 RemoteRepositoryConfiguration value = new RemoteRepositoryConfiguration();
265 //String url = registry.getString( prefix + "url", value.getUrl() );
267 List<String> urlList = registry.getList(prefix + "url");
268 String url = value.getUrl();
269 if (urlList != null && !urlList.isEmpty()) {
270 StringBuilder sb = new StringBuilder();
271 for (int i = 0, size = urlList.size(); i < size; i++) {
272 sb.append(urlList.get(i));
281 //String username = registry.getString( prefix + "username", value.getUsername() );
283 List<String> usernameList = registry.getList(prefix + "username");
284 String username = value.getUsername();
285 if (usernameList != null && !usernameList.isEmpty()) {
286 StringBuilder sb = new StringBuilder();
287 for (int i = 0, size = usernameList.size(); i < size; i++) {
288 sb.append(usernameList.get(i));
293 username = sb.toString();
296 value.setUsername(username);
297 //String password = registry.getString( prefix + "password", value.getPassword() );
299 List<String> passwordList = registry.getList(prefix + "password");
300 String password = value.getPassword();
301 if (passwordList != null && !passwordList.isEmpty()) {
302 StringBuilder sb = new StringBuilder();
303 for (int i = 0, size = passwordList.size(); i < size; i++) {
304 sb.append(passwordList.get(i));
309 password = sb.toString();
312 value.setPassword(password);
313 int timeout = registry.getInt(prefix + "timeout", value.getTimeout());
314 value.setTimeout(timeout);
315 //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
317 List<String> refreshCronExpressionList = registry.getList(prefix + "refreshCronExpression");
318 String refreshCronExpression = value.getRefreshCronExpression();
319 if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty()) {
320 StringBuilder sb = new StringBuilder();
321 for (int i = 0, size = refreshCronExpressionList.size(); i < size; i++) {
322 sb.append(refreshCronExpressionList.get(i));
327 refreshCronExpression = sb.toString();
330 value.setRefreshCronExpression(refreshCronExpression);
331 boolean downloadRemoteIndex = registry.getBoolean(prefix + "downloadRemoteIndex", value.isDownloadRemoteIndex());
332 value.setDownloadRemoteIndex(downloadRemoteIndex);
333 //String remoteIndexUrl = registry.getString( prefix + "remoteIndexUrl", value.getRemoteIndexUrl() );
335 List<String> remoteIndexUrlList = registry.getList(prefix + "remoteIndexUrl");
336 String remoteIndexUrl = value.getRemoteIndexUrl();
337 if (remoteIndexUrlList != null && !remoteIndexUrlList.isEmpty()) {
338 StringBuilder sb = new StringBuilder();
339 for (int i = 0, size = remoteIndexUrlList.size(); i < size; i++) {
340 sb.append(remoteIndexUrlList.get(i));
345 remoteIndexUrl = sb.toString();
348 value.setRemoteIndexUrl(remoteIndexUrl);
349 //String remoteDownloadNetworkProxyId = registry.getString( prefix + "remoteDownloadNetworkProxyId", value.getRemoteDownloadNetworkProxyId() );
351 List<String> remoteDownloadNetworkProxyIdList = registry.getList(prefix + "remoteDownloadNetworkProxyId");
352 String remoteDownloadNetworkProxyId = value.getRemoteDownloadNetworkProxyId();
353 if (remoteDownloadNetworkProxyIdList != null && !remoteDownloadNetworkProxyIdList.isEmpty()) {
354 StringBuilder sb = new StringBuilder();
355 for (int i = 0, size = remoteDownloadNetworkProxyIdList.size(); i < size; i++) {
356 sb.append(remoteDownloadNetworkProxyIdList.get(i));
361 remoteDownloadNetworkProxyId = sb.toString();
364 value.setRemoteDownloadNetworkProxyId(remoteDownloadNetworkProxyId);
365 int remoteDownloadTimeout = registry.getInt(prefix + "remoteDownloadTimeout", value.getRemoteDownloadTimeout());
366 value.setRemoteDownloadTimeout(remoteDownloadTimeout);
367 boolean downloadRemoteIndexOnStartup = registry.getBoolean(prefix + "downloadRemoteIndexOnStartup", value.isDownloadRemoteIndexOnStartup());
368 value.setDownloadRemoteIndexOnStartup(downloadRemoteIndexOnStartup);
369 java.util.Map extraParameters = registry.getProperties(prefix + "extraParameters");
370 value.setExtraParameters(extraParameters);
371 java.util.Map extraHeaders = registry.getProperties(prefix + "extraHeaders");
372 value.setExtraHeaders(extraHeaders);
373 //String checkPath = registry.getString( prefix + "checkPath", value.getCheckPath() );
375 List<String> checkPathList = registry.getList(prefix + "checkPath");
376 String checkPath = value.getCheckPath();
377 if (checkPathList != null && !checkPathList.isEmpty()) {
378 StringBuilder sb = new StringBuilder();
379 for (int i = 0, size = checkPathList.size(); i < size; i++) {
380 sb.append(checkPathList.get(i));
385 checkPath = sb.toString();
388 value.setCheckPath(checkPath);
389 //String id = registry.getString( prefix + "id", value.getId() );
391 List<String> idList = registry.getList(prefix + "id");
392 String id = value.getId();
393 if (idList != null && !idList.isEmpty()) {
394 StringBuilder sb = new StringBuilder();
395 for (int i = 0, size = idList.size(); i < size; i++) {
396 sb.append(idList.get(i));
405 //String type = registry.getString( prefix + "type", value.getType() );
407 List<String> typeList = registry.getList(prefix + "type");
408 String type = value.getType();
409 if (typeList != null && !typeList.isEmpty()) {
410 StringBuilder sb = new StringBuilder();
411 for (int i = 0, size = typeList.size(); i < size; i++) {
412 sb.append(typeList.get(i));
417 type = sb.toString();
421 //String name = registry.getString( prefix + "name", value.getName() );
423 List<String> nameList = registry.getList(prefix + "name");
424 String name = value.getName();
425 if (nameList != null && !nameList.isEmpty()) {
426 StringBuilder sb = new StringBuilder();
427 for (int i = 0, size = nameList.size(); i < size; i++) {
428 sb.append(nameList.get(i));
433 name = sb.toString();
437 //String layout = registry.getString( prefix + "layout", value.getLayout() );
439 List<String> layoutList = registry.getList(prefix + "layout");
440 String layout = value.getLayout();
441 if (layoutList != null && !layoutList.isEmpty()) {
442 StringBuilder sb = new StringBuilder();
443 for (int i = 0, size = layoutList.size(); i < size; i++) {
444 sb.append(layoutList.get(i));
449 layout = sb.toString();
452 value.setLayout(layout);
453 //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
455 List<String> indexDirList = registry.getList(prefix + "indexDir");
456 String indexDir = value.getIndexDir();
457 if (indexDirList != null && !indexDirList.isEmpty()) {
458 StringBuilder sb = new StringBuilder();
459 for (int i = 0, size = indexDirList.size(); i < size; i++) {
460 sb.append(indexDirList.get(i));
465 indexDir = sb.toString();
468 value.setIndexDir(indexDir);
469 //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
471 List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
472 String packedIndexDir = value.getPackedIndexDir();
473 if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
474 StringBuilder sb = new StringBuilder();
475 for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
476 sb.append(packedIndexDirList.get(i));
481 packedIndexDir = sb.toString();
484 value.setPackedIndexDir(packedIndexDir);
485 //String description = registry.getString( prefix + "description", value.getDescription() );
487 List<String> descriptionList = registry.getList(prefix + "description");
488 String description = value.getDescription();
489 if (descriptionList != null && !descriptionList.isEmpty()) {
490 StringBuilder sb = new StringBuilder();
491 for (int i = 0, size = descriptionList.size(); i < size; i++) {
492 sb.append(descriptionList.get(i));
497 description = sb.toString();
500 value.setDescription(description);
505 private ManagedRepositoryConfiguration readManagedRepositoryConfiguration(String prefix, Registry registry) {
506 ManagedRepositoryConfiguration value = new ManagedRepositoryConfiguration();
508 //String location = registry.getString( prefix + "location", value.getLocation() );
510 List<String> locationList = registry.getList(prefix + "location");
511 String location = value.getLocation();
512 if (locationList != null && !locationList.isEmpty()) {
513 StringBuilder sb = new StringBuilder();
514 for (int i = 0, size = locationList.size(); i < size; i++) {
515 sb.append(locationList.get(i));
520 location = sb.toString();
523 value.setLocation(location);
524 boolean releases = registry.getBoolean(prefix + "releases", value.isReleases());
525 value.setReleases(releases);
526 boolean blockRedeployments = registry.getBoolean(prefix + "blockRedeployments", value.isBlockRedeployments());
527 value.setBlockRedeployments(blockRedeployments);
528 boolean snapshots = registry.getBoolean(prefix + "snapshots", value.isSnapshots());
529 value.setSnapshots(snapshots);
530 boolean scanned = registry.getBoolean(prefix + "scanned", value.isScanned());
531 value.setScanned(scanned);
532 //String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
534 List<String> refreshCronExpressionList = registry.getList(prefix + "refreshCronExpression");
535 String refreshCronExpression = value.getRefreshCronExpression();
536 if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty()) {
537 StringBuilder sb = new StringBuilder();
538 for (int i = 0, size = refreshCronExpressionList.size(); i < size; i++) {
539 sb.append(refreshCronExpressionList.get(i));
544 refreshCronExpression = sb.toString();
547 value.setRefreshCronExpression(refreshCronExpression);
548 int retentionCount = registry.getInt(prefix + "retentionCount", value.getRetentionCount());
549 value.setRetentionCount(retentionCount);
550 int retentionPeriod = registry.getInt(prefix + "retentionPeriod", value.getRetentionPeriod());
551 value.setRetentionPeriod(retentionPeriod);
552 boolean deleteReleasedSnapshots = registry.getBoolean(prefix + "deleteReleasedSnapshots", value.isDeleteReleasedSnapshots());
553 value.setDeleteReleasedSnapshots(deleteReleasedSnapshots);
554 boolean skipPackedIndexCreation = registry.getBoolean(prefix + "skipPackedIndexCreation", value.isSkipPackedIndexCreation());
555 value.setSkipPackedIndexCreation(skipPackedIndexCreation);
556 boolean stageRepoNeeded = registry.getBoolean(prefix + "stageRepoNeeded", value.isStageRepoNeeded());
557 value.setStageRepoNeeded(stageRepoNeeded);
558 //String id = registry.getString( prefix + "id", value.getId() );
560 List<String> idList = registry.getList(prefix + "id");
561 String id = value.getId();
562 if (idList != null && !idList.isEmpty()) {
563 StringBuilder sb = new StringBuilder();
564 for (int i = 0, size = idList.size(); i < size; i++) {
565 sb.append(idList.get(i));
574 //String type = registry.getString( prefix + "type", value.getType() );
576 List<String> typeList = registry.getList(prefix + "type");
577 String type = value.getType();
578 if (typeList != null && !typeList.isEmpty()) {
579 StringBuilder sb = new StringBuilder();
580 for (int i = 0, size = typeList.size(); i < size; i++) {
581 sb.append(typeList.get(i));
586 type = sb.toString();
590 //String name = registry.getString( prefix + "name", value.getName() );
592 List<String> nameList = registry.getList(prefix + "name");
593 String name = value.getName();
594 if (nameList != null && !nameList.isEmpty()) {
595 StringBuilder sb = new StringBuilder();
596 for (int i = 0, size = nameList.size(); i < size; i++) {
597 sb.append(nameList.get(i));
602 name = sb.toString();
606 //String layout = registry.getString( prefix + "layout", value.getLayout() );
608 List<String> layoutList = registry.getList(prefix + "layout");
609 String layout = value.getLayout();
610 if (layoutList != null && !layoutList.isEmpty()) {
611 StringBuilder sb = new StringBuilder();
612 for (int i = 0, size = layoutList.size(); i < size; i++) {
613 sb.append(layoutList.get(i));
618 layout = sb.toString();
621 value.setLayout(layout);
622 //String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
624 List<String> indexDirList = registry.getList(prefix + "indexDir");
625 String indexDir = value.getIndexDir();
626 if (indexDirList != null && !indexDirList.isEmpty()) {
627 StringBuilder sb = new StringBuilder();
628 for (int i = 0, size = indexDirList.size(); i < size; i++) {
629 sb.append(indexDirList.get(i));
634 indexDir = sb.toString();
637 value.setIndexDir(indexDir);
638 //String packedIndexDir = registry.getString( prefix + "packedIndexDir", value.getPackedIndexDir() );
640 List<String> packedIndexDirList = registry.getList(prefix + "packedIndexDir");
641 String packedIndexDir = value.getPackedIndexDir();
642 if (packedIndexDirList != null && !packedIndexDirList.isEmpty()) {
643 StringBuilder sb = new StringBuilder();
644 for (int i = 0, size = packedIndexDirList.size(); i < size; i++) {
645 sb.append(packedIndexDirList.get(i));
650 packedIndexDir = sb.toString();
653 value.setPackedIndexDir(packedIndexDir);
654 //String description = registry.getString( prefix + "description", value.getDescription() );
656 List<String> descriptionList = registry.getList(prefix + "description");
657 String description = value.getDescription();
658 if (descriptionList != null && !descriptionList.isEmpty()) {
659 StringBuilder sb = new StringBuilder();
660 for (int i = 0, size = descriptionList.size(); i < size; i++) {
661 sb.append(descriptionList.get(i));
666 description = sb.toString();
669 value.setDescription(description);
674 private LegacyArtifactPath readLegacyArtifactPath(String prefix, Registry registry) {
675 LegacyArtifactPath value = new LegacyArtifactPath();
677 //String path = registry.getString( prefix + "path", value.getPath() );
679 List<String> pathList = registry.getList(prefix + "path");
680 String path = value.getPath();
681 if (pathList != null && !pathList.isEmpty()) {
682 StringBuilder sb = new StringBuilder();
683 for (int i = 0, size = pathList.size(); i < size; i++) {
684 sb.append(pathList.get(i));
689 path = sb.toString();
693 //String artifact = registry.getString( prefix + "artifact", value.getArtifact() );
695 List<String> artifactList = registry.getList(prefix + "artifact");
696 String artifact = value.getArtifact();
697 if (artifactList != null && !artifactList.isEmpty()) {
698 StringBuilder sb = new StringBuilder();
699 for (int i = 0, size = artifactList.size(); i < size; i++) {
700 sb.append(artifactList.get(i));
705 artifact = sb.toString();
708 value.setArtifact(artifact);
713 private RepositoryGroupConfiguration readRepositoryGroupConfiguration(String prefix, Registry registry) {
714 RepositoryGroupConfiguration value = new RepositoryGroupConfiguration();
716 //String id = registry.getString( prefix + "id", value.getId() );
718 List<String> idList = registry.getList(prefix + "id");
719 String id = value.getId();
720 if (idList != null && !idList.isEmpty()) {
721 StringBuilder sb = new StringBuilder();
722 for (int i = 0, size = idList.size(); i < size; i++) {
723 sb.append(idList.get(i));
732 //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() );
734 List<String> mergedIndexPathList = registry.getList(prefix + "mergedIndexPath");
735 String mergedIndexPath = value.getMergedIndexPath();
736 if (mergedIndexPathList != null && !mergedIndexPathList.isEmpty()) {
737 StringBuilder sb = new StringBuilder();
738 for (int i = 0, size = mergedIndexPathList.size(); i < size; i++) {
739 sb.append(mergedIndexPathList.get(i));
744 mergedIndexPath = sb.toString();
747 value.setMergedIndexPath(mergedIndexPath);
748 int mergedIndexTtl = registry.getInt(prefix + "mergedIndexTtl", value.getMergedIndexTtl());
749 value.setMergedIndexTtl(mergedIndexTtl);
750 //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
752 List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
753 String cronExpression = value.getCronExpression();
754 if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
755 StringBuilder sb = new StringBuilder();
756 for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
757 sb.append(cronExpressionList.get(i));
762 cronExpression = sb.toString();
765 value.setCronExpression(cronExpression);
766 java.util.List repositories = new java.util.ArrayList/*<String>*/();
767 repositories.addAll(registry.getList(prefix + "repositories.repository"));
768 value.setRepositories(repositories);
773 private RepositoryCheckPath readRepositoryCheckPath(String prefix, Registry registry) {
774 RepositoryCheckPath value = new RepositoryCheckPath();
776 //String url = registry.getString( prefix + "url", value.getUrl() );
778 List<String> urlList = registry.getList(prefix + "url");
779 String url = value.getUrl();
780 if (urlList != null && !urlList.isEmpty()) {
781 StringBuilder sb = new StringBuilder();
782 for (int i = 0, size = urlList.size(); i < size; i++) {
783 sb.append(urlList.get(i));
792 //String path = registry.getString( prefix + "path", value.getPath() );
794 List<String> pathList = registry.getList(prefix + "path");
795 String path = value.getPath();
796 if (pathList != null && !pathList.isEmpty()) {
797 StringBuilder sb = new StringBuilder();
798 for (int i = 0, size = pathList.size(); i < size; i++) {
799 sb.append(pathList.get(i));
804 path = sb.toString();
812 private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration(String prefix, Registry registry) {
813 AbstractRepositoryConnectorConfiguration value = new AbstractRepositoryConnectorConfiguration();
815 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
817 List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
818 String sourceRepoId = value.getSourceRepoId();
819 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
820 StringBuilder sb = new StringBuilder();
821 for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
822 sb.append(sourceRepoIdList.get(i));
827 sourceRepoId = sb.toString();
830 value.setSourceRepoId(sourceRepoId);
831 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
833 List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
834 String targetRepoId = value.getTargetRepoId();
835 if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
836 StringBuilder sb = new StringBuilder();
837 for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
838 sb.append(targetRepoIdList.get(i));
843 targetRepoId = sb.toString();
846 value.setTargetRepoId(targetRepoId);
847 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
849 List<String> proxyIdList = registry.getList(prefix + "proxyId");
850 String proxyId = value.getProxyId();
851 if (proxyIdList != null && !proxyIdList.isEmpty()) {
852 StringBuilder sb = new StringBuilder();
853 for (int i = 0, size = proxyIdList.size(); i < size; i++) {
854 sb.append(proxyIdList.get(i));
859 proxyId = sb.toString();
862 value.setProxyId(proxyId);
863 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
864 blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
865 value.setBlackListPatterns(blackListPatterns);
866 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
867 whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
868 value.setWhiteListPatterns(whiteListPatterns);
869 java.util.Map policies = registry.getProperties(prefix + "policies");
870 value.setPolicies(policies);
871 java.util.Map properties = registry.getProperties(prefix + "properties");
872 value.setProperties(properties);
873 boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
874 value.setDisabled(disabled);
879 private ProxyConnectorRuleConfiguration readProxyConnectorRuleConfiguration(String prefix, Registry registry) {
880 ProxyConnectorRuleConfiguration value = new ProxyConnectorRuleConfiguration();
882 //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() );
884 List<String> ruleTypeList = registry.getList(prefix + "ruleType");
885 String ruleType = value.getRuleType();
886 if (ruleTypeList != null && !ruleTypeList.isEmpty()) {
887 StringBuilder sb = new StringBuilder();
888 for (int i = 0, size = ruleTypeList.size(); i < size; i++) {
889 sb.append(ruleTypeList.get(i));
894 ruleType = sb.toString();
897 value.setRuleType(ruleType);
898 //String pattern = registry.getString( prefix + "pattern", value.getPattern() );
900 List<String> patternList = registry.getList(prefix + "pattern");
901 String pattern = value.getPattern();
902 if (patternList != null && !patternList.isEmpty()) {
903 StringBuilder sb = new StringBuilder();
904 for (int i = 0, size = patternList.size(); i < size; i++) {
905 sb.append(patternList.get(i));
910 pattern = sb.toString();
913 value.setPattern(pattern);
914 java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
915 List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
916 for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
917 ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
918 proxyConnectors.add(v);
920 value.setProxyConnectors(proxyConnectors);
925 private ProxyConnectorConfiguration readProxyConnectorConfiguration(String prefix, Registry registry) {
926 ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();
928 int order = registry.getInt(prefix + "order", value.getOrder());
929 value.setOrder(order);
930 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
932 List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
933 String sourceRepoId = value.getSourceRepoId();
934 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
935 StringBuilder sb = new StringBuilder();
936 for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
937 sb.append(sourceRepoIdList.get(i));
942 sourceRepoId = sb.toString();
945 value.setSourceRepoId(sourceRepoId);
946 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
948 List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
949 String targetRepoId = value.getTargetRepoId();
950 if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
951 StringBuilder sb = new StringBuilder();
952 for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
953 sb.append(targetRepoIdList.get(i));
958 targetRepoId = sb.toString();
961 value.setTargetRepoId(targetRepoId);
962 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
964 List<String> proxyIdList = registry.getList(prefix + "proxyId");
965 String proxyId = value.getProxyId();
966 if (proxyIdList != null && !proxyIdList.isEmpty()) {
967 StringBuilder sb = new StringBuilder();
968 for (int i = 0, size = proxyIdList.size(); i < size; i++) {
969 sb.append(proxyIdList.get(i));
974 proxyId = sb.toString();
977 value.setProxyId(proxyId);
978 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
979 blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
980 value.setBlackListPatterns(blackListPatterns);
981 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
982 whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
983 value.setWhiteListPatterns(whiteListPatterns);
984 java.util.Map policies = registry.getProperties(prefix + "policies");
985 value.setPolicies(policies);
986 java.util.Map properties = registry.getProperties(prefix + "properties");
987 value.setProperties(properties);
988 boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
989 value.setDisabled(disabled);
994 private SyncConnectorConfiguration readSyncConnectorConfiguration(String prefix, Registry registry) {
995 SyncConnectorConfiguration value = new SyncConnectorConfiguration();
997 //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
999 List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
1000 String cronExpression = value.getCronExpression();
1001 if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
1002 StringBuilder sb = new StringBuilder();
1003 for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
1004 sb.append(cronExpressionList.get(i));
1009 cronExpression = sb.toString();
1012 value.setCronExpression(cronExpression);
1013 //String method = registry.getString( prefix + "method", value.getMethod() );
1015 List<String> methodList = registry.getList(prefix + "method");
1016 String method = value.getMethod();
1017 if (methodList != null && !methodList.isEmpty()) {
1018 StringBuilder sb = new StringBuilder();
1019 for (int i = 0, size = methodList.size(); i < size; i++) {
1020 sb.append(methodList.get(i));
1025 method = sb.toString();
1028 value.setMethod(method);
1029 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
1031 List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
1032 String sourceRepoId = value.getSourceRepoId();
1033 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
1034 StringBuilder sb = new StringBuilder();
1035 for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
1036 sb.append(sourceRepoIdList.get(i));
1041 sourceRepoId = sb.toString();
1044 value.setSourceRepoId(sourceRepoId);
1045 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
1047 List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
1048 String targetRepoId = value.getTargetRepoId();
1049 if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
1050 StringBuilder sb = new StringBuilder();
1051 for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
1052 sb.append(targetRepoIdList.get(i));
1057 targetRepoId = sb.toString();
1060 value.setTargetRepoId(targetRepoId);
1061 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1063 List<String> proxyIdList = registry.getList(prefix + "proxyId");
1064 String proxyId = value.getProxyId();
1065 if (proxyIdList != null && !proxyIdList.isEmpty()) {
1066 StringBuilder sb = new StringBuilder();
1067 for (int i = 0, size = proxyIdList.size(); i < size; i++) {
1068 sb.append(proxyIdList.get(i));
1073 proxyId = sb.toString();
1076 value.setProxyId(proxyId);
1077 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1078 blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
1079 value.setBlackListPatterns(blackListPatterns);
1080 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1081 whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
1082 value.setWhiteListPatterns(whiteListPatterns);
1083 java.util.Map policies = registry.getProperties(prefix + "policies");
1084 value.setPolicies(policies);
1085 java.util.Map properties = registry.getProperties(prefix + "properties");
1086 value.setProperties(properties);
1087 boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
1088 value.setDisabled(disabled);
1093 private NetworkProxyConfiguration readNetworkProxyConfiguration(String prefix, Registry registry) {
1094 NetworkProxyConfiguration value = new NetworkProxyConfiguration();
1096 //String id = registry.getString( prefix + "id", value.getId() );
1098 List<String> idList = registry.getList(prefix + "id");
1099 String id = value.getId();
1100 if (idList != null && !idList.isEmpty()) {
1101 StringBuilder sb = new StringBuilder();
1102 for (int i = 0, size = idList.size(); i < size; i++) {
1103 sb.append(idList.get(i));
1112 //String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
1114 List<String> protocolList = registry.getList(prefix + "protocol");
1115 String protocol = value.getProtocol();
1116 if (protocolList != null && !protocolList.isEmpty()) {
1117 StringBuilder sb = new StringBuilder();
1118 for (int i = 0, size = protocolList.size(); i < size; i++) {
1119 sb.append(protocolList.get(i));
1124 protocol = sb.toString();
1127 value.setProtocol(protocol);
1128 //String host = registry.getString( prefix + "host", value.getHost() );
1130 List<String> hostList = registry.getList(prefix + "host");
1131 String host = value.getHost();
1132 if (hostList != null && !hostList.isEmpty()) {
1133 StringBuilder sb = new StringBuilder();
1134 for (int i = 0, size = hostList.size(); i < size; i++) {
1135 sb.append(hostList.get(i));
1140 host = sb.toString();
1143 value.setHost(host);
1144 int port = registry.getInt(prefix + "port", value.getPort());
1145 value.setPort(port);
1146 //String username = registry.getString( prefix + "username", value.getUsername() );
1148 List<String> usernameList = registry.getList(prefix + "username");
1149 String username = value.getUsername();
1150 if (usernameList != null && !usernameList.isEmpty()) {
1151 StringBuilder sb = new StringBuilder();
1152 for (int i = 0, size = usernameList.size(); i < size; i++) {
1153 sb.append(usernameList.get(i));
1158 username = sb.toString();
1161 value.setUsername(username);
1162 //String password = registry.getString( prefix + "password", value.getPassword() );
1164 List<String> passwordList = registry.getList(prefix + "password");
1165 String password = value.getPassword();
1166 if (passwordList != null && !passwordList.isEmpty()) {
1167 StringBuilder sb = new StringBuilder();
1168 for (int i = 0, size = passwordList.size(); i < size; i++) {
1169 sb.append(passwordList.get(i));
1174 password = sb.toString();
1177 value.setPassword(password);
1178 boolean useNtlm = registry.getBoolean(prefix + "useNtlm", value.isUseNtlm());
1179 value.setUseNtlm(useNtlm);
1184 private RepositoryScanningConfiguration readRepositoryScanningConfiguration(String prefix, Registry registry) {
1185 RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();
1187 java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
1188 List fileTypesSubsets = registry.getSubsetList(prefix + "fileTypes.fileType");
1189 for (Iterator i = fileTypesSubsets.iterator(); i.hasNext(); ) {
1190 FileType v = readFileType("", (Registry) i.next());
1193 value.setFileTypes(fileTypes);
1194 java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
1195 knownContentConsumers.addAll(registry.getList(prefix + "knownContentConsumers.knownContentConsumer"));
1196 value.setKnownContentConsumers(knownContentConsumers);
1197 java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
1198 invalidContentConsumers.addAll(registry.getList(prefix + "invalidContentConsumers.invalidContentConsumer"));
1199 value.setInvalidContentConsumers(invalidContentConsumers);
1204 private FileType readFileType(String prefix, Registry registry) {
1205 FileType value = new FileType();
1207 //String id = registry.getString( prefix + "id", value.getId() );
1209 List<String> idList = registry.getList(prefix + "id");
1210 String id = value.getId();
1211 if (idList != null && !idList.isEmpty()) {
1212 StringBuilder sb = new StringBuilder();
1213 for (int i = 0, size = idList.size(); i < size; i++) {
1214 sb.append(idList.get(i));
1223 java.util.List patterns = new java.util.ArrayList/*<String>*/();
1224 patterns.addAll(registry.getList(prefix + "patterns.pattern"));
1225 value.setPatterns(patterns);
1230 private OrganisationInformation readOrganisationInformation(String prefix, Registry registry) {
1231 OrganisationInformation value = new OrganisationInformation();
1233 //String name = registry.getString( prefix + "name", value.getName() );
1235 List<String> nameList = registry.getList(prefix + "name");
1236 String name = value.getName();
1237 if (nameList != null && !nameList.isEmpty()) {
1238 StringBuilder sb = new StringBuilder();
1239 for (int i = 0, size = nameList.size(); i < size; i++) {
1240 sb.append(nameList.get(i));
1245 name = sb.toString();
1248 value.setName(name);
1249 //String url = registry.getString( prefix + "url", value.getUrl() );
1251 List<String> urlList = registry.getList(prefix + "url");
1252 String url = value.getUrl();
1253 if (urlList != null && !urlList.isEmpty()) {
1254 StringBuilder sb = new StringBuilder();
1255 for (int i = 0, size = urlList.size(); i < size; i++) {
1256 sb.append(urlList.get(i));
1261 url = sb.toString();
1265 //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() );
1267 List<String> logoLocationList = registry.getList(prefix + "logoLocation");
1268 String logoLocation = value.getLogoLocation();
1269 if (logoLocationList != null && !logoLocationList.isEmpty()) {
1270 StringBuilder sb = new StringBuilder();
1271 for (int i = 0, size = logoLocationList.size(); i < size; i++) {
1272 sb.append(logoLocationList.get(i));
1277 logoLocation = sb.toString();
1280 value.setLogoLocation(logoLocation);
1285 private WebappConfiguration readWebappConfiguration(String prefix, Registry registry) {
1286 WebappConfiguration value = new WebappConfiguration();
1288 UserInterfaceOptions ui = readUserInterfaceOptions(prefix + "ui.", registry);
1294 private UserInterfaceOptions readUserInterfaceOptions(String prefix, Registry registry) {
1295 UserInterfaceOptions value = new UserInterfaceOptions();
1297 boolean showFindArtifacts = registry.getBoolean(prefix + "showFindArtifacts", value.isShowFindArtifacts());
1298 value.setShowFindArtifacts(showFindArtifacts);
1299 boolean appletFindEnabled = registry.getBoolean(prefix + "appletFindEnabled", value.isAppletFindEnabled());
1300 value.setAppletFindEnabled(appletFindEnabled);
1301 boolean disableEasterEggs = registry.getBoolean(prefix + "disableEasterEggs", value.isDisableEasterEggs());
1302 value.setDisableEasterEggs(disableEasterEggs);
1303 //String applicationUrl = registry.getString( prefix + "applicationUrl", value.getApplicationUrl() );
1305 List<String> applicationUrlList = registry.getList(prefix + "applicationUrl");
1306 String applicationUrl = value.getApplicationUrl();
1307 if (applicationUrlList != null && !applicationUrlList.isEmpty()) {
1308 StringBuilder sb = new StringBuilder();
1309 for (int i = 0, size = applicationUrlList.size(); i < size; i++) {
1310 sb.append(applicationUrlList.get(i));
1315 applicationUrl = sb.toString();
1318 value.setApplicationUrl(applicationUrl);
1319 boolean disableRegistration = registry.getBoolean(prefix + "disableRegistration", value.isDisableRegistration());
1320 value.setDisableRegistration(disableRegistration);
1325 private NetworkConfiguration readNetworkConfiguration(String prefix, Registry registry) {
1326 NetworkConfiguration value = new NetworkConfiguration();
1328 int maxTotal = registry.getInt(prefix + "maxTotal", value.getMaxTotal());
1329 value.setMaxTotal(maxTotal);
1330 int maxTotalPerHost = registry.getInt(prefix + "maxTotalPerHost", value.getMaxTotalPerHost());
1331 value.setMaxTotalPerHost(maxTotalPerHost);
1332 boolean usePooling = registry.getBoolean(prefix + "usePooling", value.isUsePooling());
1333 value.setUsePooling(usePooling);
1338 private ArchivaRuntimeConfiguration readArchivaRuntimeConfiguration(String prefix, Registry registry) {
1339 ArchivaRuntimeConfiguration value = new ArchivaRuntimeConfiguration();
1341 CacheConfiguration urlFailureCacheConfiguration = readCacheConfiguration(prefix + "urlFailureCacheConfiguration.", registry);
1342 value.setUrlFailureCacheConfiguration(urlFailureCacheConfiguration);
1343 FileLockConfiguration fileLockConfiguration = readFileLockConfiguration(prefix + "fileLockConfiguration.", registry);
1344 value.setFileLockConfiguration(fileLockConfiguration);
1345 //String dataDirectory = registry.getString( prefix + "dataDirectory", value.getDataDirectory() );
1347 List<String> dataDirectoryList = registry.getList(prefix + "dataDirectory");
1348 String dataDirectory = value.getDataDirectory();
1349 if (dataDirectoryList != null && !dataDirectoryList.isEmpty()) {
1350 StringBuilder sb = new StringBuilder();
1351 for (int i = 0, size = dataDirectoryList.size(); i < size; i++) {
1352 sb.append(dataDirectoryList.get(i));
1357 dataDirectory = sb.toString();
1360 value.setDataDirectory(dataDirectory);
1361 //String repositoryBaseDirectory = registry.getString( prefix + "repositoryBaseDirectory", value.getRepositoryBaseDirectory() );
1363 List<String> repositoryBaseDirectoryList = registry.getList(prefix + "repositoryBaseDirectory");
1364 String repositoryBaseDirectory = value.getRepositoryBaseDirectory();
1365 if (repositoryBaseDirectoryList != null && !repositoryBaseDirectoryList.isEmpty()) {
1366 StringBuilder sb = new StringBuilder();
1367 for (int i = 0, size = repositoryBaseDirectoryList.size(); i < size; i++) {
1368 sb.append(repositoryBaseDirectoryList.get(i));
1373 repositoryBaseDirectory = sb.toString();
1376 value.setRepositoryBaseDirectory(repositoryBaseDirectory);
1377 //String remoteRepositoryBaseDirectory = registry.getString( prefix + "remoteRepositoryBaseDirectory", value.getRemoteRepositoryBaseDirectory() );
1379 List<String> remoteRepositoryBaseDirectoryList = registry.getList(prefix + "remoteRepositoryBaseDirectory");
1380 String remoteRepositoryBaseDirectory = value.getRemoteRepositoryBaseDirectory();
1381 if (remoteRepositoryBaseDirectoryList != null && !remoteRepositoryBaseDirectoryList.isEmpty()) {
1382 StringBuilder sb = new StringBuilder();
1383 for (int i = 0, size = remoteRepositoryBaseDirectoryList.size(); i < size; i++) {
1384 sb.append(remoteRepositoryBaseDirectoryList.get(i));
1389 remoteRepositoryBaseDirectory = sb.toString();
1392 value.setRemoteRepositoryBaseDirectory(remoteRepositoryBaseDirectory);
1393 //String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() );
1395 List<String> defaultLanguageList = registry.getList(prefix + "defaultLanguage");
1396 String defaultLanguage = value.getDefaultLanguage();
1397 if (defaultLanguageList != null && !defaultLanguageList.isEmpty()) {
1398 StringBuilder sb = new StringBuilder();
1399 for (int i = 0, size = defaultLanguageList.size(); i < size; i++) {
1400 sb.append(defaultLanguageList.get(i));
1405 defaultLanguage = sb.toString();
1408 value.setDefaultLanguage(defaultLanguage);
1409 //String languageRange = registry.getString( prefix + "languageRange", value.getLanguageRange() );
1411 List<String> languageRangeList = registry.getList(prefix + "languageRange");
1412 String languageRange = value.getLanguageRange();
1413 if (languageRangeList != null && !languageRangeList.isEmpty()) {
1414 StringBuilder sb = new StringBuilder();
1415 for (int i = 0, size = languageRangeList.size(); i < size; i++) {
1416 sb.append(languageRangeList.get(i));
1421 languageRange = sb.toString();
1424 value.setLanguageRange(languageRange);
1426 List<String> checksumTypeList = registry.getList(prefix + "checksumTypes.type");
1427 value.setChecksumTypes(checksumTypeList);
1432 private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration(String prefix, Registry registry) {
1433 RedbackRuntimeConfiguration value = new RedbackRuntimeConfiguration();
1435 boolean migratedFromRedbackConfiguration = registry.getBoolean(prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration());
1436 value.setMigratedFromRedbackConfiguration(migratedFromRedbackConfiguration);
1437 java.util.List userManagerImpls = new java.util.ArrayList/*<String>*/();
1438 userManagerImpls.addAll(registry.getList(prefix + "userManagerImpls.userManagerImpl"));
1439 value.setUserManagerImpls(userManagerImpls);
1440 java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
1441 rbacManagerImpls.addAll(registry.getList(prefix + "rbacManagerImpls.rbacManagerImpl"));
1442 value.setRbacManagerImpls(rbacManagerImpls);
1443 LdapConfiguration ldapConfiguration = readLdapConfiguration(prefix + "ldapConfiguration.", registry);
1444 value.setLdapConfiguration(ldapConfiguration);
1445 java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
1446 List ldapGroupMappingsSubsets = registry.getSubsetList(prefix + "ldapGroupMappings.ldapGroupMapping");
1447 for (Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); ) {
1448 LdapGroupMapping v = readLdapGroupMapping("", (Registry) i.next());
1449 ldapGroupMappings.add(v);
1451 value.setLdapGroupMappings(ldapGroupMappings);
1452 java.util.Map configurationProperties = registry.getProperties(prefix + "configurationProperties");
1453 value.setConfigurationProperties(configurationProperties);
1454 boolean useUsersCache = registry.getBoolean(prefix + "useUsersCache", value.isUseUsersCache());
1455 value.setUseUsersCache(useUsersCache);
1456 CacheConfiguration usersCacheConfiguration = readCacheConfiguration(prefix + "usersCacheConfiguration.", registry);
1457 value.setUsersCacheConfiguration(usersCacheConfiguration);
1462 private ArchivaDefaultConfiguration readArchivaDefaultConfiguration(String prefix, Registry registry) {
1463 ArchivaDefaultConfiguration value = new ArchivaDefaultConfiguration();
1465 java.util.List defaultCheckPaths = new java.util.ArrayList/*<RepositoryCheckPath>*/();
1466 List defaultCheckPathsSubsets = registry.getSubsetList(prefix + "defaultCheckPaths.defaultCheckPath");
1467 for (Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); ) {
1468 RepositoryCheckPath v = readRepositoryCheckPath("", (Registry) i.next());
1469 defaultCheckPaths.add(v);
1471 value.setDefaultCheckPaths(defaultCheckPaths);
1476 private LdapConfiguration readLdapConfiguration(String prefix, Registry registry) {
1477 LdapConfiguration value = new LdapConfiguration();
1479 //String hostName = registry.getString( prefix + "hostName", value.getHostName() );
1481 List<String> hostNameList = registry.getList(prefix + "hostName");
1482 String hostName = value.getHostName();
1483 if (hostNameList != null && !hostNameList.isEmpty()) {
1484 StringBuilder sb = new StringBuilder();
1485 for (int i = 0, size = hostNameList.size(); i < size; i++) {
1486 sb.append(hostNameList.get(i));
1491 hostName = sb.toString();
1494 value.setHostName(hostName);
1495 int port = registry.getInt(prefix + "port", value.getPort());
1496 value.setPort(port);
1497 boolean ssl = registry.getBoolean(prefix + "ssl", value.isSsl());
1499 //String baseDn = registry.getString( prefix + "baseDn", value.getBaseDn() );
1501 List<String> baseDnList = registry.getList(prefix + "baseDn");
1502 String baseDn = value.getBaseDn();
1503 if (baseDnList != null && !baseDnList.isEmpty()) {
1504 StringBuilder sb = new StringBuilder();
1505 for (int i = 0, size = baseDnList.size(); i < size; i++) {
1506 sb.append(baseDnList.get(i));
1511 baseDn = sb.toString();
1514 value.setBaseDn(baseDn);
1515 //String baseGroupsDn = registry.getString( prefix + "baseGroupsDn", value.getBaseGroupsDn() );
1517 List<String> baseGroupsDnList = registry.getList(prefix + "baseGroupsDn");
1518 String baseGroupsDn = value.getBaseGroupsDn();
1519 if (baseGroupsDnList != null && !baseGroupsDnList.isEmpty()) {
1520 StringBuilder sb = new StringBuilder();
1521 for (int i = 0, size = baseGroupsDnList.size(); i < size; i++) {
1522 sb.append(baseGroupsDnList.get(i));
1527 baseGroupsDn = sb.toString();
1530 value.setBaseGroupsDn(baseGroupsDn);
1531 //String contextFactory = registry.getString( prefix + "contextFactory", value.getContextFactory() );
1533 List<String> contextFactoryList = registry.getList(prefix + "contextFactory");
1534 String contextFactory = value.getContextFactory();
1535 if (contextFactoryList != null && !contextFactoryList.isEmpty()) {
1536 StringBuilder sb = new StringBuilder();
1537 for (int i = 0, size = contextFactoryList.size(); i < size; i++) {
1538 sb.append(contextFactoryList.get(i));
1543 contextFactory = sb.toString();
1546 value.setContextFactory(contextFactory);
1547 //String bindDn = registry.getString( prefix + "bindDn", value.getBindDn() );
1549 List<String> bindDnList = registry.getList(prefix + "bindDn");
1550 String bindDn = value.getBindDn();
1551 if (bindDnList != null && !bindDnList.isEmpty()) {
1552 StringBuilder sb = new StringBuilder();
1553 for (int i = 0, size = bindDnList.size(); i < size; i++) {
1554 sb.append(bindDnList.get(i));
1559 bindDn = sb.toString();
1562 value.setBindDn(bindDn);
1563 //String password = registry.getString( prefix + "password", value.getPassword() );
1565 List<String> passwordList = registry.getList(prefix + "password");
1566 String password = value.getPassword();
1567 if (passwordList != null && !passwordList.isEmpty()) {
1568 StringBuilder sb = new StringBuilder();
1569 for (int i = 0, size = passwordList.size(); i < size; i++) {
1570 sb.append(passwordList.get(i));
1575 password = sb.toString();
1578 value.setPassword(password);
1579 //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() );
1581 List<String> authenticationMethodList = registry.getList(prefix + "authenticationMethod");
1582 String authenticationMethod = value.getAuthenticationMethod();
1583 if (authenticationMethodList != null && !authenticationMethodList.isEmpty()) {
1584 StringBuilder sb = new StringBuilder();
1585 for (int i = 0, size = authenticationMethodList.size(); i < size; i++) {
1586 sb.append(authenticationMethodList.get(i));
1591 authenticationMethod = sb.toString();
1594 value.setAuthenticationMethod(authenticationMethod);
1595 boolean bindAuthenticatorEnabled = registry.getBoolean(prefix + "bindAuthenticatorEnabled", value.isBindAuthenticatorEnabled());
1596 value.setBindAuthenticatorEnabled(bindAuthenticatorEnabled);
1597 boolean writable = registry.getBoolean(prefix + "writable", value.isWritable());
1598 value.setWritable(writable);
1599 boolean useRoleNameAsGroup = registry.getBoolean(prefix + "useRoleNameAsGroup", value.isUseRoleNameAsGroup());
1600 value.setUseRoleNameAsGroup(useRoleNameAsGroup);
1601 java.util.Map extraProperties = registry.getProperties(prefix + "extraProperties");
1602 value.setExtraProperties(extraProperties);
1607 private FileLockConfiguration readFileLockConfiguration(String prefix, Registry registry) {
1608 FileLockConfiguration value = new FileLockConfiguration();
1610 boolean skipLocking = registry.getBoolean(prefix + "skipLocking", value.isSkipLocking());
1611 value.setSkipLocking(skipLocking);
1612 int lockingTimeout = registry.getInt(prefix + "lockingTimeout", value.getLockingTimeout());
1613 value.setLockingTimeout(lockingTimeout);
1618 private CacheConfiguration readCacheConfiguration(String prefix, Registry registry) {
1619 CacheConfiguration value = new CacheConfiguration();
1621 int timeToIdleSeconds = registry.getInt(prefix + "timeToIdleSeconds", value.getTimeToIdleSeconds());
1622 value.setTimeToIdleSeconds(timeToIdleSeconds);
1623 int timeToLiveSeconds = registry.getInt(prefix + "timeToLiveSeconds", value.getTimeToLiveSeconds());
1624 value.setTimeToLiveSeconds(timeToLiveSeconds);
1625 int maxElementsInMemory = registry.getInt(prefix + "maxElementsInMemory", value.getMaxElementsInMemory());
1626 value.setMaxElementsInMemory(maxElementsInMemory);
1627 int maxElementsOnDisk = registry.getInt(prefix + "maxElementsOnDisk", value.getMaxElementsOnDisk());
1628 value.setMaxElementsOnDisk(maxElementsOnDisk);
1633 private LdapGroupMapping readLdapGroupMapping(String prefix, Registry registry) {
1634 LdapGroupMapping value = new LdapGroupMapping();
1636 //String group = registry.getString( prefix + "group", value.getGroup() );
1638 List<String> groupList = registry.getList(prefix + "group");
1639 String group = value.getGroup();
1640 if (groupList != null && !groupList.isEmpty()) {
1641 StringBuilder sb = new StringBuilder();
1642 for (int i = 0, size = groupList.size(); i < size; i++) {
1643 sb.append(groupList.get(i));
1648 group = sb.toString();
1651 value.setGroup(group);
1652 java.util.List roleNames = new java.util.ArrayList/*<String>*/();
1653 roleNames.addAll(registry.getList(prefix + "roleNames.roleName"));
1654 value.setRoleNames(roleNames);