Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-349

secure FTP Problem with Commons vfs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Labels:
    • Environment:

      Linux server

      Description

      I am facing wiered problem in apache commons vfs. I have a method which will create the folder name in remote server using secure FTP. I crated a web-application for this. When I call the below method from web it works fine, no matter how many times you call this method. Now I am testing this using the Jmeter script multiple times. When I execute the script first time it creates the folder and deletes (Calling delete method to delete the folder which I didn't include here and executing fine.) When it tries to create the same folder second time it says The specified directory already exists if I connect the server and see there is no folder exists. I am using file system manager in VFS. Please let me know what I was doing wrong. Please let me know if you have any questions. Thanks in advance.

      private FileSystemManager fileSystemManager;

      private FileSystemOptions fileSystemOptions;

      @Autowired
      public void setFileSystemManager(FileSystemManager fileSystemManager)

      { this.fileSystemManager = fileSystemManager; }

      @Autowired
      public void setFileSystemOptions(FileSystemOptions fileSystemOptions)

      { this.fileSystemOptions = fileSystemOptions; }

      @RequestMapping(value = "/app/newDirectoryForm", method = RequestMethod.GET)
      public ModelAndView showNewDirectoryForm()

      { return new ModelAndView(NEW_DIRECTORY_FORM, "request", new CreateDirectoryRequest()); }

      @RequestMapping(value = "/app/createDirectory", method = RequestMethod.POST)
      public String createDirectory(@Valid @ModelAttribute("request") CreateDirectoryRequest request, BindingResult bindingResult) throws Exception {
      if (bindingResult.hasErrors())
      return NEW_DIRECTORY_FORM;

      FileObject fo = null;
      try {
      fo = fileSystemManager.resolveFile(request.getDirectoryPath(), fileSystemOptions);
      if (fo.exists())

      { bindingResult.addError(new FieldError("request", "directoryPath", request.getDirectoryPath(), false, null, null, "The specified directory already exists.")); return NEW_DIRECTORY_FORM; }


      fo.createFolder();
      }
      finally

      { if (fo != null) fo.close(); }

      return SUCCESS_REDIRECT;
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              praveenk PRAVEEN KASAM
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified