On this page
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.
The following code snippet shows how to determine a file type using the file extension:
import com.groupdocs.viewer.FileType; // ... String extension = ".docx"; FileType fileType = FileType.fromExtension(extension); System.out.println("\nExtension " + extension + "; File type: " + fileType);
The following image shows a sample console output:
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.