: redbackRequestInformation.getUser().getUsername() );
}
- protected String getBaseUrl( HttpServletRequest req )
+ protected String getBaseUrl()
throws RepositoryAdminException
{
String applicationUrl = archivaAdministration.getUiConfiguration().getApplicationUrl();
{
return applicationUrl;
}
- return req.getScheme() + "://" + req.getServerName() + ( req.getServerPort() == 80
- ? ""
- : ":" + req.getServerPort() ) + req.getContextPath();
+ return httpServletRequest.getScheme() + "://" + httpServletRequest.getServerName() + (
+ httpServletRequest.getServerPort() == 80 ? "" : ":" + httpServletRequest.getServerPort() )
+ + httpServletRequest.getContextPath();
}
protected <T> Map<String, T> getBeansOfType( ApplicationContext applicationContext, Class<T> clazz )
}
/**
- * TODO add a configuration mechanism to have configured the base archiva url
- *
* @param artifact
* @return
*/
return null;
}
- StringBuilder sb = new StringBuilder( getBaseUrl( httpServletRequest ) );
+ StringBuilder sb = new StringBuilder( getBaseUrl() );
sb.append( "/repository" );
snippet.append( " <" ).append( distRepoName ).append( ">\n" );
snippet.append( " <id>" ).append( repo.getId() ).append( "</id>\n" );
snippet.append( " <url>" );
- snippet.append( getBaseUrl( httpServletRequest ) + "/repository" );
+ snippet.append( getBaseUrl( ) + "/repository" );
snippet.append( "/" ).append( repo.getId() ).append( "/" ).append( "</url>\n" );
if ( !"default".equals( repo.getLayout() ) )
snippet.append( " <name>" ).append( repo.getName() ).append( "</name>\n" );
snippet.append( " <url>" );
- snippet.append( getBaseUrl( httpServletRequest ) + "/repository" );
+ snippet.append( getBaseUrl( ) + "/repository" );
snippet.append( "/" ).append( repo.getId() ).append( "/" );
snippet.append( "</url>\n" );
snippet.append( " <name>" ).append( repo.getName() ).append( "</name>\n" );
snippet.append( " <url>" );
- snippet.append( getBaseUrl( httpServletRequest ) + "/repository" );
+ snippet.append( getBaseUrl( ) + "/repository" );
snippet.append( "/" ).append( repo.getId() ).append( "/" );
snippet.append( "</url>\n" );