abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erling Wegger Linde" <erlin...@gmail.com>
Subject Re: How to properly set Mime Type on an Entry
Date Thu, 21 Aug 2008 10:16:55 GMT
On Thu, Aug 21, 2008 at 12:04 PM, David Calavera
<david.calavera@gmail.com> wrote:
> Hi Erling, what abdera version are you using? This test works fine in the
> development version:
>
> Abdera abdera = new Abdera();
> Entry entry = abdera.newEntry();
> entry.setContent("", "text/rdf+n3");
> assertEquals("text/rdf+n3", entry.getContentMimeType().toString());

<dependency>
	<groupId>org.apache.abdera</groupId>
	<artifactId>abdera-client</artifactId>
	<version>0.4.0-incubating</version>
</dependency>

But I got it to work with:

		Factory abderaFactory = abdera.getFactory();		
		Content content = abderaFactory.newContent();		
		content.setValue(project.toN3());
		content.setMimeType("text/rdf+n3");		
		entry.setContentElement(content);

So that'll do fine for now =)

Thanks,
- Erling

>
> On Thu, Aug 21, 2008 at 11:22 AM, Erling Wegger Linde <erlingwl@gmail.com>wrote:
>
>> Hi,
>>
>> I've just switched from Propono to Abdera on the client side, and I
>> think Abdera gives you more control, so I like it so far =)
>>
>> But I haven't figured out how to set the Mime Type correctly:
>>
>>                entry.setContent(project.toN3(), "text/rdf+n3");
>>
>>                System.out.println(entry.getContentMimeType()); // THIS
>> GIVES
>> "text/plain, what do I do wrong?
>>
>> Thanks,
>> Erling
>>
>
>
>
> --
> David Calavera
> http://www.thinkincode.net
>



-- 
Med vennlig hilsen
Erling Wegger Linde

Mime
View raw message