/** * Converts the given HTML code according to the settings of this converter.<p> * * @param htmlInput HTML input stored in a string * @return array of bytes containing the converted HTML * * @throws UnsupportedEncodingException if the encoding set for the conversion is not supported */ public byte[] convertToByte(String htmlInput) throws UnsupportedEncodingException { return convertToString(htmlInput).getBytes(getEncoding()); }
/** * Converts the given HTML code according to the settings of this converter.<p> * * @param htmlInput HTML input stored in an array of bytes * @return string containing the converted HTML * * @throws UnsupportedEncodingException if the encoding set for the conversion is not supported */ public String convertToString(byte[] htmlInput) throws UnsupportedEncodingException { return convertToString(new String(htmlInput, getEncoding())); }
/** * Converts the given HTML code according to the settings of this converter.<p> * * @param htmlInput HTML input stored in an array of bytes * @return array of bytes containing the converted HTML * * @throws UnsupportedEncodingException if the encoding set for the conversion is not supported */ public byte[] convertToByte(byte[] htmlInput) throws UnsupportedEncodingException { return convertToByte(new String(htmlInput, getEncoding())); }
/** * Converts the given HTML code according to the settings of this converter.<p> * * @param htmlInput HTML input stored in a string * @return array of bytes containing the converted HTML * * @throws UnsupportedEncodingException if the encoding set for the conversion is not supported */ public byte[] convertToByte(String htmlInput) throws UnsupportedEncodingException { return convertToString(htmlInput).getBytes(getEncoding()); }
/** * Converts the given HTML code according to the settings of this converter.<p> * * @param htmlInput HTML input stored in an array of bytes * @return string containing the converted HTML * * @throws UnsupportedEncodingException if the encoding set for the conversion is not supported */ public String convertToString(byte[] htmlInput) throws UnsupportedEncodingException { return convertToString(new String(htmlInput, getEncoding())); }
/** * Converts the given HTML code according to the settings of this converter.<p> * * @param htmlInput HTML input stored in an array of bytes * @return array of bytes containing the converted HTML * * @throws UnsupportedEncodingException if the encoding set for the conversion is not supported */ public byte[] convertToByte(byte[] htmlInput) throws UnsupportedEncodingException { return convertToByte(new String(htmlInput, getEncoding())); }
/** * Converts the given HTML code according to the settings of this converter.<p> * * If an any error occurs during the conversion process, the original input is returned unmodified.<p> * * @param htmlInput HTML input stored in a string * @return array of bytes containing the converted HTML */ public byte[] convertToByteSilent(String htmlInput) { try { return convertToByte(htmlInput.getBytes(getEncoding())); } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e); } try { return htmlInput.getBytes(getEncoding()); } catch (UnsupportedEncodingException e1) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e1); } return htmlInput.getBytes(); } } }
/** * Converts the given HTML code according to the settings of this converter.<p> * * If an any error occurs during the conversion process, the original input is returned unmodified.<p> * * @param htmlInput HTML input stored in a string * @return array of bytes containing the converted HTML */ public byte[] convertToByteSilent(String htmlInput) { try { return convertToByte(htmlInput.getBytes(getEncoding())); } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e); } try { return htmlInput.getBytes(getEncoding()); } catch (UnsupportedEncodingException e1) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e1); } return htmlInput.getBytes(); } } }
/** * Converts the given HTML code according to the settings of this converter.<p> * * If an any error occurs during the conversion process, the original input is returned unmodified.<p> * * @param htmlInput HTML input stored in an array of bytes * * @return string containing the converted HTML */ public String convertToStringSilent(byte[] htmlInput) { try { return convertToString(htmlInput); } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e); } try { return new String(htmlInput, getEncoding()); } catch (UnsupportedEncodingException e1) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e1); } return new String(htmlInput); } } }
/** * Converts the given HTML code according to the settings of this converter.<p> * * If an any error occurs during the conversion process, the original input is returned unmodified.<p> * * @param htmlInput HTML input stored in an array of bytes * * @return string containing the converted HTML */ public String convertToStringSilent(byte[] htmlInput) { try { return convertToString(htmlInput); } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e); } try { return new String(htmlInput, getEncoding()); } catch (UnsupportedEncodingException e1) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e1); } return new String(htmlInput); } } }
I_CmsHtmlConverter converter = (I_CmsHtmlConverter)Class.forName(className).newInstance(); converter.init(getEncoding(), modes);
I_CmsHtmlConverter converter = (I_CmsHtmlConverter)Class.forName(className).newInstance(); converter.init(getEncoding(), modes);