org.deckfour.xes.nikefs2
Class NikeFS2SwapFileManager

java.lang.Object
  extended by org.deckfour.xes.nikefs2.NikeFS2SwapFileManager

public class NikeFS2SwapFileManager
extends Object

This class provides static facilities to acquire and manage temporary swap files. It is ensured, that acquired swap files will be removed after they are no longer used on a best-effort basis. On Unix systems, this is usually guaranteed after JVM shutdown. Especially on the Win32 platform, this class implements a workaround which will guarantee the deletion of swap files upon the next startup.

Author:
Christian W. Guenther (christian@deckfour.org)

Constructor Summary
NikeFS2SwapFileManager()
           
 
Method Summary
static File createSwapFile()
          Creates a new, empty swap file, ready for use.
static File createSwapFile(String prefix, String suffix)
          Creates a new, empty swap file, ready for use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NikeFS2SwapFileManager

public NikeFS2SwapFileManager()
Method Detail

createSwapFile

public static File createSwapFile()
                           throws IOException
Creates a new, empty swap file, ready for use. It is guaranteed that this swap file will be removed from the system either on JVM shutdown (Unix platforms) or on subsequent use of this class (Win32 platforms).

Returns:
A new swap file.
Throws:
IOException

createSwapFile

public static File createSwapFile(String prefix,
                                  String suffix)
                           throws IOException
Creates a new, empty swap file, ready for use. It is guaranteed that this swap file will be removed from the system either on JVM shutdown (Unix platforms) or on subsequent use of this class (Win32 platforms).

Parameters:
prefix - Prefix to be used for this swap file.
suffix - Suffix to be used for this swap file.
Returns:
A new swap file.
Throws:
IOException