Package gov.nih.mipav.model.file
Class FileTypeInfo
- java.lang.Object
-
- gov.nih.mipav.model.file.FileTypeInfo
-
public class FileTypeInfo extends java.lang.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
Fields Modifier and Type Field Description private java.lang.String
description
static java.lang.String
EXT_DELIM
The string delimiter which should be used for extension lists passed into or generated by this class.private java.util.Vector<java.lang.String>
extensionList
-
Constructor Summary
Constructors Constructor Description FileTypeInfo(java.lang.String desc, java.lang.String extsString)
Create a new FileTypeInfo.FileTypeInfo(java.lang.String desc, java.lang.String ext, java.lang.String... extMore)
Create a new FileTypeInfo.FileTypeInfo(java.lang.String desc, java.util.Vector<java.lang.String> exts)
Create a new FileTypeInfo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExtension(java.lang.String ext)
Add an extension to the file type's list of supported suffixes.java.lang.String
getDefaultExtension()
Returns the primary extension which should be used for this file type (i.e., '.nii' for NIFTI).java.lang.String
getDescription()
Retrieve the description for this file type.java.lang.String
getExtendedDescription()
Return the description and file extension list for this file type.java.util.Vector<java.lang.String>
getExtensionList()
Retrieve the list of extensions supported by this file type.java.lang.String
getExtensionsString()
Retrieve a string listing all of the extensions supported by this file type, separated by EXT_DELIM.
-
-
-
Field Detail
-
description
private java.lang.String description
-
extensionList
private java.util.Vector<java.lang.String> extensionList
-
EXT_DELIM
public static final java.lang.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(java.lang.String desc, java.util.Vector<java.lang.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(java.lang.String desc, java.lang.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(java.lang.String desc, java.lang.String ext, java.lang.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 Detail
-
getDescription
public java.lang.String getDescription()
Retrieve the description for this file type.- Returns:
- The file type description (i.e., 'AFNI').
-
getExtensionList
public java.util.Vector<java.lang.String> getExtensionList()
Retrieve the list of extensions supported by this file type.- Returns:
- The list of file extensions.
-
getExtensionsString
public java.lang.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 java.lang.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 java.lang.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(java.lang.String ext)
Add an extension to the file type's list of supported suffixes.- Parameters:
ext
- The extension to add to this file type.
-
-