public Glob resolve(String... subPath) {
    String separator = "/";
    if (pattern != null) {
      return new Glob(base, pattern + separator + String.join(separator, subPath));
    } else if (subPath == null || subPath.length == 0) {
      return this;
    } else if (GLOB_PATTERN.matcher(subPath[0]).find()) {
      return new Glob(base, String.join(separator, subPath));
    } else {
      return of(base.resolve(subPath[0])).resolve(Arrays.copyOfRange(subPath, 1, subPath.length));
    }
  }
Resolves a subdirectory using parts separated by the platform file separator.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/Glob.java