29 messages in com.googlegroups.google-picasa-data-apiRe: Problems already.| From | Sent On | Attachments |
|---|---|---|
| Larry Borsato | 22 Mar 2007 18:31 | |
| Sven | 23 Mar 2007 10:29 | |
| Larry Borsato | 23 Mar 2007 11:35 | |
| Sven | 26 Mar 2007 09:56 | |
| Larry Borsato | 26 Mar 2007 12:13 | |
| Larry Borsato | 26 Mar 2007 13:10 | |
| Larry Borsato | 26 Mar 2007 13:30 | |
| Sven | 26 Mar 2007 13:34 | |
| Larry Borsato | 26 Mar 2007 14:16 | |
| Larry Borsato | 26 Mar 2007 14:28 | |
| Kyle Marvin | 26 Mar 2007 14:33 | |
| Larry Borsato | 26 Mar 2007 14:59 | |
| Larry Borsato | 26 Mar 2007 15:05 | |
| Kyle Marvin | 26 Mar 2007 15:42 | |
| Larry Borsato | 26 Mar 2007 18:35 | |
| Larry Borsato | 26 Mar 2007 19:32 | |
| Kyle Marvin | 27 Mar 2007 07:20 | |
| Larry Borsato | 27 Mar 2007 12:07 | |
| blima | 29 Mar 2007 10:36 | |
| Larry Borsato | 29 Mar 2007 15:52 | |
| Kyle Marvin | 30 Mar 2007 06:51 | |
| Larry Borsato | 31 Mar 2007 18:46 | |
| Kyle Marvin | 01 Apr 2007 16:04 | |
| Larry Borsato | 01 Apr 2007 16:52 | |
| Larry Borsato | 04 Apr 2007 06:03 | |
| Kyle Marvin | 04 Apr 2007 06:54 | |
| Larry Borsato | 04 Apr 2007 07:49 | |
| Sven | 04 Apr 2007 10:34 | |
| Larry Borsato | 05 Apr 2007 12:26 |
| Subject: | Re: Problems already.![]() |
|---|---|
| From: | Larry Borsato (bors...@gmail.com) |
| Date: | 03/26/2007 03:05:06 PM |
| List: | com.googlegroups.google-picasa-data-api |
Kyle,
This is the relevant code:
PicasawebService myService = new PicasawebService("Bleezer"); PhotoEntry myPhoto = new PhotoEntry(); MediaFileSource myMedia = new MediaFileSource(new File(fullPath), "image/jpeg"); myPhoto.setMediaSource(myMedia); PhotoEntry returnedPhoto = myService.insert(feedUrl, myPhoto);
I get this error:
cannot find symbol : method insert(java.lang.String,com.google.gdata.data.BaseEntry)
Do you see anything wrong with that?
On Mar 26, 5:33 pm, "Kyle Marvin" <kmar...@google.com> wrote:
Hi Larry,
I'm unsure why you are having this issue. As Sven mentioned, the signature of Service.insert() is:
public <E extends BaseEntry> E insert(URL feedUrl, E entry) { ... }
which just says that you pass some subtype of BaseEntry as an argument and it will return an instance of the same type. In the case of posting a a photo, you'd use PhotoEntry and get back a PhotoEntry, which is what it sounds like you are trying to do. There's nothing that says an Entry is expected as an argument based upon this declaration.
Can you be more specific about the compiler error you are getting and also show how myPhoto is being declared (I'm assuming you are following the "Post a new photo" sample).
Thanks!
-- Kyle
On 3/26/07, Larry Borsato <bors...@gmail.com> wrote:
Ok, I had some incorrect jar files, so I'm down to just one error - with the insert(). This line:
PhotoEntry returnedPhoto = myService.insert(feedUrl, myPhoto);
just does not work. It expects an Entry, not a BaseEntry, and PhotoEntry cannot be cast to an Entry.
Any suggestions? Do you folks have this working?
On Mar 26, 12:57 pm, "Sven" <s....@google.com> wrote:
Hi Larry,
What version of java are you using? The java client libraries require java 5 or later. The errors you are seeing look like they might be generics-related. In case that isn't the problem, I'll respond inline to your questions.
On Mar 23, 11:36 am, "Larry Borsato" <bors...@gmail.com> wrote:
Please see my comments prefaced by LB> below.
On Mar 23, 1:30 pm, "Sven" <s....@google.com> wrote:
Hi Larry,
On Mar 22, 6:32 pm, "Larry Borsato" <bors...@gmail.com> wrote:
So I'm looking at the documentation and the code samples within to try to post a photo:
PicasawebService myService = new PicasawebService("lh2", "exampleCo-exampleApp-1");
Whoops, sorry about that. It is wrong in a couple places in the doc, my apologies. Thanks for pointing it out.
MediaFileSource myMedia = new MediaFileSource(new File("/usr/home/liz/ photos/photo23a.jpg"), "image/jpeg"); myPhoto.setMediaSource(myMedia);
- but setMediaSource() doesn't take a MediaFileSource, it takes a MediaSource - even a cast isn't helping
MediaSource is an interface. MediaFileSource extends BaseMediaSource, which implement the MediaSource interface. What particular error are you getting?
LB > I'm seeing no such method as setMediaSource(MediaFileSource). It even complains when I cast this to MediaSource.
I'm sorry, I may not have been clear. MediaSource is the interface that MediaFileSource (indirectly) implements. The method takes any implementation of the interface (you could even write your own). My guess is that either you are on an older version of java or you have some strange class-path issues where you're importing some other version of MediaFileSource.
PhotoEntry returnedPhoto = myService.insert(feedUrl, myPhoto);
- but insert() doesn't take a PhotoEntry, it takes an Entry, and there is no conversion
The signature for the insert method is:
public <E extends BaseEntry> E insert(URL feedUrl, E entry);
BaseEntry is an abstract class that PhotoEntry extends.
LB> Right, but just because Entry and PhotoEntry both extend BaseEntry doesn't mean that they are interchangeable.
The method doesn't take an Entry, it takes a BaseEntry.




