intanto 27k messaggi in 2 ore non va bene: nessuno è pagato per rispondere qui.
secondo, usa la benedetta funzione "cerca": di upload / jsp se n'è parlato almeno un milione di volte e ci sono altrettanti thread. Se non ti piacessero, usa un qualsiasi altro motore di ricerca. Poi quando ha riordinato le idee su quel che devi fare (e ti dico già che del percorso completo al file - evidentemente sul client - te ne deve interessare poco - anzi, certi browser proprio non lo passano). Se poi non trovi come si fa l'upload con le api di google (mai usate), si va su google et voilà:
http://code.google.com/intl/it-IT/ap...uide_java.html
scorri un po' ed esce:
Uploading attachments
codice:
MimetypesFileTypeMap mediaTypes = new MimetypesFileTypeMap();
mediaTypes.addMimeTypes("application/msword doc");
mediaTypes.addMimeTypes("application/vnd.ms-excel xls");
mediaTypes.addMimeTypes("application/pdf pdf");
mediaTypes.addMimeTypes("text/richtext rtx");
// ... See a more complete list of mime types in the SitesHelper.java
public AttachmentEntry uploadAttachment(File file, BasePageEntry<?> parentPage,
String title, String description) throws IOException, ServiceException {
AttachmentEntry newAttachment = new AttachmentEntry();
newAttachment.setMediaSource(new MediaFileSource(file, mediaTypes.getContentType(file)));
newAttachment.setTitle(new PlainTextConstruct(title));
newAttachment.setSummary(new PlainTextConstruct(description));
newAttachment.addLink(SitesLink.Rel.PARENT, Link.Type.ATOM, parentPage.getSelfLink().getHref());
return client.insert(new URL(buildContentFeedUrl()), newAttachment);
}
ContentFeed contentFeed = client.getFeed(new URL(buildContentFeedUrl() + "?kind=filecabinet"), ContentFeed.class);
FileCabinetPageEntry parentPage = contentFeed.getEntries(FileCabinetPageEntry.class).get(0);
AttachmentEntry attachment = uploadAttachment(
new File("/path/to/your/file.pdf"), parentPage, "Getting Started", "HR packet");
System.out.println("Uploaded!");