Package org.apache.commons.vfs2.provider

Examples of org.apache.commons.vfs2.provider.FileProvider


            return;
        }

        scratchFolder.delete(Selectors.EXCLUDE_SELF);

        DefaultFileSystemManager fs = createManager();
        fs.setCacheStrategy(CacheStrategy.MANUAL);
        fs.init();
        FileObject foBase2 = getBaseTestFolder(fs);

        FileObject cachedFolder = foBase2.resolveFile(scratchFolder.getName().getPath());

        FileObject[] fos = cachedFolder.getChildren();
View Full Code Here


            return;
        }

        scratchFolder.delete(Selectors.EXCLUDE_SELF);

        DefaultFileSystemManager fs = createManager();
        fs.setCacheStrategy(CacheStrategy.ON_RESOLVE);
        fs.init();
        FileObject foBase2 = getBaseTestFolder(fs);

        FileObject cachedFolder = foBase2.resolveFile(scratchFolder.getName().getPath());

        FileObject[] fos = cachedFolder.getChildren();
View Full Code Here

            return;
        }

        scratchFolder.delete(Selectors.EXCLUDE_SELF);

        DefaultFileSystemManager fs = createManager();
        fs.setCacheStrategy(CacheStrategy.ON_CALL);
        fs.init();
        FileObject foBase2 = getBaseTestFolder(fs);

        FileObject cachedFolder = foBase2.resolveFile(scratchFolder.getName().getPath());

        FileObject[] fos = cachedFolder.getChildren();
View Full Code Here

        // Create the file system manager
        manager = providerConfig.getDefaultFileSystemManager();
        manager.setFilesCache(providerConfig.getFilesCache());

        final DefaultFileReplicator replicator = new DefaultFileReplicator(tempDir);
        manager.setReplicator(new PrivilegedFileReplicator(replicator));
        manager.setTemporaryFileStore(replicator);

        providerConfig.prepare(manager);

        if (!manager.hasProvider("file"))
View Full Code Here

        // Extract the scheme
        final String scheme = UriParser.extractScheme(uri);
        if (scheme != null)
        {
            // An absolute URI - locate the provider
            final FileProvider provider = providers.get(scheme);
            if (provider != null)
            {
                return provider.findFile(realBaseFile, uri, fileSystemOptions);
            }
            // Otherwise, assume a local file
        }

        // Handle absolute file names
View Full Code Here

        else
        {
            scheme = realBase.getScheme();
            fullPath = realBase.getRootURI() + resolvedPath;
        }
        final FileProvider provider = providers.get(scheme);
        if (provider != null)
        {
            // todo: extend the filename parser to be able to parse
            // only a pathname and take the missing informations from
            // the base. Then we can get rid of the string operation.
            // // String fullPath = base.getRootURI() +
            // resolvedPath.substring(1);

            return provider.parseUri(realBase, fullPath);
        }

        if (scheme != null)
        {
            // An unknown scheme - hand it to the default provider - if possible
View Full Code Here

        // Extract the scheme
        final String scheme = UriParser.extractScheme(uri);
        if (scheme != null)
        {
            // An absolute URI - locate the provider
            final FileProvider provider = providers.get(scheme);
            if (provider != null)
            {
                return provider.parseUri(null, uri);
            }

            // Otherwise, assume a local file
        }
View Full Code Here

     * @throws FileSystemException if an error occurs.
     */
    public FileObject createFileSystem(final String scheme,
            final FileObject file) throws FileSystemException
    {
        final FileProvider provider = providers.get(scheme);
        if (provider == null)
        {
            throw new FileSystemException("vfs.impl/unknown-provider.error",
                    new Object[] {scheme, file});
        }
        return provider.createFileSystem(scheme, file, file.getFileSystem().getFileSystemOptions());
    }
View Full Code Here

     * If you use VFS as singleton it is VERY dangerous to call this method
     * @param filesystem The FileSystem to close.
     */
    public void _closeFileSystem(FileSystem filesystem)
    {
        FileProvider provider = providers.get(filesystem.getRootName().getScheme());
        if (provider != null)
        {
            ((AbstractFileProvider) provider).closeFileSystem(filesystem);
        }
    }
View Full Code Here

     * @throws FileSystemException if the given scheme is not konwn
     */
    public Collection<Capability> getProviderCapabilities(final String scheme)
            throws FileSystemException
    {
        FileProvider provider = providers.get(scheme);
        if (provider == null)
        {
            throw new FileSystemException("vfs.impl/unknown-scheme.error",
                    new Object[] {scheme});
        }

        return provider.getCapabilities();
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs2.provider.FileProvider

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.