mule read single file from classpath during flow

前端 未结 8 1733
渐次进展
渐次进展 2020-12-05 11:13

Is there an easy way to configure a Flow to read a single file from the classpath one time? I don\'t need to poll for a file. I just need to read a known file and set its co

8条回答
  •  佛祖请我去吃肉
    2020-12-05 11:43

    You can create a "Spring Bean" which tries to "import" the file (Suppose Mule XML conefiguration file). Sample code below:

    
     
    
    

    Or else you can try by placing the file in a property placeholder as below

    
    

    Or else you can even read the file by using a Groovy component with sample code:

     File file = new File("C://Users//schiraboina//Desktop//123.txt")
    payload=file.getText()  
    

提交回复
热议问题