228 |
|
|
229 |
File other = (File) obj; |
File other = (File) obj; |
230 |
|
|
231 |
if (VMFile.caseSensitive) |
if (VMFile.IS_CASE_SENSITIVE) |
232 |
return path.equals(other.path); |
return path.equals(other.path); |
233 |
else |
else |
234 |
return path.equalsIgnoreCase(other.path); |
return path.equalsIgnoreCase(other.path); |
631 |
*/ |
*/ |
632 |
public int hashCode() |
public int hashCode() |
633 |
{ |
{ |
634 |
if (VMFile.caseSensitive) |
if (VMFile.IS_CASE_SENSITIVE) |
635 |
return path.hashCode() ^ 1234321; |
return path.hashCode() ^ 1234321; |
636 |
else |
else |
637 |
return path.toLowerCase().hashCode() ^ 1234321; |
return path.toLowerCase().hashCode() ^ 1234321; |
1101 |
if (suffix == null) |
if (suffix == null) |
1102 |
suffix = ".tmp"; |
suffix = ".tmp"; |
1103 |
|
|
1104 |
/* Now identify a file name and make sure it doesn't exist. |
// Now identify a file name and make sure it doesn't exist. |
|
If the separator is '\' a DOS-style-filesystem is assumed and |
|
|
a 8+3-filename is used, otherwise use a long name. |
|
|
WARNGIN: some implementation of DOS-style-filesystems also |
|
|
accept '/' as separator. In that case the following code |
|
|
will fail. |
|
|
*/ |
|
1105 |
File file; |
File file; |
1106 |
if (separatorChar!='\\') |
if (!VMFile.IS_DOS_8_3) |
1107 |
{ |
{ |
|
// probably a non-DOS-filesystem, use long names |
|
1108 |
do |
do |
1109 |
{ |
{ |
1110 |
String filename = prefix + System.currentTimeMillis() + suffix; |
String filename = prefix + System.currentTimeMillis() + suffix; |
1114 |
} |
} |
1115 |
else |
else |
1116 |
{ |
{ |
|
// probably a DOS-filesystem, use short names (8+3) |
|
|
|
|
1117 |
// make sure prefix is not longer than 7 characters |
// make sure prefix is not longer than 7 characters |
1118 |
if (prefix.length() >= 8) |
if (prefix.length() >= 8) |
1119 |
throw new IllegalArgumentException("Prefix too long: " + prefix + "(valid length 3..7)"); |
throw new IllegalArgumentException("Prefix too long: " + prefix + "(valid length 3..7)"); |
1232 |
*/ |
*/ |
1233 |
public int compareTo(File other) |
public int compareTo(File other) |
1234 |
{ |
{ |
1235 |
if (VMFile.caseSensitive) |
if (VMFile.IS_CASE_SENSITIVE) |
1236 |
return path.compareTo (other.path); |
return path.compareTo (other.path); |
1237 |
else |
else |
1238 |
return path.compareToIgnoreCase (other.path); |
return path.compareToIgnoreCase (other.path); |