Class KeepLastNCleanupPolicy

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getFilesToDelete​(java.util.List<java.lang.String> candidateFiles, java.lang.String currentFileName)
      Get a list of files that needs to be deleted because of the cleanup policy.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeepLastNCleanupPolicy

        public KeepLastNCleanupPolicy​(int keepLastN,
                                      java.lang.String filePattern)
      • KeepLastNCleanupPolicy

        public KeepLastNCleanupPolicy​(int keepLastN,
                                      java.util.regex.Pattern filePattern)
    • Method Detail

      • getFilesToDelete

        @Nonnull
        public java.util.List<java.lang.String> getFilesToDelete​(@Nonnull
                                                                 java.util.List<java.lang.String> candidateFiles,
                                                                 @Nonnull
                                                                 java.lang.String currentFileName)
        Description copied from interface: RollingFileMessageWriter.CleanupPolicy
        Get a list of files that needs to be deleted because of the cleanup policy.
        Specified by:
        getFilesToDelete in interface RollingFileMessageWriter.CleanupPolicy
        Parameters:
        candidateFiles - List of the files that can be cleaned up. This does NOT include the currently written files (current file and symlink).
        currentFileName - The current file name.
        Returns:
        List of files that needs to be deleted.