|
|
@ -183,7 +183,7 @@ public class FileBean extends AbstractBean {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public int deleteOf(String infoType, String... infoKeys) {
|
|
|
|
public int deleteOf(String infoType, String... infoKeys) {
|
|
|
|
List<FileInfo> files = getFilesOf(infoType, infoKeys);
|
|
|
|
List<FileInfo> files = getFilesOf(infoType, infoKeys);
|
|
|
|
if (delete(files) < 1) return 0;
|
|
|
|
delete(files);
|
|
|
|
|
|
|
|
|
|
|
|
return fileMapper.delete(files);
|
|
|
|
return fileMapper.delete(files);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -194,7 +194,7 @@ public class FileBean extends AbstractBean {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public int deleteByIDs(String... fileIDs) {
|
|
|
|
public int deleteByIDs(String... fileIDs) {
|
|
|
|
List<FileInfo> files = getFiles(fileIDs);
|
|
|
|
List<FileInfo> files = getFiles(fileIDs);
|
|
|
|
if (delete(files) < 1) return 0;
|
|
|
|
delete(files);
|
|
|
|
|
|
|
|
|
|
|
|
return fileMapper.delete(files);
|
|
|
|
return fileMapper.delete(files);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -207,8 +207,12 @@ public class FileBean extends AbstractBean {
|
|
|
|
if (isEmpty(files)) return 0;
|
|
|
|
if (isEmpty(files)) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
int affected = 0;
|
|
|
|
int affected = 0;
|
|
|
|
for (FileInfo file: files)
|
|
|
|
for (FileInfo file: files) {
|
|
|
|
affected += file.delete() ? 1 : 0;
|
|
|
|
if (file.delete())
|
|
|
|
|
|
|
|
++affected;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
log().warn("Failed to delete {}({})", file.getPath(), file.getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return affected;
|
|
|
|
return affected;
|
|
|
|
}
|
|
|
|
}
|
|
|
|