DbtuTools project
Java Library

org.dbtutools.DbtuTools.core.os
Class TempFile

java.lang.Object
  |
  +--org.dbtutools.DbtuTools.core.os.TempFile

public class TempFile
extends java.lang.Object

This class should be used to create temporary files within the /opt/dbtutools tree. It cannot be instantiated.

Author:
Daniel Scheibli <daniel.scheibli at edelbyte.org>

Method Summary
static java.io.File createTempFile()
          Creates a File class instance, pointing to a newly created (empty) temporary file, which is located in the /opt/dbtutools tree.

Remark: The name of the temporary file is based on the following format: t<yyyymmddhhmmss>p<nnnn>n<n>.tmp The first token contains time and date; the next token represents the parent process id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTempFile

public static java.io.File createTempFile()
                                   throws UnknownValueException,
                                          java.io.IOException
Creates a File class instance, pointing to a newly created (empty) temporary file, which is located in the /opt/dbtutools tree.

Remark: The name of the temporary file is based on the following format: t<yyyymmddhhmmss>p<nnnn>n<n>.tmp The first token contains time and date; the next token represents the parent process id. The last token is an additional number (most of the times zero) which is increased in a case of a conflicts with an already existing file.
Returns:
The File instance, addressing the created temporary file.
Throws:
UnknownValueException - For the case, that the /opt/dbtutools tree or the parent process id could not be detected.
java.io.IOException - For the case, that the temporary file could not be created (there are different reasons for).

DbtuTools project
Java Library