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 Julian Klein <ce...@yahoo.com> on 2002/12/17 01:30:17 UTC

Error When Implementing new HTTP doPOST - Conflict: Must not be Collection

Hi all,

  I implemented my own version of a doPOST method by
first allowing the default PostMethod to be created
via the MethodFactory in the webdavservlet (rather
than to be passed to super()).  The PostMethod
apparently calls the PutMethod (its superclass).  I
then implemented a component of mine in the PutMethod
to remove the mulitpart-form encodings before passing
the bytes to the appropriate descriptor object:

if(req.getMethod().equalsIgnoreCase("POST")) {
   //remove multipart encoding
   MultiPartUpload mu = new MultiPartUpload();
   mu.parseRequest(req);   
revisionContent.setContent(mu.getBytes());
 else {       
revisionContent.setContent(req.getInputStream());
}

However, when I post my file I get an error which
indicates: Conflict: Must not be collection.  I tried
various file types via the upload to no avail.  I am
100% certain my decoding bean for the multipart data
is accurate. I believe the error is generated via the
WebdavUtils.isCollection() method call:

                if
(WebdavUtils.isCollection(oldRevisionDescriptor)) {
                    int statusCode =
WebdavStatus.SC_METHOD_NOT_ALLOWED;
                    sendError( statusCode,
getClass().getName()+".mustNotBeCollection" );
                    throw new WebdavException(
statusCode );
                }

, but cannot find this in the javadoc.

Overall these are the only places I adjust the
incoming request.  Perhaps I do need to alter some
other points, such as where the content-type, etc. are
determined from the request?  Has anyone implemented
this functionality yet?  I believe this to be the
right track, any help is greatly appreciated.

Thanks in advance,
Julian



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>