Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-3250

In camel-sftp component if folder path is set with double slash (//) than exception thrown is misleading user.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • jboss-fuse-6.2.1
    • jboss-fuse-6.1
    • Camel
    • None
    • % %
    • Hide
      • Attached is the reproducer.
      • Using // in path set relative-path to null. Hence throw Null Pointer Exception.
      • Class org.apache.camel.component.file.remote.SftpOperations(camel-ftp-2.12.0.redhat-610379.jar) with line number 674 throws the exception.
        temp = new File(local, relativeName + ".inprogress");
        local = new File(local, relativeName);
        
      • If we catch this line and throw some readable exception than that would be very user friendly.
      Show
      Attached is the reproducer. Using // in path set relative-path to null. Hence throw Null Pointer Exception. Class org.apache.camel.component.file.remote.SftpOperations(camel-ftp-2.12.0.redhat-610379.jar) with line number 674 throws the exception. temp = new File(local, relativeName + ".inprogress" ); local = new File(local, relativeName); If we catch this line and throw some readable exception than that would be very user friendly.

      • Camel sftp endpoint is set with double slash(//) following way:
        <route id="timerToLog2">
            <from uri="sftp://rider:secret@localhost:21000///tmp?localWorkDirectory=/home/cpandey/output/intermediate"/>
             <to uri="file:///home/cpandey/output"/>
        </route>
        
      • Above we see 'sftp://rider:secret@localhost:21000///tmp' i.e. tmp with two forward slash.
      • This code throws exception.
        [org.apache.camel.component.file.GenericFileOperationFailedException - Cannot create new local work file: /home/cpandey/output/intermediate]
        
      • This exception is very generic and mislead user to permission error while creating localworkdirectory.
      • If we can provide some other exception like path is not correct than it would be more user friendly.

            ggrzybek Grzegorz Grzybek
            rhn-support-cpandey Chandra Shekhar Pandey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: