内置对象存储支持绝对路径和相对路径

This commit is contained in:
heavyrian2012
2022-11-14 15:13:06 +08:00
parent d706f545d2
commit 0b6612eacc
@@ -240,7 +240,12 @@ public class UploadFileAction extends Action {
datePath = "fs/" + bucket[0] + "/" + datePath; //add bucket
String dir = "./" + MediaServerConfig.FILE_STROAGE_ROOT + "/" + datePath;
String dir;
if(MediaServerConfig.FILE_STROAGE_ROOT.startsWith("/") || MediaServerConfig.FILE_STROAGE_ROOT.startsWith("~/") || MediaServerConfig.FILE_STROAGE_ROOT.startsWith("./")) {
dir = MediaServerConfig.FILE_STROAGE_ROOT + "/" + datePath;
} else {
dir = "./" + MediaServerConfig.FILE_STROAGE_ROOT + "/" + datePath;
}
File dirFile = new File(dir);
boolean bFile = dirFile.exists();