Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is java.nio.file

Tags:

java

import

nio

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?

like image 833
Nick Avatar asked Jan 09 '10 18:01

Nick


People also ask

What is Nio file in Java?

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.

What is import Java NIO file paths?

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.

Which methods are found in NIO 2 files class?

Java NIO Files class contains static methods that is used for manipulating files and directories and those methods mostly works on Path object.

What package is imported by NIO API?

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.


1 Answers

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.

like image 146
skaffman Avatar answered Nov 04 '22 12:11

skaffman