com.groupdocs.search

Class DocumentFilter



  • public abstract class DocumentFilter
    extends Object
    Represents the base class for document filters. Contains methods for creation document filter instances.

    Learn more

    • Constructor Detail

      • DocumentFilter

        public DocumentFilter()
    • Method Detail

      • getByteCount

        protected static int getByteCount(DocumentFilter filter)
      • toString

        public abstract String toString()
        Returns string representation of a document filter.
        Overrides:
        toString in class Object
        Returns:
        String representation of a document filter.
      • createCreationTimeLowerBound

        public static DocumentFilter createCreationTimeLowerBound(Date lowerBound)
        Creates a filter for skipping documents with creation date earlier than the lower bound.
        Parameters:
        lowerBound - The lower bound of the document creation time.
        Returns:
        A document filter by document creation time.
      • createCreationTimeUpperBound

        public static DocumentFilter createCreationTimeUpperBound(Date upperBound)
        Creates a filter for skipping documents with creation date later than the upper bound.
        Parameters:
        upperBound - The upper bound of the document creation time.
        Returns:
        A document filter by document creation time.
      • createCreationTimeRange

        public static DocumentFilter createCreationTimeRange(Date lowerBound,
                                                             Date upperBound)
        Creates a filter for skipping documents with creation date out of the specified range.
        Parameters:
        lowerBound - The lower bound of the document creation time.
        upperBound - The upper bound of the document creation time.
        Returns:
        A document filter by document creation time.
      • createModificationTimeLowerBound

        public static DocumentFilter createModificationTimeLowerBound(Date lowerBound)
        Creates a filter for skipping documents with modification date earlier than the lower bound.
        Parameters:
        lowerBound - The lower bound of the document modification time.
        Returns:
        A document filter by document modification time.
      • createModificationTimeUpperBound

        public static DocumentFilter createModificationTimeUpperBound(Date upperBound)
        Creates a filter for skipping documents with modification date later than the upper bound.
        Parameters:
        upperBound - The upper bound of the document modification time.
        Returns:
        A document filter by document modification time.
      • createModificationTimeRange

        public static DocumentFilter createModificationTimeRange(Date lowerBound,
                                                                 Date upperBound)
        Creates a filter for skipping documents with modification date out of the specified range.
        Parameters:
        lowerBound - The lower bound of the document modification time.
        upperBound - The upper bound of the document modification time.
        Returns:
        A document filter by document modification time.
      • createFilePathRegularExpression

        public static DocumentFilter createFilePathRegularExpression(String pattern)
        Creates a filter for skipping documents that are not match a regular expression. The regular expression is applied to the full path of a document.
        Parameters:
        pattern - The regular expression pattern.
        Returns:
        A document filter by file name.
      • createFilePathRegularExpression

        public static DocumentFilter createFilePathRegularExpression(String pattern,
                                                                     int options)
        Creates a filter for skipping documents that are not match a regular expression. The regular expression is applied to the full path of a document.
        Parameters:
        pattern - The regular expression pattern.
        options - The regular expression options.
        Returns:
        A document filter by file name.
      • createFileLengthLowerBound

        public static DocumentFilter createFileLengthLowerBound(long lowerBound)
        Creates a filter for skipping documents with the length less than the lower bound.
        Parameters:
        lowerBound - The lower bound of the document length.
        Returns:
        A document filter by document length.
      • createFileLengthUpperBound

        public static DocumentFilter createFileLengthUpperBound(long upperBound)
        Creates a filter for skipping documents with the length greater than the upper bound.
        Parameters:
        upperBound - The upper bound of the document length.
        Returns:
        A document filter by document length.
      • createFileLengthRange

        public static DocumentFilter createFileLengthRange(long lowerBound,
                                                           long upperBound)
        Creates a filter for skipping documents out of the specified document length range.
        Parameters:
        lowerBound - The lower bound of the document length.
        upperBound - The upper bound of the document length.
        Returns:
        A document filter by document length.
      • createFileExtension

        public static DocumentFilter createFileExtension(String... extensions)
        Creates a filter for skipping documents that do not have allowable extension.
        Parameters:
        extensions - The list of allowable extensions.
        Returns:
        A document filter by document extension.
      • createNot

        public static DocumentFilter createNot(DocumentFilter innerFilter)
        Creates a filter that has inverse logic in relation to the specified inner filter.
        Parameters:
        innerFilter - The inner document filter.
        Returns:
        An inverted document filter.
      • createAnd

        public static DocumentFilter createAnd(DocumentFilter... filters)
        Creates a logical conjunction of the specified filters.
        Parameters:
        filters - The document filters.
        Returns:
        A document filter that represents result of conjunction of the specified filters.
      • createOr

        public static DocumentFilter createOr(DocumentFilter... filters)
        Creates a logical disjunction of the specified filters.
        Parameters:
        filters - The document filters.
        Returns:
        A document filter that represents result of disjunction of the specified filters.