2
谷歌的开发者指南介绍了如何upload photos到Picasa网络相册,但我怎么下载的图像文件在Java中,这样我可以将它保存在我的本地机器上?怎样下载Picasa网络API图片在Java中
谷歌的开发者指南介绍了如何upload photos到Picasa网络相册,但我怎么下载的图像文件在Java中,这样我可以将它保存在我的本地机器上?怎样下载Picasa网络API图片在Java中
我真的没有与Picasa网络相册API的熟悉,但是这是我认为可以通过看的Javadoc工作:
// 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
}
我的自我评论道歉,但你可以使用MediaSource.getContentType()方法来找出你有什么类型的文件。 – salexander 2010-12-23 05:22:07