< prev index next >
src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java
Print this page
rev 14210 : 8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs
*** 29,39 ****
import java.nio.file.attribute.*;
import java.nio.file.spi.*;
import java.io.IOException;
import java.util.*;
import java.util.regex.Pattern;
- import java.security.AccessController;
import sun.security.action.GetPropertyAction;
/**
* Base implementation of FileSystem for Unix-like implementations.
*/
--- 29,38 ----
*** 55,66 ****
}
// if process-wide chdir is allowed or default directory is not the
// process working directory then paths must be resolved against the
// default directory.
! String propValue = AccessController.doPrivileged(
! new GetPropertyAction("sun.nio.fs.chdirAllowed", "false"));
boolean chdirAllowed = (propValue.length() == 0) ?
true : Boolean.valueOf(propValue);
if (chdirAllowed) {
this.needToResolveAgainstDefaultDirectory = true;
} else {
--- 54,65 ----
}
// if process-wide chdir is allowed or default directory is not the
// process working directory then paths must be resolved against the
// default directory.
! String propValue = GetPropertyAction
! .getProperty("sun.nio.fs.chdirAllowed", "false");
boolean chdirAllowed = (propValue.length() == 0) ?
true : Boolean.valueOf(propValue);
if (chdirAllowed) {
this.needToResolveAgainstDefaultDirectory = true;
} else {
< prev index next >