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


Java AbstractGoogleClient.Builder方法代码示例

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


在下文中一共展示了AbstractGoogleClient.Builder方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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


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