]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove slashes from beginning or end of constants (#10140) 20/320/1
authorLeif Åstrand <leif@vaadin.com>
Wed, 21 Nov 2012 12:22:44 +0000 (14:22 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 21 Nov 2012 12:22:58 +0000 (14:22 +0200)
* Also rename the constants to cause compile errors in 3rd party code

Change-Id: If96c9956de7737345ec9372be28292b3490387a2

12 files changed:
client/src/com/vaadin/client/ApplicationConnection.java
server/src/com/vaadin/server/BootstrapHandler.java
server/src/com/vaadin/server/CommunicationManager.java
server/src/com/vaadin/server/ConnectorResource.java
server/src/com/vaadin/server/ConnectorResourceHandler.java
server/src/com/vaadin/server/Constants.java
server/src/com/vaadin/server/GlobalResourceHandler.java
server/src/com/vaadin/server/PortletCommunicationManager.java
server/src/com/vaadin/server/ResourceReference.java
server/src/com/vaadin/server/ServletPortletHelper.java
server/src/com/vaadin/ui/LoginForm.java
shared/src/com/vaadin/shared/ApplicationConstants.java

index ede16b8125d42e743bf7960efa58b26fbc3f84a5..0dbc0984a74d74de5f53c5bda6ba561040d46f2e 100644 (file)
@@ -681,7 +681,7 @@ public class ApplicationConnection {
                 + requestData;
         VConsole.log("Making UIDL Request with params: " + payload);
         String uri = translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX
-                + ApplicationConstants.UIDL_REQUEST_PATH);
+                + ApplicationConstants.UIDL_PATH + '/');
 
         if (extraParams != null && extraParams.length() > 0) {
             uri = addGetParameters(uri, extraParams);
@@ -3068,7 +3068,7 @@ public class ApplicationConnection {
     protected void sendHeartbeat() {
         final String uri = addGetParameters(
                 translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX
-                        + ApplicationConstants.HEARTBEAT_REQUEST_PATH),
+                        + ApplicationConstants.HEARTBEAT_PATH + '/'),
                 UIConstants.UI_ID_PARAMETER + "="
                         + getConfiguration().getUIId());
 
index 43fc6a5c702b73f2127065bf4e15f9e6737c5d71..13268c596c88fc7a54b6d844b71f3c9b09e14cb0 100644 (file)
@@ -487,7 +487,7 @@ public abstract class BootstrapHandler implements RequestHandler {
         VaadinRequest request = context.getRequest();
         final String staticFilePath = request.getService()
                 .getStaticFileLocation(request);
-        return staticFilePath + "/" + VaadinServlet.THEME_DIRECTORY_PATH
+        return staticFilePath + "/" + VaadinServlet.THEME_DIR_PATH + '/'
                 + themeName;
     }
 
index acc0e46c0c343eca3b994ad4197a137138d646d3..1d8ef2d0e701ba97d5c7236e4cb76b9e73886ae0 100644 (file)
@@ -87,7 +87,7 @@ public class CommunicationManager extends AbstractCommunicationManager {
         ServletContext servletContext = service.getServlet()
                 .getServletContext();
         return servletContext.getResourceAsStream("/"
-                + VaadinServlet.THEME_DIRECTORY_PATH + themeName + "/"
+                + VaadinServlet.THEME_DIR_PATH + '/' + themeName + "/"
                 + resource);
     }
 }
index e696c35c0dfe736b214f2659e34bb8170330f394..2cbc18bf58d6d5fa0fcad905661b7c8c464387ba 100644 (file)
@@ -26,7 +26,7 @@ package com.vaadin.server;
  * @since 7.0.0
  */
 public interface ConnectorResource extends Resource {
-    public static final String CONNECTOR_REQUEST_PATH = "connector/";
+    public static final String CONNECTOR_PATH = "connector";
 
     /**
      * Gets resource as stream.
index 5cd218471cf411ee920094807c115a4f5a7b69e3..b82c0e2ff88d234c36ace78a12628ab7394c3a1b 100644 (file)
@@ -14,8 +14,8 @@ import com.vaadin.ui.UI;
 public class ConnectorResourceHandler implements RequestHandler {
     // APP/connector/[uiid]/[cid]/[filename.xyz]
     private static final Pattern CONNECTOR_RESOURCE_PATTERN = Pattern
-            .compile("^/?" + ApplicationConstants.APP_REQUEST_PATH + '/'
-                    + ConnectorResource.CONNECTOR_REQUEST_PATH
+            .compile("^/?" + ApplicationConstants.APP_PATH + '/'
+                    + ConnectorResource.CONNECTOR_PATH + '/'
                     + "(\\d+)/(\\d+)/(.*)");
 
     private static Logger getLogger() {
@@ -63,7 +63,7 @@ public class ConnectorResourceHandler implements RequestHandler {
 
             return true;
         } else if (requestPath.matches('/'
-                + ApplicationConstants.APP_REQUEST_PATH + "(/.*)?")) {
+                + ApplicationConstants.APP_PATH + "(/.*)?")) {
             /*
              * This should be the last request handler before we get to
              * bootstrap logic. Prevent /APP requests from reaching bootstrap
index faf24b4bce97f25e31bb35b7464e970bcca37add..e63d7e7111a235b0d25ad6a47ee160a901ab6056 100644 (file)
@@ -72,11 +72,11 @@ public interface Constants {
 
     static final int MAX_BUFFER_SIZE = 64 * 1024;
 
-    final String THEME_DIRECTORY_PATH = "VAADIN/themes/";
+    final String THEME_DIR_PATH = "VAADIN/themes";
 
     static final int DEFAULT_THEME_CACHETIME = 1000 * 60 * 60 * 24;
 
-    static final String WIDGETSET_DIRECTORY_PATH = "VAADIN/widgetsets/";
+    static final String WIDGETSET_DIR_PATH = "VAADIN/widgetsets";
 
     // Name of the default widget set, used if not specified in web.xml
     static final String DEFAULT_WIDGETSET = "com.vaadin.DefaultWidgetSet";
index 119f9cdae08b088cee572e28e183cb3cf00845ca..94505658c33a7626aff8a145138fb3eac7c19fdc 100644 (file)
@@ -61,7 +61,7 @@ public class GlobalResourceHandler implements RequestHandler {
 
     // APP/global/[uiid]/[type]/[id]
     private static final Matcher matcher = Pattern.compile(
-            "^/?" + ApplicationConstants.APP_REQUEST_PATH + '/'
+            "^/?" + ApplicationConstants.APP_PATH + '/'
                     + RESOURCE_REQUEST_PATH + "(\\d+)/(([^/]+)(/.*))").matcher(
             "");
 
@@ -189,7 +189,7 @@ public class GlobalResourceHandler implements RequestHandler {
         String uri = legacyResourceKeys.get(resource);
         if (uri != null && !uri.isEmpty()) {
             return ApplicationConstants.APP_PROTOCOL_PREFIX
-                    + ApplicationConstants.APP_REQUEST_PATH + '/'
+                    + ApplicationConstants.APP_PATH + '/'
                     + RESOURCE_REQUEST_PATH + connector.getUI().getUIId() + '/'
                     + uri;
         } else {
index 0d63c4b8dc9e550689d3e7c89848885a46f036a4..ce67aedcb38fca0f6847659c078111937682b837 100644 (file)
@@ -140,7 +140,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager {
         PortletContext portletContext = session.getPortletSession()
                 .getPortletContext();
         return portletContext.getResourceAsStream("/"
-                + VaadinPortlet.THEME_DIRECTORY_PATH + themeName + "/"
+                + VaadinPortlet.THEME_DIR_PATH + '/' + themeName + "/"
                 + resource);
     }
 
index fbb8af89c1da037822a7373af9f6b43dd3579700..94b9f1ac9aa4645736f510c2e4b8151a30b8e72b 100644 (file)
@@ -78,8 +78,8 @@ public class ResourceReference extends URLReference {
     private static String getConnectorResourceBase(String filename,
             ClientConnector connector) {
         String uri = ApplicationConstants.APP_PROTOCOL_PREFIX
-                + ApplicationConstants.APP_REQUEST_PATH + '/'
-                + ConnectorResource.CONNECTOR_REQUEST_PATH
+                + ApplicationConstants.APP_PATH + '/'
+                + ConnectorResource.CONNECTOR_PATH + '/'
                 + connector.getUI().getUIId() + '/'
                 + connector.getConnectorId() + '/' + encodeFileName(filename);
         return uri;
index be5fd1c28799f15785f93522e239d2e316918dd6..cbedeabf515d7c61034d219708d0336d88801b36 100644 (file)
@@ -106,17 +106,18 @@ class ServletPortletHelper implements Serializable {
     }
 
     public static boolean isUIDLRequest(VaadinRequest request) {
-        return hasPathPrefix(request, ApplicationConstants.UIDL_REQUEST_PATH);
+        return hasPathPrefix(request,
+                ApplicationConstants.UIDL_PATH + '/');
     }
 
     public static boolean isAppRequest(VaadinRequest request) {
         return hasPathPrefix(request,
-                ApplicationConstants.APP_REQUEST_PATH + '/');
+                ApplicationConstants.APP_PATH + '/');
     }
 
     public static boolean isHeartbeatRequest(VaadinRequest request) {
         return hasPathPrefix(request,
-                ApplicationConstants.HEARTBEAT_REQUEST_PATH);
+                ApplicationConstants.HEARTBEAT_PATH + '/');
     }
 
     public static void initDefaultUIProvider(VaadinSession session,
index 9c131b9700c66f26c25c6846ddbafb5c2c1404f6..8e35b0b2ac79250abec5351adec9fd3546743799 100644 (file)
@@ -119,8 +119,8 @@ public class LoginForm extends CustomComponent {
         // Generate magic URL now when UI id and connectorId are known
         iframe.setSource(new ExternalResource(
                 ApplicationConstants.APP_PROTOCOL_PREFIX
-                        + ApplicationConstants.APP_REQUEST_PATH + '/'
-                        + ConnectorResource.CONNECTOR_REQUEST_PATH
+                        + ApplicationConstants.APP_PATH + '/'
+                        + ConnectorResource.CONNECTOR_PATH + '/'
                         + getUI().getUIId() + '/' + getConnectorId() + "/login"));
         super.beforeClientResponse(initial);
     }
index a21a0d0b35b6ac0c3b7233e3e03816004b6b4fcf..7b24ef732c9d487b5a10817d7903d9ad0afae2a7 100644 (file)
@@ -20,13 +20,13 @@ public class ApplicationConstants {
     // This indicates the whole page is generated by us (not embedded)
     public static final String GENERATED_BODY_CLASSNAME = "v-generated-body";
 
-    public static final String APP_REQUEST_PATH = "APP";
+    public static final String APP_PATH = "APP";
 
-    public static final String UIDL_REQUEST_PATH = "UIDL/";
+    public static final String UIDL_PATH = "UIDL";
 
-    public static final String HEARTBEAT_REQUEST_PATH = "HEARTBEAT/";
+    public static final String HEARTBEAT_PATH = "HEARTBEAT";
 
-    public static final String PUBLISHED_FILE_PATH = APP_REQUEST_PATH + '/'
+    public static final String PUBLISHED_FILE_PATH = APP_PATH + '/'
             + "PUBLISHED";
 
     public static final String APP_PROTOCOL_PREFIX = "app://";