File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed
spring-boot-samples/spring-boot-sample-tomcat-jsp/src/main/resources/META-INF/resources
main/java/org/springframework/boot/context/embedded/tomcat
test/java/org/springframework/boot/context/embedded/tomcat Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ void addResourceJars(List<URL> resourceJarUrls) {
5959 }
6060 addJar (jar );
6161 }
62+ else if ("jar" .equals (url .getProtocol ())) {
63+ addJar (url .toString ());
64+ }
6265 else {
6366 addDir (new File (url .toURI ()).getAbsolutePath (), url );
6467 }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2012-2018 the original author or authors.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package org .springframework .boot .context .embedded .tomcat ;
18+
19+ import java .net .URL ;
20+ import java .util .ArrayList ;
21+ import java .util .List ;
22+
23+ import org .apache .catalina .Context ;
24+ import org .junit .Test ;
25+
26+ import static org .mockito .Mockito .mock ;
27+
28+ /**
29+ * Tests for {@link TomcatResources}.
30+ *
31+ * @author Phillip Webb
32+ */
33+ public class TomcatResourcesTests {
34+
35+ @ Test
36+ public void nonHierarchicalUri () throws Exception {
37+ // gh-13265
38+ Context context = mock (Context .class );
39+ TomcatResources resources = new TomcatResources .Tomcat8Resources (context );
40+ List <URL > resourceJarUrls = new ArrayList <URL >();
41+ resourceJarUrls .add (new URL ("jar:file:/opt/app/app.war!/WEB-INF/classes!/" ));
42+ resources .addResourceJars (resourceJarUrls );
43+ }
44+
45+ }
You can’t perform that action at this time.
0 commit comments