public class FilePurgeServiceImpl extends Object implements FilePurgeService
Modifier and Type | Field and Description |
---|---|
protected static String |
DAYS_BEFORE_PURGE_PARAMETER_PREFIX |
protected static String |
DAYS_BEFORE_PURGE_PARAMETER_SUFFIX |
protected org.apache.log4j.Logger |
LOG |
Constructor and Description |
---|
FilePurgeServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.commons.io.filefilter.IOFileFilter |
buildAnyDirectoryButCustomAgeDirectoryFileFilter(List<FilePurgeCustomAge> customAges)
Builds a file filter which will skip the directories taken by the CustomAges
|
protected org.apache.commons.io.filefilter.IOFileFilter |
buildDefaultAgeFileFilter()
Builds an age file filter for the default removal run
|
protected FilePurgeDirectoryWalker |
getCustomAgesDirectoryWalker(List<FilePurgeCustomAge> customAges)
Gets a directory walker which will
|
int |
getDaysBeforePurgeForCustomAge(FilePurgeCustomAge customAge)
Returns the age in days that files matching this custom age should leave matching files before purging
|
protected String |
getDaysBeforePurgeSuffix() |
protected FilePurgeDirectoryWalker |
getDefaultDirectoryWalker(List<FilePurgeCustomAge> customAges)
Gets the directory walker for the default directories
|
org.kuali.rice.coreservice.framework.parameter.ParameterService |
getParameterService()
Gets the parameterService attribute.
|
int |
getStandardDaysBeforePurge()
Looks up the parameter for the standard number of days before a file should be purged
|
protected String |
getStandardDaysBeforePurgeParameterName() |
protected void |
purgeCustomAgeFiles(String directory,
List<FilePurgeCustomAge> customAges)
Purges any files in the given directory associated with custom ages
|
protected void |
purgeDefaultFiles(String directory,
List<FilePurgeCustomAge> customAges)
Purges any files in the given directory not associated with custom ages
|
void |
purgeFiles(String directory,
List<FilePurgeCustomAge> customAges)
Uses a FilePurgeDirectoryWalker to get a List of Files to purge, then purges each
|
protected int |
retrieveDaysBeforePurgeParameterValue(String parameterName)
Retrieves the parameter value of the OLE-SYS / FilePurgeStep / parameterName parameter and converts it to an integer number of days
|
void |
setParameterService(org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService)
Sets the parameterService attribute value.
|
protected org.apache.log4j.Logger LOG
protected static final String DAYS_BEFORE_PURGE_PARAMETER_SUFFIX
protected static final String DAYS_BEFORE_PURGE_PARAMETER_PREFIX
public FilePurgeServiceImpl()
public void purgeFiles(String directory, List<FilePurgeCustomAge> customAges)
purgeFiles
in interface FilePurgeService
directory
- the directory to purgecustomAges
- the List of customized ages for files which do not follow the standardorg.kuali.ole.gl.batch.service.FilePurgeService#purgeFiles(java.lang.String, java.util.List)
protected void purgeCustomAgeFiles(String directory, List<FilePurgeCustomAge> customAges)
directory
- the directory to purge files fromcustomAges
- custom ages to purge files forprotected void purgeDefaultFiles(String directory, List<FilePurgeCustomAge> customAges)
directory
- the directory to purge files fromcustomAges
- the custom ages with directories to avoidprotected FilePurgeDirectoryWalker getCustomAgesDirectoryWalker(List<FilePurgeCustomAge> customAges)
customAges
- the custom ages to purge files forprotected FilePurgeDirectoryWalker getDefaultDirectoryWalker(List<FilePurgeCustomAge> customAges)
customAges
- the custom ages, because custom age directories will not be purgedprotected org.apache.commons.io.filefilter.IOFileFilter buildAnyDirectoryButCustomAgeDirectoryFileFilter(List<FilePurgeCustomAge> customAges)
customAges
- the customAges to avoidpublic int getDaysBeforePurgeForCustomAge(FilePurgeCustomAge customAge)
FilePurgeService
getDaysBeforePurgeForCustomAge
in interface FilePurgeService
customAge
- a custom age to checkorg.kuali.ole.gl.batch.service.FilePurgeService#getAgeInDaysForCustomAge(org.kuali.ole.sys.batch.FilePurgeCustomAge)
protected String getDaysBeforePurgeSuffix()
public int getStandardDaysBeforePurge()
FilePurgeService
getStandardDaysBeforePurge
in interface FilePurgeService
org.kuali.ole.gl.batch.service.FilePurgeService#getStandardDaysBeforePurge()
protected String getStandardDaysBeforePurgeParameterName()
protected int retrieveDaysBeforePurgeParameterValue(String parameterName)
parameterName
- the name of the parameter to retrieve the value ofprotected org.apache.commons.io.filefilter.IOFileFilter buildDefaultAgeFileFilter()
public org.kuali.rice.coreservice.framework.parameter.ParameterService getParameterService()
public void setParameterService(org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService)
parameterService
- The parameterService to set.Copyright © 2004–2015 The Kuali Foundation. All rights reserved.