String contentsType = request.getHeader("Content-type");
//TODO contentsType별로 핸들러 분리
//TODO 일단 json만..
Handler handler = null;
if("application/json".equals(contentsType)) {
handler = new JsonDataHandler();
}
String collectionName = request.getParameter("collection_name");
logger.info("collection name : {}", collectionName);
StringBuilder text = new StringBuilder();
try {
BufferedReader reader = request.getReader();
String tmp = "";
while((tmp = reader.readLine()) != null) {
text.append(tmp);
//logger.info(tmp);
}
reader.close();
IndexingRequestForm indexingRequestForm = handler.handledData(text.toString());
// CrescentCollectionHandler collectionHandler
// = SpringApplicationContext.getBean("crescentCollectionHandler", CrescentCollectionHandler.class);
CrescentCollection collection = collectionHandler.getCrescentCollections().getCrescentCollection(collectionName);