java - How to check if file exists in Mule esb -


i want use choice flow control chose 1 route when file named #[function:datestamp:dd-mm-yyyy].xml exists , other route when file not exist.

is possible write 'when' part of choice check file existence?

you use mel:

<configuration>     <expression-language>         <import class="java.text.simpledateformat" />         <global-functions><![cdata[           def xmlfileexists() {             filepath = '/tmp/' + new simpledateformat('dd-mm-yyyy').format(new date()) + '.xml';             new file(filepath).isfile();           }         ]]></global-functions>     </expression-language> </configuration>  ...      <choice>         <when expression="#[xmlfileexists()]">             ...         </when>         <otherwise>             ...         </otherwise>     </choice> 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -