WillemJiang commented on code in PR #1799:
URL:
https://github.com/apache/incubator-streampark/pull/1799#discussion_r991784040
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java:
##########
@@ -293,7 +294,8 @@ public void tailMvnDownloading(Long id) {
@Override
public String upload(MultipartFile file) throws ApplicationException {
File temp = WebUtils.getAppTempDir();
- File saveFile = new File(temp,
Objects.requireNonNull(file.getOriginalFilename()));
+ String fileName =
FilenameUtils.getName(Objects.requireNonNull(file.getOriginalFilename()));
+ File saveFile = new File(temp, fileName);
// delete when exists
if (saveFile.exists()) {
Review Comment:
Not sure if it can cause some side effects.
##########
streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java:
##########
@@ -89,4 +94,15 @@ public void start() throws Exception {
applicationService.start(application, false);
}
+ @Test
+ public void uploadTest() throws Exception {
Review Comment:
I think we need to add another test for verifying the uploaded file is not a
jar file.
It looks like we just verify the ContentType
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]