congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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