Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
Project
Project
Details
Activity
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
jenkins
slm-fileview
Commits
845cb2e6
Commit
845cb2e6
authored
Oct 24, 2019
by
陈精华
Committed by
kl
Oct 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复:参数包含特殊字符时url解码失败
parent
a4bfde68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
FileUtils.java
...onverter-web/src/main/java/cn/keking/utils/FileUtils.java
+3
-11
No files found.
jodconverter-web/src/main/java/cn/keking/utils/FileUtils.java
View file @
845cb2e6
...
...
@@ -12,7 +12,6 @@ import org.springframework.stereotype.Component;
import
org.springframework.util.StringUtils
;
import
java.io.*
;
import
java.net.URLDecoder
;
import
java.nio.charset.Charset
;
import
java.util.Arrays
;
import
java.util.HashMap
;
...
...
@@ -328,26 +327,19 @@ public class FileUtils {
public
FileAttribute
getFileAttribute
(
String
url
)
{
String
decodedUrl
=
null
;
try
{
decodedUrl
=
URLDecoder
.
decode
(
url
,
"utf-8"
);
}
catch
(
UnsupportedEncodingException
e
){
log
.
error
(
"url解码失败"
);
}
String
fileName
;
FileType
type
;
String
suffix
;
String
fullFileName
=
getUrlParameterReg
(
decodedUrl
,
"fullfilename"
);
String
fullFileName
=
getUrlParameterReg
(
url
,
"fullfilename"
);
if
(!
StringUtils
.
isEmpty
(
fullFileName
))
{
fileName
=
fullFileName
;
type
=
typeFromFileName
(
fileName
);
suffix
=
suffixFromFileName
(
fileName
);
}
else
{
fileName
=
getFileNameFromURL
(
decodedU
rl
);
fileName
=
getFileNameFromURL
(
u
rl
);
type
=
typeFromUrl
(
url
);
suffix
=
suffixFromUrl
(
url
);
}
return
new
FileAttribute
(
type
,
suffix
,
fileName
,
url
,
decodedU
rl
);
return
new
FileAttribute
(
type
,
suffix
,
fileName
,
url
,
u
rl
);
}
}
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