Meant to send this to only the users list-sorry for double-posting.
I'm coding a GeoServer web service and would like to support a method where
there is XML for the main request and then a zip-file as well. I'm having
trouble figuring out how to reference the zip file in my service code.
I'm sending geoserver a multipart form as input and this gets processed in the
Dispatcher, as it uses ServletFileUpload to parse the request. When Dispatcher
loops thru the return from ServletFileUpload.parseRequest it saves the
individual FileItems into the kvp map if FileItem.isFormField() returns true.
Otherwise the dispatcher assumes the item is an XML file and passes its reader
to request.setInput.
In my case isFormField() will be false for both the xml and zip. There are two
files in the post. One is the application/xml for the body of the request and
the other is the application/zip for the zip file.
If I attach the body (xml) last, my XML will get parsed successfully because a
reader for the body ends up being the last thing passed to Request.setInput().
But then the zip file attachment is not available at all because it got
discarded by the dispatcher since it was a file attachment and therefore not
put into the kvp map. If I attach the body first, the zip file ends up being
the last input passed to Request.setInput() and the whole method fails because
this can't be read by geoserver as a valid method request.
I can easily send the XML as a form-field instead of a file, and I see this
code that supports a form-field called "body"....
if (request.getInput() == null) {
FileItem body = kvpFileItems.get("body");
if (body != null) {
request.setInput(fileItemReader(body));
kvpFileItems.remove("body");
}
}
But this code will not run because request.getInput() is NOT null because it
got set a few lines up when isFormField() on the zip file returned false.
Can anybody help me with how to proceed? It seems like if my multipart request
has a zip file on it then that will be passed to request.setInput(). Then the
code never makes into my service because later on geoserver uses that to figure
o
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users