diff options
author | Joakim Erdfelt <joakime@apache.org> | 2007-10-10 21:35:50 +0000 |
---|---|---|
committer | Joakim Erdfelt <joakime@apache.org> | 2007-10-10 21:35:50 +0000 |
commit | 313cc4ddfce06ae8bbb75d12a742d47edc019b4b (patch) | |
tree | 5eb6cca9e64f76fc50ddea11b2005577ada1bafe /archiva-base/archiva-repository-layer/src | |
parent | e6bf5123682cc82597a80b7ee893c10840c0b163 (diff) | |
download | archiva-313cc4ddfce06ae8bbb75d12a742d47edc019b4b.tar.gz archiva-313cc4ddfce06ae8bbb75d12a742d47edc019b4b.zip |
Fixing XMLException on non-existant proxy metadata file.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@583623 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-base/archiva-repository-layer/src')
-rw-r--r-- | archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java index 54374f485..779cfceca 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java @@ -331,7 +331,7 @@ public class MetadataTools throws InitializationException { this.artifactPatterns = new ArrayList<String>(); - this.proxies = new HashMap(); + this.proxies = new HashMap<String, Set<String>>(); initConfigVariables(); configuration.addChangeListener( this ); @@ -342,6 +342,12 @@ public class MetadataTools { String metadataPath = getRepositorySpecificName( proxyId, toPath( reference ) ); File metadataFile = new File( managedRepository.getRepoRoot(), metadataPath ); + + if ( !metadataFile.exists() || !metadataFile.isFile() ) + { + // Nothing to do. return null. + return null; + } try { @@ -361,6 +367,12 @@ public class MetadataTools { String metadataPath = getRepositorySpecificName( proxyId, toPath( reference ) ); File metadataFile = new File( managedRepository.getRepoRoot(), metadataPath ); + + if ( !metadataFile.exists() || !metadataFile.isFile() ) + { + // Nothing to do. return null. + return null; + } try { @@ -659,14 +671,12 @@ public class MetadataTools { this.proxies.clear(); - List proxyConfigs = configuration.getConfiguration().getProxyConnectors(); - Iterator it = proxyConfigs.iterator(); - while ( it.hasNext() ) + List<ProxyConnectorConfiguration> proxyConfigs = configuration.getConfiguration().getProxyConnectors(); + for( ProxyConnectorConfiguration proxyConfig: proxyConfigs ) { - ProxyConnectorConfiguration proxyConfig = (ProxyConnectorConfiguration) it.next(); String key = proxyConfig.getSourceRepoId(); - Set remoteRepoIds = this.proxies.get( key ); + Set<String> remoteRepoIds = this.proxies.get( key ); if ( remoteRepoIds == null ) { |