*/
public String toNativePath( String requestedPath, ManagedRepositoryContent repository ) throws LayoutException
{
if ( StringUtils.isBlank( requestedPath ) )
{
throw new LayoutException( "Request Path is blank." );
}
String referencedResource = requestedPath;
// No checksum by default.
String supportfile = "";
// Figure out support file, and actual referencedResource.
if( isSupportFile( requestedPath ) )
{
int idx = requestedPath.lastIndexOf( '.' );
referencedResource = requestedPath.substring( 0, idx );
supportfile = requestedPath.substring( idx );
}
if ( isMetadata( referencedResource ) )
{
if ( repository instanceof ManagedLegacyRepositoryContent )
{
throw new LayoutException( "Cannot translate metadata request to legacy layout." );
}
/* Nothing to translate.
* Default layout is the only layout that can contain maven-metadata.xml files, and
* if the managedRepository is layout legacy, this request would never occur.