} else if (StringUtils.isNotBlank(file)) {
Response f = repository.getResource(file);
filecontent = new String((byte[]) f.getEntity());
}
if (StringUtils.isBlank(filecontent)) {
throw new SaikuServiceException(
"Cannot create new query. Empty file content " + StringUtils.isNotBlank(json) + " or read from file:"
+ file);
}
if (thinQueryService.isOldQuery(filecontent)) {
tq = thinQueryService.convertQuery(filecontent);
} else {
ObjectMapper om = new ObjectMapper();
tq = om.readValue(filecontent, ThinQuery.class);
}
if (LOG.isDebugEnabled()) {
LOG.debug("TRACK\t" + "\t/query/" + queryName + "\tPOST\t tq:" + (tq == null) + " file:" + file);
}
if (tq == null) {
throw new SaikuServiceException("Cannot create blank query (ThinQuery object = null)");
}
tq.setName(queryName);
//SaikuCube cube = tq.getCube();
//if (StringUtils.isNotBlank(xml)) {