mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
4847239: (spec) File.createTempFile() should make it clear that it doesn't create the temporary directory
Reviewed-by: naoto, lancea
This commit is contained in:
parent
3fae4b3720
commit
68ef21db41
2 changed files with 115 additions and 1 deletions
|
@ -2110,6 +2110,13 @@ public class File
|
|||
* is invoked, but programmatic changes to this property are not guaranteed
|
||||
* to have any effect upon the temporary directory used by this method.
|
||||
*
|
||||
* <p> If the {@code directory} argument is not {@code null} and its
|
||||
* abstract pathname is valid and denotes an existing, writable directory,
|
||||
* then the file will be created in that directory. Otherwise the file will
|
||||
* not be created and an {@code IOException} will be thrown. Under no
|
||||
* circumstances will a directory be created at the location specified by
|
||||
* the {@code directory} argument.
|
||||
*
|
||||
* @param prefix The prefix string to be used in generating the file's
|
||||
* name; must be at least three characters long
|
||||
*
|
||||
|
@ -2127,7 +2134,8 @@ public class File
|
|||
* If the {@code prefix} argument contains fewer than three
|
||||
* characters
|
||||
*
|
||||
* @throws IOException If a file could not be created
|
||||
* @throws IOException
|
||||
* If a file could not be created
|
||||
*
|
||||
* @throws SecurityException
|
||||
* If a security manager exists and its {@link
|
||||
|
@ -2149,6 +2157,7 @@ public class File
|
|||
|
||||
File tmpdir = (directory != null) ? directory
|
||||
: TempDirectory.location();
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
File f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue