-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Refactor File I/O handling #817
Labels
Comments
Can I contribute to this? If yes, do I need to first assign it on my name first? Thanks so much! |
2 tasks
Gladly, thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make our File handling more robust by replacing the current mix of
java.lang.String
andjava.io.File
objects with the more recentjava.nio.file.Path
api.The need for many helper methods in the
FileUtilities
class would no longer be given when using thejava.nio.file.Files
class, e.g. for copying or reading files.Especially in the utiLITI editor, this change would simplify many things.
We'd have to make sure that File handling uses Paths exclusively, but things like Maps of currently loaded Spritesheets should still use String values (file names) as the map's keyset rather than Path objects.
Furthermore, we could improve the way we load image files by adopting the ImageIO utility methods for image loading in conjunction with the Path api for path processing.
I have originally started a branch for the conversion but progress has stalled and I got lost.
Some references to the java NIO2 Path api:
https://blogs.oracle.com/javamagazine/post/java-nio-nio2-buffers-channels-async-future-callback?source=:em:nw:mt::::RC_WWMK200429P00043C00073:NSL400304995
https://blogs.oracle.com/javamagazine/post/path-files-input-output?source=:em:nw:mt::::RC_WWMK200429P00043C00073:NSL400304995
https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html
https://www.baeldung.com/java-nio-2-file-api
https://howtodoinjava.com/java/nio/how-to-define-path-in-java-nio/
The text was updated successfully, but these errors were encountered: