dev
parent
071fd41976
commit
01479efce3
|
|
@ -1,5 +1,7 @@
|
|||
package org.qinan.safetyeval.app.executor.institution;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
|
@ -415,17 +417,13 @@ public class EvalProcessControlExecutor implements EvalProcessControlApi {
|
|||
}
|
||||
|
||||
private String extractFileName(String url) {
|
||||
if (!StringUtils.hasText(url)) {
|
||||
return "";
|
||||
if (StrUtil.isBlank(url)) {
|
||||
return StrUtil.EMPTY;
|
||||
}
|
||||
String noQuery = url;
|
||||
int queryIdx = noQuery.indexOf('?');
|
||||
if (queryIdx > 0) {
|
||||
noQuery = noQuery.substring(0, queryIdx);
|
||||
}
|
||||
int slashIdx = noQuery.lastIndexOf('/');
|
||||
String name = slashIdx >= 0 ? noQuery.substring(slashIdx + 1) : noQuery;
|
||||
return StringUtils.hasText(name) ? name : url;
|
||||
// 去掉查询参数后取最后一段路径作为文件名
|
||||
String noQuery = StrUtil.subBefore(url, "?", false);
|
||||
String name = FileUtil.getName(noQuery);
|
||||
return StrUtil.isBlank(name) ? url : name;
|
||||
}
|
||||
|
||||
private EvalReportEntity buildReport(EvalProjectEntity project) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue