gov.nih.mipav.model.file
Class FileTypeInfo

java.lang.Object
  extended by 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 Summary
static String EXT_DELIM
          The string delimiter which should be used for extension lists passed into or generated by this class.
 
Constructor Summary
FileTypeInfo(String desc, String extsString)
          Create a new FileTypeInfo.
FileTypeInfo(String desc, Vector<String> exts)
          Create a new FileTypeInfo.
 
Method Summary
 void addExtension(String ext)
          Add an extension to the file type's list of supported suffixes.
 String getDefaultExtension()
          Returns the primary extension which should be used for this file type (i.e., '.nii' for NIFTI).
 String getDescription()
          Retrieve the description for this file type.
 String getExtendedDescription()
          Return the description and file extension list for this file type.
 Vector<String> getExtensionList()
          Retrieve the list of extensions supported by this file type.
 String getExtensionsString()
          Retrieve a string listing all of the extensions supported by this file type, separated by EXT_DELIM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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:
Constant Field Values
Constructor Detail

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.
Method Detail

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.