uk.org.simonsite.log4j.helpers
Class FileHelper

java.lang.Object
  extended by uk.org.simonsite.log4j.helpers.FileHelper

public final class FileHelper
extends Object

Version:
3.9
Author:
Simon Park

Method Summary
 boolean deleteExisting(File file)
          Delete with retry.
static FileHelper getInstance()
           
 boolean isCompressed(File file)
           
 boolean isEmpty(File file)
           
 boolean isGZip(File file)
           
 boolean isReadable(File file)
           
 boolean isWriteable(File file)
           
 boolean isZip(File file)
           
 void makeParentDirsOf(File file)
           
 File parentDirOf(File file)
           
 boolean rename(File from, File to)
          Rename with retry.
 long sizeOf(File file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final FileHelper getInstance()

sizeOf

public long sizeOf(File file)

isEmpty

public boolean isEmpty(File file)

deleteExisting

public boolean deleteExisting(File file)
Delete with retry.

Parameters:
file -
Returns:
true if the file was successfully deleted.

rename

public boolean rename(File from,
                      File to)
Rename with retry.

Parameters:
from -
to -
Returns:
true if the file was successfully renamed.

isReadable

public boolean isReadable(File file)

isWriteable

public boolean isWriteable(File file)

parentDirOf

public File parentDirOf(File file)
Parameters:
file -
Returns:
The parent File if one exists, the current working directory otherwise.

makeParentDirsOf

public void makeParentDirsOf(File file)

isCompressed

public boolean isCompressed(File file)

isZip

public boolean isZip(File file)

isGZip

public boolean isGZip(File file)