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

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