Skip to content

Commit fef1ef7

Browse files
author
Brian Burkhalter
committed
6426678: (spec) File.createTempFile(prefix, suffix, dir) needs clarification for illegal symbols in suffix
Reviewed-by: alanb
1 parent a528c4b commit fef1ef7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/java.base/share/classes/java/io/File.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -2117,6 +2117,11 @@ static File generateFile(String prefix, String suffix, File dir)
21172117
* made the name of the new file will be generated by concatenating the
21182118
* prefix, five or more internally-generated characters, and the suffix.
21192119
*
2120+
* <p> If a file with the generated name cannot be created by the
2121+
* underlying platform, then an {@code IOException} will be thrown.
2122+
* This could occur for example if the supplied prefix or suffix contains
2123+
* one or more characters not supported by the underlying file system.
2124+
*
21202125
* <p> If the {@code directory} argument is {@code null} then the
21212126
* system-dependent default temporary-file directory will be used. The
21222127
* default temporary-file directory is specified by the system property

0 commit comments

Comments
 (0)