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
6cae9257
Commit
6cae9257
authored
Nov 29, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
07b7d1cb
a491727b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Handler.java
...ain/java/org/springframework/boot/loader/jar/Handler.java
+9
-2
No files found.
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java
View file @
6cae9257
...
@@ -48,6 +48,10 @@ public class Handler extends URLStreamHandler {
...
@@ -48,6 +48,10 @@ public class Handler extends URLStreamHandler {
private
static
final
String
SEPARATOR
=
"!/"
;
private
static
final
String
SEPARATOR
=
"!/"
;
private
static
final
String
CURRENT_DIR
=
"/./"
;
private
static
final
String
PARENT_DIR
=
"/../"
;
private
static
final
String
[]
FALLBACK_HANDLERS
=
{
private
static
final
String
[]
FALLBACK_HANDLERS
=
{
"sun.net.www.protocol.jar.Handler"
};
"sun.net.www.protocol.jar.Handler"
};
...
@@ -207,6 +211,9 @@ public class Handler extends URLStreamHandler {
...
@@ -207,6 +211,9 @@ public class Handler extends URLStreamHandler {
}
}
private
String
normalize
(
String
file
)
{
private
String
normalize
(
String
file
)
{
if
(!
file
.
contains
(
CURRENT_DIR
)
&&
!
file
.
contains
(
PARENT_DIR
))
{
return
file
;
}
int
afterLastSeparatorIndex
=
file
.
lastIndexOf
(
SEPARATOR
)
+
SEPARATOR
.
length
();
int
afterLastSeparatorIndex
=
file
.
lastIndexOf
(
SEPARATOR
)
+
SEPARATOR
.
length
();
String
afterSeparator
=
file
.
substring
(
afterLastSeparatorIndex
);
String
afterSeparator
=
file
.
substring
(
afterLastSeparatorIndex
);
afterSeparator
=
replaceParentDir
(
afterSeparator
);
afterSeparator
=
replaceParentDir
(
afterSeparator
);
...
@@ -216,7 +223,7 @@ public class Handler extends URLStreamHandler {
...
@@ -216,7 +223,7 @@ public class Handler extends URLStreamHandler {
private
String
replaceParentDir
(
String
file
)
{
private
String
replaceParentDir
(
String
file
)
{
int
parentDirIndex
;
int
parentDirIndex
;
while
((
parentDirIndex
=
file
.
indexOf
(
"/../"
))
>=
0
)
{
while
((
parentDirIndex
=
file
.
indexOf
(
PARENT_DIR
))
>=
0
)
{
int
precedingSlashIndex
=
file
.
lastIndexOf
(
'/'
,
parentDirIndex
-
1
);
int
precedingSlashIndex
=
file
.
lastIndexOf
(
'/'
,
parentDirIndex
-
1
);
if
(
precedingSlashIndex
>=
0
)
{
if
(
precedingSlashIndex
>=
0
)
{
file
=
file
.
substring
(
0
,
precedingSlashIndex
)
file
=
file
.
substring
(
0
,
precedingSlashIndex
)
...
@@ -230,7 +237,7 @@ public class Handler extends URLStreamHandler {
...
@@ -230,7 +237,7 @@ public class Handler extends URLStreamHandler {
}
}
private
String
replaceCurrentDir
(
String
file
)
{
private
String
replaceCurrentDir
(
String
file
)
{
return
file
.
replace
(
"/./"
,
"/"
);
return
file
.
replace
(
CURRENT_DIR
,
"/"
);
}
}
@Override
@Override
...
...
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