Skip to content

Support case sensitive files #395

@enoyhs

Description

@enoyhs

I have run into a problem where using zip4j to process APK or JAR files which contain case sensitive files, for example, minified APKs contain a lot of resources that differ only by case (res/aA.xml, res/aa.xml).

As far as I understand zip files should support this or at least there is no explicit requirement for files to be case insensitive. Zip files could actually contain duplicate files, but I don't want/need that.

There is of course a potential issue of trying to extract these zips on case insensitive system (e.g. Windows, OSX), so there might be a need for some warnings or something, but that might be out of scope for this.

Attached is a simple zip containing two files and java code that I would execute to create such a file.

try (ZipFile zipFile = new ZipFile("test.zip")) {
    ZipParameters zp = new ZipParameters();
    zp.setFileNameInZip("case.txt");
    zipFile.addFile("test.txt", zp);
    zp.setFileNameInZip("CASE.txt");
    zipFile.addFile("test.txt", zp);
}

test.zip

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions