You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by David Calavera <da...@gmail.com> on 2007/08/10 10:48:07 UTC

Media ranges allowed for a collection

Hi,

I'd like to know if this is the correct behavior for the "setAccept" method
into "Collection" class:

The MimeTypeHelper drops the "entry" content type when I add several
parameters and one of this is the keyword "entry".

Ie:

the source code:
    Collection users = workspace.addCollection("Users", USERS_URL);
    users.setAccept(new String[]{"multipart/form-data", "entry"});

the output:

    <collection href="/api/v1/users">
      <atom:title type="text">Users</atom:title>
      <accept>multipart/form-data</accept>
    </collection>

Regards

-- 
David Calavera
http://www.thinkincode.net

Re: Media ranges allowed for a collection

Posted by James M Snell <ja...@gmail.com>.
That's a bug.  FWIW, the "entry" keyword is no longer used in the final
version of the Atompub draft.  All of the values need to be valid media
ranges.  The error was being ignored and the "entry" was being silently
dropped.  I've fixed the code in trunk so that the mime type parse
exception is not hidden and that the "entry" token is automatically
converted into the proper application/atom+xml;type="entry" media type.

- James

David Calavera wrote:
> Hi,
> 
> I'd like to know if this is the correct behavior for the "setAccept" method
> into "Collection" class:
> 
> The MimeTypeHelper drops the "entry" content type when I add several
> parameters and one of this is the keyword "entry".
> 
> Ie:
> 
> the source code:
>     Collection users = workspace.addCollection("Users", USERS_URL);
>     users.setAccept(new String[]{"multipart/form-data", "entry"});
> 
> the output:
> 
>     <collection href="/api/v1/users">
>       <atom:title type="text">Users</atom:title>
>       <accept>multipart/form-data</accept>
>     </collection>
> 
> Regards
>