String mt = "text/plain"; Charset ISO8859_4 = Charset.forName("ISO-8859-4"); ContentSink cs = contentItemFactory.createContentSink(mt+"; charset="+ISO8859_4.name()); assertNotNull(cs); assertNotNull(cs.getBlob());
String mt = "text/plain"; Charset ISO8859_4 = Charset.forName("ISO-8859-4"); ContentSink cs = contentItemFactory.createContentSink(mt+"; charset="+ISO8859_4.name()); assertNotNull(cs); assertNotNull(cs.getBlob());
@Test public void testContentSinkDefaultMimeType() throws IOException { String DEFAULT = "application/octet-stream"; ContentSink cs = contentItemFactory.createContentSink(null); assertNotNull(cs); assertNotNull(cs.getBlob()); assertNotNull(cs.getBlob().getMimeType()); //get MimeType MUST return the simple mime type assertEquals(DEFAULT, cs.getBlob().getMimeType()); assertNull(cs.getBlob().getParameter().get("charset")); }
@Test public void testContentSinkDefaultMimeType() throws IOException { String DEFAULT = "application/octet-stream"; ContentSink cs = contentItemFactory.createContentSink(null); assertNotNull(cs); assertNotNull(cs.getBlob()); assertNotNull(cs.getBlob().getMimeType()); //get MimeType MUST return the simple mime type assertEquals(DEFAULT, cs.getBlob().getMimeType()); assertNull(cs.getBlob().getParameter().get("charset")); }
plainTextSink = ciFactory.createContentSink(TEXT_PLAIN +"; charset="+UTF8.name()); } catch (IOException e) { if(!plainMediaType.equals(XHTML)){ //do not parse XHTML from XHTML try { xhtmlSink = ciFactory.createContentSink(XHTML +"; charset="+UTF8.name()); } catch (IOException e) { throw new EngineException("Error while initialising Blob for" +