delete file quietly (#351)
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -171,6 +171,10 @@
|
||||
<artifactId>hawkbit-repository-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<!-- Vaadin -->
|
||||
<dependency>
|
||||
<groupId>com.vaadin</groupId>
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.Set;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.ui.artifacts.event.SoftwareModuleEvent;
|
||||
@@ -593,10 +594,7 @@ public class UploadLayout extends VerticalLayout {
|
||||
void clearFileList() {
|
||||
// delete file system zombies
|
||||
artifactUploadState.getFileSelected().forEach(customFile -> {
|
||||
final File file = new File(customFile.getFilePath());
|
||||
if (!file.delete()) {
|
||||
LOG.warn("Failed to delete file {} in upload dialog", customFile.getFilePath());
|
||||
}
|
||||
FileUtils.deleteQuietly(new File(customFile.getFilePath()));
|
||||
});
|
||||
|
||||
artifactUploadState.getFileSelected().clear();
|
||||
|
||||
Reference in New Issue
Block a user