* @return DescribeRequest request object.
* @throws WcsException
*/
public Request getRequest(HttpServletRequest request)
throws WcsException {
DescribeRequest currentRequest = new DescribeRequest((WCSInfo) serviceConfig);
if (keyExists("SERVICE")) {
final String service = getValue("SERVICE");
if (service.trim().toUpperCase().startsWith("WCS")) {
currentRequest.setService(service);
} else {
throw new WcsException("SERVICE parameter is wrong.");
}
} else {
throw new WcsException("SERVICE parameter is mandatory.");
}
if (keyExists("VERSION")) {
final String version = getValue("VERSION");
if (version.equals("1.0.0")) {
currentRequest.setVersion(version);
} else {
throw new WcsException("VERSION parameter is wrong.");
}
} else {
throw new WcsException("VERSION parameter is mandatory.");
}
if (keyExists("REQUEST")) {
final String requestType = getValue("REQUEST");
if (requestType.equalsIgnoreCase("DescribeCoverage")) {
currentRequest.setRequest(requestType);
} else {
throw new WcsException("REQUEST parameter is wrong.");
}
} else {
throw new WcsException("REQUEST parameter is mandatory.");
}
currentRequest.setHttpServletRequest(request);
currentRequest.setVersion(getValue("VERSION"));
currentRequest.setRequest(getValue("REQUEST"));
currentRequest.setOutputFormat(getValue("OUTPUTFORMAT"));
currentRequest.setCoverages(readFlat(getValue("COVERAGE"), INNER_DELIMETER));
return currentRequest;
}