public ODatabaseExport exportDatabase() { try { listener.onMessage("\nStarted export of database '" + database.getName() + "' to " + fileName + "..."); long time = System.currentTimeMillis(); if (includeInfo) exportInfo(); if (includeClusterDefinitions) exportClusters(); if (includeSchema) exportSchema(); if (includeRecords) exportRecords(); if (includeIndexDefinitions) exportIndexDefinitions(); if (includeManualIndexes) exportManualIndexes(); listener.onMessage("\n\nDatabase export completed in " + (System.currentTimeMillis() - time) + "ms"); writer.flush(); } catch (Exception e) { OLogManager.instance().error(this, "Error on exporting database '%s' to: %s", e, database.getName(), fileName); throw new ODatabaseExportException("Error on exporting database '" + database.getName() + "' to: " + fileName, e); } finally { close(); } return this; }