private boolean isJndiConfig() throws ConfigurationException { Class<?> driverClass = null; try { if (driver.length() > 0) { driverClass = Class.forName(driver); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Could not load JDBC driver class " + driver, e); } return driverClass != null && Context.class.isAssignableFrom(driverClass); }
public List<? extends ProtectedItemImporter> getProtectedItemImporters() { List<ProtectedItemImporter> piis = new ArrayList<ProtectedItemImporter>(); for (BeanConfig bc : protectedItemImporters) { try { piis.add(bc.newInstance(ProtectedItemImporter.class)); } catch (ConfigurationException e) { log.warn(e.getMessage()); } } return piis; }
private boolean isJndiConfig() throws ConfigurationException { Class<?> driverClass = null; try { if (driver.length() > 0) { driverClass = Class.forName(driver); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Could not load JDBC driver class " + driver, e); } return driverClass != null && Context.class.isAssignableFrom(driverClass); }
public List<? extends ProtectedItemImporter> getProtectedItemImporters() { List<ProtectedItemImporter> piis = new ArrayList<ProtectedItemImporter>(); for (BeanConfig bc : protectedItemImporters) { try { piis.add(bc.newInstance(ProtectedItemImporter.class)); } catch (ConfigurationException e) { log.warn(e.getMessage()); } } return piis; }
private boolean isJndiConfig() throws ConfigurationException { Class<?> driverClass = null; try { if (driver.length() > 0) { driverClass = Class.forName(driver); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Could not load JDBC driver class " + driver, e); } return driverClass != null && Context.class.isAssignableFrom(driverClass); }
/** * Creates a transient repository with files in the local temp directory. * * @return the created repository * * @throws IOException * if the repository configuration can not be read */ @Override protected RepositoryImpl createRepository() throws IOException { try { final RepositoryConfig config = createRepositoryConfiguration(); return RepositoryImpl.create(config); } catch (final ConfigurationException e) { LOG.error("Configuration invalid", e); throw new AssertionError(e.getMessage(), e); } catch (RepositoryException e) { LOG.error("Could not create repository", e); throw new AssertionError(e.getMessage(), e); } }
/** * Returns the value of the named attribute of the given element. * * @param element element * @param name attribute name * @return attribute value * @throws ConfigurationException if the attribute is not found */ protected String getAttribute(Element element, String name) throws ConfigurationException { Attr attribute = element.getAttributeNode(name); if (attribute != null) { return attribute.getValue(); } else { throw new ConfigurationException( "Configuration attribute " + name + " not found in " + element.getNodeName() + "."); } }
module = config.getLoginModule(); } catch (ConfigurationException e) { throw new LoginException(e.getMessage());
/** * Returns the value of the named attribute of the given element. * * @param element element * @param name attribute name * @return attribute value * @throws ConfigurationException if the attribute is not found */ protected String getAttribute(Element element, String name) throws ConfigurationException { Attr attribute = element.getAttributeNode(name); if (attribute != null) { return attribute.getValue(); } else { throw new ConfigurationException( "Configuration attribute " + name + " not found in " + element.getNodeName() + "."); } }
module = config.getLoginModule(); } catch (ConfigurationException e) { throw new LoginException(e.getMessage());
private void verify(Properties props) throws ConfigurationException { throw new ConfigurationException("DataSource logical name must not be null or empty"); throw new ConfigurationException("DataSource driver must not be null or empty"); throw new ConfigurationException("DataSource URL must not be null or empty"); throw new ConfigurationException("DataSource databaseType must not be null or empty"); throw new ConfigurationException("Unknown DataSource property: " + propName); for (Object propName : props.keySet()) { if (!allJndiPropNames.contains((String) propName)) { throw new ConfigurationException("Property " + propName + " is not allowed for a DataSource obtained through JNDI" + ", DataSource logicalName = " + logicalName);
private void verify(Properties props) throws ConfigurationException { throw new ConfigurationException("DataSource logical name must not be null or empty"); throw new ConfigurationException("DataSource driver must not be null or empty"); throw new ConfigurationException("DataSource URL must not be null or empty"); throw new ConfigurationException("DataSource databaseType must not be null or empty"); throw new ConfigurationException("Unknown DataSource property: " + propName); for (Object propName : props.keySet()) { if (!allJndiPropNames.contains((String) propName)) { throw new ConfigurationException("Property " + propName + " is not allowed for a DataSource obtained through JNDI" + ", DataSource logicalName = " + logicalName);
private void verify(Properties props) throws ConfigurationException { throw new ConfigurationException("DataSource logical name must not be null or empty"); throw new ConfigurationException("DataSource driver must not be null or empty"); throw new ConfigurationException("DataSource URL must not be null or empty"); throw new ConfigurationException("DataSource databaseType must not be null or empty"); throw new ConfigurationException("Unknown DataSource property: " + propName); for (Object propName : props.keySet()) { if (!allJndiPropNames.contains((String) propName)) { throw new ConfigurationException("Property " + propName + " is not allowed for a DataSource obtained through JNDI" + ", DataSource logicalName = " + logicalName);
/** * Adds the given workspace configuration to the repository. * * @param wc workspace configuration * @throws ConfigurationException if a workspace with the same name * already exists */ private void addWorkspaceConfig(WorkspaceConfig wc) throws ConfigurationException { String name = wc.getName(); if (!workspaces.containsKey(name)) { workspaces.put(name, wc); } else { throw new ConfigurationException( "Duplicate workspace configuration: " + name); } }
/** * Adds the given workspace configuration to the repository. * * @param wc workspace configuration * @throws ConfigurationException if a workspace with the same name * already exists */ private void addWorkspaceConfig(WorkspaceConfig wc) throws ConfigurationException { String name = wc.getName(); if (!workspaces.containsKey(name)) { workspaces.put(name, wc); } else { throw new ConfigurationException( "Duplicate workspace configuration: " + name); } }
/** * Performs variable replacement on the given string value. * Each <code>${...}</code> sequence within the given value is replaced * with the value of the named parser variable. The replacement is not * done if the named variable does not exist. * * @param value original value * @return value after variable replacements * @throws ConfigurationException if the replacement of a referenced * variable is not found */ protected String replaceVariables(String value) throws ConfigurationException { try { return Text.replaceVariables(variables, value, false); } catch (IllegalArgumentException e) { throw new ConfigurationException(e.getMessage(), e); } }
/** * Returns the configuration of a repository with the given configuration * file and repository home directory. * <p> * An exception is thrown if the directory does not exist or if * the repository configuration file can not be read. * * @param xml The configuration file. * @param dir repository home directory * @return repository configuration * @throws ConfigurationException on configuration errors * @since Apache Jackrabbit 1.6 */ public static RepositoryConfig create(File xml, File dir) throws ConfigurationException { if (!dir.isDirectory()) { throw new ConfigurationException( "Repository directory " + dir + " does not exist"); } if (!xml.isFile()) { throw new ConfigurationException( "Repository configuration file " + xml + " does not exist"); } return create(new InputSource(xml.toURI().toString()), dir.getPath()); }
/** * Performs variable replacement on the given string value. * Each <code>${...}</code> sequence within the given value is replaced * with the value of the named parser variable. The replacement is not * done if the named variable does not exist. * * @param value original value * @return value after variable replacements * @throws ConfigurationException if the replacement of a referenced * variable is not found */ protected String replaceVariables(String value) throws ConfigurationException { try { return Text.replaceVariables(variables, value, false); } catch (IllegalArgumentException e) { throw new ConfigurationException(e.getMessage(), e); } }
&& name.equals(child.getNodeName())) { if (found != null) { throw new ConfigurationException( "Duplicate configuration element " + name + " in " + parent.getNodeName() + "."); throw new ConfigurationException( "Configuration element " + name + " not found in " + parent.getNodeName() + ".");
Class<?> objectClass = Class.forName(cname, true, config.getClassLoader()); if (!klass.isAssignableFrom(objectClass)) { throw new ConfigurationException( "Configured class " + cname + " does not implement " + klass.getName() throw new ConfigurationException( "Configured bean implementation class " + cname + " was not found.", e); } catch (InstantiationException e) { throw new ConfigurationException( "Configured bean implementation class " + cname + " can not be instantiated.", e); } catch (IllegalAccessException e) { throw new ConfigurationException( "Configured bean implementation class " + cname + " is protected.", e);