artifact.setVersion( legacyArtifactPath.getVersion() );
artifact.setType( legacyArtifactPath.getType() );
String path = repositoryContent.toPath( artifact );
if ( !StringUtils.equals( path, legacyArtifactPath.getPath() ) )
{
throw new ArchivaRestServiceException(
"artifact path reference '" + legacyArtifactPath.getPath() + "' does not match the initial path: '"
+ path + "'", Response.Status.BAD_REQUEST.getStatusCode(), null );
}
try
{
archivaAdministration.addLegacyArtifactPath( legacyArtifactPath, getAuditInformation() );
}
catch ( RepositoryAdminException e )
{
throw new ArchivaRestServiceException( e.getMessage(), e );
}
}