当前位置: 首页>>代码示例>>Java>>正文


Java AbstractGoogleClient类代码示例

本文整理汇总了Java中com.google.api.client.googleapis.services.AbstractGoogleClient的典型用法代码示例。如果您正苦于以下问题:Java AbstractGoogleClient类的具体用法?Java AbstractGoogleClient怎么用?Java AbstractGoogleClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AbstractGoogleClient类属于com.google.api.client.googleapis.services包,在下文中一共展示了AbstractGoogleClient类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateBuilder

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
/**
 * Updates the Google client builder to connect the appropriate server based
 * on whether LOCAL_ANDROID_RUN is true or false.
 * 
 * @param builder Google client builder
 * @return same Google client builder
 */
public static <B extends AbstractGoogleClient.Builder> B updateBuilder(B builder) {
    if (LOCAL_ANDROID_RUN) {
        builder.setRootUrl(LOCAL_APP_ENGINE_SERVER_URL + "/_ah/api/");
    }

    // only enable GZip when connecting to remote server
    final boolean enableGZip = builder.getRootUrl().startsWith("https:");

    builder.setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
        @Override
        public void initialize(AbstractGoogleClientRequest<?> request) throws IOException {
            if (!enableGZip) {
                request.setDisableGZipContent(true);
            }
        }
    });

    return builder;
}
 
开发者ID:pkill9,项目名称:POSproject,代码行数:27,代码来源:CloudEndpointUtils.java

示例2: createService

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
protected static <T extends AbstractGoogleClient> T createService(
    AbstractGoogleClient.Builder builder) {
  String endpoint = System.getenv(ENDPOINT_ENV_VAR);
  if (endpoint != null) {
    try {
      URI u = new URI(endpoint);
      if (!u.isAbsolute()) {
        throw new IllegalArgumentException("Endpoint URL must be absolute: " + endpoint);
      }
      builder.setRootUrl(u.resolve("/").toString());
      builder.setServicePath(u.getPath());
      System.out.println("Using non-standard API endpoint: " + endpoint);
    } catch (URISyntaxException e) {
      throw new RuntimeException(e);
    }
  }
  @SuppressWarnings({"unchecked"})
  T built = (T) builder.build();
  return built;
}
 
开发者ID:googleads,项目名称:googleads-shopping-samples,代码行数:21,代码来源:BaseWorkflowSample.java

示例3: updateBuilder

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
/**
 * Updates the Google client builder to connect the appropriate server based
 * on whether LOCAL_ANDROID_RUN is true or false.
 * 
 * @param builder
 *            Google client builder
 * @return same Google client builder
 */
public static <B extends AbstractGoogleClient.Builder> B updateBuilder(
    B builder) {
  if (LOCAL_ANDROID_RUN) {
    builder.setRootUrl(LOCAL_APP_ENGINE_SERVER_URL_FOR_ANDROID
        + "/_ah/api/");
  }

  // only enable GZip when connecting to remote server
  final boolean enableGZip = builder.getRootUrl().startsWith("https:");

  builder.setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
    public void initialize(AbstractGoogleClientRequest<?> request)
        throws IOException {
      if (!enableGZip) {
        request.setDisableGZipContent(true);
      }
    }
  });

  return builder;
}
 
开发者ID:ljug,项目名称:gestionDepenseMobile,代码行数:30,代码来源:CloudEndpointUtils.java

示例4: updateBuilder

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
/**
 * Updates the Google client builder to connect the appropriate server based on whether
 * LOCAL_ANDROID_RUN is true or false.
 *
 * @param builder Google client builder
 * @return same Google client builder
 */
public static <B extends AbstractGoogleClient.Builder> B updateBuilder(B builder) {
  if (LOCAL_ANDROID_RUN) {
    builder.setRootUrl(LOCAL_APP_ENGINE_SERVER_URL + "/_ah/api/");
  }

  // only enable GZip when connecting to remote server
  final boolean enableGZip = builder.getRootUrl().startsWith("https:");

  builder.setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
    @Override
    public void initialize(AbstractGoogleClientRequest<?> request) {
      if (!enableGZip) {
        request.setDisableGZipContent(true);
      }
    }
  });

  return builder;
}
 
开发者ID:googlearchive,项目名称:solutions-mobile-shopping-assistant-android-client,代码行数:27,代码来源:CloudEndpointBuilderHelper.java

示例5: updateBuilder

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
/**
 * Updates the Google client builder to connect the appropriate server based
 * on whether LOCAL_ANDROID_RUN is true or false.
 * 
 * @param builder
 *          Google client builder
 * @return same Google client builder
 */
