144 |
if (! VMFile.exists(path)) |
if (! VMFile.exists(path)) |
145 |
return false; |
return false; |
146 |
|
|
147 |
if (!VMFile.isDirectory(path)) |
if (VMFile.isDirectory(path)) |
148 |
return VMFile.canWrite(path); |
return VMFile.canWriteDirectory(this); |
149 |
else |
else |
150 |
try |
return VMFile.canWrite(path); |
|
{ |
|
|
/* If the separator is '\' a DOS-style-filesystem is assumed |
|
|
and a short name is used, otherwise use a long name. |
|
|
WARNING: some implementation of DOS-style-filesystems also |
|
|
accept '/' as separator. In that case the following code |
|
|
will fail. |
|
|
*/ |
|
|
String filename = (separatorChar!='\\')?"test-dir-write":"tst"; |
|
|
File test = createTempFile(filename, null, this); |
|
|
return (test != null && test.delete()); |
|
|
} |
|
|
catch (IOException ioe) |
|
|
{ |
|
|
return false; |
|
|
} |
|
151 |
} |
} |
152 |
|
|
153 |
/** |
/** |