JDK-4735419 : File.createTempDirectory() to create a temporary directory
  • Type: Enhancement
  • Status: Closed
  • Resolution: Won't Fix
  • Component: core-libs
  • Sub-Component: java.io
  • Priority: P4
  • Affected Version: 1.4.0
  • OS: generic
  • CPU: generic
  • Submit Date: 2002-08-22
  • Updated Date: 2011-01-28
  • Resolved Date: 2011-01-28
Related Reports
Relates :  
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 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

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