-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.1.17]ECM Support file download #318
Conversation
private final Logger logger = LoggerFactory.getLogger(ECMRestfulApi.class); | ||
|
||
@RequestMapping(path = "/downloadEngineLog", method = RequestMethod.POST) | ||
public void downloadEngineLog( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add swagger annotation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
logger.error("download failed", e); | ||
response.reset(); | ||
response.setCharacterEncoding(Consts.UTF_8.toString()); | ||
response.setContentType("text/plain; charset=utf-8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add header content-length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -33,7 +33,8 @@ public enum EngineconnServerErrorCodeSummary implements LinkisErrorCode { | |||
11110, | |||
"the parameters of engineConnInstance and ticketId are both not exists.(engineConnInstance 和ticketId 的参数都不存在.)"), | |||
LOG_IS_NOT_EXISTS(11110, "Log directory {0} does not exists.(日志目录 {0} 不存在.)"), | |||
FAILED_TO_DOWNLOAD(911115, "failed to downLoad(下载失败)"); | |||
FAILED_TO_DOWNLOAD(911115, "failed to downLoad(下载失败)"), | |||
FILE_IS_OVERSIZE(911116, "Download file has exceeded 100MB(下载文件已经超过100M)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FILE_IS_OVERSIZE(911116, "Download file size has exceeded 100MB(下载文件已超过100M)");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
response.addHeader( | ||
"Content-Disposition", | ||
"attachment;filename=" + instance.replace(":", "_") + "_" + logType + ".txt"); | ||
response.addHeader("Content-Length", fileSizeInBytes + ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add annotation for filename example
// filename eg:xxxxx
val filename= instance.replace(":", "") + "" + logType + ".txt"
.....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
What is the purpose of the change
ECM Support file download
Related issues/PRs
Related issues: apache#4949
Brief change log
Checklist