congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
HttpHeaderHelper.mapCharset
Code IndexAdd Tabnine to your IDE (free)

How to use
mapCharset
method
in
org.apache.cxf.helpers.HttpHeaderHelper

Best Java code snippets using org.apache.cxf.helpers.HttpHeaderHelper.mapCharset (Showing top 18 results out of 315)

origin: org.apache.cxf/cxf-rt-transports-http

private String setEncoding(final Message inMessage,
              final HttpServletRequest req,
              final String contentType) throws IOException {
  String enc = HttpHeaderHelper.findCharset(contentType);
  if (enc == null) {
    enc = req.getCharacterEncoding();
  }
  // work around a bug with Jetty which results in the character
  // encoding not being trimmed correctly.
  if (enc != null && enc.endsWith("\"")) {
    enc = enc.substring(0, enc.length() - 1);
  }
  if (enc != null || "POST".equals(req.getMethod()) || "PUT".equals(req.getMethod())) {
    //allow gets/deletes/options to not specify an encoding
    String normalizedEncoding = HttpHeaderHelper.mapCharset(enc);
    if (normalizedEncoding == null) {
      String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
                               LOG, enc).toString();
      LOG.log(Level.WARNING, m);
      throw new IOException(m);
    }
    inMessage.put(Message.ENCODING, normalizedEncoding);
  }
  return contentType;
}
protected Message retrieveFromContinuation(HttpServletRequest req) {
origin: org.apache.cxf/cxf-core

public static String mapCharset(String enc) {
  return mapCharset(enc, ISO88591);
}
origin: apache/cxf

public static String mapCharset(String enc) {
  return mapCharset(enc, ISO88591);
}
origin: org.apache.cxf/cxf-api

public static String mapCharset(String enc) {
  return mapCharset(enc, ISO88591);
}    

origin: org.apache.cxf/cxf-common-utilities

public static String mapCharset(String enc) {
  return mapCharset(enc, ISO88591);
}    

origin: org.apache.cxf/cxf-bundle-jaxrs

public static String mapCharset(String enc) {
  return mapCharset(enc, ISO88591);
}    

origin: org.apache.cxf/cxf-rt-transports-http

String normalizedEncoding = HttpHeaderHelper.mapCharset(charset);
if (normalizedEncoding == null) {
  String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
origin: apache/cxf

static String getEncoding(String ct) throws UnsupportedEncodingException {
  String enc = HttpHeaderHelper.findCharset(ct);
  String normalizedEncoding = HttpHeaderHelper.mapCharset(enc, StandardCharsets.UTF_8.name());
  if (normalizedEncoding == null) {
    String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG", LOG, new Object[] {
      enc
    }).toString();
    LOG.log(Level.WARNING, m);
    throw new UnsupportedEncodingException(m);
  }
  return normalizedEncoding;
}
origin: org.apache.camel/camel-cxf

protected void setCharsetWithContentType(Exchange camelExchange) {
  // setup the charset from content-type header
  String contentTypeHeader = ExchangeHelper.getContentType(camelExchange);
  if (contentTypeHeader != null) {
    String charset = HttpHeaderHelper.findCharset(contentTypeHeader);
    String normalizedEncoding = HttpHeaderHelper.mapCharset(charset, Charset.forName("UTF-8").name());
    if (normalizedEncoding != null) {
      camelExchange.setProperty(Exchange.CHARSET_NAME, normalizedEncoding);
    }
  }
}

origin: org.apache.camel/camel-cxf

protected void setCharsetWithContentType(Exchange camelExchange) {
  // setup the charset from content-type header
  String contentTypeHeader = ExchangeHelper.getContentType(camelExchange);
  if (contentTypeHeader != null) {
    String charset = HttpHeaderHelper.findCharset(contentTypeHeader);
    String normalizedEncoding = HttpHeaderHelper.mapCharset(charset, Charset.forName("UTF-8").name());
    if (normalizedEncoding != null) {
      camelExchange.setProperty(Exchange.CHARSET_NAME, normalizedEncoding);
    }
  }
}
origin: apache/cxf

private String setEncoding(final Message inMessage,
              final HttpServletRequest req,
              final String contentType) throws IOException {
  String enc = HttpHeaderHelper.findCharset(contentType);
  if (enc == null) {
    enc = req.getCharacterEncoding();
  }
  // work around a bug with Jetty which results in the character
  // encoding not being trimmed correctly.
  if (enc != null && enc.endsWith("\"")) {
    enc = enc.substring(0, enc.length() - 1);
  }
  if (enc != null || "POST".equals(req.getMethod()) || "PUT".equals(req.getMethod())) {
    //allow gets/deletes/options to not specify an encoding
    String normalizedEncoding = HttpHeaderHelper.mapCharset(enc);
    if (normalizedEncoding == null) {
      String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
                               LOG, enc).toString();
      LOG.log(Level.WARNING, m);
      throw new IOException(m);
    }
    inMessage.put(Message.ENCODING, normalizedEncoding);
  }
  return contentType;
}
protected Message retrieveFromContinuation(HttpServletRequest req) {
origin: org.apache.cxf/cxf-bundle-jaxrs

private String setEncoding(final Message inMessage, 
              final HttpServletRequest req, 
              final String contentType) throws IOException {
  
  String enc = HttpHeaderHelper.findCharset(contentType);
  if (enc == null) {
    enc = req.getCharacterEncoding();
  }
  // work around a bug with Jetty which results in the character
  // encoding not being trimmed correctly.
  if (enc != null && enc.endsWith("\"")) {
    enc = enc.substring(0, enc.length() - 1);
  }
  if (enc != null || "POST".equals(req.getMethod()) || "PUT".equals(req.getMethod())) {
    //allow gets/deletes/options to not specify an encoding
    String normalizedEncoding = HttpHeaderHelper.mapCharset(enc);
    if (normalizedEncoding == null) {
      String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
                               LOG, enc).toString();
      LOG.log(Level.WARNING, m);
      throw new IOException(m);   
    }
    inMessage.put(Message.ENCODING, normalizedEncoding);
  }
  return contentType;
}
protected Message retrieveFromContinuation(HttpServletRequest req) {
origin: org.apache.cxf/cxf-api

String cs = HttpHeaderHelper.findCharset(val);
if (!StringUtils.isEmpty(cs)) {
  message.put(Message.ENCODING, HttpHeaderHelper.mapCharset(cs));
origin: org.apache.cxf/cxf-bundle-jaxrs

String cs = HttpHeaderHelper.findCharset(val);
if (!StringUtils.isEmpty(cs)) {
  message.put(Message.ENCODING, HttpHeaderHelper.mapCharset(cs));
origin: apache/cxf

String cs = HttpHeaderHelper.findCharset(val);
if (!StringUtils.isEmpty(cs)) {
  message.put(Message.ENCODING, HttpHeaderHelper.mapCharset(cs));
origin: org.apache.cxf/cxf-core

String cs = HttpHeaderHelper.findCharset(val);
if (!StringUtils.isEmpty(cs)) {
  message.put(Message.ENCODING, HttpHeaderHelper.mapCharset(cs));
origin: org.apache.cxf/cxf-bundle-jaxrs

String normalizedEncoding = HttpHeaderHelper.mapCharset(charset);
if (normalizedEncoding == null) {
  String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
origin: apache/cxf

String normalizedEncoding = HttpHeaderHelper.mapCharset(charset);
if (normalizedEncoding == null) {
  String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
org.apache.cxf.helpersHttpHeaderHelpermapCharset

Popular methods of HttpHeaderHelper

  • findCharset
  • getHeaderKey
  • getHeader

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now