net.sourceforge.cruisecontrol.logmanipulators
Class BaseManipulator
java.lang.Object
net.sourceforge.cruisecontrol.logmanipulators.BaseManipulator
- All Implemented Interfaces:
- Manipulator
- Direct Known Subclasses:
- DeleteArtifactsManipulator, DeleteManipulator, GZIPManipulator
- public abstract class BaseManipulator
- extends java.lang.Object
- implements Manipulator
|
Method Summary |
protected java.io.FilenameFilter |
getFilenameFilter(java.util.Date logdate,
boolean ignoreSuffix)
Can be overriden to provide different FilenameFilter implementations. |
protected java.io.File[] |
getRelevantFiles(java.lang.String logDir,
boolean ignoreSuffix)
Identifies the relevant Logfiles from the given Logdir |
void |
setEvery(int every)
sets the backup keep amount |
void |
setUnit(java.lang.String unit)
sets the unit on which the backup should run. valid are YEAR, MONTH, WEEK, DAY |
void |
validate()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseManipulator
public BaseManipulator()
getRelevantFiles
protected java.io.File[] getRelevantFiles(java.lang.String logDir,
boolean ignoreSuffix)
- Identifies the relevant Logfiles from the given Logdir
- Parameters:
logDir - the logDir as String
- Returns:
- File-Array of the the relevant files.
validate
public void validate()
throws CruiseControlException
- Specified by:
validate in interface Manipulator
- Throws:
CruiseControlException
setEvery
public void setEvery(int every)
throws CruiseControlException
- sets the backup keep amount
- Parameters:
every -
- Throws:
CruiseControlException
setUnit
public void setUnit(java.lang.String unit)
throws CruiseControlException
- sets the unit on which the backup should run. valid are YEAR, MONTH, WEEK, DAY
- Parameters:
unit - String that is used as Key for the Calendar-Constants
- Throws:
CruiseControlException
getFilenameFilter
protected java.io.FilenameFilter getFilenameFilter(java.util.Date logdate,
boolean ignoreSuffix)
- Can be overriden to provide different FilenameFilter implementations.
- Parameters:
logdate - the date of 'old' build file(s) on which some action should be taken.ignoreSuffix - true to ignore ".xml" suffix during matching
- Returns:
- a FilenameFilter to be used to select files older than the given date for manipulation.