Summary
Improve the specification of Files.createTempDirectory(Path,String,FileAttribute<?>...)
for the case when no attributes are specified.
Problem
Unlike the related method Files.createTempFile(Path,String,String,FileAttribute<?>...)
, Files.createTempDirectory(Path,String,FileAttribute<?>...)
does not make clear that the directory created may have restrictive permissions if the FileAttribute<?>...
parameter is null
.
Solution
Add a sentence clarifying the behavior of Files.createTempDirectory(Path,String,FileAttribute<?>...)
when no attributes are specified.
Specification
--- a/src/java.base/share/classes/java/nio/file/Files.java
+++ b/src/java.base/share/classes/java/nio/file/Files.java
@@ -860,7 +860,10 @@ public static Path createTempFile(String prefix,
* file-attributes} to set atomically when creating the directory. Each
* attribute is identified by its {@link FileAttribute#name name}. If more
* than one attribute of the same name is included in the array then all but
- * the last occurrence is ignored.
+ * the last occurrence is ignored. When no file attributes are specified,
+ * then the resulting directory may have more restrictive access
+ * permissions to directories created by the
+ * {@linkplain Files#createDirectory(Path, FileAttribute<?>...)} method.
*
* @param dir
* the path to directory in which to create the directory
- csr of
-
JDK-8350654 (fs) Files.createTempDirectory should say something about the default file permissions when no file attributes specified
-
- Resolved
-
- relates to
-
JDK-8351294 (fs) Minor verbiage correction for Files.createTemp{Directory,File}
-
- Resolved
-