org.sourcejammer.util
Class TempDirectoryManager

java.lang.Object
  |
  +--org.sourcejammer.util.TempDirectoryManager

public class TempDirectoryManager
extends java.lang.Object


Field Summary
private static java.lang.String COUNTER_FILE_NAME
           
private static java.lang.String TEMP_DIRECTORY_NAME
           
private static java.io.File tempDir
           
 
Constructor Summary
private TempDirectoryManager()
           
 
Method Summary
static void clearAllTempFiles()
          Remove all files in temp directory other than namer.
static void deleteTempFile(long id)
           
private static java.io.File getFileById(long id)
           
static java.io.File getNewTempFile()
           
static java.io.File getNewTempFile(long id)
           
static long getNextID()
          Gets the next unique ID from the Counter object.
static java.io.File getTempFileById(long id)
           
static byte[] getTempFileBytesById(long id)
           
static void main(java.lang.String[] args)
           
private static void makeCounterIfNeeded(java.io.File flCounter)
          Creates and stores the Counter object if it does not already exist in the temp directory.
static long makeNewTempFile(byte[] by)
           
private static void makeTempDirIfNeeded()
          Creates the temp directory if it does not exist.
static void removeTempFiles(java.util.Date olderThanDate)
          Remove all files in temp directory (except namer) older than specified Date.
static long streamFromFileToTemp(java.io.File fl)
           
static void streamFromTempToFile(long tempFileID, java.io.File fl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMP_DIRECTORY_NAME

private static final java.lang.String TEMP_DIRECTORY_NAME
See Also:
Constant Field Values

COUNTER_FILE_NAME

private static final java.lang.String COUNTER_FILE_NAME
See Also:
Constant Field Values

tempDir

private static java.io.File tempDir
Constructor Detail

TempDirectoryManager

private TempDirectoryManager()
Method Detail

clearAllTempFiles

public static void clearAllTempFiles()
Remove all files in temp directory other than namer.


removeTempFiles

public static void removeTempFiles(java.util.Date olderThanDate)
Remove all files in temp directory (except namer) older than specified Date.


makeTempDirIfNeeded

private static void makeTempDirIfNeeded()
                                 throws java.io.IOException
Creates the temp directory if it does not exist.

java.io.IOException

getNextID

public static long getNextID()
                      throws java.io.IOException
Gets the next unique ID from the Counter object.

java.io.IOException

getNewTempFile

public static java.io.File getNewTempFile()
                                   throws java.io.IOException
java.io.IOException

getTempFileBytesById

public static byte[] getTempFileBytesById(long id)
                                   throws java.io.IOException
java.io.IOException

makeNewTempFile

public static long makeNewTempFile(byte[] by)
                            throws java.io.IOException
java.io.IOException

streamFromFileToTemp

public static long streamFromFileToTemp(java.io.File fl)
                                 throws java.io.IOException
java.io.IOException

streamFromTempToFile

public static void streamFromTempToFile(long tempFileID,
                                        java.io.File fl)
                                 throws java.io.IOException
java.io.IOException

getTempFileById

public static java.io.File getTempFileById(long id)
                                    throws java.io.IOException
java.io.IOException

getNewTempFile

public static java.io.File getNewTempFile(long id)
                                   throws java.io.IOException
java.io.IOException

deleteTempFile

public static void deleteTempFile(long id)
                           throws java.io.IOException
java.io.IOException

getFileById

private static java.io.File getFileById(long id)

makeCounterIfNeeded

private static void makeCounterIfNeeded(java.io.File flCounter)
                                 throws java.io.IOException
Creates and stores the Counter object if it does not already exist in the temp directory.

java.io.IOException

main

public static void main(java.lang.String[] args)


Copyright 2003 Soucejammer project.