From 4c1e0e49e14940ff76dce93b3419aad9aab2cea8 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Fri, 13 Mar 2020 19:20:14 +0100 Subject: [PATCH] Fixing extension handling --- .../java/org/apache/archiva/repository/content/Artifact.java | 4 ++-- ...xt-no-mock-conf.xml => spring-context-repository-conf.xml} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/{spring-context-no-mock-conf.xml => spring-context-repository-conf.xml} (90%) diff --git a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/content/Artifact.java b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/content/Artifact.java index a86d1c372..e7bae8e8e 100644 --- a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/content/Artifact.java +++ b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/content/Artifact.java @@ -99,8 +99,8 @@ public interface Artifact extends ContentItem default String getExtension( ) { final String name = getAsset( ).getName( ); - final int idx = name.lastIndexOf( '.' ); - if ( idx >= 0 ) + final int idx = name.lastIndexOf( '.' )+1; + if ( idx > 0 ) { return name.substring( idx ); } diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-no-mock-conf.xml b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-repository-conf.xml similarity index 90% rename from archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-no-mock-conf.xml rename to archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-repository-conf.xml index 40c7dc99e..3915ff458 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-no-mock-conf.xml +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-repository-conf.xml @@ -27,8 +27,8 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - - + + \ No newline at end of file -- 2.39.5