From fa286f549a3bc7c69ac03b5945bac1f51e728a23 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 12 Jul 2016 18:52:26 -0700 Subject: [PATCH] GUACAMOLE-5: Consider methods annotated with @Path to be REST methods as well. --- .../java/org/apache/guacamole/rest/RESTMethodMatcher.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/RESTMethodMatcher.java b/guacamole/src/main/java/org/apache/guacamole/rest/RESTMethodMatcher.java index c80750c40..623932f9f 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/RESTMethodMatcher.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/RESTMethodMatcher.java @@ -23,6 +23,7 @@ import com.google.inject.matcher.AbstractMatcher; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import javax.ws.rs.HttpMethod; +import javax.ws.rs.Path; import org.apache.guacamole.GuacamoleException; /** @@ -67,7 +68,7 @@ public class RESTMethodMatcher extends AbstractMatcher { /** * Returns whether the given method is annotated as a REST method. A REST * method is annotated with an annotation which is annotated with - * @HttpMethod. + * @HttpMethod or @Path. * * @param method * The method to test. @@ -86,6 +87,10 @@ public class RESTMethodMatcher extends AbstractMatcher { if (annotationType.isAnnotationPresent(HttpMethod.class)) return true; + // A method is a REST method if it is annotated with @Path + if (Path.class.isAssignableFrom(annotationType)) + return true; + } // A method is also REST method if it overrides a REST method within