Package org.apache.jackrabbit.core.fs

Examples of org.apache.jackrabbit.core.fs.FileSystem


     * @throws RepositoryException if an error occurrs
     */
    protected VersionManager createVersionManager(VersioningConfig vConfig,
                                                  DelegatingObservationDispatcher delegatingDispatcher)
            throws RepositoryException {
        FileSystem fs = vConfig.getFileSystemConfig().createFileSystem();
        PersistenceManager pm = createPersistenceManager(vConfig.getHomeDir(),
                fs,
                vConfig.getPersistenceManagerConfig(),
                rootNodeId,
                nsReg,
View Full Code Here


                    public QueryHandler getQueryHandler(QueryHandlerContext context)
                            throws RepositoryException {
                        Element element = (Element) child;

                        // Optional file system implementation
                        FileSystem fs = null;
                        if (getElement(element, FILE_SYSTEM_ELEMENT, false) != null) {
                            fs = getFileSystemFactory(
                                    element, FILE_SYSTEM_ELEMENT).getFileSystem();
                        }
View Full Code Here

            throws ConfigurationException {
        final BeanConfig config = parseBeanConfig(parent, name);
        return new FileSystemFactory() {
            public FileSystem getFileSystem() throws RepositoryException {
                try {
                    FileSystem fs = config.newInstance(FileSystem.class);
                    fs.init();
                    return fs;
                } catch (FileSystemException e) {
                    throw new RepositoryException(
                            "File system initialization failure.", e);
                }
View Full Code Here

    protected InternalVersionManagerImpl createVersionManager(VersioningConfig vConfig,
                                                      DelegatingObservationDispatcher delegatingDispatcher)
            throws RepositoryException {


        FileSystem fs = vConfig.getFileSystem();
        PersistenceManager pm = createPersistenceManager(
                vConfig.getHomeDir(), fs,
                vConfig.getPersistenceManagerConfig());

        ISMLocking ismLocking = vConfig.getISMLocking();
View Full Code Here

        // Get all workspace subdirectories
        if (workspaceConfigDirectory != null) {
            // a configuration directoy had been specified; search for
            // workspace configurations in virtual repository file system
            // rather than in physical workspace root directory on disk
            FileSystem fs = fsc.getFileSystem();
            try {
                if (!fs.exists(workspaceConfigDirectory)) {
                    fs.createFolder(workspaceConfigDirectory);
                } else {
                    String[] dirNames = fs.listFolders(workspaceConfigDirectory);
                    for (int i = 0; i < dirNames.length; i++) {
                        String configDir = workspaceConfigDirectory
                                + FileSystem.SEPARATOR + dirNames[i];
                        WorkspaceConfig wc = loadWorkspaceConfig(fs, configDir);
                        if (wc != null) {
View Full Code Here

        // get a writer for the workspace configuration file
        if (workspaceConfigDirectory != null) {
            // a configuration directoy had been specified; create workspace
            // configuration in virtual repository file system rather than
            // on disk
            FileSystem fs = fsc.getFileSystem();
            String configDir = workspaceConfigDirectory
                    + FileSystem.SEPARATOR + name;
            String configFile = configDir + FileSystem.SEPARATOR + WORKSPACE_XML;
            try {
                // Create the directory
                fs.createFolder(configDir);
                configWriter = new OutputStreamWriter(
                        fs.getOutputStream(configFile));
            } catch (FileSystemException e) {
                throw new ConfigurationException(
                        "failed to create workspace configuration at path "
                        + configFile, e);
            }
        } else {
            File file = new File(directory, WORKSPACE_XML);
            try {
                configWriter = new FileWriter(file);
            } catch (IOException e) {
                throw new ConfigurationException(
                        "failed to create workspace configuration at path "
                        + file.getPath(), e);
            }
        }

        // Create the workspace.xml file using the configuration template and
        // the configuration writer.
        try {
            template.setAttribute("name", name);

            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer();
            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
            transformer.transform(
                    new DOMSource(template), new StreamResult(configWriter));
        } catch (TransformerConfigurationException e) {
            throw new ConfigurationException(
                    "Cannot create a workspace configuration writer", e);
        } catch (TransformerException e) {
            throw new ConfigurationException(
                    "Cannot create a workspace configuration file", e);
        } finally {
            try {
                configWriter.close();
            } catch (IOException ignore) {}
        }

        // Load the created workspace configuration.
        WorkspaceConfig wc;
        if (workspaceConfigDirectory != null) {
            FileSystem fs = fsc.getFileSystem();
            String configDir = workspaceConfigDirectory
                    + FileSystem.SEPARATOR + name;
            wc = loadWorkspaceConfig(fs, configDir);
        } else {
            wc = loadWorkspaceConfig(directory);
View Full Code Here

    public void init(PMContext context) throws Exception {
        if (initialized) {
            throw new IllegalStateException("already initialized");
        }

        FileSystem wspFS = context.getFileSystem();
        itemStateFS = new BasedFileSystem(wspFS, "/data");

        /**
         * store BLOB data in local file system in a sub directory
         * of the workspace home directory
View Full Code Here

            if (synonymProviderConfigPath.endsWith(FileSystem.SEPARATOR)) {
                throw new FileSystemException(
                        "Invalid synonymProviderConfigPath: "
                        + synonymProviderConfigPath);
            }
            FileSystem fs = getContext().getFileSystem();
            if (fs == null) {
                fs = new LocalFileSystem();
                int lastSeparator = synonymProviderConfigPath.lastIndexOf(
                        FileSystem.SEPARATOR_CHAR);
                if (lastSeparator != -1) {
                    File root = new File(path,
                            synonymProviderConfigPath.substring(0, lastSeparator));
                    ((LocalFileSystem) fs).setRoot(root.getCanonicalFile());
                    fs.init();
                    fsr = new FileSystemResource(fs,
                            synonymProviderConfigPath.substring(lastSeparator + 1));
                } else {
                    ((LocalFileSystem) fs).setPath(path);
                    fs.init();
                    fsr = new FileSystemResource(fs, synonymProviderConfigPath);
                }
                synonymProviderConfigFs = fs;
            } else {
                fsr = new FileSystemResource(fs, synonymProviderConfigPath);
View Full Code Here

    public void init(PMContext context) throws Exception {
        if (initialized) {
            throw new IllegalStateException("already initialized");
        }

        FileSystem wspFS = context.getFileSystem();
        itemStateFS = new BasedFileSystem(wspFS, "/data");

        /**
         * store BLOB data in local file system in a sub directory
         * of the workspace home directory
View Full Code Here

    protected InternalVersionManagerImpl createVersionManager(VersioningConfig vConfig,
                                                      DelegatingObservationDispatcher delegatingDispatcher)
            throws RepositoryException {


        FileSystem fs = vConfig.getFileSystem();
        PersistenceManager pm = createPersistenceManager(vConfig.getHomeDir(),
                fs,
                vConfig.getPersistenceManagerConfig(),
                rootNodeId,
                nsReg,
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.fs.FileSystem

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.