commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PRAVEEN KASAM (JIRA)" <j...@apache.org>
Subject [jira] [Created] (VFS-349) secure FTP Problem with Commons vfs
Date Fri, 25 Mar 2011 02:05:05 GMT
secure FTP Problem with Commons vfs
-----------------------------------

                 Key: VFS-349
                 URL: https://issues.apache.org/jira/browse/VFS-349
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 1.0
         Environment: Linux server
            Reporter: PRAVEEN KASAM


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;  
    }   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message