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