src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java
changeset 55256 3b22c7e00573
parent 50113 caf115bb98ad
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java	Thu Jun 06 21:19:07 2019 +0800
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java	Thu Jun 06 15:22:12 2019 +0200
@@ -50,7 +50,8 @@
     private final AccessControlContext controlContext;
     private final Path original;
     private final Path real;
-    private final String text;
+    private final String realPathText;
+    private final String originalText;
 
     // Not to ensure security, but to help
     // against programming errors
@@ -68,8 +69,9 @@
         BufferedWriter fw = Files.newBufferedWriter(path);
         fw.close();
         this.original = path;
+        this.originalText = path.toString();
         this.real = path.toRealPath();
-        this.text = real.toString();
+        this.realPathText = real.toString();
     }
 
     /**
@@ -85,15 +87,25 @@
     }
 
     /**
-     * Returns a string representation of the path.
+     * Returns a string representation of the real path.
      *
      * @return path as text
      */
-    public String getText() {
-        return 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