I am working on a Jenkins custom Plugin, where I need to list all valid FilePaths: sub-Directories and child files, excluding some temporary files like .git,.npm,.cache etc
, the full list is included in below code sample:
String excludes = "node_modules/**/*,**/node_modules/**/*,.git/**,.npm*/**,**/.npm*/**,**/.nvm*/**,**/cronus/**,**/.cache/**,**/npmtmp/**,**/.tmp/**";
FilePath[] validFileAndFolderPaths = workspace.list("**/*", excludes);
The above code is giving me all of the files in the workspace
FilePath, but not the sub-directories.
There is a method for listing all sub-directories hudson.FilePath#listDirectories
, but that doesn't support exclusion list.
Any help on how to achieve this requirement?