From 276d5f405910e6d91610a8e15697b8383448da84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Tue, 20 Nov 2012 11:46:12 +0200 Subject: [PATCH] Rename VaadinRequest.getRequestPathInfo() to getPathInfo() (#9749) Change-Id: Ibf460de507b4eea156a794304476b547bf63291a --- .../src/com/vaadin/server/AbstractCommunicationManager.java | 4 ++-- server/src/com/vaadin/server/BrowserPopupUIProvider.java | 2 +- server/src/com/vaadin/server/CommunicationManager.java | 2 +- server/src/com/vaadin/server/ConnectorResourceHandler.java | 4 ++-- server/src/com/vaadin/server/GlobalResourceHandler.java | 4 ++-- .../src/com/vaadin/server/LegacyApplicationUIProvider.java | 2 +- server/src/com/vaadin/server/ServletPortletHelper.java | 2 +- server/src/com/vaadin/server/VaadinPortletRequest.java | 2 +- server/src/com/vaadin/server/VaadinRequest.java | 2 +- server/src/com/vaadin/server/VaadinServletRequest.java | 5 ----- uitest/src/com/vaadin/tests/Parameters.java | 2 +- .../com/vaadin/tests/application/NavigateWithOngoingXHR.java | 2 +- .../vaadin/tests/applicationservlet/InitParamUIProvider.java | 2 +- uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java | 2 +- .../tests/minitutorials/v7a1/UsingXyzWhenInitializing.java | 2 +- uitest/src/com/vaadin/tests/tickets/Ticket1589.java | 2 +- uitest/src/com/vaadin/tests/tickets/Ticket2292.java | 2 +- 17 files changed, 19 insertions(+), 24 deletions(-) diff --git a/server/src/com/vaadin/server/AbstractCommunicationManager.java b/server/src/com/vaadin/server/AbstractCommunicationManager.java index dc987530bd..74e5d5fd20 100644 --- a/server/src/com/vaadin/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/server/AbstractCommunicationManager.java @@ -2632,7 +2632,7 @@ public abstract class AbstractCommunicationManager implements Serializable { public void serveDependencyResource(VaadinRequest request, VaadinResponse response) throws IOException { - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); // + 2 to also remove beginning and ending slashes String resourceName = pathInfo .substring(ApplicationConstants.DEPENDENCY_RESOURCE_PREFIX @@ -2734,7 +2734,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * #createReceiverUrl */ - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); // strip away part until the data we are interested starts int startOfData = pathInfo .indexOf(ServletPortletHelper.UPLOAD_URL_PREFIX) diff --git a/server/src/com/vaadin/server/BrowserPopupUIProvider.java b/server/src/com/vaadin/server/BrowserPopupUIProvider.java index 23036dabed..6259fb605d 100644 --- a/server/src/com/vaadin/server/BrowserPopupUIProvider.java +++ b/server/src/com/vaadin/server/BrowserPopupUIProvider.java @@ -40,7 +40,7 @@ public class BrowserPopupUIProvider extends UIProvider { @Override public Class getUIClass(UIClassSelectionEvent event) { - String requestPathInfo = event.getRequest().getRequestPathInfo(); + String requestPathInfo = event.getRequest().getPathInfo(); if (path.equals(requestPathInfo)) { return uiClass; } else { diff --git a/server/src/com/vaadin/server/CommunicationManager.java b/server/src/com/vaadin/server/CommunicationManager.java index 19a431c882..6d60789be7 100644 --- a/server/src/com/vaadin/server/CommunicationManager.java +++ b/server/src/com/vaadin/server/CommunicationManager.java @@ -53,7 +53,7 @@ public class CommunicationManager extends AbstractCommunicationManager { return new BootstrapHandler() { @Override protected String getServiceUrl(BootstrapContext context) { - String pathInfo = context.getRequest().getRequestPathInfo(); + String pathInfo = context.getRequest().getPathInfo(); if (pathInfo == null) { return null; } else { diff --git a/server/src/com/vaadin/server/ConnectorResourceHandler.java b/server/src/com/vaadin/server/ConnectorResourceHandler.java index dd785e97b8..5cd218471c 100644 --- a/server/src/com/vaadin/server/ConnectorResourceHandler.java +++ b/server/src/com/vaadin/server/ConnectorResourceHandler.java @@ -26,7 +26,7 @@ public class ConnectorResourceHandler implements RequestHandler { @Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - String requestPath = request.getRequestPathInfo(); + String requestPath = request.getPathInfo(); if (requestPath == null) { return false; } @@ -80,7 +80,7 @@ public class ConnectorResourceHandler implements RequestHandler { VaadinResponse response, String logMessage) throws IOException { getLogger().log(Level.WARNING, logMessage); response.sendError(HttpServletResponse.SC_NOT_FOUND, - request.getRequestPathInfo() + " can not be found"); + request.getPathInfo() + " can not be found"); // Request handled (though not in a nice way) return true; diff --git a/server/src/com/vaadin/server/GlobalResourceHandler.java b/server/src/com/vaadin/server/GlobalResourceHandler.java index 23c294650e..119f9cdae0 100644 --- a/server/src/com/vaadin/server/GlobalResourceHandler.java +++ b/server/src/com/vaadin/server/GlobalResourceHandler.java @@ -68,7 +68,7 @@ public class GlobalResourceHandler implements RequestHandler { @Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); if (pathInfo == null) { return false; } @@ -229,7 +229,7 @@ public class GlobalResourceHandler implements RequestHandler { VaadinResponse response, String logMessage) throws IOException { getLogger().log(Level.WARNING, logMessage); response.sendError(HttpServletResponse.SC_NOT_FOUND, - request.getRequestPathInfo() + " can not be found"); + request.getPathInfo() + " can not be found"); // Request handled (though not in a nice way) return true; diff --git a/server/src/com/vaadin/server/LegacyApplicationUIProvider.java b/server/src/com/vaadin/server/LegacyApplicationUIProvider.java index b3e8af8184..d139ee19f6 100644 --- a/server/src/com/vaadin/server/LegacyApplicationUIProvider.java +++ b/server/src/com/vaadin/server/LegacyApplicationUIProvider.java @@ -76,7 +76,7 @@ public abstract class LegacyApplicationUIProvider extends UIProvider { private UI getUIInstance(UIProviderEvent event) { VaadinRequest request = event.getRequest(); - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); String name = null; if (pathInfo != null && pathInfo.length() > 0) { Matcher matcher = WINDOW_NAME_PATTERN.matcher(pathInfo); diff --git a/server/src/com/vaadin/server/ServletPortletHelper.java b/server/src/com/vaadin/server/ServletPortletHelper.java index 6fb03ab265..07218f9abd 100644 --- a/server/src/com/vaadin/server/ServletPortletHelper.java +++ b/server/src/com/vaadin/server/ServletPortletHelper.java @@ -79,7 +79,7 @@ class ServletPortletHelper implements Serializable { } private static boolean hasPathPrefix(VaadinRequest request, String prefix) { - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); if (pathInfo == null) { return false; diff --git a/server/src/com/vaadin/server/VaadinPortletRequest.java b/server/src/com/vaadin/server/VaadinPortletRequest.java index f4ad040321..259b227b42 100644 --- a/server/src/com/vaadin/server/VaadinPortletRequest.java +++ b/server/src/com/vaadin/server/VaadinPortletRequest.java @@ -97,7 +97,7 @@ public class VaadinPortletRequest implements VaadinRequest { } @Override - public String getRequestPathInfo() { + public String getPathInfo() { if (request instanceof ResourceRequest) { ResourceRequest resourceRequest = (ResourceRequest) request; String resourceID = resourceRequest.getResourceID(); diff --git a/server/src/com/vaadin/server/VaadinRequest.java b/server/src/com/vaadin/server/VaadinRequest.java index f5786c9b80..9e454761f2 100644 --- a/server/src/com/vaadin/server/VaadinRequest.java +++ b/server/src/com/vaadin/server/VaadinRequest.java @@ -122,7 +122,7 @@ public interface VaadinRequest extends Serializable { * * @see javax.servlet.http.HttpServletRequest#getPathInfo() */ - public String getRequestPathInfo(); + public String getPathInfo(); /** * Returns the portion of the request URI that indicates the context of the diff --git a/server/src/com/vaadin/server/VaadinServletRequest.java b/server/src/com/vaadin/server/VaadinServletRequest.java index 5b4b876244..e0ad94c18c 100644 --- a/server/src/com/vaadin/server/VaadinServletRequest.java +++ b/server/src/com/vaadin/server/VaadinServletRequest.java @@ -48,11 +48,6 @@ public class VaadinServletRequest extends HttpServletRequestWrapper implements this.vaadinService = vaadinService; } - @Override - public String getRequestPathInfo() { - return getPathInfo(); - } - @Override public WrappedSession getWrappedSession() { return getWrappedSession(true); diff --git a/uitest/src/com/vaadin/tests/Parameters.java b/uitest/src/com/vaadin/tests/Parameters.java index feb9a8cf6b..934a98e910 100644 --- a/uitest/src/com/vaadin/tests/Parameters.java +++ b/uitest/src/com/vaadin/tests/Parameters.java @@ -110,7 +110,7 @@ public class Parameters extends com.vaadin.server.LegacyApplication implements public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { context.setValue("Context not available"); - relative.setValue(request.getRequestPathInfo()); + relative.setValue(request.getPathInfo()); params.removeAllItems(); Map parameters = request.getParameterMap(); diff --git a/uitest/src/com/vaadin/tests/application/NavigateWithOngoingXHR.java b/uitest/src/com/vaadin/tests/application/NavigateWithOngoingXHR.java index 5e3094b66c..d32ecb583d 100644 --- a/uitest/src/com/vaadin/tests/application/NavigateWithOngoingXHR.java +++ b/uitest/src/com/vaadin/tests/application/NavigateWithOngoingXHR.java @@ -35,7 +35,7 @@ public class NavigateWithOngoingXHR extends AbstractTestUI { public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - if ("/slowRequestHandler".equals(request.getRequestPathInfo())) { + if ("/slowRequestHandler".equals(request.getPathInfo())) { // Make the navigation request last longer to keep the // communication error visible // System.out.println("Got slow content request"); diff --git a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java index b4f29dda06..e62cd9a4f9 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java @@ -27,7 +27,7 @@ public class InitParamUIProvider extends UIProvider { @Override public Class getUIClass(UIClassSelectionEvent event) { VaadinRequest request = event.getRequest(); - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); if ("/test".equals(pathInfo)) { return BasicJavaScriptComponent.class; } else { diff --git a/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java b/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java index 57fc9f3e62..984ac69d6e 100644 --- a/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java +++ b/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java @@ -87,7 +87,7 @@ public class LazyInitUIs extends AbstractTestUIProvider { public static Label getRequestInfo(String name, VaadinRequest request) { String info = name; - info += "
pathInfo: " + request.getRequestPathInfo(); + info += "
pathInfo: " + request.getPathInfo(); info += "
parameters: " + request.getParameterMap().keySet(); info += "
uri fragment: " + Page.getCurrent().getLocation().getFragment(); diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java index c4d496641d..6cf0514df4 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java @@ -44,7 +44,7 @@ public class UsingXyzWhenInitializing extends UI { layout.addComponent(new Label("Hello " + name)); - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); if ("/viewSource".equals(pathInfo)) { layout.addComponent(new Label("This is the source")); } else { diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java index 9b5be40aa3..db6fa682fc 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java @@ -54,7 +54,7 @@ class MyDynamicResource implements RequestHandler { @Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - String relativeUri = request.getRequestPathInfo(); + String relativeUri = request.getPathInfo(); // Catch the given URI that identifies the resource, otherwise let other // URI handlers or the Application to handle the response. if (!relativeUri.startsWith("myresource")) { diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java index 2fd843ede6..e81ad3185a 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java @@ -50,7 +50,7 @@ public class Ticket2292 extends com.vaadin.server.LegacyApplication implements @Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - String relativeUri = request.getRequestPathInfo(); + String relativeUri = request.getPathInfo(); if (!relativeUri.contains("icon.png")) { return false; -- 2.39.5