I have two array list in that form:
def AllowedExtensions = [ '.mxf', '.mov', '.mp4']
def myPaths = [C:\Temp\Media\Media.c2v, C:\Temp\Media\Media.V2C, C:\Temp\Media\toto\test\巨塔の終わり.mp4, C:\Temp\Media\toto\toto.mxf]
I'm trying to build a new list mySelectedPath from myPaths only if it matches one of the extensions from AllowedExtensions
I'm looking for the groovy way to do it but can't get it working correctly.
AllowedExtensions.each { mySelectedPath = myPaths.findAll { it }}
Here is my expected result:
[C:\Temp\MediaNavigator\toto\toto.mxf, C:\Temp\MediaNavigator\toto\test\巨塔の終わり.mp4]
Thank you for any input !