939 |
* |
* |
940 |
* @since 1.2 |
* @since 1.2 |
941 |
*/ |
*/ |
942 |
public static synchronized File createTempFile (String prefix, String suffix, |
public static File createTempFile (String prefix, String suffix, |
943 |
File directory) |
File directory) |
944 |
throws IllegalArgumentException, SecurityException, IOException |
throws IOException |
945 |
{ |
{ |
946 |
// Grab the system temp directory if necessary |
// Grab the system temp directory if necessary |
947 |
if (directory == null) |
if (directory == null) |
1089 |
* |
* |
1090 |
* @since 1.2 |
* @since 1.2 |
1091 |
*/ |
*/ |
1092 |
public int compareTo (File file) |
public int compareTo (File other) |
1093 |
{ |
{ |
1094 |
String p1, p2; |
String p1, p2; |
1095 |
|
|
1096 |
try |
try |
1097 |
{ |
{ |
1098 |
p1 = getCanonicalPath(); |
p1 = getCanonicalPath (); |
1099 |
p2 = file.getCanonicalPath(); |
p2 = other.getCanonicalPath (); |
1100 |
} |
} |
1101 |
catch(IOException e) |
catch(IOException e) |
1102 |
{ |
{ |
1104 |
// Even if we don't call the method, we must replicate the functionality |
// Even if we don't call the method, we must replicate the functionality |
1105 |
// which per the spec can fail. What happens in that situation? |
// which per the spec can fail. What happens in that situation? |
1106 |
// I just assume the files are equal! |
// I just assume the files are equal! |
1107 |
// |
return 0; |
|
return(0); |
|
1108 |
} |
} |
1109 |
|
|
1110 |
return p1.compareTo (p2); |
return p1.compareTo (p2); |
1131 |
* |
* |
1132 |
* @since 1.2 |
* @since 1.2 |
1133 |
*/ |
*/ |
1134 |
public int compareTo (Object obj) throws ClassCastException |
public int compareTo (Object obj) |
1135 |
{ |
{ |
1136 |
return compareTo ((File) obj); |
return compareTo ((File) obj); |
1137 |
} |
} |
1208 |
s.checkRead (path); |
s.checkRead (path); |
1209 |
} |
} |
1210 |
|
|
1211 |
/** |
/** |
1212 |
* Calling this method requests that the file represented by this object |
* Calling this method requests that the file represented by this object |
1213 |
* be deleted when the virtual machine exits. Note that this request cannot |
* be deleted when the virtual machine exits. Note that this request cannot |
1214 |
* be cancelled. Also, it will only be carried out if the virtual machine |
* be cancelled. Also, it will only be carried out if the virtual machine |
1215 |
* exits normally. |
* exits normally. |
1216 |
* |
* |
1217 |
* @exception SecurityException If deleting of the file is not allowed |
* @exception SecurityException If deleting of the file is not allowed |
1218 |
|
* |
1219 |
|
* @since 1.2 |
1220 |
*/ |
*/ |
1221 |
public void deleteOnExit () |
public void deleteOnExit () |
1222 |
{ |
{ |