public static <B extends AbstractGoogleClient.Builder> B updateBuilder(B builder) {
  if (LOCAL_ANDROID_RUN) {
    builder.setRootUrl(LOCAL_APP_ENGINE_SERVER_URL + "/_ah/api/");
  }

  // only enable GZip when connecting to remote server
  final boolean enableGZip = builder.getRootUrl().startsWith("https:");

  builder.setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
    public void initialize(AbstractGoogleClientRequest<?> request) throws IOException {
      if (!enableGZip) {
        request.setDisableGZipContent(true);
      }
    }
  });

  return builder;
}
 
开发者ID:harrypritchett,项目名称:Give-Me-Ltc-Android-App,代码行数:27,代码来源:CloudEndpointUtils.java

示例6: updateBuilder

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
/**
 * Updates the Google client builder to connect the appropriate server based
 * on whether LOCAL_ANDROID_RUN is true or false.
 *
 * @param builder Google client builder
 * @return same Google client builder
 */
public static <B extends AbstractGoogleClient.Builder> B updateBuilder(
        B builder) {
    if (LOCAL_ANDROID_RUN) {
        builder.setRootUrl(LOCAL_APP_ENGINE_SERVER_URL_FOR_ANDROID
                + "/_ah/api/");
    }

    // only enable GZip when connecting to remote server
    final boolean enableGZip = builder.getRootUrl().startsWith("https:");

    builder.setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
        public void initialize(AbstractGoogleClientRequest<?> request)
                throws IOException {
            if (!enableGZip) {
                request.setDisableGZipContent(true);
            }
        }
    });

    return builder;
}
 
开发者ID:gabuzomeu,项目名称:geoPingProject,代码行数:29,代码来源:CloudEndpointUtils.java

示例7: updateBuilder

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
/**
 * Updates the Google client builder to connect the appropriate server based on whether
 * LOCAL_ANDROID_RUN is true or false.
 * 
 * @param builder Google client builder
 * @return same Google client builder
 */
public static <B extends AbstractGoogleClient.Builder> B updateBuilder(B builder) {
  if (LOCAL_ANDROID_RUN) {
    builder.setRootUrl(LOCAL_APP_ENGINE_SERVER_URL + "/_ah/api/");
  }

  // only enable GZip when connecting to remote server
  final boolean enableGZip = builder.getRootUrl().startsWith("https:");

  builder.setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() {
    public void initialize(AbstractGoogleClientRequest<?> request) throws IOException {
      if (!enableGZip) {
        request.setDisableGZipContent(true);
      }
    }
  });

  return builder;
}
 
开发者ID:GoogleCloudPlatform,项目名称:solutions-cloud-adventure-sample-android-client,代码行数:26,代码来源:CloudEndpointUtils.java

示例8: addTraceFor

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
/**
 * Creates a {@link GoogleApiTracer} that sets the trace destination on all
 * calls that match the given client type.
 */
public GoogleApiTracer addTraceFor(AbstractGoogleClient client, String traceDestination) {
  put(client.getClass().getCanonicalName(), traceDestination);
  return this;
}
 
开发者ID:apache,项目名称:beam,代码行数:9,代码来源:GoogleApiDebugOptions.java

示例9: createService

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
protected <T extends AbstractGoogleClient> T createService(AbstractGoogleClient.Builder builder) {
  return BaseWorkflowSample.createService(builder);
}
 
开发者ID:googleads,项目名称:googleads-shopping-samples,代码行数:4,代码来源:BaseSample.java

示例10: Request

import com.google.api.client.googleapis.services.AbstractGoogleClient; //导入依赖的package包/类
/**
	 * Constructor for a new instance of {@link Request}.
	 * 
	 * @param abstractGoogleClient Instance of {@link AmbiverseApiClient}
	 * @param requestMethod The HTTP request method to use, e.g. "GET" or "POST".
	 * @param uriTemplate The endpoint URL
	 * @param httpContent The payload to send to the endpoint.
	 * @param responseClass The model class to deserialize the JSON response to.
	 */
	protected Request(AbstractGoogleClient abstractGoogleClient, String requestMethod, String uriTemplate,
			HttpContent httpContent, Class<T> responseClass) {
		super(abstractGoogleClient, requestMethod, uriTemplate, httpContent, responseClass);
		
//		this.setDisableGZipContent(true);		
	}
 
开发者ID:ambi-verse,项目名称:nlu-api-client-java,代码行数:16,代码来源:Request.java


注:本文中的com.google.api.client.googleapis.services.AbstractGoogleClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。