if ( path.startsWith( BROWSE_PREFIX ) )
{
path = path.substring( BROWSE_PREFIX.length() );
if ( path.length() == 0 )
{
return new ActionMapping( "browse", "/", "", null );
}
else
{
String[] parts = path.split( "/" );
if ( parts.length == 1 )
{
Map params = new HashMap();
params.put( "groupId", parts[0] );
return new ActionMapping( "browseGroup", "/", "", params );
}
else if ( parts.length == 2 )
{
Map params = new HashMap();
params.put( "groupId", parts[0] );
params.put( "artifactId", parts[1] );
return new ActionMapping( "browseArtifact", "/", "", params );
}
else if ( parts.length == 3 )
{
Map params = new HashMap();
params.put( "groupId", parts[0] );
params.put( "artifactId", parts[1] );
params.put( "version", parts[2] );
return new ActionMapping( "showArtifact", "/", "", params );
}
else if ( parts.length == 4 )
{
Map params = new HashMap();
params.put( "groupId", parts[0] );
params.put( "artifactId", parts[1] );
params.put( "version", parts[2] );
if ( "dependencies".equals( parts[3] ) )
{
return new ActionMapping( "showArtifactDependencies", "/", "", params );
}
else if ( "mailingLists".equals( parts[3] ) )
{
return new ActionMapping( "showArtifactMailingLists", "/", "", params );
}
else if ( "usedby".equals( parts[3] ) )
{
return new ActionMapping( "showArtifactDependees", "/", "", params );
}
else if ( "dependencyTree".equals( parts[3] ) )
{
return new ActionMapping( "showArtifactDependencyTree", "/", "", params );
}
}
}
}
else if ( path.startsWith( PROXY_PREFIX ) )
{
// retain the leading /
path = path.substring( PROXY_PREFIX.length() - 1 );
Map params = new HashMap();
params.put( "path", path );
return new ActionMapping( "proxy", "/", "", params );
}
return super.getMapping( httpServletRequest );
}