Opened 2 years ago

Closed 22 months ago

#24 closed defect (fixed)

cleanUp fails by new empty archive

Reported by: martinP Owned by: Martin Scharm <martin@…>
Priority: major Milestone:
Component: code Version:
Keywords: Cc: martin

Description

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.<init>(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)

Change History (1)

comment:1 Changed 22 months ago by Martin Scharm <martin@…>

  • Owner set to Martin Scharm <martin@…>
  • Resolution set to fixed
  • Status changed from new to closed

In f239cf7b98d740d54c5841ca953c7741bbb9076d:

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

Note: See TracTickets for help on using tickets.
authorship