in src/main/java/org/apache/maven/resolver/internal/ant/tasks/Layout.java [73:129]
public String getPath( Artifact artifact )
{
StringBuilder buffer = new StringBuilder( 128 );
for ( int i = 0; i < tokens.length; i++ )
{
String token = tokens[i];
if ( GID.equals( token ) )
{
buffer.append( artifact.getGroupId() );
}
else if ( GID_DIRS.equals( token ) )
{
buffer.append( artifact.getGroupId().replace( '.', '/' ) );
}
else if ( AID.equals( token ) )
{
buffer.append( artifact.getArtifactId() );
}
else if ( VER.equals( token ) )
{
buffer.append( artifact.getVersion() );
}
else if ( BVER.equals( token ) )
{
buffer.append( artifact.getBaseVersion() );
}
else if ( CLS.equals( token ) )
{
if ( artifact.getClassifier().length() <= 0 )
{
if ( i > 0 )
{
String lt = tokens[i - 1];
if ( lt.length() > 0 && "-_".indexOf( lt.charAt( lt.length() - 1 ) ) >= 0 )
{
buffer.setLength( buffer.length() - 1 );
}
}
}
else
{
buffer.append( artifact.getClassifier() );
}
}
else if ( EXT.equals( token ) )
{
buffer.append( artifact.getExtension() );
}
else
{
buffer.append( token );
}
}
return buffer.toString();
}