Class AbstractDeleteFilesSchedulable.DeleteFilesConfiguration

    • 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 to true 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 to true 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 to true 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