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