Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-parent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 570c2861
authored
Dec 15, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增压缩文件公用接口--增加子文件夹目录
1 parent
ed490517
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
ne-shield-common/src/main/java/cn/com/glsx/admin/common/util/fileupload/FileUploadUtil.java
ne-shield-common/src/main/java/cn/com/glsx/admin/common/util/fileupload/FileUploadUtil.java
View file @
570c286
...
@@ -95,6 +95,25 @@ public class FileUploadUtil {
...
@@ -95,6 +95,25 @@ public class FileUploadUtil {
return
restTemplate
.
postForObject
(
PropertiesUtils
.
getProperty
(
FileConstants
.
FILE_ZIP_BY_CMD_URL
),
form
,
FileUploadServerData
.
class
);
return
restTemplate
.
postForObject
(
PropertiesUtils
.
getProperty
(
FileConstants
.
FILE_ZIP_BY_CMD_URL
),
form
,
FileUploadServerData
.
class
);
}
}
/**
* 将文件采用linux命令压缩至文件服务器 (解决压缩包里面有文件夹的问题)
*
* @param filePathList 文件路径的集合
* @param subFolderName 文件子路径名
* @return FileUploadServerData
*/
public
static
FileUploadServerData
zipByCmdToFileSystemWithSubFolder
(
String
fileName
,
String
subFolderName
,
List
filePathList
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
MultiValueMap
<
String
,
String
>
form
=
new
LinkedMultiValueMap
<>();
form
.
add
(
"systemSign"
,
"salesexcelzip"
);
form
.
add
(
"filePath"
,
""
);
form
.
add
(
"param1"
,
fileName
);
form
.
add
(
"param2"
,
subFolderName
);
form
.
add
(
"param3"
,
""
);
form
.
add
(
"zipfiles"
,
JSONArray
.
toJSON
(
filePathList
).
toString
());
return
restTemplate
.
postForObject
(
PropertiesUtils
.
getProperty
(
FileConstants
.
FILE_ZIP_BY_CMD_URL
),
form
,
FileUploadServerData
.
class
);
}
public
static
String
upload
(
InputStream
fis
,
String
savePath
)
throws
IOException
{
public
static
String
upload
(
InputStream
fis
,
String
savePath
)
throws
IOException
{
StringBuffer
tempFileName
=
new
StringBuffer
(
"pdf"
);
StringBuffer
tempFileName
=
new
StringBuffer
(
"pdf"
);
tempFileName
.
append
(
"-"
);
tempFileName
.
append
(
"-"
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment