Commons VFS
  1. Commons VFS
  2. VFS-97

Microsoft FTP Virtual Folder support

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.1
    • Labels:
      None
    • Environment:

      current CVS version, 1.0-RC8

      Description

      FTP Object should return child by name, even if it's name of unlisted virtual directory.

      IIS support creation FTP virtual folders. Such foldres is not listed in LS command, but can be accessed by name (CWD/LS) as well as files in it.

      1. patch.txt
        4 kB
        Sergey Vladimirov
      2. patch.txt
        4 kB
        Sergey Vladimirov
      3. patch.txt
        4 kB
        Sergey Vladimirov
      4. patch-testcase.txt
        3 kB
        Sergey Vladimirov
      5. patch.txt
        2 kB
        Sergey Vladimirov

        Issue Links

          Activity

          Hide
          Sergey Vladimirov added a comment -

          In ideal case there is should be mount point of another fylesystem, i.e. virtual direcotry should be considered as root object of new filysystem.

          But this temporary solution works for me.

          Show
          Sergey Vladimirov added a comment - In ideal case there is should be mount point of another fylesystem, i.e. virtual direcotry should be considered as root object of new filysystem. But this temporary solution works for me.
          Hide
          Sergey Vladimirov added a comment -

          Old patch has bugs with UNIX L8 ftp server - files are reported as existing, but they are not.

          This patch adds "testChacgeDirectory" to FtpClient. This operation changes working directory, so it is required to destroy ftp client after this operation.

          It is possible not to destroy ftpclient, if one can find the way to restore working directory. For example, if working directory is specified.

          Tested on Windows NT. Will be tested on V8 lately.

          Show
          Sergey Vladimirov added a comment - Old patch has bugs with UNIX L8 ftp server - files are reported as existing, but they are not. This patch adds "testChacgeDirectory" to FtpClient. This operation changes working directory, so it is required to destroy ftp client after this operation. It is possible not to destroy ftpclient, if one can find the way to restore working directory. For example, if working directory is specified. Tested on Windows NT. Will be tested on V8 lately.
          Hide
          Sergey Vladimirov added a comment -

          New patch with merged changes from today SVN content (line numbers were changed due to changes in license header change)

          Show
          Sergey Vladimirov added a comment - New patch with merged changes from today SVN content (line numbers were changed due to changes in license header change)
          Hide
          Sergey Vladimirov added a comment -

          Addition:
          Check if possible not to disconnect. It is possible if we can restore working directory after testChangeDirectory():

          public boolean testChangeDirectory(String relPath) throws IOException {
          boolean disconnect = true;
          Boolean userDirIsRoot = FtpFileSystemConfigBuilder.getInstance()
          .getUserDirIsRoot(fileSystemOptions);
          if (getRoot().getPath() != null
          && (userDirIsRoot == null || !userDirIsRoot.booleanValue()))

          { disconnect = false; }

          try {
          FTPClient ftpClient = getFtpClient();
          boolean result = ftpClient.changeWorkingDirectory(relPath);

          if (!disconnect) {
          if (!ftpClient.changeWorkingDirectory(getRoot().getPath()))

          { throw new FileSystemException( "vfs.provider.ftp/change-work-directory.error", getRoot().getPath()); }

          } else

          { disconnect(); }

          return result;
          } catch (IOException e) {
          disconnect();
          FTPClient ftpClient = getFtpClient();
          try { boolean result = ftpClient.changeWorkingDirectory(relPath); return result; } finally { disconnect(); }

          }
          }

          Show
          Sergey Vladimirov added a comment - Addition: Check if possible not to disconnect. It is possible if we can restore working directory after testChangeDirectory(): public boolean testChangeDirectory(String relPath) throws IOException { boolean disconnect = true; Boolean userDirIsRoot = FtpFileSystemConfigBuilder.getInstance() .getUserDirIsRoot(fileSystemOptions); if (getRoot().getPath() != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue())) { disconnect = false; } try { FTPClient ftpClient = getFtpClient(); boolean result = ftpClient.changeWorkingDirectory(relPath); if (!disconnect) { if (!ftpClient.changeWorkingDirectory(getRoot().getPath())) { throw new FileSystemException( "vfs.provider.ftp/change-work-directory.error", getRoot().getPath()); } } else { disconnect(); } return result; } catch (IOException e) { disconnect(); FTPClient ftpClient = getFtpClient(); try { boolean result = ftpClient.changeWorkingDirectory(relPath); return result; } finally { disconnect(); } } }
          Hide
          Sergey Vladimirov added a comment -

          Update patch...

          Show
          Sergey Vladimirov added a comment - Update patch...
          Hide
          Sergey Vladimirov added a comment -

          I'm not sure, if it's a bug or new feature. May be incorrect work with Microsoft FTP virtual folders is a bug.

          Show
          Sergey Vladimirov added a comment - I'm not sure, if it's a bug or new feature. May be incorrect work with Microsoft FTP virtual folders is a bug.

            People

            • Assignee:
              Unassigned
              Reporter:
              Sergey Vladimirov
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development