Uncategorized
Why consecutive slashes in resource path fail in Jar files
Resource paths with consecutive slashes seem to work in the IDE (STS and IntelliJ) but fail to load when the application is deployed as a Jar file. Let’s see why. tldr; To speed lookup of resources and classes, Java’s Zip implementation uses hashes to match filenames initially rather than a full string comparison. A double slash in the path is essentially mapping to an entirely different hash and thus to a hash not available in Read more…