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