diff options
author | Brett Porter <brett@apache.org> | 2009-11-25 12:17:38 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2009-11-25 12:17:38 +0000 |
commit | 7c7f2cfd6df17d9226cd09433c5d0adfea3fa42c (patch) | |
tree | 7e0a39340ae0a072b74d5a086af77c3b7f8277ec /archiva-modules/metadata | |
parent | 78191d6285e7bad6d93cea693ebdd77c37333a54 (diff) | |
download | archiva-7c7f2cfd6df17d9226cd09433c5d0adfea3fa42c.tar.gz archiva-7c7f2cfd6df17d9226cd09433c5d0adfea3fa42c.zip |
[MRM-1282] improve exception handling
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@884066 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata')
3 files changed, 33 insertions, 2 deletions
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java index 0fb3cbabb..e058ca22d 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java @@ -49,6 +49,7 @@ public class DefaultMetadataResolver } public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) + throws MetadataResolverException { ProjectVersionMetadata metadata = metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion ); // TODO: do we want to detect changes as well by comparing timestamps? isProjectVersionNewerThan(updated) diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java index 7050b0552..7e6aaef7d 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java @@ -21,14 +21,15 @@ package org.apache.archiva.metadata.repository; import java.util.Collection; -import org.apache.archiva.metadata.model.ProjectVersionMetadata; import org.apache.archiva.metadata.model.ProjectMetadata; +import org.apache.archiva.metadata.model.ProjectVersionMetadata; public interface MetadataResolver { ProjectMetadata getProject( String repoId, String namespace, String projectId ); - ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion ); + ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) + throws MetadataResolverException; Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion ); } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolverException.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolverException.java new file mode 100644 index 000000000..c62a2577f --- /dev/null +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolverException.java @@ -0,0 +1,29 @@ +package org.apache.archiva.metadata.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +public class MetadataResolverException + extends Exception +{ + public MetadataResolverException( String message, Exception cause ) + { + super( message, cause ); + } +} |