|
|
|
[
Permlink
| « Hide
]
Robin Shen [26/Jun/12 11:38 PM]
Can you please show me your script?
Could you please let me know why I am able to get the file when the script is like this:
groovy: new File(configuration.workspaceDir, "build_status.txt").text = build.status.name(); But I am not able to get when script is like this: groovy: new File(configuration.workspaceDir, "build_status.txt") Can I create an empty file? To create an empty file, please try this:
new File(configuration.workspaceDir, "build_status.txt").text = "" Thank you this worked for me.
But still I am not able to get the files for the following script groovy: address = "ftp://xx.com/file.zip" file = new FileOutputStream("download.zip") new BufferedOutputStream(file) << new URL(address).openStream() Are you able to run this script outside of QB successfully (using groovy shell or something else)? If not, it is rather a groovy problem then.
I just tried and below works for me:
groovy: address = "http://xx.com/file.zip" // I am trying http since I do not find a ftp source to download) file = new FileOutputStream(new File(configuration.workspaceDir, "download.zip")) // make sure to create file under workspace directory explicitly; otherwise, files will be created under working directory of the process, which is "<QB install dir>/bin" new BufferedOutputStream(file) << new URL(address).openStream() |