public class ArchiveOldFiles extends OldFileFinder
Modifier and Type | Method and Description |
---|---|
static void |
archive(ArchiverInterface archiver,
java.lang.String baseDirectory,
java.lang.String subDirectory,
int daysOld)
Static method for instantiating class.
|
void |
handleOldFile(java.io.File file)
Called for each file that is older than specified number of days.
|
static void |
main(java.lang.String[] args)
For testing.
|
public static void archive(ArchiverInterface archiver, java.lang.String baseDirectory, java.lang.String subDirectory, int daysOld)
archiver
- Specifies the archiver to use to actually archive the filebaseDirectory
- Specifies directory where to find files. This part of the
directory name is not included in the file description for
each file in the archived zip file. This way the file names in
the zip file will be something like "mbta/core/2014/12/20"
instead of "D:/Logs/mbta/core/2014/12/20".subDirectory
- The subdirectory beyond the base directory. Specifies where to
find the log files to be archived. This part of the file names
is included in the file descriptions in the zip file.daysOld
- If files older than daysOld found in a directory then that
directory is archived.public void handleOldFile(java.io.File file)
public static void main(java.lang.String[] args)
args
-