Class FileListDescriptor

    • Method Detail

      • builder

        public IFileListBuilder builder()
        Description copied from interface: IFileListDescriptor
        Creates a new builder for configuring a file list conforming to this descriptor.
        Specified by:
        builder in interface IFileListDescriptor
        Returns:
        A new builder for configuring a file list conforming to this descriptor.
      • getContentTypes

        public Set<String> getContentTypes()
        Description copied from interface: IFileListDescriptor
        The content types of the files that might be contained in the list of files. Each content type is a MIME type. Use "*/*" when the content type is unknown or any type of file might be contained in the list. Use an asterisk as a wildcard to allow a range of content types, e.g. "image/*". An empty set allows no files.

        null is treated as if the empty set had been returned.

        Specified by:
        getContentTypes in interface IFileListDescriptor
        Returns:
        The content types of the files that might be contained in the list of files.
      • getExtensions

        public Set<String> getExtensions()
        Description copied from interface: IFileListDescriptor
        The file extensions of the files that can be contained in the list of files. Each extension is a string without a leading dot, e.g. "pdf" or "png". Use the empty string "" to allow files without an extension. Use a set with a single entry "*" when the extension is unknown or any extension is allowed. An empty set allows no files.

        Implementations should normalize extensions to lower case, so that this method always returns lower case extensions.

        null is treated as if the empty set had been returned.

        Specified by:
        getExtensions in interface IFileListDescriptor
        Returns:
        The file extensions of the files that can be contained in the list of files.
      • getMaxFileCount

        public int getMaxFileCount()
        Description copied from interface: IFileListDescriptor
        The maximum number of files that will be contained in the list of files. MAX_VALUE when there is no limit.
        Specified by:
        getMaxFileCount in interface IFileListDescriptor
        Returns:
        The maximum number of files that will be contained in the list of files.
      • getMinFileCount

        public int getMinFileCount()
        Description copied from interface: IFileListDescriptor
        The minimum number of files that are contained in the list of files. 0 when the list might be empty, 1 if the list will contain at least one file.
        Specified by:
        getMinFileCount in interface IFileListDescriptor
        Returns:
        The minimum number of files that are contained in the list of files.
      • intersect

        public IFileListDescriptor intersect​(IFileListDescriptor other)
        Description copied from interface: IFileListDescriptor
        Intersects this file list descriptor with another file list descriptor. The intersection of two file list descriptors is a new file list descriptor that only allows files that are allowed by both file list descriptors. When the two file list descriptors are incompatible, returns an empty descriptor.

        This operation is, for the most part, symmetric / commutative. The only exception is the attribute map of the files. When both input descriptors have an attribute with the same key but different values, the value from the right hand side is used.

        Specified by:
        intersect in interface IFileListDescriptor
        Parameters:
        other - The other file list descriptor to intersect with.
        Returns:
        The intersection of this file list descriptor with the other file list descriptor.
      • any

        public static IFileListDescriptor any()
        Returns an IFileListDescriptor that allows any file type and any number of files.
        Returns:
        A descriptor that allows any file type and any number of files.
      • anyFileListDescriptor

        public static IFileListDescriptor anyFileListDescriptor()
        Returns an IFileListDescriptor that allows any file type and any number of files.
        Returns:
        A descriptor that allows any file type and any number of files.