A file type is a standard way that information is encoded for storage in a computer file. For example, Microsoft Word (.docx) and Adobe PDF (.pdf) are two different file types.
Using GroupDocs.Viewer for Java, you can determine the file type using the file extension.
To determine the file type from the file extension, call the fromExtension() method of FileType.
The following code snippet shows how to determine a file type using the file extension: