Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileSystem


      return true;
    }
    final FileObject vfsConnection = PublishUtil.createVFSConnection(VFS.getManager(), loginData);
    try
    {
      final FileSystem fileSystem = vfsConnection.getFileSystem();
      if (fileSystem instanceof WebSolutionFileSystem)
      {
        final WebSolutionFileSystem webSolutionFileSystem = (WebSolutionFileSystem) fileSystem;
        final Long l = (Long) webSolutionFileSystem.getAttribute(WebSolutionFileSystem.LAST_REFRESH_TIME_ATTRIBUTE);
        if (l != null)
View Full Code Here


                                                final PentahoPathModel pathModel)
  {
    try
    {
      final FileObject fileSystemRoot = PublishUtil.createVFSConnection(VFS.getManager(), loginData);
      final FileSystem fileSystem = fileSystemRoot.getFileSystem();
     
      // as of version 3.7 we do not need to check anything other than that the version information is there
      // later we may have to add additional checks in here to filter out known broken versions.

      final String localPath = pathModel.getLocalPath();
      final FileObject object = fileSystemRoot.resolveFile(localPath);
      final FileContent content = object.getContent();
      final String majorVersionText = (String) fileSystem.getAttribute(WebSolutionFileSystem.MAJOR_VERSION);

      if (StringUtils.isEmpty(majorVersionText) == false)
      {
        final String paramService = (String) content.getAttribute("param-service-url");
        if (StringUtils.isEmpty(paramService))
View Full Code Here

    }

    protected void closeFileSystem() {

        if (_fsResources != null) {
            FileSystem fs = _fsResources.getBaseFolder().getFileSystem();
            _fsResources = null;
            _fsManager.closeFileSystem(fs);
            _fsManager.freeUnusedResources();
        }
View Full Code Here

        {
            final URL url = new URL(uri);

            URL rootUrl = new URL(url, "/");
            final String key = this.getClass().getName() + rootUrl.toString();
            FileSystem fs = findFileSystem(key, fileSystemOptions);
            if (fs == null)
            {
                String extForm = rootUrl.toExternalForm();
                final FileName rootName = getContext().parseURI(extForm);
                // final FileName rootName =
                //    new BasicFileName(rootUrl, FileName.ROOT_PATH);
                fs = new MvnFileSystem(rootName, fileSystemOptions);
                addFileSystem(key, fs);
            }
            return fs.resolveFile(url.getPath());
        }
        catch (final MalformedURLException e)
        {
            throw new FileSystemException("vfs.provider.url/badly-formed-uri.error", uri, e);
        }
View Full Code Here

    public void disconnect() {
      System.out.println("FTPConnection.disconnect()");
        try {
          // Close and nullify the manager object
          if (manager != null) {
              FileSystem fs = null;
              if(fCloseFile != null) {               
                fCloseFile.close(); // Seems to still work even if this line is omitted
                fs = fCloseFile.getFileSystem(); // This works even after the src is closed.
                manager.closeFileSystem(fs);
              }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs.FileSystem

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.