JimFS: how to get a file from a path

I started using jimfs google and I can not figure out how I can get the file from the path. In the source code, I see that Path.toFile throws an UnsupportedOperationException. But how can I use it without files? For example, if my application needs to know if some path is a folder or file.

+6
source share
1 answer

The JSR 203 API has all the necessary tools; and in this case the Files class .

Despite its name, it handles all Path . For example, you can use:

 Files.isDirectory(thePath) 

check if the file is a directory. But there are other ways to test the same thing.

+5
source

All Articles