Package org.ametys.cms.schedule
Class AbstractDeleteFilesSchedulable.DeleteFilesConfiguration
java.lang.Object
org.ametys.cms.schedule.AbstractDeleteFilesSchedulable.DeleteFilesConfiguration
- Enclosing class:
- AbstractDeleteFilesSchedulable
Inner class to store configuration for deletion.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
When a folder is empty, do it needs to be deleted ?boolean
Do the folders needs to be deleted recursively ?boolean
Do the root needs to be deleted or emptied ?Only delete files older than this instant.Get the root folder or file to deletevoid
setAgeLimit
(Instant ageLimit) Set the age limit of files to delete.void
setDeleteEmptyFolders
(boolean deleteEmptyFolders) Set totrue
to delete empty folders.void
setDeleteRecursively
(boolean deleteRecursively) Set totrue
to delete files recursively.void
setDeleteRoot
(boolean deleteRoot) Set totrue
to delete the root folder.
-
Constructor Details
-
DeleteFilesConfiguration
Constructor. Default values: - ageLimit = now - deleteRoot = false - deleteRecursively = true - deleteEmptyFolders = true- Parameters:
rootPath
- The root path for deletion
-
-
Method Details
-
getRootPath
Get the root folder or file to delete- Returns:
- a Directory or a file, that will be deleted/emptied
-
setDeleteRoot
Set totrue
to delete the root folder.- Parameters:
deleteRoot
-true
to delete the root folde
-
deleteRoot
Do the root needs to be deleted or emptied ?- Returns:
true
to delete the root folder
-
setDeleteRecursively
Set totrue
to delete files recursively.- Parameters:
deleteRecursively
-true
to delete files recursively
-
deleteRecursively
Do the folders needs to be deleted recursively ?- Returns:
true
to delete files recursively
-
setDeleteEmptyFolders
Set totrue
to delete empty folders.- Parameters:
deleteEmptyFolders
-true
to delete empty folders
-
deleteEmptyFolders
When a folder is empty, do it needs to be deleted ?- Returns:
true
to delete empty folders
-
setAgeLimit
Set the age limit of files to delete.- Parameters:
ageLimit
- The age limit
-
getAgeLimit
Only delete files older than this instant.- Returns:
- instant, only older files will be deleted
-