Class NikeFS2SwapFileManager


  • public class NikeFS2SwapFileManager
    extends java.lang.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)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.File createSwapFile()
      Creates a new, empty swap file, ready for use.
      static java.io.File createSwapFile​(java.lang.String prefix, java.lang.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 java.io.File createSwapFile()
                                           throws java.io.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:
        java.io.IOException
      • createSwapFile

        public static java.io.File createSwapFile​(java.lang.String prefix,
                                                  java.lang.String suffix)
                                           throws java.io.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:
        java.io.IOException