Hi list,

I am trying to upload (put) .xml files to my restlet server via curl:
curl -T <file.xml> http://<server>/<path>/<resource>.xml

In my resource's constructor I set the supported media type via:
getVariant().add(new Variant(MediaType.APPLICATION_XML));

Unfortunately in my resource's put method, when I am trying to get the
media type via getMediaType, it returns null:

public void put (Representation entity)
{
if (entity.getMediaType().equals(MediaType.APPLICATION_XML)) {
// throws NullPointerException because getMediaType returns null :(
...
}
}

So I was wondering if I have to set the media type manually myself
somewhere or what I am doing wrong that it doesn't get set correctly
automatically?

Thanks a lot,
Rico

Reply via email to