Opened 3 years ago

Closed 3 years ago

#25 closed task (fixed)

Issues with getEntry() and removeEntry() on Windows environment

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


CombineArchive v0.9.4.4 :

The functionality getEntry() and removeEntry() (with "location" or "entry" as parameter) doesn't work for Windows based system and they don't show any error or exceptions either.

The Steps to reproduce,

  1. Create combine archive and add a file as entry to it.
  2. Save and close this combine archive to file system.
  3. Open this existing combine archive.

4 a.Try to access entry ( getEntry() or removeEntry() ) using its relative file path.
4 b. Try to access entry ( getEntry() or removeEntry() ) using valid Archive Entry.

  1. The access to entry is not possible and these methods return failure ("null" in case of getEntry() and "false" for removeEntry()).

The unit test for this issue is added to "TestArchive?.java" from CombineArchive codebase locally and patch is attached with the ticket.

The initial analysis suggests that this issue is related with handling File separators during reading and accessing archive for different file systems.

Attachments (1)

TestCombineArchive.patch (1.8 KB) - added by sdeshmukh@… 3 years ago.
archive unit test patch

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by sdeshmukh@…

archive unit test patch

comment:1 Changed 3 years ago by Martin Scharm <martin@…>

In 4d996c5eb4a87c6b4a0e6e73ff852ea1475d4677:

added unit test by sdeshmukh@.. [see #25]

comment:2 Changed 3 years ago by Martin Scharm <martin@…>

In e82859e6f2392cec67469faca6a3cfe9fd882601:

started wotking on win bug [see #25]

spotted the problem: win is a bit incosistent wit paths?

when working with paths from a zipfs i get slashes ('/'), that means

zipfs.getPath (location).normalize ()

results in something like /path/to/file.

but (almost) every other path will contain backslashes ('\'), so

Paths.get (about).normalize ()

will give me \path\to\file.

oviously, comparing these two fails...

i already implemented a pathFixer in the Utils class which
replaces the os' path seperator with a slash, to make sure we
always work with slashes. that should hopefully be able to fix
that problem. still need to find out where to fix the paths..

comment:3 Changed 3 years ago by Martin Scharm <martin@…>

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

In 82e4830ca5f7b34cfe532a53ca669f336dd7a880:

applied the path fixer.. [fixes #25]

that should fix the slash/backslash problem.
had to adjust the test, because the test will
now fail on slash-based-systems.

Note: See TracTickets for help on using tickets.