Package org.apache.jackrabbit.core.config

Examples of org.apache.jackrabbit.core.config.RepositoryConfig


    public void repositoryStart() throws Exception {
        InputStream config =
            RepositoryImpl.class.getResourceAsStream("repository.xml");
        String home = new File("target/cltest").getAbsolutePath();
        RepositoryConfig rc = RepositoryConfig.create(config, home);
        RepositoryImpl repository = RepositoryImpl.create(rc);

        try {
            Context ctx = getInitialContext();
            ctx.bind(REPOSITORY_NAME, repository);
View Full Code Here


     * @return repository instance
     * @throws RepositoryException if the repository could not be created
     */
    protected JackrabbitRepository createRepository()
            throws RepositoryException {
        RepositoryConfig config = RepositoryConfig.create(
                reference.get(CONFIGFILEPATH_ADDRTYPE).getContent().toString(),
                reference.get(REPHOMEDIR_ADDRTYPE).getContent().toString());
        return RepositoryImpl.create(config);
    }
View Full Code Here

                } catch (Exception e) {
                    // Not running within the main test suite
                    InputStream xml =
                        TestRepository.class.getResourceAsStream(CONF_RESOURCE);
                    String home = System.getProperty(HOME_PROPERTY, HOME_DEFAULT);
                    RepositoryConfig config = RepositoryConfig.create(xml, home);
                    instance = new TransientRepository(config);
                }
            }
            return instance;
        } catch (ConfigurationException e) {
View Full Code Here

                    if (!homeDir.exists()) {
                        logger.info("Creating repository home directory " + home);
                        homeDir.mkdirs();
                    }
                    // Load the configuration and create the repository
                    RepositoryConfig rc = RepositoryConfig.create(config, home);
                    return RepositoryImpl.create(rc);
                } catch (IOException e) {
                    throw new RepositoryException(
                            "Automatic repository configuration failed", e);
                } catch (ConfigurationException e) {
View Full Code Here

            }
        }
    }

    private void backup(File sourceDir) throws Exception {
        RepositoryConfig source;
        if (command.hasOption("conf")) {
            source = RepositoryConfig.create(
                    new File(command.getOptionValue("conf")), sourceDir);
        } else {
            source = RepositoryConfig.create(sourceDir);
        }

        File targetDir;
        if (command.hasOption("backup-repo")) {
            targetDir = new File(command.getOptionValue("backup-repo"));
        } else {
            int i = 1;
            do {
                targetDir = new File("jackrabbit-backup" + i++);
            } while (targetDir.exists());
        }

        RepositoryConfig target;
        if (command.hasOption("backup-conf")) {
            target = RepositoryConfig.install(
                    new File(command.getOptionValue("backup-conf")), targetDir);
        } else {
            target = RepositoryConfig.install(targetDir);
View Full Code Here

         * Return the repository.
         */
        public RepositoryImpl create()
                throws RepositoryException {
            if (repository == null) {
                RepositoryConfig config = null;

                if (configFile.startsWith(CLASSPATH_CONFIG_PREFIX)) {
                    ClassLoader cl = Thread.currentThread().getContextClassLoader();
                    if (cl == null) {
                        cl = this.getClass().getClassLoader();
View Full Code Here

     * @return a new jcr repository.
     * @throws RepositoryException if an error during creation occurs.
     */
    protected Repository createRepository(InputSource is, File homedir)
            throws RepositoryException {
        RepositoryConfig config = RepositoryConfig.create(is, homedir.getAbsolutePath());
        return RepositoryImpl.create(config);
    }
View Full Code Here

            } finally {
                input.close();
            }
        }

        RepositoryConfig config = RepositoryConfig.create(xml, dir);
        return RepositoryImpl.create(config);
    }
View Full Code Here

     * @return repository instance
     * @throws RepositoryException if the repository could not be created
     */
    protected JackrabbitRepository createRepository()
            throws RepositoryException {
        RepositoryConfig config = RepositoryConfig.create(
                reference.get(CONFIGFILEPATH_ADDRTYPE).getContent().toString(),
                reference.get(REPHOMEDIR_ADDRTYPE).getContent().toString());
        return RepositoryImpl.create(config);
    }
View Full Code Here

  protected synchronized Repository getRepository() {
    if (repository==null) {
      try {
        InputStream stream = ClassLoaderUtil.getStream(configuration);
        RepositoryConfig config = RepositoryConfig.create(stream, directory);
        repository = RepositoryImpl.create(config);
      } catch (Exception e) {
        // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
        throw new JbpmException("couldn't create new jackrabbit repository with configResource '"+configuration+"' and directory '"+directory+"'", e);
      }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.config.RepositoryConfig

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.