code: def _GenClientLib(discovery_path, language, output_path, build_system):
    
    with open(discovery_path) as f:
      discovery_doc = f.read()
  
    client_name = re.sub(r'\.discovery$', '.zip',
                         os.path.basename(discovery_path))
  
    return _GenClientLibFromContents(discovery_doc, language, output_path,
                                     build_system, client_name)
docs: Write a client library from a discovery doc.
  
    Args:
      discovery_path: Path to the discovery doc used to generate the client
        library.
      language: The client library language to generate. (java)
      output_path: The directory to output the client library zip to.
      build_system: The target build system for the client library language.
  
    Raises:
      IOError: If reading the discovery doc fails.
      ServerRequestException: If fetching the generated client library fails.
  
    Returns:
      The path to the zipped client library.