Google's developer guide explains how to upload photos to the Picasa Web Albums, but how do I download the image file in Java so that I can save it on my local machine?
1 Answer 1
I don't really have any familiarity with the Picasa Web Albums API, but this is what I think may work by just looking at the Javadocs:
// read all photos from an album
URL feedUrl = "https://picasaweb.google.com/data/feed/api/user/username/albumid/albumid";
AlbumFeed feed = myService.getFeed(feedUrl, AlbumFeed.class);
for(PhotoEntry photo : feed.getPhotoEntries()) {
MediaSource mediaSource = photo.getMediaSource();
InputStream photoInputStream = mediaSource.getInputStream();
// read from the photoInputStream here to get contents of photo
}
answered Dec 23, 2010 at 5:20
Sign up to request clarification or add additional context in comments.
1 Comment
salexander
I apologize for the self-comment, but you can use the MediaSource.getContentType() method to figure out what type of file you have.
lang-java