Class FileTypeInfo

java.lang.Object
gov.nih.mipav.model.file.FileTypeInfo

public class FileTypeInfo extends Object
This class stores information about a file type, including the type description (i.e., 'NRRD') and allowed extensions (i.e., '.nrrd,.nhdr').
Author:
mccreedy
  • Field Details

    • description

      private String description
    • extensionList

      private Vector<String> extensionList
    • EXT_DELIM

      public static final String EXT_DELIM
      The string delimiter which should be used for extension lists passed into or generated by this class.
      See Also:
  • Constructor Details

    • FileTypeInfo

      public FileTypeInfo(String desc, Vector<String> exts)
      Create a new FileTypeInfo.
      Parameters:
      desc - The description for this file type (i.e., 'NRRD').
      exts - A vector of file extension strings, each of which should start with a period (i.e., '.mnc'). The first extension is the default extension for this file type.
    • FileTypeInfo

      public FileTypeInfo(String desc, String extsString)
      Create a new FileTypeInfo.
      Parameters:
      desc - The description for this file type (i.e., 'NIFTI').
      exts - A String containing file extensions for this file type, separated by EXT_DELIM, starting with a period (i.e., '.nii,.img'). The first extension is the default extension for this file type.
    • FileTypeInfo

      public FileTypeInfo(String desc, String ext, String... extMore)
      Create a new FileTypeInfo.
      Parameters:
      desc - The description for this file type.
      exts - A String containing file extensions for this file type, separated by EXT_DELIM, starting with a period (i.e., '.nii,.img'). The first extension is the default extension for this file type.
  • Method Details

    • getDescription

      public String getDescription()
      Retrieve the description for this file type.
      Returns:
      The file type description (i.e., 'AFNI').
    • getExtensionList

      public Vector<String> getExtensionList()
      Retrieve the list of extensions supported by this file type.
      Returns:
      The list of file extensions.
    • getExtensionsString

      public String getExtensionsString()
      Retrieve a string listing all of the extensions supported by this file type, separated by EXT_DELIM.
      Returns:
      A string listing the file extensions supported (or the empty string if none supported).
    • getDefaultExtension

      public String getDefaultExtension()
      Returns the primary extension which should be used for this file type (i.e., '.nii' for NIFTI).
      Returns:
      The default extension to use for this file type (or the empty string if none supported).
    • getExtendedDescription

      public String getExtendedDescription()
      Return the description and file extension list for this file type.
      Returns:
      A string in the format 'DESCRIPTION (.EXT1,EXT2,...)'.
    • addExtension

      public void addExtension(String ext)
      Add an extension to the file type's list of supported suffixes.
      Parameters:
      ext - The extension to add to this file type.