Skip to content

Instantly share code, notes, and snippets.

@ifedorenko
Created August 30, 2011 21:21
Show Gist options
  • Save ifedorenko/1182082 to your computer and use it in GitHub Desktop.
Save ifedorenko/1182082 to your computer and use it in GitHub Desktop.
// TODO this looks like a total hack! Is there a better way to get repository base url?
private String getRepoUrl( Request request, Repository repository )
{
String repoUrl = getContextRoot( request ).toString();
if ( !repoUrl.endsWith( "/" ) )
{
repoUrl = repoUrl + "/";
}
repoUrl = repoUrl + "content/repositories/" + repository.getId();
return repoUrl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment