Detect format of 3D file
Contents
[
Hide
]
Aspose.3D for Java API has support of detecting 3D supported formats before opening because the file extension does not guarantee that the file content is appropriate.
Detect Format Programming Sample
This source code illustrates how to detect the file format (using the file path or stream) and check its extension.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the path to the documents directory. | |
String MyDir = RunExamples.getDataDir(); | |
// detect format of 3D file | |
FileFormat inputFormat = FileFormat.detect(MyDir + "document.fbx"); | |
// display the file format | |
System.out.println("File Format: " + inputFormat.toString()); |