org.apache.jackrabbit.core.journal
Class RotatingLogFile

java.lang.Object
  extended by org.apache.jackrabbit.core.journal.RotatingLogFile
All Implemented Interfaces:
Comparable<RotatingLogFile>

public class RotatingLogFile
extends Object
implements Comparable<RotatingLogFile>

Represents a log file that can be rotated.


Method Summary
 int compareTo(RotatingLogFile o)
          Compares this log file to another file.
 File getFile()
          Return the backing file.
static RotatingLogFile[] listFiles(File directory, String basename)
          List all log files inside some directory.
 void rotate()
          Rotate this file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFile

public File getFile()
Return the backing file.


rotate

public void rotate()
Rotate this file.


compareTo

public int compareTo(RotatingLogFile o)
Compares this log file to another file. It will return a negative number if this log file has a smaller version, a positive number if this log file a bigger version and 0 if they have the same version.

Specified by:
compareTo in interface Comparable<RotatingLogFile>

listFiles

public static RotatingLogFile[] listFiles(File directory,
                                          String basename)
List all log files inside some directory. The list returned is guaranteed to be in descending order, i.e. it is safe to rotate every file in turn without accidentally overwriting another one.

Parameters:
directory - parent directory
basename - basename expected
Returns:
array of log files found


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.