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.getURL(basePath, file);
            }
            try
            {
                FileSystemManager fsManager = VFS.getManager();

                FileName path;
                if (basePath != null && UriParser.extractScheme(file) == null)
                {
                    FileName base = fsManager.resolveURI(basePath);
                    path = fsManager.resolveName(base, file);
                }
                else
                {
                    path = fsManager.resolveURI(file);
                }

                URLStreamHandler handler = new VFSURLStreamHandler(path);
                return new URL(null, path.getURI(), handler);
            }
    View Full Code Here

    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

         */
        protected FileObject getFile()
        {
            try
            {
                FileSystemManager fsManager = VFS.getManager();
                FileSystem fs = ((FileSystemBased) configuration).getFileSystem();
                String uri = fs.getPath(null, configuration.getURL(), configuration.getBasePath(),
                    configuration.getFileName());
                if (uri == null)
                {
                    throw new ConfigurationRuntimeException("Unable to determine file to monitor");
                }
                return fsManager.resolveFile(uri);
            }
            catch (FileSystemException fse)
            {
                String msg = "Unable to monitor " + configuration.getURL().toString();
                log.error(msg);
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

    //    System.out.println( "Waiting" );
    //    System.in.read();
    //  }

      private FileObject createDir( String name ) throws FileSystemException {
        FileSystemManager fsm = VFS.getManager();
        FileObject dir = fsm.resolveFile( name );
        dir.createFolder();
        assertTrue( "Failed to create test dir " + dir.getName().getFriendlyURI(), dir.exists() );
        return dir;
      }
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

                return null;
            }

            try
            {
                FileSystemManager fsManager = VFS.getManager();
                String uri = resolveFileURI();
                if (uri == null)
                {
                    throw new ConfigurationRuntimeException("Unable to determine file to monitor");
                }
                return fsManager.resolveFile(uri);
            }
            catch (FileSystemException fse)
            {
                String msg = "Unable to monitor " + getFileHandler().getURL().toString();
                log.error(msg);
    View Full Code Here

    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

        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.