Class RotatingLogFile

  extended by org.apache.jackrabbit.core.journal.RotatingLogFile
All Implemented Interfaces:

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


public File getFile()
Return the backing file.


public void rotate()
Rotate this file.


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>


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.

directory - parent directory
basename - basename expected
array of log files found

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