【发布时间】:2013-06-26 11:24:57
【问题描述】:
我的问题与 simplei 的 here 完全相同。看来他从来没有得到回答,我在这个网站上找不到这个问题,所以我想我会把它放在这个社区面前。
无论出于何种原因,GphotoEntry 都能正常工作,但 PhotoEntry 什么也不返回。我需要在 PhotoEntry 上使用 getMediaSource() 方法;它不适用于 GphotoEntry。
这是我的代码(它必须在 try-catch 语句中,但我已在此处取出)。你会注意到我已经注释掉了对我有用的行:
URL baseSearchUrl = new URL("https://picasaweb.google.com/data/feed/api/all");
Query myQuery = new Query(baseSearchUrl);
myQuery.setStringCustomParameter("kind", "photo");
myQuery.setMaxResults(10);
myQuery.setFullTextQuery("puppy");
AlbumFeed searchResultsFeed = myService.query(myQuery, AlbumFeed.class);
//for (GphotoEntry photo : searchResultsFeed.getEntries()) {
for (PhotoEntry photo : searchResultsFeed.getPhotoEntries()) {
System.out.println(photo.getTitle().getPlainText());
}
感谢您的帮助
【问题讨论】: