delete file quietly (#351)

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
Michael Hirsch
2016-11-18 11:17:09 +01:00
committed by GitHub
parent 710627ce46
commit 803bdbf1de
2 changed files with 6 additions and 4 deletions

View File

@@ -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>

View File

@@ -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();