Package PamUtils

Class PamFileFilter

All Implemented Interfaces:
FileFilter
Direct Known Subclasses:
PamAudioFileFilter, PamAudioFileFilter

public class PamFileFilter extends FileFilter implements FileFilter
  • Constructor Details

    • PamFileFilter

      public PamFileFilter(String description, String defExtension)
  • Method Details

    • addFileType

      public void addFileType(String extString)
    • addFilePrefix

      public void addFilePrefix(String prefix)
      Specify a prefix for the file filter
      Parameters:
      prefix -
    • accept

      public boolean accept(File f)
      Specified by:
      accept in interface FileFilter
      Specified by:
      accept in class FileFilter
    • getExtension

      public static String getExtension(File f)
    • checkFileEnd

      public static File checkFileEnd(File f, String end, boolean forceEnd)
      Checks a file end. If forceEnd is true, then the end must be of the same type as end, otherwise, it will allow any file end, but if none exists, will add the given default one.
      Parameters:
      f - file to check
      end - file end (with or without the '.')
      forceEnd - force it to add the end to the file name
      Returns:
      File corrected file name.
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class FileFilter
    • isAcceptFolders

      public boolean isAcceptFolders()
    • setAcceptFolders

      public void setAcceptFolders(boolean acceptFolders)
    • getFileExtension

      public static String getFileExtension(String file)
    • getFileExtensions

      public ArrayList<String> getFileExtensions()
      Get all the file extensions.
      Returns:
      the file extensions