FileType

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

Methods

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.

getFileFormat()

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”.

getExtension()

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”.

getUnknown()

public static FileType getUnknown()

Represents unknown file type.

Returns: FileType

getTIF()

public static FileType getTIF()

Tagged Image File (.tif)

Returns: FileType

getTIFF()

public static FileType getTIFF()

Tagged Image File Format (.tiff)

Returns: FileType

getJPG()

public static FileType getJPG()

JPEG Image (.jpg)

Returns: FileType

getJPEG()

public static FileType getJPEG()

JPEG Image (.jpeg)

Returns: FileType

getPNG()

public static FileType getPNG()

Portable Network Graphic (.png)

Returns: FileType

getGIF()

public static FileType getGIF()

Graphical Interchange Format File (.gif)

Returns: FileType

getBMP()

public static FileType getBMP()

Bitmap Image File (.bmp)

Returns: FileType

getJP2()

public static FileType getJP2()

JPEG 2000 Core Image File (.jp2)

Returns: FileType

getHTM()

public static FileType getHTM()

Hypertext Markup Language File (.htm)

Returns: FileType

getHTML()

public static FileType getHTML()

Hypertext Markup Language File (.html)

Returns: FileType

getPDF()

public static FileType getPDF()

Portable Document Format File (.pdf)

Returns: FileType

getPPT()

public static FileType getPPT()

PowerPoint Presentation (.ppt)

Returns: FileType

getPPTX()

public static FileType getPPTX()

PowerPoint Open XML Presentation (.pptx)

Returns: FileType

getODP()

public static FileType getODP()

OpenDocument Presentation (.odp)

Returns: FileType

getXLS()

public static FileType getXLS()

Excel Spreadsheet (.xls)

Returns: FileType

getXLSX()

public static FileType getXLSX()

Microsoft Excel Open XML Spreadsheet (.xlsx)

Returns: FileType

getXLSM()

public static FileType getXLSM()

Excel Open XML Macro-Enabled Spreadsheet (.xlsm)

Returns: FileType

getXLSB()

public static FileType getXLSB()

Excel Binary Spreadsheet (.xlsb)

Returns: FileType

getCSV()

public static FileType getCSV()

Comma Separated Values File (.csv)

Returns: FileType

getTSV()

public static FileType getTSV()

Tab Separated Values File (.tsv)

Returns: FileType

getODS()

public static FileType getODS()

OpenDocument Spreadsheet (.ods)

Returns: FileType

getOTS()

public static FileType getOTS()

OpenDocument Spreadsheet Template (.ots)

Returns: FileType

getNUMBERS()

public static FileType getNUMBERS()

Apple Numbers Spreadsheet (.numbers)

Returns: FileType

getMD()

public static FileType getMD()

Markdown Documentation File (.md)

Returns: FileType

getDOC()

public static FileType getDOC()

Microsoft Word Document (.doc)

Returns: FileType

getDOCX()

public static FileType getDOCX()

Microsoft Word Open XML Document (.docx)

Returns: FileType

getDOCM()

public static FileType getDOCM()

Word Open XML Macro-Enabled Document (.docm)

Returns: FileType

getDOT()

public static FileType getDOT()

Word Document Template (.dot)

Returns: FileType

getDOTX()

public static FileType getDOTX()

Word Open XML Document Template (.dotx)

Returns: FileType

getDOTM()

public static FileType getDOTM()

Word Open XML Macro-Enabled Document Template (.dotm)

Returns: FileType

getRTF()

public static FileType getRTF()

Rich Text Format File (.rtf)

Returns: FileType

getTXT()

public static FileType getTXT()

Plain Text File (.txt)

Returns: FileType

getODT()

public static FileType getODT()

OpenDocument Text Document (.odt)

Returns: FileType

getOTT()

public static FileType getOTT()

OpenDocument Document Template (.ott)

Returns: FileType

fromExtension(String extension)

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.

getSupportedFileTypes()

public static Iterable<FileType> getSupportedFileTypes()

Retrieves supported file types

Returns: java.lang.Iterable<com.groupdocs.redaction.FileType> - Returns sequence of supported file types

equals(FileType other)

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

hashCode()

public int hashCode()

Returns the hash code for the current FileType object.

Returns: int - A hash code for the current FileType object.

op_Equality(FileType left, FileType right)

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

toString()

public String toString()

Returns a string that represents the current object.

Returns: java.lang.String - A string that represents the current object.