# HG changeset patch # User casties # Date 1423591213 -3600 # Node ID 8fefa4651d00141b8c3720a843c4716dcbf948ae # Parent acd44dfec9c86797bc4e417b80fac1bdf58d1afc changed source indentation. diff -r acd44dfec9c8 -r 8fefa4651d00 src/main/java/de/mpiwg/itgroup/annotations/restlet/utils/UrlPrefixFilter.java --- a/src/main/java/de/mpiwg/itgroup/annotations/restlet/utils/UrlPrefixFilter.java Tue Feb 10 18:11:17 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/annotations/restlet/utils/UrlPrefixFilter.java Tue Feb 10 19:00:13 2015 +0100 @@ -35,33 +35,33 @@ */ public class UrlPrefixFilter extends Filter { - private String prefix = null; - - /** - * Set the prefix to add. - * - * @param prefix - */ - public void setPrefix(String prefix) { - if (!prefix.startsWith("/")) { - prefix = "/" + prefix; - } - this.prefix = prefix; - } - - @Override - protected int beforeHandle(Request request, Response response) { - // get ref to change - Reference ref = request.getResourceRef(); - String path = ref.getPath(); - // add prefix to path - ref.setPath(prefix + path); - // change baseRef as well - Reference baseRef = ref.getBaseRef(); - String basePath = baseRef.getPath(); - // add prefix to base ref path - baseRef.setPath(prefix + basePath); - return super.beforeHandle(request, response); - } + private String prefix = null; + + /** + * Set the prefix to add. + * + * @param prefix + */ + public void setPrefix(String prefix) { + if (!prefix.startsWith("/")) { + prefix = "/" + prefix; + } + this.prefix = prefix; + } + + @Override + protected int beforeHandle(Request request, Response response) { + // get ref to change + Reference ref = request.getResourceRef(); + String path = ref.getPath(); + // add prefix to path + ref.setPath(prefix + path); + // change baseRef as well + Reference baseRef = ref.getBaseRef(); + String basePath = baseRef.getPath(); + // add prefix to base ref path + baseRef.setPath(prefix + basePath); + return super.beforeHandle(request, response); + } }