Forum Discussion
Hello richie
Thanks for your response. The original groovy is in the previous ticket. Not to overload all tickets with the same code, I thought it would be allright just to put the link of the previous ticket in here?
Cheers,
AAB
Hey AAB
my bad - I didn't notice the link. This replaceAll code works fine on normal parameters stored in the project cos I've used it loads and the regex is correct.
HOWEVER - you're working with filenames arent you?
I take it the log.info filenameWithoutExtension in your code works, right?
the groovy experts (like nmrao, @aaronpliu etc.) would know better than I - but I'm wondering if you actually explicitly pass the value into a property BEFORE you use the regex to remove the date whether that would work?
ta
Rich
- AAB3 years agoRegular Contributor
Hi richie Thanks for your help man! but meanwhile I had a lot of reading, struggling, irritation to look for what I wanted and I had to change some things in my code. A lot of differences between java.io and java.nio, not be able to work with File and Path together, irritating error messages like I didn't know where to look for. So I came back to Groovy for a part and I found the best way for me to work with:
Copy all the files in source folder to a target folder
iterating through the files in target folder and adding dateTime to it.
And that works already! 😎 🤑
Now I need to find a way to empty the target folder at the end of the testcase.
I'll post my result in here once done. Maybe someone else could use this in the future!
for now, Cheers!
Kind regards,
AAB
Related Content
- 7 months agomacheshmeh
- 10 months agoenschim
- 12 months agoakilan