0

In THREDDS server setup, I need to configure datasetScan filter element in catalog.xml so that it takes into account full file path, not just file name or directory name. Say, I have following folder structure:

/GGG/alpha/a
          /b
          /c
/GGG/beta/a
         /b
         /c

And I want to remove a file named a only from folder alpha. I can remove the file a from both folders by setting

<exclude wildcard="a"/>

or I can remove the folder alpha completely by setting

<exclude wildcard="alpha" atomic="false" collection="true"/>

but setting wildcard="alpha/a" or anything similar does not seem to work. I have also tried regexp instead of wildcard and different combinations of atomic and collection, but no luck. Is my understanding correct that it is not currently possible to filter by folder and file names in one rule?

Suneel Kumar
  • 1,650
  • 2
  • 21
  • 31
kakk11
  • 898
  • 8
  • 21
  • There is more discussion about this issue at this question: https://stackoverflow.com/questions/19385287/regexp-for-matching-directories. And perhaps a solution in this answer: https://stackoverflow.com/a/19502991/1211981 – Eric Bridger Jan 26 '18 at 13:59
  • Thanks, @EricBridger but I do not think there is the example for matching a full path? – kakk11 Jan 29 '18 at 14:12
  • You are correct, I just found a work-around which worked for me. – Eric Bridger Jan 30 '18 at 13:43

1 Answers1

3

The <exclude> and <include> elements only allows to match the name, but no the full path.

P.S.: BTW, I have just made a pull request at the Thredds' GitHub repository to include this funcionality.

https://github.com/Unidata/thredds/pull/1015

Probably some tests and improvement should be reviewed.