Examples of FileSystemManager

@author Adam Murdoch
  • org.apache.commons.vfs2.FileSystemManager
    here.org/somefile

  • Absolute local file name. For example, /home/someuser/a-file or c:\dir\somefile.html. Elements in the name can be separated using any of the following characters: /, \, or the native file separator character. For example, the following file names are the same:

     c:\somedir\somefile.xml c:/somedir/somefile.xml 

  • Relative path. For example: ../somefile or somedir/file.txt. The file system manager resolves relative paths against its base file. Elements in the relative path can be separated using /, \, or file system specific separator characters. Relative paths may also contain .. and . elements. See {@link FileObject#resolveFile} for moredetails.

    @author Commons VFS team

  • org.apache.ftpserver.ftplet.FileSystemManager
    This is the file system manager - it returns the file system view for user.
  • org.freeplane.plugin.workspace.io.FileSystemManager

  • Examples of org.apache.commons.vfs2.FileSystemManager

            {
                return super.locateFromURL(basePath, fileName);
            }
            try
            {
                FileSystemManager fsManager = VFS.getManager();

                FileObject file;
                // Only use the base path if the file name doesn't have a scheme.
                if (basePath != null && fileScheme == null)
                {
                    String scheme = UriParser.extractScheme(basePath);
                    FileSystemOptions opts = (scheme != null) ? getOptions(scheme) : null;
                    FileObject base = (opts == null) ? fsManager.resolveFile(basePath)
                            : fsManager.resolveFile(basePath, opts);
                    if (base.getType() == FileType.FILE)
                    {
                        base = base.getParent();
                    }

                    file = fsManager.resolveFile(base, fileName);
                }
                else
                {
                    FileSystemOptions opts = (fileScheme != null) ? getOptions(fileScheme) : null;
                    file = (opts == null) ? fsManager.resolveFile(fileName)
                            : fsManager.resolveFile(fileName, opts);
                }

                if (!file.exists())
                {
                    return null;
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

        ReloadingClassLoader localLoader = loader;
        while (null == localLoader) {
          synchronized (lock) {
            if (null == loader) {
             
              FileSystemManager vfs = generateVfs();
             
              // Set up the 2nd tier class loader
              if (null == parent) {
                parent = AccumuloClassLoader.getClassLoader();
              }
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

        ReloadingClassLoader localLoader = loader;
        while (null == localLoader) {
          synchronized (lock) {
            if (null == loader) {

              FileSystemManager vfs = generateVfs();

              // Set up the 2nd tier class loader
              if (null == parent) {
                parent = AccumuloClassLoader.getClassLoader();
              }
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

            }
            for (int i = 0; i < args.length; i++)
            {
                try
                {
                    FileSystemManager mgr = VFS.getManager();
                    System.out.println();
                    System.out.println("Parsing: " + args[i]);
                    FileObject file = mgr.resolveFile(args[i]);
                    System.out.println("URL: " + file.getURL());
                    System.out.println("getName(): " + file.getName());
                    System.out.println("BaseName: " + file.getName().getBaseName());
                    System.out.println("Extension: " + file.getName().getExtension());
                    System.out.println("Path: " + file.getName().getPath());
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

         * Sanity test.
         */
        public void testDefaultInstance() throws Exception
        {
            // Locate the default manager
            final FileSystemManager manager = VFS.getManager();

            // Lookup a test jar file
            final File jarFile = getTestResource("test.jar");
            FileObject file = manager.toFileObject(jarFile);
            assertNotNull(file);
            assertTrue(file.exists());
            assertSame(FileType.FILE, file.getType());

            // Expand it
            file = manager.createFileSystem(file);
            assertNotNull(file);
            assertTrue(file.exists());
            assertSame(FileType.FOLDER, file.getType());
        }
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

        public InputStream getInputStream(String basePath, String fileName)
            throws ConfigurationException
        {
            try
            {
                FileSystemManager manager = VFS.getManager();
                FileName path;
                if (basePath != null)
                {
                    FileName base = manager.resolveURI(basePath);
                    path = manager.resolveName(base, fileName);
                }
                else
                {
                    FileName file = manager.resolveURI(fileName);
                    FileName base = file.getParent();
                    path = manager.resolveName(base, file.getBaseName());
                }
                FileSystemOptions opts = getOptions(path.getScheme());
                FileObject file = (opts == null) ? manager.resolveFile(path.getURI())
                        : manager.resolveFile(path.getURI(), opts);
                FileContent content = file.getContent();
                if (content == null)
                {
                    String msg = "Cannot access content of " + file.getName().getFriendlyURI();
                    throw new ConfigurationException(msg);
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

        public OutputStream getOutputStream(URL url) throws ConfigurationException
        {
            try
            {
                FileSystemOptions opts = getOptions(url.getProtocol());
                FileSystemManager fsManager = VFS.getManager();
                FileObject file = (opts == null) ? fsManager.resolveFile(url.toString())
                        : fsManager.resolveFile(url.toString(), opts);
                // throw an exception if the target URL is a directory
                if (file == null || file.getType() == FileType.FOLDER)
                {
                    throw new ConfigurationException("Cannot save a configuration to a directory");
                }
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

            {
                return super.getPath(file, url, basePath, fileName);
            }
            try
            {
                FileSystemManager fsManager = VFS.getManager();
                if (url != null)
                {
                    FileName name = fsManager.resolveURI(url.toString());
                    if (name != null)
                    {
                        return name.toString();
                    }
                }

                if (UriParser.extractScheme(fileName) != null)
                {
                    return fileName;
                }
                else if (basePath != null)
                {
                    FileName base = fsManager.resolveURI(basePath);
                    return fsManager.resolveName(base, fileName).getURI();
                }
                else
                {
                    FileName name = fsManager.resolveURI(fileName);
                    FileName base = name.getParent();
                    return fsManager.resolveName(base, name.getBaseName()).getURI();
                }
            }
            catch (FileSystemException fse)
            {
                fse.printStackTrace();
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

            {
                return super.getBasePath(path);
            }
            try
            {
                FileSystemManager fsManager = VFS.getManager();
                FileName name = fsManager.resolveURI(path);
                return name.getParent().getURI();
            }
            catch (FileSystemException fse)
            {
                fse.printStackTrace();
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

            {
                return super.getFileName(path);
            }
            try
            {
                FileSystemManager fsManager = VFS.getManager();
                FileName name = fsManager.resolveURI(path);
                return name.getBaseName();
            }
            catch (FileSystemException fse)
            {
                fse.printStackTrace();
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.