Skip to content

Replace Path.toFile() - #1158

Merged
gnodet merged 1 commit into
jline:masterfrom
snazy:nio-files
Jan 24, 2025
Merged

gnodet merged 1 commit into
jline:masterfrom
snazy:nio-files

Conversation

@snazy

@snazy snazy commented Jan 20, 2025

Copy link
Copy Markdown
Contributor

In some use cases it's preferable to have for example the nanorc configs inside a jar. Although a lot of the code base use java.nio.file.Path, a couple of places still call Path.toFile(), which isn't supported for NIO's ZIP file system, which can be created for a jar: URL, so that the contents of the jar can be used as a (read only) file system.

This PR replaces occurences of Path.toFile() and replaces the File operations with NIO's Files.

In some use cases it's preferable to have for example the nanorc configs inside a jar. Although a lot of the code base use `java.nio.file.Path`, a couple of places still call `Path.toFile()`, which isn't supported for NIO's ZIP file system, which can be created for a `jar:` URL, so that the contents of the jar can be used as a (read only) file system.

This PR replaces occurences of `Path.toFile()` and replaces the `File` operations with NIO's `Files`.
@gnodet gnodet added this to the 3.28.1 milestone Jan 24, 2025
@gnodet
gnodet merged commit 57030d4 into jline:master Jan 24, 2025
@snazy
snazy deleted the nio-files branch January 27, 2025 09:08
@gnodet gnodet added the chore label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants