-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
The following application will cause an Error (at least on Linux):
import java.io.File;
import java.nio.file.Files;
public class HelloWorld {
public static void main(String[] args) throws Exception {
File f = Files.createTempFile("foo", ".bar").toFile();
}
}
Exception in thread "main" java.lang.UnsupportedOperationException: Path not associated with default file system.
For Path instances created using Paths.get()
, the Path.getFileSystem()
always returns the same value as FileSystems.getDefault()
. However, Paths created via Files.createTempFile()
return a different value for getFileSystem()
.