Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
2e2fde0d
Commit
2e2fde0d
authored
Jun 12, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using URLResource API that was deprecated in Undertow 1.4.16
Closes gh-9464
parent
2d3bcae4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
JarResourceManager.java
...rk/boot/context/embedded/undertow/JarResourceManager.java
+1
-1
UndertowEmbeddedServletContainerFactory.java
...ded/undertow/UndertowEmbeddedServletContainerFactory.java
+18
-10
No files found.
spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/JarResourceManager.java
View file @
2e2fde0d
...
@@ -48,7 +48,7 @@ class JarResourceManager implements ResourceManager {
...
@@ -48,7 +48,7 @@ class JarResourceManager implements ResourceManager {
public
Resource
getResource
(
String
path
)
throws
IOException
{
public
Resource
getResource
(
String
path
)
throws
IOException
{
URL
url
=
new
URL
(
"jar:file:"
+
this
.
jarPath
+
"!"
URL
url
=
new
URL
(
"jar:file:"
+
this
.
jarPath
+
"!"
+
(
path
.
startsWith
(
"/"
)
?
path
:
"/"
+
path
));
+
(
path
.
startsWith
(
"/"
)
?
path
:
"/"
+
path
));
URLResource
resource
=
new
URLResource
(
url
,
url
.
openConnection
(),
path
);
URLResource
resource
=
new
URLResource
(
url
,
path
);
if
(
resource
.
getContentLength
()
<
0
)
{
if
(
resource
.
getContentLength
()
<
0
)
{
return
null
;
return
null
;
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java
View file @
2e2fde0d
...
@@ -21,7 +21,6 @@ import java.io.IOException;
...
@@ -21,7 +21,6 @@ import java.io.IOException;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
java.net.Socket
;
import
java.net.Socket
;
import
java.net.URL
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.nio.charset.Charset
;
import
java.nio.charset.Charset
;
import
java.security.KeyManagementException
;
import
java.security.KeyManagementException
;
import
java.security.KeyStore
;
import
java.security.KeyStore
;
...
@@ -664,15 +663,9 @@ public class UndertowEmbeddedServletContainerFactory
...
@@ -664,15 +663,9 @@ public class UndertowEmbeddedServletContainerFactory
@Override
@Override
public
Resource
getResource
(
String
path
)
{
public
Resource
getResource
(
String
path
)
{
for
(
URL
url
:
this
.
metaInfResourceJarUrls
)
{
for
(
URL
url
:
this
.
metaInfResourceJarUrls
)
{
try
{
URLResource
resource
=
getMetaInfResource
(
url
,
path
);
URL
resourceUrl
=
new
URL
(
url
+
"META-INF/resources"
+
path
);
if
(
resource
!=
null
)
{
URLConnection
connection
=
resourceUrl
.
openConnection
();
return
resource
;
if
(
connection
.
getContentLength
()
>=
0
)
{
return
new
URLResource
(
resourceUrl
,
connection
,
path
);
}
}
catch
(
IOException
ex
)
{
// Continue
}
}
}
}
return
null
;
return
null
;
...
@@ -689,6 +682,21 @@ public class UndertowEmbeddedServletContainerFactory
...
@@ -689,6 +682,21 @@ public class UndertowEmbeddedServletContainerFactory
@Override
@Override
public
void
removeResourceChangeListener
(
ResourceChangeListener
listener
)
{
public
void
removeResourceChangeListener
(
ResourceChangeListener
listener
)
{
}
private
URLResource
getMetaInfResource
(
URL
resourceJar
,
String
path
)
{
try
{
URL
resourceUrl
=
new
URL
(
resourceJar
+
"META-INF/resources"
+
path
);
URLResource
resource
=
new
URLResource
(
resourceUrl
,
path
);
if
(
resource
.
getContentLength
()
<
0
)
{
return
null
;
}
return
resource
;
}
catch
(
MalformedURLException
ex
)
{
return
null
;
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment