code: private Context getURLContext(String name) throws NamingException {
          int schemeIndex = name.indexOf(":");
          if (schemeIndex != -1) {
              String scheme = name.substring(0, schemeIndex);
              return NamingManager.getURLContext(scheme, env);
          }
  
          return null;
      }
docs: Get the URL context given a name based on the scheme of the URL.
  
  @param name The name to get the URL context for
  @return The URL context for the name
  @throws NamingException