de.schlichtherle.io.util
Class Temps

java.lang.Object
  extended by de.schlichtherle.io.util.Temps

public class Temps
extends Object

A utility class for creating temporary files. This class allows to change the directory for temporary files via the class property directory. If the value of this property is null (which is the default), the value of the system property java.io.tmpdir is used.

Since:
TrueZIP 6.6
Version:
TrueZIP 6.7
Author:
Christian Schlichtherle

Constructor Summary
protected Temps()
          You can't instantiate this class.
 
Method Summary
static File createTempFile(String prefix)
          Like createTempFile(String, String), but uses the default suffix ".tmp".
static File createTempFile(String prefix, String suffix)
          Like File.createTempFile(java.lang.String, java.lang.String, java.io.File), but uses the value of the class property directory as the directory for temporary files.
static File getDirectory()
          Returns the directory for temporary files.
static void setDirectory(File directory)
          Sets the directory for temporary files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Temps

protected Temps()
You can't instantiate this class.

Method Detail

getDirectory

public static File getDirectory()
Returns the directory for temporary files. By default, this method returns null, which means that the directory used for createTempFile(java.lang.String, java.lang.String) is determined by the system property java.io.tmpdir.


setDirectory

public static void setDirectory(File directory)
Sets the directory for temporary files. If this is null, the value of the system property java.io.tmpdir is used by createTempFile(java.lang.String, java.lang.String).


createTempFile

public static final File createTempFile(String prefix,
                                        String suffix)
                                 throws IOException
Like File.createTempFile(java.lang.String, java.lang.String, java.io.File), but uses the value of the class property directory as the directory for temporary files. If the value of this property is null, the directory is determined by the value of the system property java.io.tmpdir.

Throws:
IOException
See Also:
getDirectory(), setDirectory(java.io.File)

createTempFile

public static final File createTempFile(String prefix)
                                 throws IOException
Like createTempFile(String, String), but uses the default suffix ".tmp".

Throws:
IOException
See Also:
getDirectory(), setDirectory(java.io.File)