SUPPORT-8566: fix file removing
This commit is contained in:
parent
3d918f6cd7
commit
e7f8aaed29
1 changed files with 9 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ package ru.micord.ervu.av.service;
|
|||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
|
|
@ -112,7 +113,14 @@ public class FileUploadService {
|
|||
}
|
||||
|
||||
deleteFile(downloadUrl);
|
||||
if (filePath.toFile().delete()) {
|
||||
|
||||
try {
|
||||
Files.delete(filePath);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException("Failed to delete file " + filePath.getFileName());
|
||||
}
|
||||
finally {
|
||||
acknowledgment.acknowledge();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue