|
@@ -199,7 +199,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
} else {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -214,7 +214,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
} else {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -229,7 +229,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
} else {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -244,7 +244,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
} else {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -254,7 +254,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
if (postManagementDao.savePost(postManagement) <= 0) {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -307,7 +307,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
} else {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -330,7 +330,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
} else {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -353,7 +353,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
} else {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -376,7 +376,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
} else {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -391,7 +391,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
if (postManagementDao.updatePostById(postManagement) <= 0) {
|
|
|
if (stringList != null && stringList.size() > 0) {
|
|
|
for (String url : stringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -399,7 +399,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
}
|
|
|
if (oldStringList != null && oldStringList.size() > 0) {
|
|
|
for (String url : oldStringList) {
|
|
|
- File file = new File(filePath + "\\" + url);
|
|
|
+ File file = new File(filePath + url);
|
|
|
file.delete();
|
|
|
}
|
|
|
}
|
|
@@ -471,14 +471,14 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
}
|
|
|
// 原文件名
|
|
|
String originalFileName = file.getOriginalFilename();
|
|
|
- File oldFile = new File(fileDir + "\\pdf" + "\\" + originalFileName);
|
|
|
+ File oldFile = new File(fileDir + "pdf" + "/" + originalFileName);
|
|
|
file.transferTo(oldFile);
|
|
|
//FileTypeUtil.getType要在磁盘中有这个文件才能执行
|
|
|
String type = FileTypeUtil.getType(oldFile);
|
|
|
//新文件名
|
|
|
String newFileName = generTrfn() + "." + type;
|
|
|
//创建file对象
|
|
|
- File temporaryFile = new File(fileDir + "\\pdf" + "\\" + newFileName);
|
|
|
+ File temporaryFile = new File(fileDir + "pdf" + "/" + newFileName);
|
|
|
if (temporaryFile.exists()) {
|
|
|
map.put("result", false);
|
|
|
map.put("msg", "此文件已经存在");
|
|
@@ -492,7 +492,7 @@ public class PostManagementServiceImpl implements PostManagementService {
|
|
|
return map;
|
|
|
}
|
|
|
map.put("result", true);
|
|
|
- map.put("data", "\\pdf" + "\\" + newFileName);
|
|
|
+ map.put("data", "pdf" + "/" + newFileName);
|
|
|
map.put("msg", "上传成功");
|
|
|
return map;
|
|
|
}
|