Package org.exist.config

Examples of org.exist.config.ConfigurationException


  protected static String escape(String id) throws ConfigurationException {
    URI uri;
    try {
      uri = new URI( id );
    } catch (URISyntaxException e) {
      throw new ConfigurationException(e);
    }
    if ("www.google.com".equals(uri.getAuthority()))
      return uri.getQuery().replace("id=", "") + "@google.com";
   
//    return uri.getAuthority();
    String tmp = id.replace("https://", "/");
    tmp = tmp.replace("http://", "/");
    if (tmp.endsWith("/"))
      tmp.subSequence(0, tmp.length()-1);
   
    try {
      return java.net.URLEncoder.encode(tmp,"UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new ConfigurationException(e);
    }
  }
View Full Code Here


    @Override
    public Group addGroup(Group group) throws PermissionDeniedException, EXistException {
       
        if(group.getRealmId() == null) {
            throw new ConfigurationException("Group's realmId is null.");
        }

        if(!getId().equals(group.getRealmId())) {
            throw new ConfigurationException("Group from different realm");
        }

        return getSecurityManager().addGroup(group);
    }
View Full Code Here

    }

    @Override
    public Account addAccount(Account account) throws PermissionDeniedException, EXistException, ConfigurationException {
        if(account.getRealmId() == null) {
            throw new ConfigurationException("Account's realmId is null.");
        }

        if(!getId().equals(account.getRealmId())) {
            throw new ConfigurationException("Account from different realm");
        }

        return getSecurityManager().addAccount(account);
    }
View Full Code Here

                   jobDescription = (JobDescription)jobClass.newInstance();
                    if(jobDescription.getName() == null) {
                        jobDescription.setName(name);
                    }
                } else {
                     throw new ConfigurationException("Java Jobs must extend org.exist.scheduler.UserJavaJob");
                }
            } catch(final ClassNotFoundException cnfe) {
                throw new ConfigurationException("No such class: " + clazz, cnfe);
            } catch(final InstantiationException ie) {
                throw new ConfigurationException("Cannot instantiate class: " + clazz, ie);
            } catch(final IllegalAccessException ie) {
                throw new ConfigurationException("Cannot instantiate class: " + clazz, ie);
            }
        }
       
        manager.getScheduler().createCronJob(cronExpression, jobDescription, null, true);
    }
View Full Code Here

        if (collection != null) {
            BrokerPool database;
            try {
                database = BrokerPool.getInstance();
            } catch (final EXistException e) {
                throw new ConfigurationException(e);
            }

            DBBroker broker = null;
            try {
                broker = database.get(null);

                final Configuration _config_ = Configurator.parse(this, broker, collection, XmldbURI.create(name + ".xml"));
                configuration = Configurator.configure(this, _config_);
            } catch (final EXistException e) {
                throw new ConfigurationException(e);
            } finally {
                database.release(broker);
            }
        }
    }
View Full Code Here

        this.name = name;
        try {
            final Configuration _config_ = Configurator.parse(this, broker, collection, XmldbURI.create(name+".xml"));
            configuration = Configurator.configure(this, _config_);
        } catch (final EXistException e) {
            throw new ConfigurationException(e);
        }
    }
View Full Code Here

        this.realm = realm;

        configuration = Configurator.configure(this, _config_);
       
        if (configuration == null) {
            throw new ConfigurationException("Configuration can't be NULL ["+_config_+"]");
        }

        this.id = configuration.getPropertyInteger("id");
        this.name = configuration.getProperty("name");
View Full Code Here

TOP

Related Classes of org.exist.config.ConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.