JAMES-1742 Introduce JMAP URLs constants

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/c20adf87
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/c20adf87
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/c20adf87

Branch: refs/heads/master
Commit: c20adf87c2ea607e8e510e1e7368613e1916f211
Parents: 74fd6c2
Author: Antoine Duprat <adup...@linagora.com>
Authored: Wed May 25 11:35:33 2016 +0200
Committer: Antoine Duprat <adup...@linagora.com>
Committed: Mon Jun 6 13:05:37 2016 +0200

----------------------------------------------------------------------
 .../james/jmap/AuthenticationServlet.java       |  4 +--
 .../java/org/apache/james/jmap/JMAPServer.java  |  8 +++---
 .../java/org/apache/james/jmap/JMAPUrls.java    | 26 ++++++++++++++++++++
 3 files changed, 32 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/c20adf87/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
----------------------------------------------------------------------
diff --git 
a/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
 
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
index 2984a7d..ed4b11e 100644
--- 
a/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
+++ 
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/AuthenticationServlet.java
@@ -179,7 +179,7 @@ public class AuthenticationServlet extends HttpServlet {
         AccessTokenResponse response = AccessTokenResponse
             .builder()
             .accessToken(accessTokenManager.grantAccessToken(username))
-            .api("/jmap")
+            .api(JMAPUrls.JMAP)
             .eventSource("/notImplemented")
             .upload("/notImplemented")
             .download("/notImplemented")
@@ -192,7 +192,7 @@ public class AuthenticationServlet extends HttpServlet {
         resp.setStatus(HttpServletResponse.SC_OK);
         EndPointsResponse response = EndPointsResponse
             .builder()
-            .api("/jmap")
+            .api(JMAPUrls.JMAP)
             .eventSource("/notImplemented")
             .upload("/notImplemented")
             .download("/notImplemented")

http://git-wip-us.apache.org/repos/asf/james-project/blob/c20adf87/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
----------------------------------------------------------------------
diff --git 
a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java 
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
index 17ac730..c3b0665 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
@@ -44,14 +44,14 @@ public class JMAPServer implements Configurable {
 
         server = JettyHttpServer.create(
                 configurationBuilderFor(jmapConfiguration)
-                        .serve("/authentication")
+                        .serve(JMAPUrls.AUTHENTICATION)
                             .with(authenticationServlet)
-                        .filter("/authentication")
+                        .filter(JMAPUrls.AUTHENTICATION)
                             .with(new 
AllowAllCrossOriginRequests(bypass(authenticationFilter).on("POST").and("OPTIONS").only()))
                             .only()
-                        .serve("/jmap")
+                        .serve(JMAPUrls.JMAP)
                             .with(jmapServlet)
-                        .filter("/jmap")
+                        .filter(JMAPUrls.JMAP)
                             .with(new 
AllowAllCrossOriginRequests(bypass(authenticationFilter).on("OPTIONS").only()))
                             .and(firstUserConnectionFilter)
                             .only()

http://git-wip-us.apache.org/repos/asf/james-project/blob/c20adf87/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java
----------------------------------------------------------------------
diff --git 
a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java 
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java
new file mode 100644
index 0000000..719bd49
--- /dev/null
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPUrls.java
@@ -0,0 +1,26 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.jmap;
+
+public interface JMAPUrls {
+
+    String JMAP = "/jmap";
+    String AUTHENTICATION = "/authentication";
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to