Class FileSorterUtil

java.lang.Object
fr.paris.lutece.portal.service.util.FileSorterUtil

public class FileSorterUtil extends Object
  • Field Details

  • Constructor Details

    • FileSorterUtil

      public FileSorterUtil()
  • Method Details

    • sortedByPathAndExtensionList

      public static List<String> sortedByPathAndExtensionList(List<String> set)
      Sorts the list of file paths by both path priority and extension priority. First, the list is sorted by path priority, and then by extension priority.
      Parameters:
      set - The list of file paths to be sorted
      Returns:
      The sorted list of file paths
    • sortByPathPriority

      public static List<String> sortByPathPriority(List<String> set)
      Sorts the list of file paths in descending order based on path priority. Paths with higher priority values will appear later in the list.
      Parameters:
      set - The list of file paths to sort in descending path priority
      Returns:
      The list of file paths sorted in descending path priority
    • sortByPathPriorityDescending

      public static List<String> sortByPathPriorityDescending(List<String> set)
      Sorts the list of file paths based on path priority. Paths are prioritized based on specific prefixes (e.g., PATH_OVERRIDE_PLUGINS, PATH_OVERRIDE_CORE, etc.).
      Parameters:
      set - The list of file paths to sort by path priority
      Returns:
      The list of file paths sorted by path priority
    • sortByExtensionPriority

      public static List<String> sortByExtensionPriority(List<String> set)
      Sorts the list of file paths based on extension priority. Extensions are prioritized (e.g., .xml, .json, .properties, etc.). If two files have the same extension priority, they are sorted alphabetically.
      Parameters:
      set - The list of file paths to sort by extension priority
      Returns:
      The list of file paths sorted by extension priority