Detect format of 3D file

Detect Format Programming Sample

This source code illustrates how to detect the file format (using the file path or stream) and check its extension.

// 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());