Forum Discussion
nmrao
9 years agoChampion Level 3
I believe that you wanted to input a file name using command line and send the contents of that file as message. Is it so?
Then you can just use property expansion say ${#Project#MESSAGE_FILE} in your script to get the dynamic file name as input.
While running command line, pass -PMESSAGE_FILE=</absolute/file/path>
And hope you know how to get the file contents like:
def contents = new File(context.expand('${#Project#MESSAGE_FILE}')).text
Now 'content' variable has your file content.
Hope this helps.
Then you can just use property expansion say ${#Project#MESSAGE_FILE} in your script to get the dynamic file name as input.
While running command line, pass -PMESSAGE_FILE=</absolute/file/path>
And hope you know how to get the file contents like:
def contents = new File(context.expand('${#Project#MESSAGE_FILE}')).text
Now 'content' variable has your file content.
Hope this helps.
Related Content
Recent Discussions
- 19 hours ago
- 17 days ago