guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [19/24] incubator-guacamole-client git commit: GUACAMOLE-5: Consider methods annotated with @Path to be REST methods as well.
Date Wed, 13 Jul 2016 05:09:57 GMT
GUACAMOLE-5: Consider methods annotated with @Path to be REST methods as well.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/fa286f54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/fa286f54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/fa286f54

Branch: refs/heads/master
Commit: fa286f549a3bc7c69ac03b5945bac1f51e728a23
Parents: c586d18
Author: Michael Jumper <mjumper@apache.org>
Authored: Tue Jul 12 18:52:26 2016 -0700
Committer: Michael Jumper <mjumper@apache.org>
Committed: Tue Jul 12 21:23:47 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/guacamole/rest/RESTMethodMatcher.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/fa286f54/guacamole/src/main/java/org/apache/guacamole/rest/RESTMethodMatcher.java
----------------------------------------------------------------------
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 c80750c..623932f 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<Method> {
     /**
      * Returns whether the given method is annotated as a REST method. A REST
      * method is annotated with an annotation which is annotated with
-     * <code>@HttpMethod</code>.
+     * <code>@HttpMethod</code> or <code>@Path</code>.
      *
      * @param method
      *     The method to test.
@@ -86,6 +87,10 @@ public class RESTMethodMatcher extends AbstractMatcher<Method> {
             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


Mime
View raw message