org.moremotion.cache
Class TempFileManager

java.lang.Object
  extended by org.moremotion.cache.TempFileManager
All Implemented Interfaces:
java.lang.Runnable

public class TempFileManager
extends java.lang.Object
implements java.lang.Runnable

Responsible for providing temporary files on specified directory.

Version:
$Id: TempFileManager.java 51 2008-03-10 11:46:54Z erkan $

Constructor Summary
TempFileManager(java.io.File rootFile)
          Creates new TempFileManager
 
Method Summary
static boolean delete(java.io.File file)
           
 void finalize()
           
 java.io.File getTempFile(int duration)
          Creates a temporary file on the specified directory and returns it.
 java.io.File getTempFile(java.lang.String fileName)
           
 void run()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TempFileManager

public TempFileManager(java.io.File rootFile)
Creates new TempFileManager

Method Detail

getTempFile

public java.io.File getTempFile(int duration)
Creates a temporary file on the specified directory and returns it. The temporary file name will have a prefix "yyyyMMddHHmmss" format in its name which is actually the time that the file will be deleted after that time expires.

Parameters:
duration - The life duration of the file in seconds.

getTempFile

public java.io.File getTempFile(java.lang.String fileName)

run

public void run()
Specified by:
run in interface java.lang.Runnable

stop

public void stop()

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

delete

public static boolean delete(java.io.File file)


Copyright © 2002-2008 MOR YAZILIM. All Rights Reserved.