使用java客户端将照片上传到picasa时出现异常

时间:2012-01-29 12:00:48

标签: java picasa

我正在尝试通过java客户端将照片上传到picasa相册 我的代码是

String albumId = "https://picasaweb.google.com/data/entry/user/grishaster/albumid/5703019408026078449"
PhotoEntry myPhoto = new PhotoEntry();
myPhoto.setTitle(new PlainTextConstruct(name));

MediaFileSource myMedia = new MediaFileSource(new File('pic.jpg'), "image/jpeg");
myPhoto.setMediaSource(myMedia)

PhotoEntry returnedPhoto = picasawebService.insert(new URL(albumId), myPhoto);

我有这样的例外

Bad Request. Stacktrace follows:

Message: Bad Request
   Line | Method
->> 558 | handleErrorResponse in com.google.gdata.client.http.HttpGDataRequest
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   563 | handleErrorResponse in com.google.gdata.client.http.GoogleGDataRequest
|   536 | checkResponse . . . in com.google.gdata.client.http.HttpGDataRequest
|   515 | execute             in     ''
|   535 | execute . . . . . . in com.google.gdata.client.http.GoogleGDataRequest
|   391 | insert              in com.google.gdata.client.media.MediaService
|    41 | addFile . . . . . . in com.ca.imagegallery.GalleryPicasaStorageService
|    25 | addFile             in com.ca.imagegallery.GalleryService
|    69 | uploadImage . . . . in com.ca.imagegallery.GalleryController
|   886 | runTask             in java.util.concurrent.ThreadPoolExecutor$Worker
|   908 | run . . . . . . . . in     ''

0 个答案:

没有答案