Submitted by: james ahlborn
Merged from: r630811
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@630813
13f79535-47bb-0310-9956-
ffa450edef68
private static final Pattern mavenPluginPattern = Pattern.compile( "(maven-.*-plugin)|(.*-maven-plugin)" );
private static final Pattern extensionPattern =
- Pattern.compile( "(.tar.gz$)|(.tar.bz2$)|(.[a-z0-9]*$)", Pattern.CASE_INSENSITIVE );
+ Pattern.compile( "(\\.tar\\.gz$)|(\\.tar\\.bz2$)|(\\.[a-z0-9]*$)", Pattern.CASE_INSENSITIVE );
private static final Pattern SNAPSHOT_PATTERN = Pattern.compile( "^([0-9]{8}\\.[0-9]{6}-[0-9]+)(.*)$" );
assertEquals( "artifact-id-1.0-20070219.171202-34-test-sources", parser.getName() );
assertEquals( "jar", parser.getExtension() );
}
+
+ public void testNoExtension()
+ {
+ FilenameParser parser = new FilenameParser( "foo_bar" );
+ assertNull( parser.getExtension() );
+ }
}