Class GlobExpander

    • Method Detail

      • expand

        public static List<String> expand​(String globPattern)
        Expands a string with braces ("{}") into all of its possible permutations. We call anything inside of {} braces a "one-of" group.

        The only special characters in this glob syntax are '}', '{' and ','

        The top-level pattern must not contain any commas, but a "one-of" group separates its elements with commas, and a one-of group may contain sub one-of groups.

        For example: start{a,b,c}end -> startaend, startbend, startcend start{a,{b,c},d} -> startaend, startbend, startcend, startdend {a,b,c} -> a, b, c start{a, b{x,y}} -> starta, startbx, startby

        Parameters:
        globPattern - a string in the format described above
        Returns:
        a list of all the strings that would satisfy globPattern, including duplicates