Creating a subfolder

9 views
Skip to first unread message

augusto callejas

unread,
May 25, 2010, 3:25:28 PM5/25/10
to gdata-java-client
hi-

i'm trying to create a subfolder in an existing folder, but i keep
getting "Invalid request URI":

===
public DocumentListEntry createFolder(final DocumentListEntry
parentFolder, final String folderName) throws IOException,
ServiceException
{
final URL destFolderUrl = new URL("http://docs.google.com/feeds/
folders/private/full/" + parentFolder.getResourceId());

final FolderEntry newFolder = new FolderEntry();
newFolder.setTitle(new PlainTextConstruct(folderName));

return client.insert(destFolderUrl, newFolder);
}
===

but i get "Invalid request URI"

===
Exception in thread "main"
com.google.gdata.util.InvalidEntryException: Invalid request URI
<errors xmlns='http://schemas.google.com/g/2005'>
<error>
<domain>GData</domain>
<code>invalidRequestUri</code>
<internalReason>Invalid request URI</internalReason>
</error>
</errors>

at
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:
590)
at
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:
563)
at
com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:
550)
at
com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:
530)
at
com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:
535)
at com.google.gdata.client.Service.insert(Service.java:1376)
at com.google.gdata.client.GoogleService.insert(GoogleService.java:
599)
at
com.google.gdata.client.media.MediaService.insert(MediaService.java:
381)
===

this page says to modify the "createNewDocument" method to create a
subfolder:

http://code.google.com/apis/documents/docs/2.0/developers_guide_java.html#FoldersCreating
http://code.google.com/apis/documents/docs/2.0/developers_guide_java.html#UploadingToFolder

and i'm using the uri in the second link, but i still get this error.

any ideas?

thanks,
augusto.

Yaniv Inbar (יניב ענבר)

unread,
May 25, 2010, 4:07:50 PM5/25/10
to gdata-ja...@googlegroups.com
Augusto,
Please post your question at the Google Documents List API Forum:
-- Yaniv

augusto callejas

unread,
May 25, 2010, 4:32:00 PM5/25/10
to gdata-java-client
i will, but i'm concerned since it has java code, they will tell me to
post it here instead, but i'll try.

On May 25, 1:07 pm, Yaniv Inbar (יניב ענבר) <yanivin...@gmail.com>
wrote:
> Augusto,
> Please post your question at the Google Documents List API Forum:http://www.google.com/support/forum/p/apps-apis/label?lid=5c316c702e8...
> <http://www.google.com/support/forum/p/apps-apis/label?lid=5c316c702e8...>--

> >http://code.google.com/apis/documents/docs/2.0/developers_guide_java....
>
> >http://code.google.com/apis/documents/docs/2.0/developers_guide_java....

Reply all
Reply to author
Forward
0 new messages