net.sf.farrago.util
Class FarragoFileAllocation

java.lang.Object
  extended by net.sf.farrago.util.FarragoFileAllocation
All Implemented Interfaces:
FarragoAllocation, ClosableAllocation

public class FarragoFileAllocation
extends Object
implements FarragoAllocation

FarragoFileAllocation takes care of deleting a File when it is closed. If the File is a directory, the directory and everything under it is deleted. Deletion failure is traced as a warning but does not result in an exception.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/util/FarragoFileAllocation.java#12 $
Author:
John V. Sichi

Field Summary
private  File file
           
private static Logger tracer
           
 
Constructor Summary
FarragoFileAllocation(File file)
          Creates a new FarragoFileAllocation.
 
Method Summary
 void closeAllocation()
          Closes this object.
private  void deleteDirectory(File dir)
           
private  void deleteFileOrDirectory(File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracer

private static final Logger tracer

file

private File file
Constructor Detail

FarragoFileAllocation

public FarragoFileAllocation(File file)
Creates a new FarragoFileAllocation.

Parameters:
file - the file to be deleted when this allocation is closed
Method Detail

closeAllocation

public void closeAllocation()
Description copied from interface: ClosableAllocation
Closes this object.

Specified by:
closeAllocation in interface ClosableAllocation

deleteFileOrDirectory

private void deleteFileOrDirectory(File file)

deleteDirectory

private void deleteDirectory(File dir)