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.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));
733 value.setName(registry.getString(prefix + "name"));
734 value.setType(registry.getString(prefix + "type"));
736 //String mergedIndexPath = registry.getString( prefix + "mergedIndexPath", value.getMergedIndexPath() );
738 List<String> mergedIndexPathList = registry.getList(prefix + "mergedIndexPath");
739 String mergedIndexPath = value.getMergedIndexPath();
740 if (mergedIndexPathList != null && !mergedIndexPathList.isEmpty()) {
741 StringBuilder sb = new StringBuilder();
742 for (int i = 0, size = mergedIndexPathList.size(); i < size; i++) {
743 sb.append(mergedIndexPathList.get(i));
748 mergedIndexPath = sb.toString();
751 value.setMergedIndexPath(mergedIndexPath);
752 int mergedIndexTtl = registry.getInt(prefix + "mergedIndexTtl", value.getMergedIndexTtl());
753 value.setMergedIndexTtl(mergedIndexTtl);
754 //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
756 value.setLocation( registry.getString( prefix + "location" ) );
758 List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
759 String cronExpression = value.getCronExpression();
760 if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
761 StringBuilder sb = new StringBuilder();
762 for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
763 sb.append(cronExpressionList.get(i));
768 cronExpression = sb.toString();
771 value.setCronExpression(cronExpression);
772 java.util.List repositories = new java.util.ArrayList/*<String>*/();
773 repositories.addAll(registry.getList(prefix + "repositories.repository"));
774 value.setRepositories(repositories);
779 private RepositoryCheckPath readRepositoryCheckPath(String prefix, Registry registry) {
780 RepositoryCheckPath value = new RepositoryCheckPath();
782 //String url = registry.getString( prefix + "url", value.getUrl() );
784 List<String> urlList = registry.getList(prefix + "url");
785 String url = value.getUrl();
786 if (urlList != null && !urlList.isEmpty()) {
787 StringBuilder sb = new StringBuilder();
788 for (int i = 0, size = urlList.size(); i < size; i++) {
789 sb.append(urlList.get(i));
798 //String path = registry.getString( prefix + "path", value.getPath() );
800 List<String> pathList = registry.getList(prefix + "path");
801 String path = value.getPath();
802 if (pathList != null && !pathList.isEmpty()) {
803 StringBuilder sb = new StringBuilder();
804 for (int i = 0, size = pathList.size(); i < size; i++) {
805 sb.append(pathList.get(i));
810 path = sb.toString();
818 private AbstractRepositoryConnectorConfiguration readAbstractRepositoryConnectorConfiguration(String prefix, Registry registry) {
819 AbstractRepositoryConnectorConfiguration value = new AbstractRepositoryConnectorConfiguration();
821 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
823 List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
824 String sourceRepoId = value.getSourceRepoId();
825 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
826 StringBuilder sb = new StringBuilder();
827 for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
828 sb.append(sourceRepoIdList.get(i));
833 sourceRepoId = sb.toString();
836 value.setSourceRepoId(sourceRepoId);
837 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
839 List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
840 String targetRepoId = value.getTargetRepoId();
841 if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
842 StringBuilder sb = new StringBuilder();
843 for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
844 sb.append(targetRepoIdList.get(i));
849 targetRepoId = sb.toString();
852 value.setTargetRepoId(targetRepoId);
853 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
855 List<String> proxyIdList = registry.getList(prefix + "proxyId");
856 String proxyId = value.getProxyId();
857 if (proxyIdList != null && !proxyIdList.isEmpty()) {
858 StringBuilder sb = new StringBuilder();
859 for (int i = 0, size = proxyIdList.size(); i < size; i++) {
860 sb.append(proxyIdList.get(i));
865 proxyId = sb.toString();
868 value.setProxyId(proxyId);
869 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
870 blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
871 value.setBlackListPatterns(blackListPatterns);
872 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
873 whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
874 value.setWhiteListPatterns(whiteListPatterns);
875 java.util.Map policies = registry.getProperties(prefix + "policies");
876 value.setPolicies(policies);
877 java.util.Map properties = registry.getProperties(prefix + "properties");
878 value.setProperties(properties);
879 boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
880 value.setDisabled(disabled);
885 private ProxyConnectorRuleConfiguration readProxyConnectorRuleConfiguration(String prefix, Registry registry) {
886 ProxyConnectorRuleConfiguration value = new ProxyConnectorRuleConfiguration();
888 //String ruleType = registry.getString( prefix + "ruleType", value.getRuleType() );
890 List<String> ruleTypeList = registry.getList(prefix + "ruleType");
891 String ruleType = value.getRuleType();
892 if (ruleTypeList != null && !ruleTypeList.isEmpty()) {
893 StringBuilder sb = new StringBuilder();
894 for (int i = 0, size = ruleTypeList.size(); i < size; i++) {
895 sb.append(ruleTypeList.get(i));
900 ruleType = sb.toString();
903 value.setRuleType(ruleType);
904 //String pattern = registry.getString( prefix + "pattern", value.getPattern() );
906 List<String> patternList = registry.getList(prefix + "pattern");
907 String pattern = value.getPattern();
908 if (patternList != null && !patternList.isEmpty()) {
909 StringBuilder sb = new StringBuilder();
910 for (int i = 0, size = patternList.size(); i < size; i++) {
911 sb.append(patternList.get(i));
916 pattern = sb.toString();
919 value.setPattern(pattern);
920 java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
921 List proxyConnectorsSubsets = registry.getSubsetList(prefix + "proxyConnectors.proxyConnector");
922 for (Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); ) {
923 ProxyConnectorConfiguration v = readProxyConnectorConfiguration("", (Registry) i.next());
924 proxyConnectors.add(v);
926 value.setProxyConnectors(proxyConnectors);
931 private ProxyConnectorConfiguration readProxyConnectorConfiguration(String prefix, Registry registry) {
932 ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();
934 int order = registry.getInt(prefix + "order", value.getOrder());
935 value.setOrder(order);
936 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
938 List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
939 String sourceRepoId = value.getSourceRepoId();
940 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
941 StringBuilder sb = new StringBuilder();
942 for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
943 sb.append(sourceRepoIdList.get(i));
948 sourceRepoId = sb.toString();
951 value.setSourceRepoId(sourceRepoId);
952 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
954 List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
955 String targetRepoId = value.getTargetRepoId();
956 if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
957 StringBuilder sb = new StringBuilder();
958 for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
959 sb.append(targetRepoIdList.get(i));
964 targetRepoId = sb.toString();
967 value.setTargetRepoId(targetRepoId);
968 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
970 List<String> proxyIdList = registry.getList(prefix + "proxyId");
971 String proxyId = value.getProxyId();
972 if (proxyIdList != null && !proxyIdList.isEmpty()) {
973 StringBuilder sb = new StringBuilder();
974 for (int i = 0, size = proxyIdList.size(); i < size; i++) {
975 sb.append(proxyIdList.get(i));
980 proxyId = sb.toString();
983 value.setProxyId(proxyId);
984 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
985 blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
986 value.setBlackListPatterns(blackListPatterns);
987 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
988 whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
989 value.setWhiteListPatterns(whiteListPatterns);
990 java.util.Map policies = registry.getProperties(prefix + "policies");
991 value.setPolicies(policies);
992 java.util.Map properties = registry.getProperties(prefix + "properties");
993 value.setProperties(properties);
994 boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
995 value.setDisabled(disabled);
1000 private SyncConnectorConfiguration readSyncConnectorConfiguration(String prefix, Registry registry) {
1001 SyncConnectorConfiguration value = new SyncConnectorConfiguration();
1003 //String cronExpression = registry.getString( prefix + "cronExpression", value.getCronExpression() );
1005 List<String> cronExpressionList = registry.getList(prefix + "cronExpression");
1006 String cronExpression = value.getCronExpression();
1007 if (cronExpressionList != null && !cronExpressionList.isEmpty()) {
1008 StringBuilder sb = new StringBuilder();
1009 for (int i = 0, size = cronExpressionList.size(); i < size; i++) {
1010 sb.append(cronExpressionList.get(i));
1015 cronExpression = sb.toString();
1018 value.setCronExpression(cronExpression);
1019 //String method = registry.getString( prefix + "method", value.getMethod() );
1021 List<String> methodList = registry.getList(prefix + "method");
1022 String method = value.getMethod();
1023 if (methodList != null && !methodList.isEmpty()) {
1024 StringBuilder sb = new StringBuilder();
1025 for (int i = 0, size = methodList.size(); i < size; i++) {
1026 sb.append(methodList.get(i));
1031 method = sb.toString();
1034 value.setMethod(method);
1035 //String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
1037 List<String> sourceRepoIdList = registry.getList(prefix + "sourceRepoId");
1038 String sourceRepoId = value.getSourceRepoId();
1039 if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty()) {
1040 StringBuilder sb = new StringBuilder();
1041 for (int i = 0, size = sourceRepoIdList.size(); i < size; i++) {
1042 sb.append(sourceRepoIdList.get(i));
1047 sourceRepoId = sb.toString();
1050 value.setSourceRepoId(sourceRepoId);
1051 //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
1053 List<String> targetRepoIdList = registry.getList(prefix + "targetRepoId");
1054 String targetRepoId = value.getTargetRepoId();
1055 if (targetRepoIdList != null && !targetRepoIdList.isEmpty()) {
1056 StringBuilder sb = new StringBuilder();
1057 for (int i = 0, size = targetRepoIdList.size(); i < size; i++) {
1058 sb.append(targetRepoIdList.get(i));
1063 targetRepoId = sb.toString();
1066 value.setTargetRepoId(targetRepoId);
1067 //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
1069 List<String> proxyIdList = registry.getList(prefix + "proxyId");
1070 String proxyId = value.getProxyId();
1071 if (proxyIdList != null && !proxyIdList.isEmpty()) {
1072 StringBuilder sb = new StringBuilder();
1073 for (int i = 0, size = proxyIdList.size(); i < size; i++) {
1074 sb.append(proxyIdList.get(i));
1079 proxyId = sb.toString();
1082 value.setProxyId(proxyId);
1083 java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
1084 blackListPatterns.addAll(registry.getList(prefix + "blackListPatterns.blackListPattern"));
1085 value.setBlackListPatterns(blackListPatterns);
1086 java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
1087 whiteListPatterns.addAll(registry.getList(prefix + "whiteListPatterns.whiteListPattern"));
1088 value.setWhiteListPatterns(whiteListPatterns);
1089 java.util.Map policies = registry.getProperties(prefix + "policies");
1090 value.setPolicies(policies);
1091 java.util.Map properties = registry.getProperties(prefix + "properties");
1092 value.setProperties(properties);
1093 boolean disabled = registry.getBoolean(prefix + "disabled", value.isDisabled());
1094 value.setDisabled(disabled);
1099 private NetworkProxyConfiguration readNetworkProxyConfiguration(String prefix, Registry registry) {
1100 NetworkProxyConfiguration value = new NetworkProxyConfiguration();
1102 //String id = registry.getString( prefix + "id", value.getId() );
1104 List<String> idList = registry.getList(prefix + "id");
1105 String id = value.getId();
1106 if (idList != null && !idList.isEmpty()) {
1107 StringBuilder sb = new StringBuilder();
1108 for (int i = 0, size = idList.size(); i < size; i++) {
1109 sb.append(idList.get(i));
1118 //String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
1120 List<String> protocolList = registry.getList(prefix + "protocol");
1121 String protocol = value.getProtocol();
1122 if (protocolList != null && !protocolList.isEmpty()) {
1123 StringBuilder sb = new StringBuilder();
1124 for (int i = 0, size = protocolList.size(); i < size; i++) {
1125 sb.append(protocolList.get(i));
1130 protocol = sb.toString();
1133 value.setProtocol(protocol);
1134 //String host = registry.getString( prefix + "host", value.getHost() );
1136 List<String> hostList = registry.getList(prefix + "host");
1137 String host = value.getHost();
1138 if (hostList != null && !hostList.isEmpty()) {
1139 StringBuilder sb = new StringBuilder();
1140 for (int i = 0, size = hostList.size(); i < size; i++) {
1141 sb.append(hostList.get(i));
1146 host = sb.toString();
1149 value.setHost(host);
1150 int port = registry.getInt(prefix + "port", value.getPort());
1151 value.setPort(port);
1152 //String username = registry.getString( prefix + "username", value.getUsername() );
1154 List<String> usernameList = registry.getList(prefix + "username");
1155 String username = value.getUsername();
1156 if (usernameList != null && !usernameList.isEmpty()) {
1157 StringBuilder sb = new StringBuilder();
1158 for (int i = 0, size = usernameList.size(); i < size; i++) {
1159 sb.append(usernameList.get(i));
1164 username = sb.toString();
1167 value.setUsername(username);
1168 //String password = registry.getString( prefix + "password", value.getPassword() );
1170 List<String> passwordList = registry.getList(prefix + "password");
1171 String password = value.getPassword();
1172 if (passwordList != null && !passwordList.isEmpty()) {
1173 StringBuilder sb = new StringBuilder();
1174 for (int i = 0, size = passwordList.size(); i < size; i++) {
1175 sb.append(passwordList.get(i));
1180 password = sb.toString();
1183 value.setPassword(password);
1184 boolean useNtlm = registry.getBoolean(prefix + "useNtlm", value.isUseNtlm());
1185 value.setUseNtlm(useNtlm);
1190 private RepositoryScanningConfiguration readRepositoryScanningConfiguration(String prefix, Registry registry) {
1191 RepositoryScanningConfiguration value = new RepositoryScanningConfiguration();
1193 java.util.List fileTypes = new java.util.ArrayList/*<FileType>*/();
1194 List fileTypesSubsets = registry.getSubsetList(prefix + "fileTypes.fileType");
1195 for (Iterator i = fileTypesSubsets.iterator(); i.hasNext(); ) {
1196 FileType v = readFileType("", (Registry) i.next());
1199 value.setFileTypes(fileTypes);
1200 java.util.List knownContentConsumers = new java.util.ArrayList/*<String>*/();
1201 knownContentConsumers.addAll(registry.getList(prefix + "knownContentConsumers.knownContentConsumer"));
1202 value.setKnownContentConsumers(knownContentConsumers);
1203 java.util.List invalidContentConsumers = new java.util.ArrayList/*<String>*/();
1204 invalidContentConsumers.addAll(registry.getList(prefix + "invalidContentConsumers.invalidContentConsumer"));
1205 value.setInvalidContentConsumers(invalidContentConsumers);
1210 private FileType readFileType(String prefix, Registry registry) {
1211 FileType value = new FileType();
1213 //String id = registry.getString( prefix + "id", value.getId() );
1215 List<String> idList = registry.getList(prefix + "id");
1216 String id = value.getId();
1217 if (idList != null && !idList.isEmpty()) {
1218 StringBuilder sb = new StringBuilder();
1219 for (int i = 0, size = idList.size(); i < size; i++) {
1220 sb.append(idList.get(i));
1229 java.util.List patterns = new java.util.ArrayList/*<String>*/();
1230 patterns.addAll(registry.getList(prefix + "patterns.pattern"));
1231 value.setPatterns(patterns);
1236 private OrganisationInformation readOrganisationInformation(String prefix, Registry registry) {
1237 OrganisationInformation value = new OrganisationInformation();
1239 //String name = registry.getString( prefix + "name", value.getName() );
1241 List<String> nameList = registry.getList(prefix + "name");
1242 String name = value.getName();
1243 if (nameList != null && !nameList.isEmpty()) {
1244 StringBuilder sb = new StringBuilder();
1245 for (int i = 0, size = nameList.size(); i < size; i++) {
1246 sb.append(nameList.get(i));
1251 name = sb.toString();
1254 value.setName(name);
1255 //String url = registry.getString( prefix + "url", value.getUrl() );
1257 List<String> urlList = registry.getList(prefix + "url");
1258 String url = value.getUrl();
1259 if (urlList != null && !urlList.isEmpty()) {
1260 StringBuilder sb = new StringBuilder();
1261 for (int i = 0, size = urlList.size(); i < size; i++) {
1262 sb.append(urlList.get(i));
1267 url = sb.toString();
1271 //String logoLocation = registry.getString( prefix + "logoLocation", value.getLogoLocation() );
1273 List<String> logoLocationList = registry.getList(prefix + "logoLocation");
1274 String logoLocation = value.getLogoLocation();
1275 if (logoLocationList != null && !logoLocationList.isEmpty()) {
1276 StringBuilder sb = new StringBuilder();
1277 for (int i = 0, size = logoLocationList.size(); i < size; i++) {
1278 sb.append(logoLocationList.get(i));
1283 logoLocation = sb.toString();
1286 value.setLogoLocation(logoLocation);
1291 private WebappConfiguration readWebappConfiguration(String prefix, Registry registry) {
1292 WebappConfiguration value = new WebappConfiguration();
1294 UserInterfaceOptions ui = readUserInterfaceOptions(prefix + "ui.", registry);
1300 private UserInterfaceOptions readUserInterfaceOptions(String prefix, Registry registry) {
1301 UserInterfaceOptions value = new UserInterfaceOptions();
1303 boolean showFindArtifacts = registry.getBoolean(prefix + "showFindArtifacts", value.isShowFindArtifacts());
1304 value.setShowFindArtifacts(showFindArtifacts);
1305 boolean appletFindEnabled = registry.getBoolean(prefix + "appletFindEnabled", value.isAppletFindEnabled());
1306 value.setAppletFindEnabled(appletFindEnabled);
1307 boolean disableEasterEggs = registry.getBoolean(prefix + "disableEasterEggs", value.isDisableEasterEggs());
1308 value.setDisableEasterEggs(disableEasterEggs);
1309 //String applicationUrl = registry.getString( prefix + "applicationUrl", value.getApplicationUrl() );
1311 List<String> applicationUrlList = registry.getList(prefix + "applicationUrl");
1312 String applicationUrl = value.getApplicationUrl();
1313 if (applicationUrlList != null && !applicationUrlList.isEmpty()) {
1314 StringBuilder sb = new StringBuilder();
1315 for (int i = 0, size = applicationUrlList.size(); i < size; i++) {
1316 sb.append(applicationUrlList.get(i));
1321 applicationUrl = sb.toString();
1324 value.setApplicationUrl(applicationUrl);
1325 boolean disableRegistration = registry.getBoolean(prefix + "disableRegistration", value.isDisableRegistration());
1326 value.setDisableRegistration(disableRegistration);
1331 private NetworkConfiguration readNetworkConfiguration(String prefix, Registry registry) {
1332 NetworkConfiguration value = new NetworkConfiguration();
1334 int maxTotal = registry.getInt(prefix + "maxTotal", value.getMaxTotal());
1335 value.setMaxTotal(maxTotal);
1336 int maxTotalPerHost = registry.getInt(prefix + "maxTotalPerHost", value.getMaxTotalPerHost());
1337 value.setMaxTotalPerHost(maxTotalPerHost);
1338 boolean usePooling = registry.getBoolean(prefix + "usePooling", value.isUsePooling());
1339 value.setUsePooling(usePooling);
1344 private ArchivaRuntimeConfiguration readArchivaRuntimeConfiguration(String prefix, Registry registry) {
1345 ArchivaRuntimeConfiguration value = new ArchivaRuntimeConfiguration();
1347 CacheConfiguration urlFailureCacheConfiguration = readCacheConfiguration(prefix + "urlFailureCacheConfiguration.", registry);
1348 value.setUrlFailureCacheConfiguration(urlFailureCacheConfiguration);
1349 FileLockConfiguration fileLockConfiguration = readFileLockConfiguration(prefix + "fileLockConfiguration.", registry);
1350 value.setFileLockConfiguration(fileLockConfiguration);
1351 //String dataDirectory = registry.getString( prefix + "dataDirectory", value.getDataDirectory() );
1353 List<String> dataDirectoryList = registry.getList(prefix + "dataDirectory");
1354 String dataDirectory = value.getDataDirectory();
1355 if (dataDirectoryList != null && !dataDirectoryList.isEmpty()) {
1356 StringBuilder sb = new StringBuilder();
1357 for (int i = 0, size = dataDirectoryList.size(); i < size; i++) {
1358 sb.append(dataDirectoryList.get(i));
1363 dataDirectory = sb.toString();
1366 value.setDataDirectory(dataDirectory);
1367 //String repositoryBaseDirectory = registry.getString( prefix + "repositoryBaseDirectory", value.getRepositoryBaseDirectory() );
1369 List<String> repositoryBaseDirectoryList = registry.getList(prefix + "repositoryBaseDirectory");
1370 String repositoryBaseDirectory = value.getRepositoryBaseDirectory();
1371 if (repositoryBaseDirectoryList != null && !repositoryBaseDirectoryList.isEmpty()) {
1372 StringBuilder sb = new StringBuilder();
1373 for (int i = 0, size = repositoryBaseDirectoryList.size(); i < size; i++) {
1374 sb.append(repositoryBaseDirectoryList.get(i));
1379 repositoryBaseDirectory = sb.toString();
1382 value.setRepositoryBaseDirectory(repositoryBaseDirectory);
1383 //String remoteRepositoryBaseDirectory = registry.getString( prefix + "remoteRepositoryBaseDirectory", value.getRemoteRepositoryBaseDirectory() );
1385 List<String> remoteRepositoryBaseDirectoryList = registry.getList(prefix + "remoteRepositoryBaseDirectory");
1386 String remoteRepositoryBaseDirectory = value.getRemoteRepositoryBaseDirectory();
1387 if (remoteRepositoryBaseDirectoryList != null && !remoteRepositoryBaseDirectoryList.isEmpty()) {
1388 StringBuilder sb = new StringBuilder();
1389 for (int i = 0, size = remoteRepositoryBaseDirectoryList.size(); i < size; i++) {
1390 sb.append(remoteRepositoryBaseDirectoryList.get(i));
1395 remoteRepositoryBaseDirectory = sb.toString();
1398 value.setRemoteRepositoryBaseDirectory(remoteRepositoryBaseDirectory);
1399 //String defaultLanguage = registry.getString( prefix + "defaultLanguage", value.getDefaultLanguage() );
1402 List<String> repositoryGroupBaseDirectoryList = registry.getList(prefix + "repositoryGroupBaseDirectory");
1403 String repositoryGroupBaseDirectory = value.getRepositoryGroupBaseDirectory();
1404 if (repositoryGroupBaseDirectoryList != null && !repositoryGroupBaseDirectoryList.isEmpty()) {
1405 StringBuilder sb = new StringBuilder();
1406 for (int i = 0, size = repositoryGroupBaseDirectoryList.size(); i < size; i++) {
1407 sb.append(repositoryGroupBaseDirectoryList.get(i));
1412 repositoryGroupBaseDirectory = sb.toString();
1415 value.setRepositoryGroupBaseDirectory(repositoryGroupBaseDirectory);
1417 List<String> defaultLanguageList = registry.getList(prefix + "defaultLanguage");
1418 String defaultLanguage = value.getDefaultLanguage();
1419 if (defaultLanguageList != null && !defaultLanguageList.isEmpty()) {
1420 StringBuilder sb = new StringBuilder();
1421 for (int i = 0, size = defaultLanguageList.size(); i < size; i++) {
1422 sb.append(defaultLanguageList.get(i));
1427 defaultLanguage = sb.toString();
1430 value.setDefaultLanguage(defaultLanguage);
1431 //String languageRange = registry.getString( prefix + "languageRange", value.getLanguageRange() );
1433 List<String> languageRangeList = registry.getList(prefix + "languageRange");
1434 String languageRange = value.getLanguageRange();
1435 if (languageRangeList != null && !languageRangeList.isEmpty()) {
1436 StringBuilder sb = new StringBuilder();
1437 for (int i = 0, size = languageRangeList.size(); i < size; i++) {
1438 sb.append(languageRangeList.get(i));
1443 languageRange = sb.toString();
1446 value.setLanguageRange(languageRange);
1448 List<String> checksumTypeList = registry.getList(prefix + "checksumTypes.type");
1449 value.setChecksumTypes(checksumTypeList);
1454 private RedbackRuntimeConfiguration readRedbackRuntimeConfiguration(String prefix, Registry registry) {
1455 RedbackRuntimeConfiguration value = new RedbackRuntimeConfiguration();
1457 boolean migratedFromRedbackConfiguration = registry.getBoolean(prefix + "migratedFromRedbackConfiguration", value.isMigratedFromRedbackConfiguration());
1458 value.setMigratedFromRedbackConfiguration(migratedFromRedbackConfiguration);
1459 java.util.List userManagerImpls = new java.util.ArrayList/*<String>*/();
1460 userManagerImpls.addAll(registry.getList(prefix + "userManagerImpls.userManagerImpl"));
1461 value.setUserManagerImpls(userManagerImpls);
1462 java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
1463 rbacManagerImpls.addAll(registry.getList(prefix + "rbacManagerImpls.rbacManagerImpl"));
1464 value.setRbacManagerImpls(rbacManagerImpls);
1465 LdapConfiguration ldapConfiguration = readLdapConfiguration(prefix + "ldapConfiguration.", registry);
1466 value.setLdapConfiguration(ldapConfiguration);
1467 java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
1468 List ldapGroupMappingsSubsets = registry.getSubsetList(prefix + "ldapGroupMappings.ldapGroupMapping");
1469 for (Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); ) {
1470 LdapGroupMapping v = readLdapGroupMapping("", (Registry) i.next());
1471 ldapGroupMappings.add(v);
1473 value.setLdapGroupMappings(ldapGroupMappings);
1474 java.util.Map configurationProperties = registry.getProperties(prefix + "configurationProperties");
1475 value.setConfigurationProperties(configurationProperties);
1476 boolean useUsersCache = registry.getBoolean(prefix + "useUsersCache", value.isUseUsersCache());
1477 value.setUseUsersCache(useUsersCache);
1478 CacheConfiguration usersCacheConfiguration = readCacheConfiguration(prefix + "usersCacheConfiguration.", registry);
1479 value.setUsersCacheConfiguration(usersCacheConfiguration);
1484 private ArchivaDefaultConfiguration readArchivaDefaultConfiguration(String prefix, Registry registry) {
1485 ArchivaDefaultConfiguration value = new ArchivaDefaultConfiguration();
1487 java.util.List defaultCheckPaths = new java.util.ArrayList/*<RepositoryCheckPath>*/();
1488 List defaultCheckPathsSubsets = registry.getSubsetList(prefix + "defaultCheckPaths.defaultCheckPath");
1489 for (Iterator i = defaultCheckPathsSubsets.iterator(); i.hasNext(); ) {
1490 RepositoryCheckPath v = readRepositoryCheckPath("", (Registry) i.next());
1491 defaultCheckPaths.add(v);
1493 value.setDefaultCheckPaths(defaultCheckPaths);
1498 private LdapConfiguration readLdapConfiguration(String prefix, Registry registry) {
1499 LdapConfiguration value = new LdapConfiguration();
1501 //String hostName = registry.getString( prefix + "hostName", value.getHostName() );
1503 List<String> hostNameList = registry.getList(prefix + "hostName");
1504 String hostName = value.getHostName();
1505 if (hostNameList != null && !hostNameList.isEmpty()) {
1506 StringBuilder sb = new StringBuilder();
1507 for (int i = 0, size = hostNameList.size(); i < size; i++) {
1508 sb.append(hostNameList.get(i));
1513 hostName = sb.toString();
1516 value.setHostName(hostName);
1517 int port = registry.getInt(prefix + "port", value.getPort());
1518 value.setPort(port);
1519 boolean ssl = registry.getBoolean(prefix + "ssl", value.isSsl());
1521 //String baseDn = registry.getString( prefix + "baseDn", value.getBaseDn() );
1523 List<String> baseDnList = registry.getList(prefix + "baseDn");
1524 String baseDn = value.getBaseDn();
1525 if (baseDnList != null && !baseDnList.isEmpty()) {
1526 StringBuilder sb = new StringBuilder();
1527 for (int i = 0, size = baseDnList.size(); i < size; i++) {
1528 sb.append(baseDnList.get(i));
1533 baseDn = sb.toString();
1536 value.setBaseDn(baseDn);
1537 //String baseGroupsDn = registry.getString( prefix + "baseGroupsDn", value.getBaseGroupsDn() );
1539 List<String> baseGroupsDnList = registry.getList(prefix + "baseGroupsDn");
1540 String baseGroupsDn = value.getBaseGroupsDn();
1541 if (baseGroupsDnList != null && !baseGroupsDnList.isEmpty()) {
1542 StringBuilder sb = new StringBuilder();
1543 for (int i = 0, size = baseGroupsDnList.size(); i < size; i++) {
1544 sb.append(baseGroupsDnList.get(i));
1549 baseGroupsDn = sb.toString();
1552 value.setBaseGroupsDn(baseGroupsDn);
1553 //String contextFactory = registry.getString( prefix + "contextFactory", value.getContextFactory() );
1555 List<String> contextFactoryList = registry.getList(prefix + "contextFactory");
1556 String contextFactory = value.getContextFactory();
1557 if (contextFactoryList != null && !contextFactoryList.isEmpty()) {
1558 StringBuilder sb = new StringBuilder();
1559 for (int i = 0, size = contextFactoryList.size(); i < size; i++) {
1560 sb.append(contextFactoryList.get(i));
1565 contextFactory = sb.toString();
1568 value.setContextFactory(contextFactory);
1569 //String bindDn = registry.getString( prefix + "bindDn", value.getBindDn() );
1571 List<String> bindDnList = registry.getList(prefix + "bindDn");
1572 String bindDn = value.getBindDn();
1573 if (bindDnList != null && !bindDnList.isEmpty()) {
1574 StringBuilder sb = new StringBuilder();
1575 for (int i = 0, size = bindDnList.size(); i < size; i++) {
1576 sb.append(bindDnList.get(i));
1581 bindDn = sb.toString();
1584 value.setBindDn(bindDn);
1585 //String password = registry.getString( prefix + "password", value.getPassword() );
1587 List<String> passwordList = registry.getList(prefix + "password");
1588 String password = value.getPassword();
1589 if (passwordList != null && !passwordList.isEmpty()) {
1590 StringBuilder sb = new StringBuilder();
1591 for (int i = 0, size = passwordList.size(); i < size; i++) {
1592 sb.append(passwordList.get(i));
1597 password = sb.toString();
1600 value.setPassword(password);
1601 //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() );
1603 List<String> authenticationMethodList = registry.getList(prefix + "authenticationMethod");
1604 String authenticationMethod = value.getAuthenticationMethod();
1605 if (authenticationMethodList != null && !authenticationMethodList.isEmpty()) {
1606 StringBuilder sb = new StringBuilder();
1607 for (int i = 0, size = authenticationMethodList.size(); i < size; i++) {
1608 sb.append(authenticationMethodList.get(i));
1613 authenticationMethod = sb.toString();
1616 value.setAuthenticationMethod(authenticationMethod);
1617 boolean bindAuthenticatorEnabled = registry.getBoolean(prefix + "bindAuthenticatorEnabled", value.isBindAuthenticatorEnabled());
1618 value.setBindAuthenticatorEnabled(bindAuthenticatorEnabled);
1619 boolean writable = registry.getBoolean(prefix + "writable", value.isWritable());
1620 value.setWritable(writable);
1621 boolean useRoleNameAsGroup = registry.getBoolean(prefix + "useRoleNameAsGroup", value.isUseRoleNameAsGroup());
1622 value.setUseRoleNameAsGroup(useRoleNameAsGroup);
1623 java.util.Map extraProperties = registry.getProperties(prefix + "extraProperties");
1624 value.setExtraProperties(extraProperties);
1629 private FileLockConfiguration readFileLockConfiguration(String prefix, Registry registry) {
1630 FileLockConfiguration value = new FileLockConfiguration();
1632 boolean skipLocking = registry.getBoolean(prefix + "skipLocking", value.isSkipLocking());
1633 value.setSkipLocking(skipLocking);
1634 int lockingTimeout = registry.getInt(prefix + "lockingTimeout", value.getLockingTimeout());
1635 value.setLockingTimeout(lockingTimeout);
1640 private CacheConfiguration readCacheConfiguration(String prefix, Registry registry) {
1641 CacheConfiguration value = new CacheConfiguration();
1643 int timeToIdleSeconds = registry.getInt(prefix + "timeToIdleSeconds", value.getTimeToIdleSeconds());
1644 value.setTimeToIdleSeconds(timeToIdleSeconds);
1645 int timeToLiveSeconds = registry.getInt(prefix + "timeToLiveSeconds", value.getTimeToLiveSeconds());
1646 value.setTimeToLiveSeconds(timeToLiveSeconds);
1647 int maxElementsInMemory = registry.getInt(prefix + "maxElementsInMemory", value.getMaxElementsInMemory());
1648 value.setMaxElementsInMemory(maxElementsInMemory);
1649 int maxElementsOnDisk = registry.getInt(prefix + "maxElementsOnDisk", value.getMaxElementsOnDisk());
1650 value.setMaxElementsOnDisk(maxElementsOnDisk);
1655 private LdapGroupMapping readLdapGroupMapping(String prefix, Registry registry) {
1656 LdapGroupMapping value = new LdapGroupMapping();
1658 //String group = registry.getString( prefix + "group", value.getGroup() );
1660 List<String> groupList = registry.getList(prefix + "group");
1661 String group = value.getGroup();
1662 if (groupList != null && !groupList.isEmpty()) {
1663 StringBuilder sb = new StringBuilder();
1664 for (int i = 0, size = groupList.size(); i < size; i++) {
1665 sb.append(groupList.get(i));
1670 group = sb.toString();
1673 value.setGroup(group);
1674 java.util.List roleNames = new java.util.ArrayList/*<String>*/();
1675 roleNames.addAll(registry.getList(prefix + "roleNames.roleName"));
1676 value.setRoleNames(roleNames);