Class FileRule<ParentRules extends FileRuleSet>

    • Field Detail

      • myFromPath

        protected final String myFromPath
      • myFromFull

        protected final String myFromFull
    • Constructor Detail

      • FileRule

        public FileRule​(@NotNull
                        String from,
                        ParentRules parentRules,
                        boolean isInclude)
      • FileRule

        public FileRule​(@NotNull
                        String from,
                        ParentRules parentRules,
                        boolean isInclude,
                        boolean usePattern)
        Parameters:
        from - from part of the rule
        parentRules - parent rules
        isInclude - true if it is an include rule
        usePattern - true if regexp pattern should be used to match paths (can be slow and require more memory), false if pattern shouldn't be created and ancestor of this class does all the matching in the overridden getMatchedHead(java.lang.String) method
      • FileRule

        public FileRule​(@NotNull
                        String fromPath,
                        @Nullable
                        String additionalProperties,
                        ParentRules parentRules,
                        boolean isInclude)
    • Method Detail

      • getPattern

        @Nullable
        protected Pattern getPattern()
      • createPatternString

        @NotNull
        protected String createPatternString​(@NotNull
                                             String from)
      • getFrom

        public String getFrom()
      • isIsInclude

        public boolean isIsInclude()
      • getMatchedHead

        @Nullable
        public String getMatchedHead​(@NotNull
                                     String path)
        returns matched head path without trailing wildcards if matched with path, null otherwise
        Parameters:
        path - file path to match with
        Returns:
        matched head path without trailing wildcards
      • getProperty

        @Nullable
        public String getProperty​(String propName)
      • propertiesMatch

        public boolean propertiesMatch​(Map<String,​String> props)
      • getAdditionalProperties

        @Nullable
        public Map<String,​String> getAdditionalProperties()
      • isAbsolutePath

        public boolean isAbsolutePath()
      • isRoot

        public boolean isRoot()
        Returns:
        true if from part represents root directory (from = ".")
      • preparePathWithLowercase

        @NotNull
        protected String preparePathWithLowercase​(@Nullable
                                                  String path)