FileType
Leave feedback
On this page
Inheritance: java.lang.Object
public final class FileType
Represents a file type. Provides methods to obtain a list of all file types supported by GroupDocs.Redaction, detect file type by extension, etc.
Learn more
| Method | Description |
|---|---|
| getFileFormat() | Gets file type name, for example “Microsoft Word Document”. |
| getExtension() | Gets filename suffix (including the period “.”), for instance “.doc”. |
| getUnknown() | Represents unknown file type. |
| getTIF() | Tagged Image File (.tif) |
| getTIFF() | Tagged Image File Format (.tiff) |
| getJPG() | JPEG Image (.jpg) |
| getJPEG() | JPEG Image (.jpeg) |
| getPNG() | Portable Network Graphic (.png) |
| getGIF() | Graphical Interchange Format File (.gif) |
| getBMP() | Bitmap Image File (.bmp) |
| getJP2() | JPEG 2000 Core Image File (.jp2) |
| getHTM() | Hypertext Markup Language File (.htm) |
| getHTML() | Hypertext Markup Language File (.html) |
| getPDF() | Portable Document Format File (.pdf) |
| getPPT() | PowerPoint Presentation (.ppt) |
| getPPTX() | PowerPoint Open XML Presentation (.pptx) |
| getODP() | OpenDocument Presentation (.odp) |
| getXLS() | Excel Spreadsheet (.xls) |
| getXLSX() | Microsoft Excel Open XML Spreadsheet (.xlsx) |
| getXLSM() | Excel Open XML Macro-Enabled Spreadsheet (.xlsm) |
| getXLSB() | Excel Binary Spreadsheet (.xlsb) |
| getCSV() | Comma Separated Values File (.csv) |
| getTSV() | Tab Separated Values File (.tsv) |
| getODS() | OpenDocument Spreadsheet (.ods) |
| getOTS() | OpenDocument Spreadsheet Template (.ots) |
| getNUMBERS() | Apple Numbers Spreadsheet (.numbers) |
| getMD() | Markdown Documentation File (.md) |
| getDOC() | Microsoft Word Document (.doc) |
| getDOCX() | Microsoft Word Open XML Document (.docx) |
| getDOCM() | Word Open XML Macro-Enabled Document (.docm) |
| getDOT() | Word Document Template (.dot) |
| getDOTX() | Word Open XML Document Template (.dotx) |
| getDOTM() | Word Open XML Macro-Enabled Document Template (.dotm) |
| getRTF() | Rich Text Format File (.rtf) |
| getTXT() | Plain Text File (.txt) |
| getODT() | OpenDocument Text Document (.odt) |
| getOTT() | OpenDocument Document Template (.ott) |
| fromExtension(String extension) | Maps file extension to file type. |
| getSupportedFileTypes() | Retrieves supported file types |
| equals(FileType other) | Determines whether the current FileType is the same as specified FileType object. |
| equals(Object obj) | Determines whether the current FileType is the same as specified object. |
| hashCode() | Returns the hash code for the current FileType object. |
| op_Equality(FileType left, FileType right) | Determines whether two FileType objects are the same. |
| op_Inequality(FileType left, FileType right) | Determines whether two FileType objects are not the same. |
| toString() | Returns a string that represents the current object. |
public final String getFileFormat()
Gets file type name, for example “Microsoft Word Document”.
Returns: java.lang.String - File type name, for example “Microsoft Word Document”.
public final String getExtension()
Gets filename suffix (including the period “.”), for instance “.doc”.
Returns: java.lang.String - Filename suffix (including the period “.”), for instance “.doc”.
public static FileType getUnknown()
Represents unknown file type.
Returns: FileType
public static FileType getTIF()
Tagged Image File (.tif)
Returns: FileType
public static FileType getTIFF()
Tagged Image File Format (.tiff)
Returns: FileType
public static FileType getJPG()
JPEG Image (.jpg)
Returns: FileType
public static FileType getJPEG()
JPEG Image (.jpeg)
Returns: FileType
public static FileType getPNG()
Portable Network Graphic (.png)
Returns: FileType
public static FileType getGIF()
Graphical Interchange Format File (.gif)
Returns: FileType
public static FileType getBMP()
Bitmap Image File (.bmp)
Returns: FileType
public static FileType getJP2()
JPEG 2000 Core Image File (.jp2)
Returns: FileType
public static FileType getHTM()
Hypertext Markup Language File (.htm)
Returns: FileType
public static FileType getHTML()
Hypertext Markup Language File (.html)
Returns: FileType
public static FileType getPDF()
Portable Document Format File (.pdf)
Returns: FileType
public static FileType getPPT()
PowerPoint Presentation (.ppt)
Returns: FileType
public static FileType getPPTX()
PowerPoint Open XML Presentation (.pptx)
Returns: FileType
public static FileType getODP()
OpenDocument Presentation (.odp)
Returns: FileType
public static FileType getXLS()
Excel Spreadsheet (.xls)
Returns: FileType
public static FileType getXLSX()
Microsoft Excel Open XML Spreadsheet (.xlsx)
Returns: FileType
public static FileType getXLSM()
Excel Open XML Macro-Enabled Spreadsheet (.xlsm)
Returns: FileType
public static FileType getXLSB()
Excel Binary Spreadsheet (.xlsb)
Returns: FileType
public static FileType getCSV()
Comma Separated Values File (.csv)
Returns: FileType
public static FileType getTSV()
Tab Separated Values File (.tsv)
Returns: FileType
public static FileType getODS()
OpenDocument Spreadsheet (.ods)
Returns: FileType
public static FileType getOTS()
OpenDocument Spreadsheet Template (.ots)
Returns: FileType
public static FileType getNUMBERS()
Apple Numbers Spreadsheet (.numbers)
Returns: FileType
public static FileType getMD()
Markdown Documentation File (.md)
Returns: FileType
public static FileType getDOC()
Microsoft Word Document (.doc)
Returns: FileType
public static FileType getDOCX()
Microsoft Word Open XML Document (.docx)
Returns: FileType
public static FileType getDOCM()
Word Open XML Macro-Enabled Document (.docm)
Returns: FileType
public static FileType getDOT()
Word Document Template (.dot)
Returns: FileType
public static FileType getDOTX()
Word Open XML Document Template (.dotx)
Returns: FileType
public static FileType getDOTM()
Word Open XML Macro-Enabled Document Template (.dotm)
Returns: FileType
public static FileType getRTF()
Rich Text Format File (.rtf)
Returns: FileType
public static FileType getTXT()
Plain Text File (.txt)
Returns: FileType
public static FileType getODT()
OpenDocument Text Document (.odt)
Returns: FileType
public static FileType getOTT()
OpenDocument Document Template (.ott)
Returns: FileType
public static FileType fromExtension(String extension)
Maps file extension to file type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| extension | java.lang.String | File extension (including the period “.”). |
Returns: FileType - When file type is supported returns it, otherwise returns default Unknown file type.
public static Iterable<FileType> getSupportedFileTypes()
Retrieves supported file types
Returns: java.lang.Iterable<com.groupdocs.redaction.FileType> - Returns sequence of supported file types
public final boolean equals(FileType other)
Determines whether the current FileType is the same as specified FileType object.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | FileType | The object to compare with the current FileType object. |
Returns: boolean - ``` true
if both FileType objects are the same; otherwise,
false
### equals(Object obj) {#equals-java.lang.Object-}
public boolean equals(Object obj)
Determines whether the current FileType is the same as specified object.
**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| obj | java.lang.Object | The object to compare with the current FileType object. |
**Returns:**
boolean - ```
true
if
obj
parameter is FileType and is the same as current FileType object; otherwise,
false
public int hashCode()
Returns the hash code for the current FileType object.
Returns: int - A hash code for the current FileType object.
public static boolean op_Equality(FileType left, FileType right)
Determines whether two FileType objects are the same.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| left | FileType | Left FileType object. |
| right | FileType | Right FileType object. |
Returns: boolean - ``` true
if both FileType objects are the same; otherwise,
false
### op_Inequality(FileType left, FileType right) {#op-Inequality-com.groupdocs.redaction.FileType-com.groupdocs.redaction.FileType-}
public static boolean op_Inequality(FileType left, FileType right)
Determines whether two FileType objects are not the same.
**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| left | [FileType](../../com.groupdocs.redaction/filetype) | Left FileType object. |
| right | [FileType](../../com.groupdocs.redaction/filetype) | Right FileType object. |
**Returns:**
boolean - ```
true
if both FileType objects are not the same; otherwise,
false
public String toString()
Returns a string that represents the current object.
Returns: java.lang.String - A string that represents the current object.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.