ccs.utils
Class TempFile

java.lang.Object
  extended by ccs.utils.TempFile

public class TempFile
extends java.lang.Object

A class for finding suitable names for temp files. Java2 provides an inbuilt facility for this, but creates an empty file too, which we don't want, so we delete it before returning the name. The author is a little concerned about race conditions under these circumstances.


Method Summary
static java.io.File get()
          Returns a non-existent temp file in the Checkpoint temp folder.
static java.io.File get(java.io.File folder)
          Returns a non-existent temp file in the specified folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static java.io.File get()
                        throws java.io.IOException
Returns a non-existent temp file in the Checkpoint temp folder.

Returns:
The temp file.
Throws:
java.io.IOException - if the attempt fails.

get

public static java.io.File get(java.io.File folder)
                        throws java.io.IOException
Returns a non-existent temp file in the specified folder. If the specified folder is null, the file will be in the Checkpoint temp folder.

Returns:
The temp file.
Throws:
java.io.IOException - if the attempt fails.