Beispiel #1
0
  /** 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));
  }
Beispiel #2
0
 private String parseBodyContents() {
   body = StreamUtils.getStreamContents(getStream());
   return body;
 }