public Object getAttributeValue(final String pName) { TransferAttribute lRes = getAttribute(pName.toLowerCase()); return lRes != null ? lRes.getValue() : null; }
public Transferable createTextualTransferable(final String pContentType, final String pPayLoad, final String pTargetCharset) { Transferable lTransferable = new TransferableImpl(); lTransferable.setPayload(new TextualPayload(pPayLoad, pTargetCharset)); if (pContentType != null) { String contentType = addCharset(pContentType, pTargetCharset); lTransferable.addAttribute(HttpHeaderAttribute.createHttpHeaderAttribute( HttpHeaderAttribute.HEADER_NAME_CONTENTTYPE, contentType)); } if (pTargetCharset != null) { lTransferable.addAttribute(HttpHeaderAttribute.createHttpHeaderAttribute( HttpHeaderAttribute.HEADER_NAME_CONTENTCHARSET, pTargetCharset)); } return lTransferable; }
public Transferable createStreamTransferable(final String pContentType, final InputStream pPayLoad, final String pCharset) throws IOException { Transferable lTransferable = new TransferableImpl(); lTransferable.setPayload(new StreamPayload(pPayLoad, pCharset)); if (pContentType != null) { String contentType = addCharset(pContentType, pCharset); lTransferable.addAttribute(HttpHeaderAttribute.createHttpHeaderAttribute( HttpHeaderAttribute.HEADER_NAME_CONTENTTYPE, contentType)); } if (pCharset != null) { lTransferable.addAttribute(HttpHeaderAttribute.createHttpHeaderAttribute( HttpHeaderAttribute.HEADER_NAME_CONTENTCHARSET, pCharset)); } return lTransferable; }