寻找一个好的java“完整路径glob”到regex filter maker

问题描述

我需要使用通用的完整路径“glob”过滤器格式来实现目录树遍历器,该格式类似于或等效于 .gitignore 文件中的内容或 gradle 用于其 filetree include() 和 exclude() 方法内容

ie:  "/**/aDirectory/*.foo" "/a/directory/**/*.foo" "/start/a????.d/**/*"  etc
That is:

filter = makeFilter("/**/*.foo/**/*.txt")

filter.match("/a/b/c/blah.foo/e/f.txt") == true;
filter.match("/a/b/c/blah.foo/e/f.jpg") == false;
filter.match("/a/b/c/blah/e/f.txt") == false;
filter.match("/blah.foo/e/f.txt") == true;
filter.match("/blah.foo/f.txt") == true;
  
also allowing "?" to represent a single character that must be present.

过滤器可以使用不带分隔符的字符串数组来表示路径。

是否已经为此制定了标准? 一个好的实现?

如果是的话我在哪里可以找到它:)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)