< prev index next >

src/java.base/unix/classes/sun/nio/fs/UnixPath.java

Print this page

 24  */
 25 
 26 package sun.nio.fs;
 27 
 28 import java.nio.file.*;
 29 import java.nio.charset.*;
 30 import java.io.*;
 31 import java.net.URI;
 32 import java.util.*;
 33 
 34 import jdk.internal.access.JavaLangAccess;
 35 import jdk.internal.access.SharedSecrets;
 36 
 37 import static sun.nio.fs.UnixNativeDispatcher.*;
 38 import static sun.nio.fs.UnixConstants.*;
 39 
 40 /**
 41  * Linux/Mac implementation of java.nio.file.Path
 42  */
 43 class UnixPath implements Path {
 44 
 45     private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
 46 
 47     private final UnixFileSystem fs;
 48 
 49     // internal representation
 50     private final byte[] path;
 51 
 52     // String representation (created lazily)
 53     private volatile String stringValue;
 54 
 55     // cached hashcode (created lazily, no need to be volatile)
 56     private int hash;
 57 
 58     // array of offsets of elements in path (created lazily)
 59     private volatile int[] offsets;
 60 
 61     UnixPath(UnixFileSystem fs, byte[] path) {
 62         this.fs = fs;
 63         this.path = path;
 64     }

 24  */
 25 
 26 package sun.nio.fs;
 27 
 28 import java.nio.file.*;
 29 import java.nio.charset.*;
 30 import java.io.*;
 31 import java.net.URI;
 32 import java.util.*;
 33 
 34 import jdk.internal.access.JavaLangAccess;
 35 import jdk.internal.access.SharedSecrets;
 36 
 37 import static sun.nio.fs.UnixNativeDispatcher.*;
 38 import static sun.nio.fs.UnixConstants.*;
 39 
 40 /**
 41  * Linux/Mac implementation of java.nio.file.Path
 42  */
 43 class UnixPath implements Path {

 44     private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
 45 
 46     private final UnixFileSystem fs;
 47 
 48     // internal representation
 49     private final byte[] path;
 50 
 51     // String representation (created lazily)
 52     private volatile String stringValue;
 53 
 54     // cached hashcode (created lazily, no need to be volatile)
 55     private int hash;
 56 
 57     // array of offsets of elements in path (created lazily)
 58     private volatile int[] offsets;
 59 
 60     UnixPath(UnixFileSystem fs, byte[] path) {
 61         this.fs = fs;
 62         this.path = path;
 63     }
< prev index next >