< prev index next >

src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java

Print this page

        

*** 48,59 **** */ public final class WriteableUserPath { private final AccessControlContext controlContext; private final Path original; private final Path real; ! private final String realPathText; ! private final String originalText; // Not to ensure security, but to help // against programming errors private volatile boolean inPrivileged; --- 48,58 ---- */ public final class WriteableUserPath { private final AccessControlContext controlContext; private final Path original; private final Path real; ! private final String text; // Not to ensure security, but to help // against programming errors private volatile boolean inPrivileged;
*** 67,79 **** } // will throw if non-writeable BufferedWriter fw = Files.newBufferedWriter(path); fw.close(); this.original = path; - this.originalText = path.toString(); this.real = path.toRealPath(); ! this.realPathText = real.toString(); } /** * Returns a potentially malicious path where the user may have implemented * their own version of Path. This method should never be called in an --- 66,77 ---- } // will throw if non-writeable BufferedWriter fw = Files.newBufferedWriter(path); fw.close(); this.original = path; this.real = path.toRealPath(); ! this.text = real.toString(); } /** * Returns a potentially malicious path where the user may have implemented * their own version of Path. This method should never be called in an
*** 85,113 **** public Path getPotentiallyMaliciousOriginal() { return original; } /** ! * Returns a string representation of the real path. * * @return path as text */ ! public String getRealPathText() { ! return realPathText; } /** - * Returns a string representation of the original path. - * - * @return path as text - */ - public String getOriginalText() { - return originalText; - } - - - /** * Returns a potentially malicious path where the user may have implemented * their own version of Path. This method should never be called in an * unsafe context and the Path value should never be passed along to other * methods. * --- 83,101 ---- public Path getPotentiallyMaliciousOriginal() { return original; } /** ! * Returns a string representation of the path. * * @return path as text */ ! public String getText() { ! return text; } /** * Returns a potentially malicious path where the user may have implemented * their own version of Path. This method should never be called in an * unsafe context and the Path value should never be passed along to other * methods. *
< prev index next >