United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4735419 : File.createTempDirectory() to create a temporary directory

Details
Type:
Enhancement
Submit Date:
2002-08-22
Status:
Closed
Updated Date:
2011-01-28
Project Name:
JDK
Resolved Date:
2011-01-28
Component:
core-libs
OS:
generic
Sub-Component:
java.io
CPU:
generic
Priority:
P4
Resolution:
Won't Fix
Affected Versions:
1.4.0
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
Name: rmT116609			Date: 08/22/2002


FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

and:

java version "1.4.1-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)


DESCRIPTION OF THE PROBLEM :
RFE: Add methods to java.io.File:

public static File createTempDirectory(String prefix, String
suffix) ;
public static File createTempDirectory(String prefix, String
suffix, File directory) ;

Same meaning as createTempFile() - but create directories.

CUSTOMER WORKAROUND :
File f=File.createTempFile(...);
f.delete();
f.mkdir();
(Review ID: 163479) 
======================================================================

                                    

Comments
EVALUATION

A reasonable request.  -- ###@###.### 2003/1/31
                                     
197-11-01 0
EVALUATION

The changes for 7006126 have been pushed to jdk7. Once they are available in a promoted build (probably jdk7-b130) then the new file system API can be used to create temporary directories as follows:

File dir = Files.createTempDirectory("blah").toFile();

This means there is little/no need to add a createTempDirectory to java.io.File.
                                     
2011-01-15



Hardware and Software, Engineered to Work Together