-
Notifications
You must be signed in to change notification settings - Fork 145
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
Compliance with JSR-203 and JimFs #129
Comments
Hmm, what am I supposed to do then here? I can get the URI from the path and create the file from the URI?? Or in general, should there be an implicit filesystem for the file class? I use that for any path <->file API?? |
An implicit file system would work well when writing tests like this: |
Hi @ShaneDelmore - I have a PoC PR here: #130 Would this work?? |
Looks like a step in the right direction but it will still try to call Path.toFile won't it? |
@ShaneDelmore : What should I do then? |
I was hoping you would know of a workaround 😄 |
Funnily I was in NEScala myself :) But, I am not sure what else is a good way to convert Path to a File!? |
Do you need to convert a Path to a File at all? I think the NIO interface supports all of the usual operations on Paths through the Files class, as in Files.size(path) or Files.isDirectory(path). |
Right but better-files does more than just that - for which I need a java.io.File |
Any examples of a couple of things that definitely need java.io.File? Not sure I will be able to help come up with any solutions but it will give me something to attempt at least. |
I have the same use case; for testing, a flakey FS simulates various unfriendly behaviors of a remote FS (that is also broken). |
Feature Suggestion:
It would be nice in tests to be able to use JimFs virtual file system (or any VFS really) instead of having to write to my actual file system and ensure resource cleanup after. I tested better-files with JimFs and overall it looks very compatible but calling Path.toFile is not supported.
http://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#toFile--
https://github.com/google/jimfs/blob/3299e69f75cf524e6d101d88e8c202c1b24bf25a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java#L409
The text was updated successfully, but these errors were encountered: