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.vfs.FileSystemManager

          public void run() {
        initialize();
          while (reader == null) {
            getLogger().info("attempting to load file: " + getFileURL());
            try {
              FileSystemManager fileSystemManager = VFS.getManager();
              FileObject fileObject = fileSystemManager.resolveFile(getFileURL());
              reader = new InputStreamReader(fileObject.getContent().getInputStream());
            } catch (FileSystemException fse) {
              getLogger().info("file not available - will try again in 10 seconds");
              synchronized(this) {
                try {
    View Full Code Here

    Examples of org.apache.commons.vfs.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.vfs.FileSystemManager

    {
      private final static int NUOF_RESOLVES = 100000;

      public static void main(String[] args) throws FileSystemException
      {
        FileSystemManager mgr = VFS.getManager();

        FileObject root = mgr
            .resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr");
        FileName rootName = root.getName();
     
        testNames(mgr, rootName);
    View Full Code Here

    Examples of org.apache.commons.vfs.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.vfs.FileSystemManager

      public static String resolveSchema(final ResourceManager resourceManager,
                                         final ResourceKey contextKey,
                                         String catalogUrl)
          throws FileSystemException
      {
        final FileSystemManager fsManager = VFS.getManager();
        if (fsManager == null)
        {
          throw Util.newError("Cannot get virtual file system manager");
        }

        // Workaround VFS bug.
        if (catalogUrl.startsWith("file://localhost"))
        {
          catalogUrl = catalogUrl.substring("file://localhost".length());
        }
        if (catalogUrl.startsWith("file:"))
        {
          catalogUrl = catalogUrl.substring("file:".length());
        }

        try
        {
          final File catalogFile = new File(catalogUrl).getCanonicalFile();
          final FileObject file = fsManager.toFileObject(catalogFile);
          if (file.isReadable())
          {
            return catalogFile.getPath();
          }
        }
    View Full Code Here

    Examples of org.apache.commons.vfs.FileSystemManager

      public IContentItem getFileOutputContentItem() {

        String contentRef = getContentRef();
        try {
          String contentName = getHandlerId().substring( 4 ) + ":" + contentRef; //$NON-NLS-1$
          FileSystemManager fsManager = VFS.getManager();
          if ( fsManager == null ) {
            Logger.error( ApacheVFSOutputHandler.class.getName(), Messages.getInstance().getString(
              "ApacheVFSOutputHandler.ERROR_0001_CANNOT_GET_VFSMGR" ) ); //$NON-NLS-1$
            return null;
          }
          FileObject file = fsManager.resolveFile( contentName );
          if ( file == null ) {
            Logger.error( ApacheVFSOutputHandler.class.getName(), Messages.getInstance().getString(
                "ApacheVFSOutputHandler.ERROR_0002_CANNOT_GET_VF", contentName ) ); //$NON-NLS-1$
            return null;
          }
    View Full Code Here

    Examples of org.apache.commons.vfs2.FileSystemManager

    {
        private final static int NUOF_RESOLVES = 100000;

        public static void main(String[] args) throws FileSystemException
        {
            FileSystemManager mgr = VFS.getManager();

            FileObject root = mgr
                    .resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr");
            FileName rootName = root.getName();

            testNames(mgr, rootName);
    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

            }
            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

            ConfigurationAssert.assertEquals(conf, newConfig);
        }

        private FileObject getFile(String fileName) throws Exception
        {
            FileSystemManager manager = VFS.getManager();
            FileName file = manager.resolveURI(fileName);
            FileName base = file.getParent();
            FileName path = manager.resolveName(base, file.getBaseName());
            FileSystemOptions opts = new FileSystemOptions();
            return manager.resolveFile(path.getURI(), opts);
        }
    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.