code: protected static boolean isRelativeUri(URI uri) {
          if (uri.isAbsolute())
              return false;
          String path = uri.normalize().getPath();
          if (path.length() == 0 /* isEmpty() is mustang API */)
              return false;
          if (!path.equals(uri.getPath())) // implicitly checks for embedded . and ..
              return false;
          if (path.startsWith("/") || path.startsWith("./") || path.startsWith("../"))
              return false;
          return true;
      }
docs: Enforces the specification of a "relative" name as used in
  {@linkplain #getFileForInput(Location,String,String)
  getFileForInput}.  This method must follow the rules defined in
  that method, do not make any changes without consulting the
  specification.