代码格式优化

lihaobo
laptop_zup 10 months ago
parent b1a7a1d486
commit 44fdbc3b1e

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

Loading…
Cancel
Save