Returns the URL-encoded service path of the service, for example "tasks/v1/".
Must end with a "/" and not begin with a "/". It is allowed to be an empty string ""
or a forward slash "/", if it is a forward slash then it is treated as an empty string
Universe Domain is the domain for Google Cloud Services. It follows the format of
{ServiceName}.{UniverseDomain}. For example, speech.googleapis.com would have a Universe
Domain value of googleapis.com and cloudasset.test.com would have a Universe Domain of
test.com. If this value is not set, this will default to googleapis.com.
Check that the User configured universe domain matches the Credentials' universe domain. This
uses the HttpRequestInitializer to get the Credentials and is enforced that the
HttpRequestInitializer is of the {@see HttpCredentialsAdapter}
from the google-auth-library.
To use a non-GDU Credentials, you must use the HttpCredentialsAdapter class.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class AbstractGoogleClient (2.8.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.8.1 (latest)](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [2.8.0](/java/docs/reference/google-api-client/2.8.0/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [2.7.2](/java/docs/reference/google-api-client/2.7.2/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [2.6.0](/java/docs/reference/google-api-client/2.6.0/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [2.5.1](/java/docs/reference/google-api-client/2.5.1/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [2.4.1](/java/docs/reference/google-api-client/2.4.1/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [2.1.2](/java/docs/reference/google-api-client/2.1.2/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [2.0.1](/java/docs/reference/google-api-client/2.0.1/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [1.35.2](/java/docs/reference/google-api-client/1.35.2/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [1.34.1](/java/docs/reference/google-api-client/1.34.1/com.google.api.client.googleapis.services.AbstractGoogleClient)\n- [1.33.4](/java/docs/reference/google-api-client/1.33.4/com.google.api.client.googleapis.services.AbstractGoogleClient) \n\n public abstract class AbstractGoogleClient\n\nAbstract thread-safe Google client. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e AbstractGoogleClient \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### AbstractGoogleClient(AbstractGoogleClient.Builder builder)\n\n protected AbstractGoogleClient(AbstractGoogleClient.Builder builder)\n\nMethods\n-------\n\n### batch()\n\n public final BatchRequest batch()\n\nCreate an [BatchRequest](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.batch.BatchRequest) object from this Google API client instance.\n\nSample usage: \n\n\n client.batch()\n .queue(...)\n .queue(...)\n .execute();\n \n### batch(HttpRequestInitializer httpRequestInitializer)\n\n public final BatchRequest batch(HttpRequestInitializer httpRequestInitializer)\n\nCreate an [BatchRequest](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.batch.BatchRequest) object from this Google API client instance.\n\nSample usage: \n\n\n client.batch(httpRequestInitializer)\n .queue(...)\n .queue(...)\n .execute();\n \n### getApplicationName()\n\n public final String getApplicationName()\n\nReturns the application name to be sent in the User-Agent header of each request or `\nnull` for none.\n\n### getBaseUrl()\n\n public final String getBaseUrl()\n\nReturns the URL-encoded base URL of the service, for example `\n\"`\u003chttps://www.googleapis.com/tasks/v1/\u003e`\"`.\n\nMust end with a \"/\". It is guaranteed to be equal to `getRootUrl() +\ngetServicePath()`.\n\n### getGoogleClientRequestInitializer()\n\n public final GoogleClientRequestInitializer getGoogleClientRequestInitializer()\n\nReturns the Google client request initializer or `null` for none.\n\n### getObjectParser()\n\n public ObjectParser getObjectParser()\n\nReturns the object parser or `null` for none.\n\nOverriding is only supported for the purpose of calling the super implementation and\nchanging the return type, but nothing else.\n\n### getRequestFactory()\n\n public final HttpRequestFactory getRequestFactory()\n\nReturns the HTTP request factory.\n\n### getRootUrl()\n\n public final String getRootUrl()\n\nReturns the URL-encoded root URL of the service, for example `\n\"`\u003chttps://www.googleapis.com/\u003e`\"`.\n\nMust end with a \"/\".\n\n### getServicePath()\n\n public final String getServicePath()\n\nReturns the URL-encoded service path of the service, for example `\"tasks/v1/\"`.\n\nMust end with a \"/\" and not begin with a \"/\". It is allowed to be an empty string `\"\"`\nor a forward slash `\"/\"`, if it is a forward slash then it is treated as an empty string\n\n### getSuppressPatternChecks()\n\n public final boolean getSuppressPatternChecks()\n\nReturns whether discovery pattern checks should be suppressed on required parameters.\n\n### getSuppressRequiredParameterChecks()\n\n public final boolean getSuppressRequiredParameterChecks()\n\nReturns whether discovery required parameter checks should be suppressed.\n\n### getUniverseDomain()\n\n public final String getUniverseDomain()\n\nUniverse Domain is the domain for Google Cloud Services. It follows the format of\n`{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a Universe\nDomain value of `googleapis.com` and cloudasset.test.com would have a Universe Domain of\n`test.com`. If this value is not set, this will default to `googleapis.com`.\n\n### initialize(AbstractGoogleClientRequest\\\u003c?\\\u003e httpClientRequest)\n\n protected void initialize(AbstractGoogleClientRequest\u003c?\u003e httpClientRequest)\n\nInitializes a [AbstractGoogleClientRequest](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.AbstractGoogleClientRequest) using a [GoogleClientRequestInitializer](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.GoogleClientRequestInitializer).\n\nMust be called before the Google client request is executed, preferably right after the\nrequest is instantiated. Sample usage: \n\n\n public class Get extends HttpClientRequest {\n ...\n }\n\n public Get get(String userId) throws IOException {\n Get result = new Get(userId);\n initialize(result);\n return result;\n }\n \nSubclasses may override by calling the super implementation.\n\n### validateUniverseDomain()\n\n public void validateUniverseDomain()\n\nCheck that the User configured universe domain matches the Credentials' universe domain. This\nuses the HttpRequestInitializer to get the Credentials and is enforced that the\nHttpRequestInitializer is of the {@see [HttpCredentialsAdapter](https://github.com/googleapis/google-auth-library-java/blob/main/oauth2_http/java/com/google/auth/http/HttpCredentialsAdapter.java)}\nfrom the google-auth-library.\n\nTo use a non-GDU Credentials, you must use the HttpCredentialsAdapter class."]]