47 |
*/ |
*/ |
48 |
final class VMFile |
final class VMFile |
49 |
{ |
{ |
50 |
static boolean caseSensitive; |
// FIXME: We support only case sensitive filesystems currently. |
51 |
|
static final boolean IS_CASE_SENSITIVE = true; |
52 |
|
static final boolean IS_DOS_8_3 = false; |
53 |
|
|
54 |
static |
static |
55 |
{ |
{ |
56 |
if (Configuration.INIT_LOAD_LIBRARY) |
if (Configuration.INIT_LOAD_LIBRARY) |
57 |
{ |
{ |
58 |
System.loadLibrary("javaio"); |
System.loadLibrary("javaio"); |
59 |
} |
} |
|
|
|
|
// FIXME: We support only caseSensitive filesystems currently. |
|
|
caseSensitive = true; |
|
60 |
} |
} |
61 |
|
|
62 |
/* |
/* |
63 |
* This native method does the actual work of getting the last file |
* This native method does the actual work of getting the last file |
64 |
* modification time. It also does the existence check to avoid the |
* modification time. It also does the existence check to avoid the |
126 |
static synchronized native boolean canWrite(String path); |
static synchronized native boolean canWrite(String path); |
127 |
|
|
128 |
/** |
/** |
129 |
|
* This methods checks if a directory can be written to. |
130 |
|
*/ |
131 |
|
static boolean canWriteDirectory(File dir) |
132 |
|
{ |
133 |
|
try |
134 |
|
{ |
135 |
|
String filename = IS_DOS_8_3 ? "tst" : "test-dir-write"; |
136 |
|
File test = File.createTempFile(filename, null, dir); |
137 |
|
return (test != null && test.delete()); |
138 |
|
} |
139 |
|
catch (IOException ioe) |
140 |
|
{ |
141 |
|
return false; |
142 |
|
} |
143 |
|
} |
144 |
|
|
145 |
|
/** |
146 |
* This native method checks file permissions for reading |
* This native method checks file permissions for reading |
147 |
*/ |
*/ |
148 |
static synchronized native boolean canRead(String path); |
static synchronized native boolean canRead(String path); |