Merged from: r630844, 630842
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@630850
13f79535-47bb-0310-9956-
ffa450edef68
public static String mapExtensionToType( String extension )
{
- if ( extension.equals( "tar.gz" ) )
+ if ( "tar.gz".equals( extension ) )
{
return "distribution-tgz";
}
- else if ( extension.equals( "tar.bz2" ) )
+ else if ( "tar.bz2".equals( extension ) )
{
return "distribution-bzip";
}
- else if ( extension.equals( "zip" ) )
+ else if ( "zip".equals( extension ) )
{
return "distribution-zip";
}
break;
case 0:
// End of the filename, only a simple extension left. - Set the type.
- artifact.setType( ArtifactExtensionMapping.mapExtensionToType( parser.getExtension() ) );
+ String type = ArtifactExtensionMapping.mapExtensionToType( parser.getExtension() );
+ if ( type == null )
+ {
+ throw new LayoutException( "Invalid artifact: no type was specified" );
+ }
+ artifact.setType( type );
break;
}