本文整理汇总了Java中com.google.gdata.data.photos.AlbumFeed类的典型用法代码示例。如果您正苦于以下问题:Java AlbumFeed类的具体用法?Java AlbumFeed怎么用?Java AlbumFeed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AlbumFeed类属于com.google.gdata.data.photos包,在下文中一共展示了AlbumFeed类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printAlbumLocation
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
/**
* Demonstrates use of partial query to retrieve album title and location
* information for user's albums.
*/
private void printAlbumLocation(String uname)
throws IOException, ServiceException {
String albumsUrl = API_PREFIX + uname;
String fields = "entry(title,gphoto:id,gphoto:location)";
Query albumQuery = new Query(new URL(albumsUrl));
albumQuery.setFields(fields);
AlbumFeed feed = service.query(albumQuery, AlbumFeed.class);
for (GphotoEntry entry : feed.getEntries()) {
if (entry instanceof AlbumEntry) {
AlbumEntry albumEntry = (AlbumEntry) entry;
OUT.println(albumEntry.getGphotoId() + ":"
+ albumEntry.getTitle().getPlainText()
+ " (" + albumEntry.getLocation() + ")");
}
}
}
示例2: getPhotos
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
/**
* Retrieves the photos for the given album.
*/
public List<PhotoEntry> getPhotos(AlbumEntry album) throws IOException,
ServiceException {
String feedHref = getLinkByRel(album.getLinks(), Link.Rel.FEED);
AlbumFeed albumFeed = getFeed(feedHref, AlbumFeed.class);
List<GphotoEntry> entries = albumFeed.getEntries();
List<PhotoEntry> photos = new ArrayList<PhotoEntry>();
for (GphotoEntry entry : entries) {
GphotoEntry adapted = entry.getAdaptedEntry();
if (adapted instanceof PhotoEntry) {
photos.add((PhotoEntry) adapted);
}
}
return photos;
}
示例3: getComments
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
/**
* Retrieves the comments for the given photo.
*/
public List<CommentEntry> getComments(PhotoEntry photo) throws IOException,
ServiceException {
String feedHref = getLinkByRel(photo.getLinks(), Link.Rel.FEED);
AlbumFeed albumFeed = getFeed(feedHref, AlbumFeed.class);
List<GphotoEntry> entries = albumFeed.getEntries();
List<CommentEntry> comments = new ArrayList<CommentEntry>();
for (GphotoEntry entry : entries) {
GphotoEntry adapted = entry.getAdaptedEntry();
if (adapted instanceof CommentEntry) {
comments.add((CommentEntry) adapted);
}
}
return comments;
}
示例4: getTags
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
/**
* Retrieves the tags for the given taggable entry. This is valid on user,
* album, and photo entries only.
*/
public List<TagEntry> getTags(GphotoEntry<?> parent) throws IOException,
ServiceException {
String feedHref = getLinkByRel(parent.getLinks(), Link.Rel.FEED);
feedHref = addKindParameter(feedHref, "tag");
AlbumFeed albumFeed = getFeed(feedHref, AlbumFeed.class);
List<GphotoEntry> entries = albumFeed.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;
}
示例5: printAlbumLocation
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
/**
* Demonstrates use of partial query to retrieve album title and location
* information for user's albums.
*/
private void printAlbumLocation(String uname) throws IOException, ServiceException {
String albumsUrl = API_PREFIX + uname;
String fields = "entry(title,gphoto:id,gphoto:location)";
Query albumQuery = new Query(new URL(albumsUrl));
albumQuery.setFields(fields);
AlbumFeed feed = service.query(albumQuery, AlbumFeed.class);
for (GphotoEntry entry : feed.getEntries()) {
if (entry instanceof AlbumEntry) {
AlbumEntry albumEntry = (AlbumEntry) entry;
log.info(albumEntry.getGphotoId() + ":" + albumEntry.getTitle().getPlainText() + " ("
+ albumEntry.getLocation() + ")");
}
}
}
示例6: getComments
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
/**
* Retrieves the comments for the given photo.
*/
public List<CommentEntry> getComments(PhotoEntry photo) throws IOException,
ServiceException {
String feedHref = getLinkByRel(photo.getLinks(), Link.Rel.FEED);
AlbumFeed albumFeed = getFeed(feedHref, AlbumFeed.class);
List<GphotoEntry> entries = albumFeed.getEntries();
List<CommentEntry> comments = new ArrayList<CommentEntry>();
for (GphotoEntry entry : entries) {
GphotoEntry adapted = entry.getAdaptedEntry();
if (adapted instanceof CommentEntry) {
comments.add((CommentEntry) adapted);
}
}
return comments;
}
示例7: getTags
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
/**
* Retrieves the tags for the given taggable entry. This is valid on user,
* album, and photo entries only.
*/
public List<TagEntry> getTags(GphotoEntry<?> parent) throws IOException,
ServiceException {
String feedHref = getLinkByRel(parent.getLinks(), Link.Rel.FEED);
feedHref = addKindParameter(feedHref, "tag");
AlbumFeed albumFeed = getFeed(feedHref, AlbumFeed.class);
List<GphotoEntry> entries = albumFeed.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;
}
示例8: declareExtensions
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的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);
}
示例9: movePhoto
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
public void movePhoto(PhotoEntry photo, AlbumEntry destinationAlbum) throws ServiceException, IOException
{
log.info("Moving photo " + photo.getTitle().getPlainText() + " to " + destinationAlbum.getTitle().getPlainText() );
AlbumFeed feed = destinationAlbum.getFeed();
String id = feed.getGphotoId();
photo.setAlbumId(id );
photo.update();
}
示例10: getPhotos
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的package包/类
/**
* Retrieves the photos for the given album.
*/
public List<PhotoEntry> getPhotos(AlbumEntry album) throws IOException,
ServiceException {
List<PhotoEntry> photos = new ArrayList<PhotoEntry>();
// If it doesn't have an ID, it's an album we haven't created yet!
if( album.getLinks().size() != 0 ) {
String feedHref = getLinkByRel(album.getLinks(), Link.Rel.FEED);
feedHref = addParameter(feedHref, "imgmax", "d");
feedHref = addParameter(feedHref, "max-results", "1000");
while (feedHref != null) {
AlbumFeed albumFeed = getFeed(feedHref, AlbumFeed.class);
List<GphotoEntry> entries = albumFeed.getEntries();
for (GphotoEntry entry : entries) {
GphotoEntry adapted = entry.getAdaptedEntry();
if (adapted instanceof PhotoEntry) {
photos.add((PhotoEntry) adapted);
}
}
Link nextLink = albumFeed.getNextLink();
if (nextLink != null) {
feedHref = nextLink.getHref();
} else {
feedHref = null;
}
}
}
TimeUtils.sortPhotoEntriesNewestFirst(photos);
return photos;
}
示例11: getAllImage
import com.google.gdata.data.photos.AlbumFeed; //导入依赖的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;
}