use of org.apache.http.entity.EntityTemplate in project jena by apache.
the class TestDatasetOps method datasetToHttpEntity.
/** Create an HttpEntity for the graph */
protected HttpEntity datasetToHttpEntity(final DatasetGraph dsg) {
final RDFFormat syntax = RDFFormat.NQUADS;
EntityTemplate entity = new EntityTemplate((out) -> RDFDataMgr.write(out, dsg, syntax));
String ct = syntax.getLang().getContentType().getContentType();
entity.setContentType(ct);
return entity;
}
Aggregations