Summary
Add verbiage to the specification of java.io.File.createTempFile(String,String,File)
clarifying the behavior when the platform cannot create a file with the requested name.
Problem
The specification of File.createTempFile
makes no reference to the behavior when it is not possible to create a file having the name implied by the given prefix and suffix.
Solution
Augment the specification of File.createTempFile
to indicate the behavior when the file cannot be created.
Specification
--- a/src/java.base/share/classes/java/io/File.java
+++ b/src/java.base/share/classes/java/io/File.java
@@ -2117,6 +2117,11 @@ static File generateFile(String prefix, String suffix, File dir)
* made the name of the new file will be generated by concatenating the
* prefix, five or more internally-generated characters, and the suffix.
*
+ * <p> If a file with the generated name cannot be created by the
+ * underlying platform, then an {@code IOException} will be thrown.
+ * This could occur for example if the supplied prefix or suffix contains
+ * one or more characters not supported by the underlying file system.
+ *
* <p> If the {@code directory} argument is {@code null} then the
* system-dependent default temporary-file directory will be used. The
* default temporary-file directory is specified by the system property
- csr of
-
JDK-6426678 (spec) File.createTempFile(prefix, suffix, dir) needs clarification for illegal symbols in suffix
-
- Resolved
-