org.apache.tomcat.util.buf.B2CConverter.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.apache.tomcat.util.buf.B2CConverter.<init>()方法的一些代码示例,展示了B2CConverter.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。B2CConverter.<init>()方法的具体详情如下:
包路径:org.apache.tomcat.util.buf.B2CConverter
类名称:B2CConverter
方法名:<init>

B2CConverter.<init>介绍

暂无

代码示例

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
  public B2CConverter run() throws IOException {
    return new B2CConverter(charset);
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public B2CConverter run() throws IOException {
  return new B2CConverter(enc);
}

代码示例来源:origin: org.jboss.web/jbossweb

public B2CConverter run() throws IOException {
    return new B2CConverter(enc);
  }
});

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

@Override
public B2CConverter run() throws IOException {
  return new B2CConverter(enc);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
  public B2CConverter run() throws IOException {
    return new B2CConverter(charset);
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

@Override
public B2CConverter run() throws IOException {
  return new B2CConverter(enc);
}

代码示例来源:origin: jboss.web/jbossweb

public Object run() throws IOException{
  return new B2CConverter(enc);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

public B2CConverter run() throws IOException {
  return new B2CConverter(enc);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

public B2CConverter run() throws IOException {
  return new B2CConverter(enc);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

public B2CConverter run() throws IOException {
  return new B2CConverter(enc);
}

代码示例来源:origin: tomcat/catalina

public Object run() throws IOException{
  return new B2CConverter(enc);
}

代码示例来源:origin: jboss.remoting/jboss-remoting

protected void setConverter()
   throws IOException
{
 if(coyoteRequest != null)
 {
   enc = coyoteRequest.getCharacterEncoding();
 }
 gotEnc = true;
 if(enc == null)
 {
   enc = DEFAULT_ENCODING;
 }
 conv = (B2CConverter) encoders.get(enc);
 if(conv == null)
 {
   conv = new B2CConverter(enc);
   encoders.put(enc, conv);
 }
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

private static B2CConverter createConverter(Charset charset) throws IOException {
  if (SecurityUtil.isPackageProtectionEnabled()) {
    try {
      return AccessController.doPrivileged(new PrivilegedCreateConverter(charset));
    } catch (PrivilegedActionException ex) {
      Exception e = ex.getException();
      if (e instanceof IOException) {
        throw (IOException) e;
      } else {
        throw new IOException(e);
      }
    }
  } else {
    return new B2CConverter(charset);
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

protected void setConverter()
  throws IOException {
  if (coyoteRequest != null)
    enc = coyoteRequest.getCharacterEncoding();
  gotEnc = true;
  enc = (enc == null) ? DEFAULT_ENCODING : enc.toUpperCase(Locale.US);
  conv = encoders.get(enc);
  if (conv == null) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
      try {
        conv = (B2CConverter) AccessController
            .doPrivileged(new PrivilegedExceptionAction<B2CConverter>() {
              public B2CConverter run() throws IOException {
                return new B2CConverter(enc);
              }
            });
      } catch (PrivilegedActionException ex) {
        Exception e = ex.getException();
        if (e instanceof IOException)
          throw (IOException) e;
      }
    } else {
      conv = new B2CConverter(enc);
    }
    encoders.put(enc, conv);
  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

protected void setConverter()
  throws IOException {
  if (coyoteRequest != null)
    enc = coyoteRequest.getCharacterEncoding();
  gotEnc = true;
  if (enc == null)
    enc = DEFAULT_ENCODING;
  conv = encoders.get(enc);
  if (conv == null) {
    if (SecurityUtil.isPackageProtectionEnabled()){
      try{
        conv = AccessController.doPrivileged(
            new PrivilegedExceptionAction<B2CConverter>(){
              public B2CConverter run() throws IOException {
                return new B2CConverter(enc);
              }
            }
        );              
      }catch(PrivilegedActionException ex){
        Exception e = ex.getException();
        if (e instanceof IOException)
          throw (IOException)e; 
      }
    } else {
      conv = new B2CConverter(enc);
    }
    encoders.put(enc, conv);
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

private static B2CConverter createConverter(Charset charset) throws IOException {
  if (SecurityUtil.isPackageProtectionEnabled()) {
    try {
      return AccessController.doPrivileged(new PrivilegedCreateConverter(charset));
    } catch (PrivilegedActionException ex) {
      Exception e = ex.getException();
      if (e instanceof IOException) {
        throw (IOException) e;
      } else {
        throw new IOException(e);
      }
    }
  } else {
    return new B2CConverter(charset);
  }
}

代码示例来源:origin: jboss.web/jbossweb

protected void setConverter()
  throws IOException {
  if (coyoteRequest != null)
    enc = coyoteRequest.getCharacterEncoding();
  gotEnc = true;
  if (enc == null)
    enc = DEFAULT_ENCODING;
  conv = encoders.get(enc);
  if (conv == null) {
    if (SecurityUtil.isPackageProtectionEnabled()){
      try{
        conv = (B2CConverter)AccessController.doPrivileged(
            new PrivilegedExceptionAction(){
              public Object run() throws IOException{
                return new B2CConverter(enc);
              }
            }
        );              
      }catch(PrivilegedActionException ex){
        Exception e = ex.getException();
        if (e instanceof IOException)
          throw (IOException)e; 
      }
    } else {
      conv = new B2CConverter(enc);
    }
    encoders.put(enc, conv);
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

protected void setConverter()
  throws IOException {
  if (coyoteRequest != null)
    enc = coyoteRequest.getCharacterEncoding();
  gotEnc = true;
  if (enc == null)
    enc = DEFAULT_ENCODING;
  conv = encoders.get(enc);
  if (conv == null) {
    if (SecurityUtil.isPackageProtectionEnabled()){
      try{
        conv = AccessController.doPrivileged(
            new PrivilegedExceptionAction<B2CConverter>(){
              public B2CConverter run() throws IOException {
                return new B2CConverter(enc);
              }
            }
        );              
      }catch(PrivilegedActionException ex){
        Exception e = ex.getException();
        if (e instanceof IOException)
          throw (IOException)e; 
      }
    } else {
      conv = new B2CConverter(enc);
    }
    encoders.put(enc, conv);
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Character conversion of the URI.
 *
 * @param uri MessageBytes object containing the URI
 * @param request The Servlet request object
 * @throws IOException if a IO exception occurs sending an error to the client
 */
protected void convertURI(MessageBytes uri, Request request) throws IOException {
  ByteChunk bc = uri.getByteChunk();
  int length = bc.getLength();
  CharChunk cc = uri.getCharChunk();
  cc.allocate(length, -1);
  Charset charset = connector.getURICharset();
  B2CConverter conv = request.getURIConverter();
  if (conv == null) {
    conv = new B2CConverter(charset, true);
    request.setURIConverter(conv);
  } else {
    conv.recycle();
  }
  try {
    conv.convert(bc, cc, true);
    uri.setChars(cc.getBuffer(), cc.getStart(), cc.getLength());
  } catch (IOException ioe) {
    // Should never happen as B2CConverter should replace
    // problematic characters
    request.getResponse().sendError(HttpServletResponse.SC_BAD_REQUEST);
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Character conversion of the URI.
 *
 * @param uri MessageBytes object containing the URI
 * @param request The Servlet request object
 * @throws IOException if a IO exception occurs sending an error to the client
 */
protected void convertURI(MessageBytes uri, Request request) throws IOException {
  ByteChunk bc = uri.getByteChunk();
  int length = bc.getLength();
  CharChunk cc = uri.getCharChunk();
  cc.allocate(length, -1);
  Charset charset = connector.getURICharset();
  B2CConverter conv = request.getURIConverter();
  if (conv == null) {
    conv = new B2CConverter(charset, true);
    request.setURIConverter(conv);
  } else {
    conv.recycle();
  }
  try {
    conv.convert(bc, cc, true);
    uri.setChars(cc.getBuffer(), cc.getStart(), cc.getLength());
  } catch (IOException ioe) {
    // Should never happen as B2CConverter should replace
    // problematic characters
    request.getResponse().sendError(HttpServletResponse.SC_BAD_REQUEST);
  }
}

相关文章

微信公众号

最新文章

更多