0

I know I shouldn't be asking about this because it looks so simple, yet I've been trying a few days and still unable to retrieve the highlighted value as shown in the screenshot below. It's driving me crazy. I tried out a few combination of MEL expression using Mule Evaluate but still no luck. I've tried:

#[payload.file] = returns null
#[payload.file.path] = returns exception
#[payload.path] = returns null

I need to be able to retrieve that "path" value so badly. Newbie here, please advise.

Click this. How to retrieve this value?

Chevon Teo
  • 7
  • 1
  • 7
  • It would help if you post your flow as well. If you use the file connector, normally the file path and name are available in message.inboundProperties as well. – jvas Aug 10 '16 at 17:10

1 Answers1

1

Can you share the class poc.DeleteOnCloseFileInputStream? Without knowing the file access modifier, we don't know how to read its properties.

However, referring the possibly same class in another post, DeleteOnCloseFileInputStream. The file access modifier is private, and there is no method to expose it. So you unable to get the path value.

But, if you have possibility to modify the class, then I suggest you to add a getter method. For example: public File getFile() { return file; }.

Finally, you will be able to get the path value by using this MEL: #[payload.file.path]

Community
  • 1
  • 1
sulthony h
  • 1,279
  • 1
  • 8
  • 9
  • Thank you @sulthony-h! I changed the File private variable to public and now I can access it by #[payload.file] expression. This is the first time I'm working with MuleESB and Java. A lot of learning curve and I believe I will have more silly questions coming up :( – Chevon Teo Aug 11 '16 at 09:09