|
|
|
@ -33,7 +33,7 @@ public class AppFileUtils {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
String property = properties.getProperty("filepath");
|
|
|
|
|
if(property != null && !property.isEmpty()) {
|
|
|
|
|
if(property != null && !property.isEmpty()) {
|
|
|
|
|
UPLOAD_PATH = property;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -45,7 +45,7 @@ public class AppFileUtils {
|
|
|
|
|
*/
|
|
|
|
|
public static String createNewFileName(String oldName) {
|
|
|
|
|
//获取文件名后缀
|
|
|
|
|
String stuff = oldName.substring(oldName.lastIndexOf("."), oldName.length());
|
|
|
|
|
String stuff = oldName.substring(oldName.lastIndexOf("."));
|
|
|
|
|
//将UUID与文件名后缀进行拼接,生成新的文件名 生成的UUID为32位
|
|
|
|
|
return IdUtil.simpleUUID().toUpperCase() + stuff;
|
|
|
|
|
}
|
|
|
|
@ -99,7 +99,7 @@ public class AppFileUtils {
|
|
|
|
|
//图片的路径不是默认图片的路径
|
|
|
|
|
if (!oldPath.endsWith(Constast.DEFAULT_IMG_GOODS) && !oldPath.endsWith(Constast.DEFAULT_IMG_USER)){
|
|
|
|
|
File file = new File(UPLOAD_PATH,oldPath);
|
|
|
|
|
if (file.exists()){
|
|
|
|
|
if (file.exists()) {
|
|
|
|
|
file.delete();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|