Class FileExtensionsFilter


  • @Immutable
    public class FileExtensionsFilter
    extends java.lang.Object
    Definition of supported file extensions of one "filter" when choosing files. A filter might be understood as container of file extensions for one file format.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()
      Get description of the filter.
      java.util.List<java.lang.String> getExtensions()
      Get list of supported file extensions of the filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileExtensionsFilter

        public FileExtensionsFilter​(java.lang.String description,
                                    java.lang.String... extensions)
      • FileExtensionsFilter

        public FileExtensionsFilter​(java.lang.String description,
                                    java.util.Collection<java.lang.String> extensions)
      • FileExtensionsFilter

        public FileExtensionsFilter​(FileExtension extension)
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Get description of the filter.

        The description should not include extensions. For example, the following description is a good one:

        "Image files"

        While the following one is a bad one:

        "Image files (*.jpg, *.png)

        Returns:
        description of the filter
      • getExtensions

        public java.util.List<java.lang.String> getExtensions()
        Get list of supported file extensions of the filter.

        The extensions are case-insensitive. In addition, an extension should not start with "*." prefix. For example, the following extension is a good one:

        "png"

        While the following one is a bad one:

        "*.png"

        Returns:
        list of supported file extensions