本文整理汇总了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();
}
}
示例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();
}
}
示例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)) {
}
}