diff --git a/build.gradle b/build.gradle index eaf323e08..ffca83918 100644 --- a/build.gradle +++ b/build.gradle @@ -50,14 +50,14 @@ configure(allprojects) { } repositories { - maven { url 'http://repo.spring.io/libs-release' } + maven { url 'https://repo.spring.io/libs-release' } } dependencies { compile("commons-logging:commons-logging:1.1.3") compile("org.springframework:spring-core:$springVersion") - testCompile("junit:junit:4.10") + testCompile("junit:junit:4.12") testCompile("org.easymock:easymock:3.1") testCompile("xmlunit:xmlunit:1.5") testCompile("com.sun.mail:javax.mail:1.5.4") @@ -84,7 +84,15 @@ configure(subprojects) { subproject -> apply plugin: "propdeps-maven" apply from: "${rootProject.projectDir}/publish-maven.gradle" - if (project.hasProperty('platformVersion')) { + /** + * To run an alternate profile... + * ./gradlew -Pprofile=spring4-next clean build + * ./gradlew -Pprofile=spring5 clean build + */ + if (project.hasProperty('profile')) { + apply from: "${project.rootDir}/${profile}-profile.gradle" + println "+++ Configuring ${subproject.name} for Spring Framework ${springVersion}" + } else if (project.hasProperty('platformVersion')) { apply plugin: 'spring-io' repositories { diff --git a/spring-ws-core/src/main/java/org/springframework/ws/support/WebUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/support/WebUtils.java new file mode 100644 index 000000000..26cf3f547 --- /dev/null +++ b/spring-ws-core/src/main/java/org/springframework/ws/support/WebUtils.java @@ -0,0 +1,68 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed 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.springframework.ws.support; + +/** + * Miscellaneous utilities for web applications. Used by various framework classes. + * + * NOTE: These are the parts of org.springframework.web.util.WebUtils deprecated in Spring Framework 5. + * + * @author Greg Turnquist + * @author Rod Johnson + * @author Juergen Hoeller + * @author Sebastien Deleuze + * @since 2.4.0 + */ +public abstract class WebUtils { + + /** + * Extract the URL filename from the given request URL path. + * Correctly resolves nested paths such as "/products/view.html" as well. + * @param urlPath the request URL path (e.g. "/index.html") + * @return the extracted URI filename (e.g. "index") + */ + public static String extractFilenameFromUrlPath(String urlPath) { + String filename = extractFullFilenameFromUrlPath(urlPath); + int dotIndex = filename.lastIndexOf('.'); + if (dotIndex != -1) { + filename = filename.substring(0, dotIndex); + } + return filename; + } + + /** + * Extract the full URL filename (including file extension) from the given + * request URL path. Correctly resolve nested paths such as + * "/products/view.html" and remove any path and or query parameters. + * @param urlPath the request URL path (e.g. "/products/index.html") + * @return the extracted URI filename (e.g. "index.html") + */ + public static String extractFullFilenameFromUrlPath(String urlPath) { + int end = urlPath.indexOf('?'); + if (end == -1) { + end = urlPath.indexOf('#'); + if (end == -1) { + end = urlPath.length(); + } + } + int begin = urlPath.lastIndexOf('/', end) + 1; + int paramIndex = urlPath.indexOf(';', begin); + end = (paramIndex != -1 && paramIndex < end ? paramIndex : end); + return urlPath.substring(begin, end); + } + + +} diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java index 15b000f10..dbf08791b 100644 --- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java +++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java @@ -28,7 +28,6 @@ import org.springframework.web.context.WebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; import org.springframework.web.servlet.FrameworkServlet; -import org.springframework.web.util.WebUtils; import org.springframework.ws.WebServiceMessageFactory; import org.springframework.ws.server.EndpointAdapter; import org.springframework.ws.server.EndpointExceptionResolver; @@ -36,6 +35,7 @@ import org.springframework.ws.server.MessageDispatcher; import org.springframework.ws.support.DefaultStrategiesHelper; import org.springframework.ws.transport.WebServiceMessageReceiver; +import org.springframework.ws.support.WebUtils; import org.springframework.ws.wsdl.WsdlDefinition; import org.springframework.xml.xsd.XsdSchema; diff --git a/spring-ws-core/src/test/java/org/springframework/ws/transport/http/HttpComponentsMessageSenderIntegrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/transport/http/HttpComponentsMessageSenderIntegrationTest.java index f7f36d05c..9f3904b60 100644 --- a/spring-ws-core/src/test/java/org/springframework/ws/transport/http/HttpComponentsMessageSenderIntegrationTest.java +++ b/spring-ws-core/src/test/java/org/springframework/ws/transport/http/HttpComponentsMessageSenderIntegrationTest.java @@ -17,14 +17,14 @@ package org.springframework.ws.transport.http; import static org.hamcrest.core.IsEqual.*; -import static org.springframework.test.util.MatcherAssertionErrors.*; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; import java.util.Map; + import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; diff --git a/spring-ws-core/src/test/resources/org/springframework/ws/config/interceptorsBeanDefinitionParserOrderTest.xml b/spring-ws-core/src/test/resources/org/springframework/ws/config/interceptorsBeanDefinitionParserOrderTest.xml index 1ba65c423..ac55bffe0 100644 --- a/spring-ws-core/src/test/resources/org/springframework/ws/config/interceptorsBeanDefinitionParserOrderTest.xml +++ b/spring-ws-core/src/test/resources/org/springframework/ws/config/interceptorsBeanDefinitionParserOrderTest.xml @@ -18,7 +18,7 @@ - + diff --git a/spring-ws-core/src/test/resources/org/springframework/ws/config/interceptorsBeanDefinitionParserTest.xml b/spring-ws-core/src/test/resources/org/springframework/ws/config/interceptorsBeanDefinitionParserTest.xml index 9a9d60cd1..ce55385b1 100644 --- a/spring-ws-core/src/test/resources/org/springframework/ws/config/interceptorsBeanDefinitionParserTest.xml +++ b/spring-ws-core/src/test/resources/org/springframework/ws/config/interceptorsBeanDefinitionParserTest.xml @@ -15,7 +15,7 @@ - + diff --git a/spring4-next-profile.gradle b/spring4-next-profile.gradle new file mode 100644 index 000000000..737f195a2 --- /dev/null +++ b/spring4-next-profile.gradle @@ -0,0 +1,6 @@ +/** + * Enable with "-Pprofile=spring4-next" + */ + +ext.springVersion = "4.3.2.RELEASE" +ext.springSecurityVersion = "4.1.3.RELEASE" \ No newline at end of file diff --git a/spring5-profile.gradle b/spring5-profile.gradle new file mode 100644 index 000000000..612728176 --- /dev/null +++ b/spring5-profile.gradle @@ -0,0 +1,15 @@ +/** + * Enable with "-Pprofile=spring5" + */ + +ext.springVersion = "5.0.0.BUILD-SNAPSHOT" +ext.springSecurityVersion = "4.2.0.BUILD-SNAPSHOT" + +compileJava { + sourceCompatibility=1.8 + targetCompatibility=1.8 +} + +repositories { + maven { url 'https://repo.spring.io/libs-snapshot' } +}