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


Java ServiceException.printStackTrace方法代码示例

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


在下文中一共展示了ServiceException.printStackTrace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import com.google.gdata.util.ServiceException; //导入方法依赖的package包/类
/**
 * Uses the command line arguments to authenticate the GoogleService and build
 * the basic feed URI, then invokes all the other methods to demonstrate how
 * to interface with the Blogger service.
 * 
 * @param args See the usage method.
 */
public static void main(String[] args) {

  // Set username, password and feed URI from command-line arguments.
  SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
  String userName = parser.getValue("username", "user", "u");
  String userPassword = parser.getValue("password", "pass", "p");
  boolean help = parser.containsKey("help", "h");
  if (help || (userName == null) || (userPassword == null)) {
    usage();
    System.exit(1);
  }

  BloggerService myService = new BloggerService("exampleCo-exampleApp-1");

  try {
    run(myService, userName, userPassword);
  } catch (ServiceException se) {
    se.printStackTrace();
  } catch (IOException ioe) {
    ioe.printStackTrace();
  }
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:30,代码来源:BloggerClient.java

示例2: main

import com.google.gdata.util.ServiceException; //导入方法依赖的package包/类
/**
 * Uses the command line arguments to authenticate the GoogleService and build
 * the basic feed URI, then invokes all the other methods to demonstrate how
 * to interface with the Analytics service.
 *
 * @param args See the usage method.
 */
public static void main(String[] args) {

  // Set username, password and feed URI from command-line arguments.
  SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
  String userName = parser.getValue("username", "user", "u");
  String userPassword = parser.getValue("password", "pwd", "p");
  boolean help = parser.containsKey("help", "h");
  if (help || (userName == null)) {
    usage();
    System.exit(1);
  }

  AnalyticsService myService = new AnalyticsService("exampleCo-exampleApp-1");

  try {
    run(myService, userName, userPassword);
  } catch (ServiceException se) {
    se.printStackTrace();
  } catch (IOException ioe) {
    ioe.printStackTrace();
  }
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:30,代码来源:AnalyticsClient.java

示例3: run

import com.google.gdata.util.ServiceException; //导入方法依赖的package包/类
/**
 * Starts up the demo and prompts for commands.
 * 
 * @param username name of user to authenticate (e.g. [email protected])
 * @param password password to use for authentication
 * @throws AuthenticationException if the service is unable to validate the
 *         username and password.
 */
public void run(String username, String password)
    throws AuthenticationException {
  for (String s : WELCOME_MESSAGE) {
    out.println(s);
  }

  BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

  // Login and prompt the user to pick a sheet to use.
  login(username, password);
  try {
    loadSheet(reader);
  } catch (ServiceException se) {
    // Show *exactly* what went wrong.
    se.printStackTrace();
  } catch (IOException ioe) {
    // Show *exactly* what went wrong.
    ioe.printStackTrace();
  }

  while (executeCommand(reader)) {
  }
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:32,代码来源:WorksheetDemo.java


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