You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by Erling Wegger Linde <er...@gmail.com> on 2008/08/21 11:22:59 UTC

How to properly set Mime Type on an Entry

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

Re: How to properly set Mime Type on an Entry

Posted by Erling Wegger Linde <er...@gmail.com>.
On Thu, Aug 21, 2008 at 12:04 PM, David Calavera
<da...@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 <er...@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

Re: How to properly set Mime Type on an Entry

Posted by David Calavera <da...@gmail.com>.
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());

On Thu, Aug 21, 2008 at 11:22 AM, Erling Wegger Linde <er...@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