From: Martin Stockhammer Date: Fri, 13 Mar 2020 18:20:14 +0000 (+0100) Subject: Fixing extension handling X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4c1e0e49e14940ff76dce93b3419aad9aab2cea8;p=archiva.git Fixing extension handling --- 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-no-mock-conf.xml deleted file mode 100644 index 40c7dc99e..000000000 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-no-mock-conf.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-repository-conf.xml b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-repository-conf.xml new file mode 100644 index 000000000..3915ff458 --- /dev/null +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/resources/spring-context-repository-conf.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file