@Override
  public String toUriPath(String root, Iterable<String> names, boolean directory) {
    if (root.startsWith("\\\\")) {
      root = root.replace('\\', '/');
    } else {
      root = "/" + root.replace('\\', '/');
    }

    StringBuilder builder = new StringBuilder();
    builder.append(root);

    Iterator<String> iter = names.iterator();
    if (iter.hasNext()) {
      builder.append(iter.next());
      while (iter.hasNext()) {
        builder.append('/').append(iter.next());
      }
    }

    if (directory && builder.charAt(builder.length() - 1) != '/') {
      builder.append('/');
    }

    return builder.toString();
  }
Checks if c is one of the reserved characters that aren't allowed in Windows file names.
jimfs/src/main/java/com/google/common/jimfs/WindowsPathType.java