* Also rename the constants to cause compile errors in 3rd party code Change-Id: If96c9956de7737345ec9372be28292b3490387a2tags/7.0.0.beta10
@@ -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()); | |||
@@ -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; | |||
} | |||
@@ -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); | |||
} | |||
} |
@@ -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. |
@@ -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 |
@@ -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"; |
@@ -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 { |
@@ -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); | |||
} | |||
@@ -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; |
@@ -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, |
@@ -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); | |||
} |
@@ -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://"; |