cleanUp fails by new empty archive #26

Closed
FreakyBytes opened this Issue Jan 30, 2017 · 0 comments

Comments

Projects
None yet
1 participant
Owner

FreakyBytes commented Jan 30, 2017

Trac Ticket #24

component: code
owner: Martin Scharm martin@binfalse.de
reporter: martinP
created: 2014-11-20 11:09:56
milestone:
type: defect
version:
keywords:

In !CombineArchive.cleanUp(Path p) line 1375 throws an error, when creating a new archive.
cf. source:/src/main/java/de/unirostock/sems/cbarchive/CombineArchive.java#L1377

{{{
java.lang.NullPointerException
at com.sun.nio.zipfs.ZipFileSystem.removeFromTree(ZipFileSystem.java:2329)
at com.sun.nio.zipfs.ZipFileSystem.updateDelete(ZipFileSystem.java:1102)
at com.sun.nio.zipfs.ZipFileSystem.deleteFile(ZipFileSystem.java:1339)
at com.sun.nio.zipfs.ZipPath.delete(ZipPath.java:655)
at com.sun.nio.zipfs.ZipFileSystemProvider.delete(ZipFileSystemProvider.java:206)
at java.nio.file.Files.delete(Files.java:1077)
at de.unirostock.sems.cbarchive.CombineArchive.cleanUp(CombineArchive.java:1375)
at de.unirostock.sems.cbarchive.CombineArchive.cleanUp(CombineArchive.java:1356)
at de.unirostock.sems.cbarchive.CombineArchive.(CombineArchive.java:147)
at de.unirostock.sems.cbarchive.web.UserManager.createArchive(UserManager.java:247)
at de.unirostock.sems.cbarchive.web.UserManager.createArchive(UserManager.java:222)
at de.unirostock.sems.cbarchive.web.rest.RestApi.createArchive(RestApi.java:495)
}}}

comment 1

time: 2015-07-14 11:21:29
author: Martin Scharm martin@binfalse.de

In None:


do not fail anymore for newly created files [fixes #24]

new the constructor checks if file has size 0 if it exists. in that case it simply gets deleted...

also added a test for that

comment 2

time: 2015-07-14 11:21:29
author: Martin Scharm martin@binfalse.de

Updated owner to Martin Scharm martin@binfalse.de

comment 3

time: 2015-07-14 11:21:29
author: Martin Scharm martin@binfalse.de

Updated resolution to fixed

comment 4

time: 2015-07-14 11:21:29
author: Martin Scharm martin@binfalse.de

Updated status to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment