app/src/main/java/db/juhaku/juhakudb/core/android/DatabaseHelper.java
/**
     * Tires to persist current {@link Schema} to folder.
     * @return boolean value; true if successful; false if not.
     */
Tires to persist current  Schema to folder.
@return boolean value; true if successful; false if not.
Tires to persist current Schema to folder . @return boolean value ; true if successful ; false if not .
private boolean persist() {
        if (databaseConfiguration.getRollbackHistorySize() < databaseConfiguration.getVersion()) {
            Log.w(getClass().getName(), "Failed to persist schema, maximum allowed history exceeded: "
                    + databaseConfiguration.getRollbackHistorySize() + ", current version: " + databaseConfiguration.getVersion());
            return false;
        }
        File schemaFile = new File(getSchemaFolder(), generateSchemaName(databaseConfiguration));
        ObjectOutputStream out = null;
        try {
            out = new ObjectOutputStream(new FileOutputStream(schemaFile));
            out.writeObject(schema);
        } catch (IOException e) {
            Log.e(getClass().getName(), "Schema persis failure", e);
            return false;
        } finally {
            closeStream(out);
        }
        return true;
    }
private boolean persist ( ) { if ( databaseConfiguration . getRollbackHistorySize ( ) < databaseConfiguration . getVersion ( ) ) { Log . w ( getClass ( ) . getName ( ) , "Failed to persist schema, maximum allowed history exceeded: " + databaseConfiguration . getRollbackHistorySize ( ) + ", current version: " + databaseConfiguration . getVersion ( ) ) ; return false ; } File schemaFile = new File ( getSchemaFolder ( ) , generateSchemaName ( databaseConfiguration ) ) ; ObjectOutputStream out = null ; try { out = new ObjectOutputStream ( new FileOutputStream ( schemaFile ) ) ; out . writeObject ( schema ) ; } catch ( IOException e ) { Log . e ( getClass ( ) . getName ( ) , "Schema persis failure" , e ) ; return false ; } finally { closeStream ( out ) ; } return true ; }
Tires to persist current {@link Schema} to folder.
Tires to persist current { @link Schema } to folder .
// try closing the stream