private static String getEnvironmentResource(final String domain) throws Exception { if (domain == null || domain.length() == 0) { throw new InvalidEnvironmentException("Unknown domain: '" + domain + "'"); } String confPath = ServerConstants.getTenantConfigurationFolder(domain); StringBuilder serverConfigurationPath = new StringBuilder(confPath); serverConfigurationPath.append(File.separator).append("bonita-server.xml"); final String envPath = serverConfigurationPath.toString(); final File environmentPropertiesFile = new File(envPath); if (!environmentPropertiesFile.exists()) { throw new FileNotFoundException(envPath); } return envPath; }
content = Misc.getAllContentFrom(url); } catch (final IOException e) { throw new InvalidEnvironmentException("An IO error occurs while reading environment from: " + url + " Do you have read access to this ressource?", e); throw new InvalidEnvironmentException("environmentFactory is null.");
content = Misc.getAllContentFrom(url); } catch (IOException e) { throw new InvalidEnvironmentException("An IO error occurs while reading environment from: " + url + " Do you have read access to this ressource?", e); throw new InvalidEnvironmentException("environmentFactory is null.");
} catch (final IOException e) { String message = ExceptionManager.getInstance().getFullMessage("benv_GEF_1", url); throw new InvalidEnvironmentException(message, e); throw new InvalidEnvironmentException(message);
/** throws an exception with appropriate message in case the parse contains * errors or fatal errors. This method also logs the problems with severity * 'warning'. */ public void checkProblems(String description, Parse parse) { if (parse.hasProblems()) { StringBuffer errorMsg = null; for (Problem p : parse.getProblems()) { if (p.getSeverity().equals(Problem.SEVERITY_ERROR) || p.getSeverity().equals(Problem.SEVERITY_FATALERROR)) { if (errorMsg == null) { errorMsg = new StringBuffer(); } errorMsg.append(Misc.LINE_SEPARATOR).append(" ").append(p.toString()); if (p.getCause() != null) { LOG.log(Level.SEVERE, p.toString(), p.getCause()); } else { LOG.severe(p.toString()); } } else { LOG.warning(p.toString()); } } if (errorMsg != null) { throw new InvalidEnvironmentException("errors during parsing of " + description + ": " + errorMsg); } } } }
/** throws an exception with appropriate message in case the parse contains * errors or fatal errors. This method also logs the problems with severity * 'warning'. */ @Override public void checkProblems(final String description, final Parse parse) { if (parse.hasProblems()) { StringBuffer errorMsg = null; for (final Problem p : parse.getProblems()) { if (p.getSeverity().equals(Problem.SEVERITY_ERROR) || p.getSeverity().equals(Problem.SEVERITY_FATALERROR)) { if (errorMsg == null) { errorMsg = new StringBuffer(); } errorMsg.append(Misc.LINE_SEPARATOR).append(" ").append(p.toString()); if (p.getCause() != null) { LOG.log(Level.SEVERE, p.toString(), p.getCause()); } else { LOG.severe(p.toString()); } } else { LOG.warning(p.toString()); } } if (errorMsg != null) { throw new InvalidEnvironmentException("errors during parsing of " + description + ": " + errorMsg); } } } }