本文整理汇总了Java中com.google.gdata.data.photos.UserFeed类的典型用法代码示例。如果您正苦于以下问题:Java UserFeed类的具体用法?Java UserFeed怎么用?Java UserFeed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserFeed类属于com.google.gdata.data.photos包,在下文中一共展示了UserFeed类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAlbums
import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
* Retrieves the albums for the given user.
*/
public List<AlbumEntry> getAlbums(String username) throws IOException,
ServiceException {
String albumUrl = API_PREFIX + username;
UserFeed userFeed = getFeed(albumUrl, UserFeed.class);
List<GphotoEntry> entries = userFeed.getEntries();
List<AlbumEntry> albums = new ArrayList<AlbumEntry>();
for (GphotoEntry entry : entries) {
GphotoEntry adapted = entry.getAdaptedEntry();
if (adapted instanceof AlbumEntry) {
albums.add((AlbumEntry) adapted);
}
}
return albums;
}
示例2: getTags
import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
* Retrieves the tags for the given user. These are tags aggregated across
* the entire account.
*/
public List<TagEntry> getTags(String uname) throws IOException,
ServiceException {
String tagUrl = API_PREFIX + uname + "?kind=tag";
UserFeed userFeed = getFeed(tagUrl, UserFeed.class);
List<GphotoEntry> entries = userFeed.getEntries();
List<TagEntry> tags = new ArrayList<TagEntry>();
for (GphotoEntry entry : entries) {
GphotoEntry adapted = entry.getAdaptedEntry();
if (adapted instanceof TagEntry) {
tags.add((TagEntry) adapted);
}
}
return tags;
}
示例3: getTags
import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
* Retrieves the tags for the given user. These are tags aggregated across
* the entire account.
*/
public List<TagEntry> getTags(String uname) throws IOException,
ServiceException {
String tagUrl = API_PREFIX + uname + "?kind=tag";
UserFeed userFeed = getFeed(tagUrl, UserFeed.class);
List<GphotoEntry> entries = userFeed.getEntries();
List<TagEntry> tags = new ArrayList<TagEntry>();
for (GphotoEntry entry : entries) {
GphotoEntry adapted = entry.getAdaptedEntry();
if (adapted instanceof TagEntry) {
tags.add((TagEntry) adapted);
}
}
return tags;
}
示例4: declareExtensions
import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
* Declare the extensions of the feeds for the Picasa Web Albums Data API.
*/
private void declareExtensions() {
extProfile.setAutoExtending(true);
new AlbumEntry().declareExtensions(extProfile);
new AlbumFeed().declareExtensions(extProfile);
new CommentEntry().declareExtensions(extProfile);
new PhotoEntry().declareExtensions(extProfile);
new PhotoFeed().declareExtensions(extProfile);
new TagEntry().declareExtensions(extProfile);
new UserEntry().declareExtensions(extProfile);
new UserFeed().declareExtensions(extProfile);
}
示例5: getAllImage
import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
public List<String> getAllImage()
{
String userName ="YOUR GOOGLE PICASA USERNAME";
String password = "YOUR GOOGLE PICASA PASSWORD";
System.out.println("Inside getallimage");
PicasawebService myService = new PicasawebService("exampleCo-exampleApp-1");
List<String> listUrl = new LinkedList<String>();
try
{
myService.setUserCredentials(userName, password);
URL feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/"+userName+"?kind=album");
UserFeed myUserFeed = myService.getFeed(feedUrl, UserFeed.class);
String id = "";
List<AlbumEntry> albumEntries = myUserFeed.getAlbumEntries();
System.out.println(albumEntries.isEmpty());
AlbumEntry myAlbum = albumEntries.get(1);
id = myAlbum.getGphotoId();
System.out.println(id);
//System.out.println(service.parseURL(id));
System.out.println("UserName :"+userName);
URL albumUrl = new URL("https://picasaweb.google.com/data/feed/api/user/"+userName+"/albumid/"+parseURL(id));
System.out.println(albumUrl.toString());
AlbumFeed feed = myService.getFeed(albumUrl, AlbumFeed.class);
for(PhotoEntry photo : feed.getPhotoEntries()) {
System.out.println("Photos");
String photoUrl = photo.getTitle().getPlainText();
System.out.println(parsePhotoUrl(photo.getMediaThumbnails().get(0).getUrl()));
listUrl.add(parsePhotoUrl(photo.getMediaThumbnails().get(0).getUrl()));
}
}catch (Exception e)
{
e.printStackTrace();
}
System.out.println("Returning listUrl");
return listUrl;
}
示例6: getAlbums
import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
* Retrieves the albums for the given user.
* albumUrl = addParameter(albumUrl, "hidestreamid", "photos_from_posts" );
*/
public List getAlbums(String username, Boolean showall ) throws IOException, ServiceException {
String albumUrl = API_PREFIX + username;
if( showall )
albumUrl = addParameter( albumUrl, "showall", null );
List<GphotoEntry> albums = new ArrayList<GphotoEntry>();
while( true ) {
UserFeed userFeed = getFeed(albumUrl, UserFeed.class);
feeds.add( userFeed );
List<GphotoEntry> entries = userFeed.getEntries();
for (GphotoEntry entry : entries) {
albums.add(entry);
}
Link nextLink = userFeed.getNextLink();
if( nextLink == null )
break;
albumUrl = nextLink.getHref();
}
TimeUtils.sortGPhotoEntriesNewestFirst( albums );
return albums;
}