Package gov.nih.mipav.model.file
Class FileTypeInfo
java.lang.Object
gov.nih.mipav.model.file.FileTypeInfo
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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileTypeInfo(String desc, String extsString) Create a new FileTypeInfo.FileTypeInfo(String desc, String ext, String... extMore) Create a new FileTypeInfo.FileTypeInfo(String desc, Vector<String> exts) Create a new FileTypeInfo. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtension(String ext) Add an extension to the file type's list of supported suffixes.Returns the primary extension which should be used for this file type (i.e., '.nii' for NIFTI).Retrieve the description for this file type.Return the description and file extension list for this file type.Retrieve the list of extensions supported by this file type.Retrieve a string listing all of the extensions supported by this file type, separated by EXT_DELIM.
-
Field Details
-
description
-
extensionList
-
EXT_DELIM
The string delimiter which should be used for extension lists passed into or generated by this class.- See Also:
-
-
Constructor Details
-
FileTypeInfo
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
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
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
Retrieve the description for this file type.- Returns:
- The file type description (i.e., 'AFNI').
-
getExtensionList
Retrieve the list of extensions supported by this file type.- Returns:
- The list of file extensions.
-
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
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
Return the description and file extension list for this file type.- Returns:
- A string in the format 'DESCRIPTION (.EXT1,EXT2,...)'.
-
addExtension
Add an extension to the file type's list of supported suffixes.- Parameters:
ext- The extension to add to this file type.
-