Can you make .jar archives case sensitive?

Hi,

I'm a java developer and I'm using jar files (=zip format) very often.

You may know that in Java, the class names are case sensitive, ie a != A, which means that in the jar files, you may have 2 files with the same name in a directory (a.class and A.class).

Now I have 2 problems with dopus:

  • when I try to extract the file "a.class" from the jar files (using copy and paste for example), the internal zip manager extracts the file "A.class"
  • when I try to copy "A.class" into the jar file containing a.class and A.class, the file confirmation replace dialog compares the file I want to copy to "a.class" instead of "A.class"
  • when I force the replacement, the new "A.class" file replaces the "a.class" file and now there are 2 files with the exact same name in the jar file, ie 2 X "A.class". the old a.class is deleted

Everything works perfectly in 7-zip so I assume this can be done properly in dopus (it doesn't work in winrar though).

Can you have a look please ?

thank you

We could probably provide a special .jar archive type which is case sensitive, but now right now as anything that requires translation will have to wait until after 12.0 is finished.

why don't you make all zip archives case sensitive in the first place ? I mean, the zip format does support it, 7zip supports this out of the box. Why not dopus ?

Should I reopen a case after dopus 12 is released or is it already queued in your todo list ?

Because that would make zip archives behave incorrectly in almost all cases where both users and other tools expect them to behave like a Windows filesystem. It would cause enormous problems for most users.

I think there is some confusion because 7-Zip does not treat zip archives as case-sensitive by default.

Here is video proof, showing 7-Zip only normally allows "apple.txt" or "APPLE.txt" in a zip, not both:

Although not shown in the video, the zip itself was also created using 7-Zip, to ensure it was the only thing involved.

7-Zip can be put into case-sensitive zip mode via special command-line arguments but its normal behaviour for zips is case insensitive, the same as in Opus.

(7-Zip may also automatically go into case-sensitive mode for .jar files, or for zip archives it detects originated from something other than Windows, or if it detects the existing zip contents have multiple names which only differ by case, or something else. But the Windows version of 7-Zip does not create or treat basic .zip files as being case-sensitive normally.)

It's possible 7-Zip will look for a case-sensitive match first when finding the file to act on, making some operations case-sensitive even though the archive as a whole is not treated as such. If that is the case then you could delete a particular file where two exist and only differ by case, but you still could not add another file which only differed from an existing one by case, so it's a hybrid mode.

(Technically, the zip standard allows you to have multiple files with identical names, since it is just a list of file names and data. Most tools would prevent that, for obvious reasons. You could not extract such an archive to any filesystem, even a case-sensitive one.)