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