/** Cluster data from an XML file (local). */ public void clusterFromFile() throws IOException { final Map<String, String> attributes = new LinkedHashMap<String, String>(); System.out.println("## Clustering documents from a local file"); /* * Note the optional query attribute, we can provide it to avoid creation of * trivial clusters. */ attributes.put( "dcs.c2stream", new String(StreamUtils.readFullyAndClose(new FileInputStream(XML_FILE_PATH)), "UTF-8")); attributes.put("query", "data mining"); displayResults(httpPoster.post(dcsURI, attributes)); }
private String parseBodyContents() { body = StreamUtils.getStreamContents(getStream()); return body; }