if(requestUriSegments.length > 2) {
String csvStoreList = requestUriSegments[2];
String[] storeArray = csvStoreList.split(",");
storeList = Lists.newArrayList(storeArray);
}
HttpMethod httpMethod = request.getMethod();
if(httpMethod.equals(HttpMethod.GET)) {
response = handleGet(storeList);
} else if(httpMethod.equals(HttpMethod.POST)) {
Map<String, Properties> configsToPut = Maps.newHashMap();
ChannelBuffer content = this.request.getContent();
if(content != null) {
byte[] postBody = new byte[content.capacity()];
content.readBytes(postBody);
configsToPut = ClientConfigUtil.readMultipleClientConfigAvro(new String(postBody));
}
response = handlePut(configsToPut);
} else if(httpMethod.equals(HttpMethod.DELETE)) {
if(storeList.size() == 0) {
response = handleBadRequest(
"Cannot delete config for all stores. Please specify at least one store name.");
} else {
response = handleDelete(storeList);