An "abstract" representation of a file system entity identified by a pathname. The pathname may be absolute (relative to the root directory of the file system) or relative to the current directory in which the program is running. This class provides methods for querying/changing information abou
| 44 | * @see java.lang.Comparable |
| 45 | */ |
| 46 | public class File implements Serializable, Comparable<File> { |
| 47 | |
| 48 | private static final long serialVersionUID = 301077366599181567L; |
| 49 | |
| 50 | private static final String EMPTY_STRING = ""; //$NON-NLS-1$ |
| 51 | |
| 52 | private String path; |
| 53 | |
| 54 | transient byte[] properPath; |
| 55 | |
| 56 | /** |
| 57 | * The system dependent file separator character. |
| 58 | */ |
| 59 | public static final char separatorChar; |
| 60 | |
| 61 | /** |
| 62 | * The system dependent file separator string. The initial value of this |
| 63 | * field is the system property "file.separator". |
| 64 | */ |
| 65 | public static final String separator; |
| 66 | |
| 67 | /** |
| 68 | * The system dependent path separator character. |
| 69 | */ |
| 70 | public static final char pathSeparatorChar; |
| 71 | |
| 72 | /** |
| 73 | * The system dependent path separator string. The initial value of this |
| 74 | * field is the system property "path.separator". |
| 75 | */ |
| 76 | public static final String pathSeparator; |
| 77 | |
| 78 | /* Temp file counter */ |
| 79 | private static int counter = 0; |
| 80 | |
| 81 | /* identify for differnt VM processes */ |
| 82 | private static int counterBase = 0; |
| 83 | |
| 84 | private static class TempFileLocker {}; |
| 85 | |
| 86 | private static TempFileLocker tempFileLocker = new TempFileLocker(); |
| 87 | |
| 88 | private static boolean caseSensitive; |
| 89 | |
| 90 | private static native void oneTimeInitialization(); |
| 91 | |
| 92 | static { |
| 93 | oneTimeInitialization(); |
| 94 | |
| 95 | // The default protection domain grants access to these properties |
| 96 | separatorChar = System.getProperty("file.separator", "/").charAt(0); //$NON-NLS-1$ //$NON-NLS-2$ |
| 97 | pathSeparatorChar = System.getProperty("path.separator", ";").charAt(0); //$NON-NLS-1$//$NON-NLS-2$ |
| 98 | separator = new String(new char[] { separatorChar }, 0, 1); |
| 99 | pathSeparator = new String(new char[] { pathSeparatorChar }, 0, 1); |
| 100 | caseSensitive = isCaseSensitiveImpl(); |
| 101 | } |
| 102 | |
| 103 | /** |
nothing calls this directly
no test coverage detected