I am reading java documentation that tells me there should be a java.nio.file namespace. But when I attempt to import it the precompiler is complaining that it doesn't exist.
What's up?
The java. nio. file package defines classes to access files and file systems. The API to access file and file system attributes is defined in the java.
Technically in terms of Java, Path is an interface which is introduced in Java NIO file package during Java version 7,and is the representation of location in particular file system.As path interface is in Java NIO package so it get its qualified name as java. nio. file.
Java NIO Files class contains static methods that is used for manipulating files and directories and those methods mostly works on Path object.
Java NIO package provide one more utility API named as Files which is basically used for manipulating files and directories using its static methods which mostly works on Path object.
java.nio.file
is coming in Java 7. It's not in Java 6 or before.
You must be reading the JDK7 docs.
Until then, you're stuck with the steaming heap of unpleasantness that is java.io.File.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With