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 net.paoding.rose.scanning.vfs.FileSystemManager

                logger.info("[moduleResource] exits from 'findFiles'");
                logger.info("[moduleResource] going to scan controllers"
                        + " from these folders or jar files:" + refers);
            }

            FileSystemManager fileSystem = new FileSystemManager();

            for (ResourceRef refer : refers) {
                Resource resource = refer.getResource();
                if (!refer.hasModifier("controllers")) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("[moduleResource] Ignored because not marked as 'controllers'"
                                + " in META-INF/rose.properties or META-INF/MANIFEST.MF: "
                                + resource.getURI());
                    }
                    continue;
                }
                File resourceFile = resource.getFile();
                String urlString;
                if ("jar".equals(refer.getProtocol())) {
                    urlString = ResourceUtils.URL_PROTOCOL_JAR + ":" + resourceFile.toURI()
                            + ResourceUtils.JAR_URL_SEPARATOR;
                } else {
                    urlString = resourceFile.toURI().toString();
                }
                FileObject rootObject = fileSystem.resolveFile(urlString);
                if (rootObject == null || !rootObject.exists()) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("[moduleResource] Ignored because not exists: " + urlString);
                    }
                    continue;
                }

                if (logger.isInfoEnabled()) {
                    logger.info("[moduleResource] start to scan moduleResource in file: " + rootObject);
                }

                try {
                    int oldSize = local.moduleResourceList.size();

                    deepScanImpl(local, rootObject, rootObject);

                    int newSize = local.moduleResourceList.size();

                    if (logger.isInfoEnabled()) {
                        logger.info("[moduleResource] got " + (newSize - oldSize) + " modules in "
                                + rootObject);
                    }

                } catch (Exception e) {
                    logger.error("[moduleResource] error happend when scanning " + rootObject, e);
                }

                fileSystem.clearCache();
            }

            afterScanning(local);

            logger.info("[moduleResource] found " + local.moduleResourceList.size()
    View Full Code Here

    Examples of net.sourceforge.fullsync.FileSystemManager

       */
      public void onBrowse() {
        Site conn = null;
        try {
          ConnectionDescription desc = getConnectionDescription();
          FileSystemManager fsm = new FileSystemManager();
          desc.setParameter("interactive", "true");
          conn = fsm.createConnection(desc);

          FileObject base = conn.getBase();
          FileObjectChooser foc = new FileObjectChooser(m_parent.getShell(), SWT.NULL);
          foc.setBaseFileObject(base);
          foc.setSelectedFileObject(base);
    View Full Code Here

    Examples of org.apache.commons.vfs.FileSystemManager

      public Properties getProperties() {
        if (_properties == null) {
          TemporaryFile tempFile = null;
          try {       
            tempFile = new TemporaryFile("template_" + _name, getContent(), WGADesignerPlugin.getDefault().getStateLocation().toFile());
            FileSystemManager fsManager = VFS.getManager();
            FileObject propFile = fsManager.resolveFile("zip:" + tempFile.getFile().toURI() + "!" + PROPERTIES_FILENAME);
            if (propFile.exists()) {
              _properties = new Properties();
              InputStream propIn = null;
              try {
                propIn = propFile.getContent().getInputStream();
    View Full Code Here

    Examples of org.apache.commons.vfs.FileSystemManager

      public void createOrUpdateDefaultDeployment(File defaultWGAWar, IProgressMonitor monitor) throws FileSystemException, IOException, ZipException {
        if (monitor == null) {
          monitor = new NullProgressMonitor();
        }
        FileSystemManager fsManager = VFS.getManager();
        FileObject propFile = fsManager.resolveFile( "zip:" + defaultWGAWar.toURI() + "!/WEB-INF/wgabuild.properties");
        //_defaultDeploymentName = DEFAULT_DEPLOYMENT_PREFIX + WGADeployment.determineWGAVersion(propFile.getURL().openStream(), "_", true, false);
           
        // init default wga installation
        // check if we already have a deployment with same major, minor version
        WGADeployment existingDefaultDeployment = getDeployment(DEFAULT_DEPLOYMENT_NAME);
    View Full Code Here

    Examples of org.apache.commons.vfs.FileSystemManager

      }

      public static boolean isWGAVersionSupported(File wgaWar) {
        InputStream propIn = null;
        try {
          FileSystemManager fsManager = VFS.getManager();
          FileObject propFile = fsManager.resolveFile( "zip:" + wgaWar.toURI() + "!/WEB-INF/wgabuild.properties");
          propIn = propFile.getURL().openStream();
          Version version = WGADeployment.determineWGAVersion(propIn);
          if (version != null) {
            if (version.isAtLeast(Activator.SUPPORTED_WGA_VERSION_MIN.getMajor(),  Activator.SUPPORTED_WGA_VERSION_MIN.getMinor())) {
              if (version.getMajorVersion() < Activator.SUPPORTED_WGA_VERSION_MAX.getMajor()) {
    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

    {
      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

         * 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

      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

      // build the jar
      // VFS currently does not support building zip files -> use java's ZipOutputStream
      private void buildJar(String newJar) throws IOException
      {
        ZipOutputStream out = new ZipOutputStream(new FileOutputStream(newJar ));
        FileSystemManager fsManager = VFS.getManager();
        for (String jar : _jar2class.keySet())
        {
          FileObject jarFile;
          if (jar.endsWith(".jar"))
            jarFile = fsManager.resolveFile( "jar:"+jar );
          else
            jarFile = fsManager.resolveFile( jar );
           
            for (String file : _jar2class.get(jar))
            {
              file = file.replaceAll("\\.", "/");
              file += ".class";
              FileObject f = fsManager.resolveFile(jarFile, file);
              if (f.exists())
                addFile(f, file, out);
              else
                System.out.println("file not found "+f);
           
    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.