Code example for StringWriter

Methods: append

0
		System.out.println(TikaUtils.getUrlsFromObject("a"));
	} 
 
	@Test 
	public void testAddTextToDocument() { 
		StringWriter textData = new StringWriter();
		String text = "My text";
		textData.append(text);
 
		String fieldPrefix = "a_";
 
		TikaUtils.addTextToDocument(doc, fieldPrefix, textData);
 
		String field = (String) doc.getContentField(fieldPrefix + "content");
		if (!text.equals(field)) {
			fail("Expected: " + text + " got: " + field);
		} 
	} 
 
	@Test