Mercurial > hg > AnnotationManagerN4J
changeset 96:8fefa4651d00
changed source indentation.
author | casties |
---|---|
date | Tue, 10 Feb 2015 19:00:13 +0100 |
parents | acd44dfec9c8 |
children | 434264e1839a |
files | src/main/java/de/mpiwg/itgroup/annotations/restlet/utils/UrlPrefixFilter.java |
diffstat | 1 files changed, 28 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- 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); + } }