Skip to content
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

fix: 文件分发使用严谨模式,目标目录如果不存在仍然会被自动创建 #2354 #2357

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public GseTaskResponse asyncTransferFile(TransferFileRequest request) {
private List<api_copy_fileinfoV2> toV1CopyFileInfoRequest(TransferFileRequest request) {
return request.getTasks().stream()
.map(task -> buildCopyFileInfo(task, request.getUploadSpeed(),
request.getDownloadSpeed(), request.getTimeout()))
request.getDownloadSpeed(), request.getTimeout(), request.isAutoMkdir()))
.collect(Collectors.toList());
}

Expand Down Expand Up @@ -622,13 +622,18 @@ public GseTaskResponse terminateGseScriptTask(TerminateGseTaskRequest request) {
/**
* 构建 GSE 拷贝文件请求
*
* @param task 文件拷贝任务
* @param task 文件拷贝任务
* @param uploadSpeedLimit 上传限速,null 表示不限速
* @param downloadSpeedLimit 下载限速,null 表示不限速
* @param timeout 任务超时时间
* @param autoMkdir 目标目录不存在,是否自动创建目录
* @return 拷贝文件请求
*/
public api_copy_fileinfoV2 buildCopyFileInfo(FileTransferTask task,
Integer uploadSpeedLimit,
Integer downloadSpeedLimit,
Integer timeout) {
Integer timeout,
boolean autoMkdir) {
api_copy_fileinfoV2 copyFileInfo = new api_copy_fileinfoV2();

api_base_file_info baseFileInfo = new api_base_file_info();
Expand Down Expand Up @@ -657,6 +662,7 @@ public api_copy_fileinfoV2 buildCopyFileInfo(FileTransferTask task,
if (timeout != null) {
copyFileInfo.setTimeout(timeout);
}
copyFileInfo.setMkdirflag(autoMkdir ? 1 : 0);
return copyFileInfo;
}

Expand Down
Loading