use of org.jkiss.dbeaver.model.connection.DBPConnectionType in project dbeaver by serge-rider.
the class DataSourceProviderRegistry method saveConnectionTypes.
public void saveConnectionTypes() {
File ctConfig = DBeaverActivator.getConfigurationFile(RegistryConstants.CONNECTION_TYPES_FILE_NAME);
try {
OutputStream os = new FileOutputStream(ctConfig);
XMLBuilder xml = new XMLBuilder(os, GeneralUtils.UTF8_ENCODING);
xml.setButify(true);
xml.startElement(RegistryConstants.TAG_TYPES);
for (DBPConnectionType connectionType : connectionTypes.values()) {
xml.startElement(RegistryConstants.TAG_TYPE);
xml.addAttribute(RegistryConstants.ATTR_ID, connectionType.getId());
xml.addAttribute(RegistryConstants.ATTR_NAME, CommonUtils.toString(connectionType.getName()));
xml.addAttribute(RegistryConstants.ATTR_COLOR, connectionType.getColor());
xml.addAttribute(RegistryConstants.ATTR_DESCRIPTION, CommonUtils.toString(connectionType.getDescription()));
xml.addAttribute(RegistryConstants.ATTR_AUTOCOMMIT, connectionType.isAutocommit());
xml.addAttribute(RegistryConstants.ATTR_CONFIRM_EXECUTE, connectionType.isConfirmExecute());
xml.endElement();
}
xml.endElement();
xml.flush();
os.close();
} catch (Exception ex) {
log.warn("Error saving drivers", ex);
}
}
Aggregations