On Mon, 6 Apr 2026 05:00:03 GMT, Eirik Bjørsnøs <[email protected]> wrote:

> Please review this PR which improves validation of unmappable characters in 
> strings passed to `ZipFileSystem::getPath` and `ZipPath::resolve`.
> 
> Currently, `ZipFileSystem::getPath` and `ZipPath::resolve` throw 
> `IllegalArgumentException` when rejecting a path or entry name which cannot 
> be encoded with the given charset.  This PR adds validation to 
> `ZipFileSystem::getBytes` where a failed validation now throws 
> `InvalidPathException`.
> 
> As far as I can tell, the transitive call sites of `ZipFileSystem::getBytes` 
> ends up being `ZipFileSystem::getPath` and `ZipPath::resolve`.
> 
> A new test is added in the ZipFS area to verify that the APIs throw 
> exceptions according to specifications when faced with unmappable characters 
> in primary or secondary path string components.
> 
> This PR is similar to a recently integrated change in the `ZipOutputStream` 
> API via #30319.

This pull request has now been integrated.

Changeset: 9df6054d
Author:    Eirik Bjørsnøs <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/9df6054d432157284bc5f099a73be538aef61711
Stats:     123 lines in 2 files changed: 122 ins; 0 del; 1 mod

8380450: (zipfs) ZipFileSystem::getPath and ZipPath::resolve throw unspecified 
IllegalArgumentException for unmappable names

Reviewed-by: lancea

-------------

PR: https://git.openjdk.org/jdk/pull/30584

Reply via email to