private static void loadApplicationProperties(final Settings settings) throws IOException { final File jiraApplicationProperties = new File(getJiraApplicationProperties()); logInfo("Loading application properties from " + jiraApplicationProperties.getCanonicalPath()); InputStream propertiesInputStream = new FileInputStream(jiraApplicationProperties); try { String jiraHome = getJiraHomeValue(propertiesInputStream); // IF we are on Windoze, then display backslashes instead of forward slashes if (File.separatorChar == '\\') { jiraHome = jiraHome.replace("/", "\\"); } settings.setJiraHome(jiraHome); } catch (ParseException ex) { throw new IOException("Error parsing " + jiraApplicationProperties + ". " + ex.getMessage()); } finally { propertiesInputStream.close(); } }
private static void loadServerXmlSettings(final Settings settings) throws IOException { final Document doc = parseDocument(getServerXmlFile()); try { loadWebServerSettings(doc, settings); } catch (ParseException ex) { throw new IOException("Unable to parse the config file '" + getServerXmlFile() + "'. " + ex.getMessage()); } }
private static void loadCurrentSettings() { try { settings = SettingsLoader.loadCurrentSettings(); } catch (IOException e) { showErrorDialogAndExit("IO Exception occurred while trying to load settings.\n" + e.getMessage()); } catch (SAXException e) { showErrorDialogAndExit("SAX Exception occurred while trying to load settings.\n" + e.getMessage()); } catch (ParserConfigurationException e) { showErrorDialogAndExit("Parser Configuration Exception occurred while trying to load settings.\n" + e.getMessage()); } catch (ParseException e) { showErrorDialogAndExit("Parse Exception occurred while trying to load settings.\n" + e.getMessage()); } }
public void setSettings(Settings settings) { this.settings = settings; selectedDatabaseType = settings.initDatabaseType(false); try { getSelectedDatabaseConfig().setSettings(settings); } catch (ParseException e) { console.printErrorMessage("Unable to fully parse the current JDBC settings. Some settings may be blank."); console.printErrorMessage("Parse Exception: " + e.getMessage()); } }
public String getUrl() throws ValidationException { try { return databaseType.getJdbcUrlParser().getUrl(cfHostname.getValue(), cfPort.getValue(), cfInstance.getValue()); } catch (ParseException e) { throw new ValidationException(e.getMessage()); } }
@Override public String getUrl(String jiraHome) throws ValidationException { try { return databaseType.getJdbcUrlParser().getUrl(getHostname(), getPort(), getInstance()); } catch (ParseException e) { throw new ValidationException(e.getMessage()); } }
private static void startGui() { ConfiguratorFrame configuratorFrame = new ConfiguratorFrame(); // Appear in the middle of the screen configuratorFrame.setLocationRelativeTo(null); // "Configurator" is the nickname, but the official name from the Documentation Team is "JIRA Configuration Tool" configuratorFrame.setTitle("JIRA Configuration Tool"); try { configuratorFrame.setSettings(settings); } catch (ParseException e) { showWarningDialog("Unable to fully parse the current JDBC settings. Some settings may be blank.\n" + e.getMessage()); } configuratorFrame.setVisible(true); }