ADDITIONAL SYSTEM INFORMATION :
macOS Catalina (beta), OpenJDK 11.0.4 (but most likely this will affect any Java version)
A DESCRIPTION OF THE PROBLEM :
Beginning with macOS Catalina certain parts of the file system are write-protected.
However, `Files.getFileStore(anyPath)` doesn't distinguish protected and non-protected parts and will always return the same file store, which will then be reported as read-only.
The root path of a file system no longer defines whether the file system as a whole is read-only.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run attached test program on macOS Catalina.
Optionally change the path variable to any other existing path residing in non-protected regions.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Program prints "read-only: false"
ACTUAL -
Program prints "read-only: true"
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Test {
public static void main(String[] args) throws IOException {
Path path = Paths.get("/tmp");
System.out.println("read-only: " + Files.getFileStore(path).isReadOnly());
}
}
---------- END SOURCE ----------
FREQUENCY : always