Top "Java.nio.file" questions

This standard Java package defines classes and interfaces to access files, file attributes and file systems.

Watching a Directory for Changes in Java

I want to watch a directory for file changes. And I used WatchService in java.nio. I can successfully listen …

java file java.nio.file
java - The process cannot access the file because it is being used by another process

I have a piece of code that monitors a directory for addition of files. Whenever a new file is added …

java file java-8 java.nio.file
What is the exact use of java nio package when already methods are available with io package

I was learning java nio package and I realized there are lots of methods already provided by File which nio.…

java nio java.nio.file
Java.nio.files - Copying files

Can anyone tell me what I've done wrong with the following code. I receive no errors - it just goes …

java file copying java.nio.file
Hot to get rid of an java.io.Exception at java.io.WinNTFileSystem.createFileExclusively?

I currently have the problem that I encounter an exception I never saw before and that's why I don't know …

java windows file-io java.nio.file
Remove first element of a Stream in Java 8

I have generated a Stream in Java 8 with Files.walk() method from java.nio library. The problem is that the …

java filter functional-programming java-stream java.nio.file
Files.move and Files.copy is throwing java.nio.file.FileAlreadyExistsException

I want to delete one file and rename another file with the old file but I am not able to …

java java.nio.file
How do I use directory globbing in JDK7

I have been trying to use the new globbing feature in JDK7, starting from the documentation and examples I can …

java java-7 glob java.nio.file
Java File.exists() versus File.isFile()

I'm unable to think of a realistic use case for the method java.io.File.exists() or its equivalent in …

java java-io java.nio.file
What is the difference between Files.list and Files.walkFileTree and Files.walk with maxdepth = 1?

If I want to do something with files only on the first level of the directory, is there a difference …

java nio2 java.nio.file