From: Olivier Lamy Date: Mon, 30 Jul 2012 14:39:46 +0000 (+0000) Subject: use a static final String X-Git-Tag: archiva-1.4-M3~490 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=67adb61834f86e77e3344688475173829cadce6a;p=archiva.git use a static final String git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1367108 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/RepositoryRequest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/RepositoryRequest.java index dcf825031..73c53cf83 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/RepositoryRequest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/RepositoryRequest.java @@ -19,17 +19,17 @@ package org.apache.archiva.repository.content; * under the License. */ -import org.apache.commons.lang.StringUtils; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.layout.LayoutException; import org.apache.archiva.repository.metadata.MetadataTools; +import org.apache.commons.lang.StringUtils; /** * RepositoryRequest is used to determine the type of request that is incoming, and convert it to an appropriate * ArtifactReference. - * - * + *

+ *

*

*/ public class RepositoryRequest @@ -38,7 +38,7 @@ public class RepositoryRequest private PathParser legacyPathParser; - public RepositoryRequest (LegacyPathParser legacyPathParser) + public RepositoryRequest( LegacyPathParser legacyPathParser ) { this.legacyPathParser = legacyPathParser; } @@ -104,16 +104,14 @@ public class RepositoryRequest } /** - * * @param requestedPath * @return true if the requestedPath is likely an archetype catalog request. */ public boolean isArchetypeCatalog( String requestedPath ) { - //TODO: Make it static final String - return requestedPath.endsWith( "/archetype-catalog.xml"); + return requestedPath.endsWith( "/" + MetadataTools.MAVEN_ARCHETYPE_CATALOG ); } - + /** *

* Tests the path to see if it conforms to the expectations of a support file request. diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java index c9ae1301a..3ad07b8ff 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java @@ -85,6 +85,8 @@ public class MetadataTools public static final String MAVEN_METADATA = "maven-metadata.xml"; + public static final String MAVEN_ARCHETYPE_CATALOG ="archetype-catalog.xml"; + private static final char PATH_SEPARATOR = '/'; private static final char GROUP_SEPARATOR = '.';