Class SuffixMatchFilter

    • Constructor Detail

      • SuffixMatchFilter

        public SuffixMatchFilter​(java.lang.String suffix)
        Create a new SuffixMatchFilter, using VisitorAttributes.DEFAULT
        Parameters:
        suffix - the suffix
        Throws:
        java.lang.IllegalArgumentException - for a null suffix
      • SuffixMatchFilter

        public SuffixMatchFilter​(java.lang.String suffix,
                                 VisitorAttributes attributes)
        Create a new SuffixMatchFilter.
        Parameters:
        suffix - the suffix
        attributes - the attributes, pass null to use VisitorAttributes.DEFAULT
        Throws:
        java.lang.IllegalArgumentException - for a null suffix
      • SuffixMatchFilter

        public SuffixMatchFilter​(java.util.Collection<java.lang.String> suffixes)
        Create a new SuffixMatchFilter.
        Parameters:
        suffixes - - the list of file suffixes to accept.
        Throws:
        java.lang.IllegalArgumentException - for a null suffixes
      • SuffixMatchFilter

        public SuffixMatchFilter​(java.util.Collection<java.lang.String> suffixes,
                                 VisitorAttributes attributes)
        Create a new SuffixMatchFilter.
        Parameters:
        suffixes - - the list of file suffixes to accept.
        attributes - the attributes, pass null to use VisitorAttributes.DEFAULT
        Throws:
        java.lang.IllegalArgumentException - for a null suffixes
    • Method Detail

      • accepts

        public boolean accepts​(VirtualFile file)
        Accept any file that ends with one of the filter suffixes. This checks that the file.getName() endsWith a suffix.
        Parameters:
        file - the virtual file
        Returns:
        true if the file matches a suffix, false otherwise.