Class FileRuleSet<IncludeRuleClass extends FileRule,​ExcludeRuleClass extends FileRule>

    • Method Detail

      • convertToLines

        @NotNull
        public static List<String> convertToLines​(@NotNull
                                                  String body)
        Accepts string and transforms it to the list of lines which can be passed to the FileRuleSet(List) constructor
        Parameters:
        body - text to split by lines
        Returns:
        list of lines
        Since:
        2019.1
      • preparePath

        @NotNull
        public String preparePath​(@Nullable
                                  String path)
      • sortByFrom

        protected static void sortByFrom​(@NotNull
                                         List<? extends FileRule> rules,
                                         boolean reverse)
      • getBody

        @NotNull
        public List<String> getBody()
      • shouldInclude

        protected boolean shouldInclude​(String path,
                                        @NotNull
                                        Filter<FileRule> includeExcludeRulesFilter)
      • shouldInclude

        public boolean shouldInclude​(String path)
      • shouldInclude

        public boolean shouldInclude​(@Nullable
                                     String path,
                                     @NotNull
                                     IncludeRule rule)
      • isUnder

        public boolean isUnder​(String parentPath)
        Parameters:
        parentPath - path which is a candidate for a parent of all include rules
        Returns:
        true if all include paths of these Checkout rules are under given parent path
      • isSubDir

        public static boolean isSubDir​(String child,
                                       String parent)
      • getIncludeRuleMerged

        @Nullable
        public IncludeRuleClass getIncludeRuleMerged()
        Return a common include rule for this CheckoutRules. Right part of the IncludeRule is not considered at all here.
         +:a/b
         +:a/c
         result = +:a
        
         +:a
         +:b  
         result = +:.
        
         +:a/b => foo
         +:a  => bar
         result = +:a => . 
        
        Returns:
        see above
        Since:
        7.0
      • findMostSpecific

        @Nullable
        protected static <T extends FileRule> T findMostSpecific​(String path,
                                                                 List<T> rules)
      • isIgnoreCase

        public boolean isIgnoreCase()
      • setIgnoreCase

        public void setIgnoreCase​(boolean ignoreCase)
      • isEmpty

        public boolean isEmpty()
      • describe

        @NotNull
        public String describe​(boolean verbose)
        Specified by:
        describe in interface Loggable
        Parameters:
        verbose - verbosity of object description
        Returns:
        description of this object. If verbose is true, description should have mode details.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object