Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Path.toFile() #1158

Merged
merged 1 commit into from
Jan 24, 2025
Merged

Replace Path.toFile() #1158

merged 1 commit into from
Jan 24, 2025

Conversation

snazy
Copy link
Contributor

@snazy snazy commented Jan 20, 2025

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
5 checks passed
@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