net.sf.farrago.util
Class FarragoFileAllocation
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tracer
private static final Logger tracer
file
private File file
FarragoFileAllocation
public FarragoFileAllocation(File file)
- Creates a new FarragoFileAllocation.
- Parameters:
file
- the file to be deleted when this allocation is closed
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)