|
@@ -58,28 +58,13 @@ public class RmsMaterialController extends BaseRESTfulController {
|
|
int year = calendar.get(Calendar.YEAR);
|
|
int year = calendar.get(Calendar.YEAR);
|
|
int month = calendar.get(Calendar.MONTH);
|
|
int month = calendar.get(Calendar.MONTH);
|
|
int day= calendar.get(Calendar.DAY_OF_MONTH);
|
|
int day= calendar.get(Calendar.DAY_OF_MONTH);
|
|
- //year+File.separator+month+File.separator+day
|
|
|
|
- System.out.println(year+File.separator+month+File.separator+day);
|
|
|
|
//上传文件夹路径
|
|
//上传文件夹路径
|
|
- String uploadPath=replaceSeparator(path);
|
|
|
|
List<String> urls=new ArrayList<>();
|
|
List<String> urls=new ArrayList<>();
|
|
for (int i=0;i<files.length;i++){
|
|
for (int i=0;i<files.length;i++){
|
|
- String url = UploadUtils.uploadFile(files[i], new IdGenerator(1, 10), uploadPath, File.separator+year+File.separator+month+File.separator+day+File.separator);
|
|
|
|
|
|
+ String url = UploadUtils.uploadFile(files[i], new IdGenerator(1, 10), path, File.separator+year+File.separator+month+File.separator+day+File.separator);
|
|
urls.add(url);
|
|
urls.add(url);
|
|
}
|
|
}
|
|
-
|
|
|
|
return urls;
|
|
return urls;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- *将正斜杠和反斜杠替代为window和linux都支持的
|
|
|
|
- * @param path
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- public String replaceSeparator(String path){
|
|
|
|
- return path.replaceAll("/", File.separator);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|