You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Alex Pakka <al...@xenotex.com> on 2006/03/02 19:40:00 UTC

WCK/SLIDE to set Content-Type when returning resourceStream

Hi, all!

I have an implementation of BasicWebdavStore with 
WebdavStoreSinglePropertyExtension.
SinglePropertyExtension properly sets "DAV:getcontenttype" to some MIME 
type. On a client side, PROPFIND returns this content type to be exactly 
as set. However,
sniffing the traffic, SLIDE servlet does not set HTTP Content-Type to 
match the one in the PROPFIND:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
ETag: ""
Content-Language:
Last-Modified: Wed, 01 Mar 2006 21:21:48 GMT
Content-Type:
Content-Length: 24064
Date: Thu, 02 Mar 2006 18:20:03 GMT
<...content...>

Is it intended or a bug?

Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: WCK/SLIDE to set Content-Type when returning resourceStream

Posted by Alex Pakka <al...@xenotex.com>.
Hi!

I resolved the issue after some time spent with debugger. For some 
reason one should return "DAV::getcontenttype" (note double colon mark). 
I.e. my implementation looks like this:

public class VirtualFileSystemStoreImpl implements 
WebdavStoreSinglePropertyExtension {
.....
public Map getProperties(String string) throws ServiceAccessException, 
AccessDeniedException, ObjectNotFoundException, ObjectLockedException {
        Properties p = new Properties();
        p.setProperty("DAV::getcontenttype","application/msword");
        return p;
}
....
}

(obviously, in reality Properties p is static final constant in the class)

I am not familiar with Apache patching process, but many people after me 
will be greateful if someone in the loop could fix JavaDoc for 
WebdavStoreSinglePropertyExtension, which talks about single colon.

Alex

> Hi, all!
>
> I have an implementation of BasicWebdavStore with 
> WebdavStoreSinglePropertyExtension.
> SinglePropertyExtension properly sets "DAV:getcontenttype" to some 
> MIME type. On a client side, PROPFIND returns this content type to be 
> exactly as set. However,
> sniffing the traffic, SLIDE servlet does not set HTTP Content-Type to 
> match the one in the PROPFIND:
>
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> ETag: ""
> Content-Language:
> Last-Modified: Wed, 01 Mar 2006 21:21:48 GMT
> Content-Type:
> Content-Length: 24064
> Date: Thu, 02 Mar 2006 18:20:03 GMT
> <...content...>
>
> Is it intended or a bug?
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org