diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-21 14:22:44 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-11-21 14:22:58 +0200 |
commit | 6ed87c1b6ce280082c2dee21a6f87c1620e0ea79 (patch) | |
tree | 907c13b4491867904034218c00b335781ddd6783 /server | |
parent | 416b8a6d6b9eb580454f006b38a72ffe7f484638 (diff) | |
download | vaadin-framework-6ed87c1b6ce280082c2dee21a6f87c1620e0ea79.tar.gz vaadin-framework-6ed87c1b6ce280082c2dee21a6f87c1620e0ea79.zip |
Remove slashes from beginning or end of constants (#10140)
* Also rename the constants to cause compile errors in 3rd party code
Change-Id: If96c9956de7737345ec9372be28292b3490387a2
Diffstat (limited to 'server')
10 files changed, 19 insertions, 18 deletions
diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index 43fc6a5c70..13268c596c 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -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; } diff --git a/server/src/com/vaadin/server/CommunicationManager.java b/server/src/com/vaadin/server/CommunicationManager.java index acc0e46c0c..1d8ef2d0e7 100644 --- a/server/src/com/vaadin/server/CommunicationManager.java +++ b/server/src/com/vaadin/server/CommunicationManager.java @@ -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); } } diff --git a/server/src/com/vaadin/server/ConnectorResource.java b/server/src/com/vaadin/server/ConnectorResource.java index e696c35c0d..2cbc18bf58 100644 --- a/server/src/com/vaadin/server/ConnectorResource.java +++ b/server/src/com/vaadin/server/ConnectorResource.java @@ -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. diff --git a/server/src/com/vaadin/server/ConnectorResourceHandler.java b/server/src/com/vaadin/server/ConnectorResourceHandler.java index 5cd218471c..b82c0e2ff8 100644 --- a/server/src/com/vaadin/server/ConnectorResourceHandler.java +++ b/server/src/com/vaadin/server/ConnectorResourceHandler.java @@ -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 diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java index faf24b4bce..e63d7e7111 100644 --- a/server/src/com/vaadin/server/Constants.java +++ b/server/src/com/vaadin/server/Constants.java @@ -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"; diff --git a/server/src/com/vaadin/server/GlobalResourceHandler.java b/server/src/com/vaadin/server/GlobalResourceHandler.java index 119f9cdae0..94505658c3 100644 --- a/server/src/com/vaadin/server/GlobalResourceHandler.java +++ b/server/src/com/vaadin/server/GlobalResourceHandler.java @@ -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 { diff --git a/server/src/com/vaadin/server/PortletCommunicationManager.java b/server/src/com/vaadin/server/PortletCommunicationManager.java index 0d63c4b8dc..ce67aedcb3 100644 --- a/server/src/com/vaadin/server/PortletCommunicationManager.java +++ b/server/src/com/vaadin/server/PortletCommunicationManager.java @@ -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); } diff --git a/server/src/com/vaadin/server/ResourceReference.java b/server/src/com/vaadin/server/ResourceReference.java index fbb8af89c1..94b9f1ac9a 100644 --- a/server/src/com/vaadin/server/ResourceReference.java +++ b/server/src/com/vaadin/server/ResourceReference.java @@ -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; diff --git a/server/src/com/vaadin/server/ServletPortletHelper.java b/server/src/com/vaadin/server/ServletPortletHelper.java index be5fd1c287..cbedeabf51 100644 --- a/server/src/com/vaadin/server/ServletPortletHelper.java +++ b/server/src/com/vaadin/server/ServletPortletHelper.java @@ -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, diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java index 9c131b9700..8e35b0b2ac 100644 --- a/server/src/com/vaadin/ui/LoginForm.java +++ b/server/src/com/vaadin/ui/LoginForm.java @@ -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); } |