MinieExamples/src/main/java/jme3utilities/minie/test/TestDac.java
/**
     * Save the specified model to a J3O or XML file.
     */
Save the specified model to a J3O or XML file.
Save the specified model to a J3O or XML file .
private void save(Spatial model, String assetPath) {
        String filePath = filePath(assetPath);
        File file = new File(filePath);
        JmeExporter exporter;
        if (assetPath.endsWith(".j3o")) {
            exporter = BinaryExporter.getInstance();
        } else {
            assert assetPath.endsWith(".xml");
            exporter = XMLExporter.getInstance();
        }
        try {
            exporter.save(model, file);
        } catch (IOException exception) {
            System.out.println("Caught IOException: " + exception.getMessage());
            logger.log(Level.SEVERE,
                    "Output exception while saving {0} to file {1}",
                    new Object[]{
                        MyString.quote(model.getName()),
                        MyString.quote(filePath)
                    });
            return;
        }
        logger.log(Level.INFO, "Saved {0} to file {1}", new Object[]{
            MyString.quote(model.getName()),
            MyString.quote(filePath)
        });
    }
private void save ( Spatial model , String assetPath ) { String filePath = filePath ( assetPath ) ; File file = new File ( filePath ) ; JmeExporter exporter ; if ( assetPath . endsWith ( ".j3o" ) ) { exporter = BinaryExporter . getInstance ( ) ; } else { assert assetPath . endsWith ( ".xml" ) ; exporter = XMLExporter . getInstance ( ) ; } try { exporter . save ( model , file ) ; } catch ( IOException exception ) { System . out . println ( "Caught IOException: " + exception . getMessage ( ) ) ; logger . log ( Level . SEVERE , "Output exception while saving {0} to file {1}" , new Object [ ] { MyString . quote ( model . getName ( ) ) , MyString . quote ( filePath ) } ) ; return ; } logger . log ( Level . INFO , "Saved {0} to file {1}" , new Object [ ] { MyString . quote ( model . getName ( ) ) , MyString . quote ( filePath ) } ) ; }
Save the specified model to a J3O or XML file.
Save the specified model to a J3O or XML file .