javax.servlet.http.HttpServletRequestWrapper.getContentLength()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(142)

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

HttpServletRequestWrapper.getContentLength介绍

暂无

代码示例

代码示例来源:origin: cloudfoundry/uaa

@Override
public int getContentLength() {
  return super.getContentLength();
}

代码示例来源:origin: sk.seges.acris/acris-security-core

@Override
public int getContentLength() {
  if (bytes == null) {
    return super.getContentLength();
  }
  return bytes.length;
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public int getContentLength()
{
  int contentLength = super.getContentLength();
  return contentLength;
}

代码示例来源:origin: apache/juneau

int getRawContentLength() {
  return super.getContentLength();
}

代码示例来源:origin: FINRAOS/herd

@Override
public int getContentLength()
{
  if (payload == null)
  {
    return super.getContentLength();
  }
  else
  {
    return payload.length;
  }
}

代码示例来源:origin: org.apache.juneau/juneau-rest-server

int getRawContentLength() {
  return super.getContentLength();
}

代码示例来源:origin: com.github.wuic/wuic-servlet

/**
 * {@inheritDoc}
 */
@Override
public int getContentLength() {
  // Synchronized access
  synchronized (mutex) {
    return super.getContentLength();
  }
}

代码示例来源:origin: org.finra.herd/herd-ui

@Override
public int getContentLength()
{
  if (payload == null)
  {
    return super.getContentLength();
  }
  else
  {
    return payload.length;
  }
}

代码示例来源:origin: org.apache.juneau/juneau-server

@Override /* ServletRequest */
public int getContentLength() {
  return contentLength == 0 ? super.getContentLength() : contentLength;
}

代码示例来源:origin: devefx/validator-web

public boolean hasMessageBody() throws IOException {
  if (super.getContentLength() == 0) {
    return false;
  }
  return true;
}

代码示例来源:origin: apache/juneau

int getRawContentLength() {
  return super.getContentLength();
}

代码示例来源:origin: apache/knox

@Override
public int getContentLength() {
 int len;
 String contentType = getContentType();
 // If the content type is a form we might rewrite the body so default it to -1.
 if( contentType != null && contentType.startsWith( "application/x-www-form-urlencoded" ) ) {
  len = -1;
 } else {
  len = super.getContentLength();
 }
 return len;
}

代码示例来源:origin: Jasig/uPortal

@Override
public int getContentLength() {
  this.checkState();
  return super.getContentLength();
}

代码示例来源:origin: org.keycloak/keycloak-servlet-adapter-spi

@Override
public int getContentLength() {
  if (!needRequestRestore) return super.getContentLength();
  String header = getHeader("content-length");
  if (header == null) return -1;
  return Integer.valueOf(header);
}

代码示例来源:origin: org.apache.wink/wink-server

@Override
public int getContentLength() {
  return getCorrectRequest().getContentLength();
}

代码示例来源:origin: org.apache.knox/gateway-provider-identity-assertion-common

@Override
public int getContentLength() {
 int len;
 String contentType = getContentType();
 // If the content type is a form we might rewrite the body so default it to -1.
 if( contentType != null && contentType.startsWith( "application/x-www-form-urlencoded" ) ) {
  len = -1;
 } else {
  len = super.getContentLength();
 }
 return len;
}

代码示例来源:origin: org.jasig.portal/uPortal-rendering

@Override
public int getContentLength() {
  this.checkState();
  return super.getContentLength();
}

代码示例来源:origin: org.apache.flex.blazeds/flex-messaging-core

int length = super.getContentLength();

代码示例来源:origin: org.eclipse.scout.rt/org.eclipse.scout.rt.server.commons

protected BufferedServletInputStream ensureBufferedStream() throws IOException {
 if (m_buf == null) {
  byte[] gzipped = IOUtility.readBytes(super.getInputStream(), super.getContentLength());
  m_compressedLength = gzipped.length;
  m_buf = new BufferedServletInputStream(IOUtility.uncompressGzip(gzipped));
  m_uncompressedLength = m_buf.getLength();
 }
 return m_buf;
}

代码示例来源:origin: nu.validator/validator

/**
   * @see javax.servlet.ServletRequestWrapper#getInputStream()
   */
  @Override
  public ServletInputStream getInputStream() throws IOException {
    if (stream == null) {
      if (super.getContentLength() > sizeLimit) {
        throw new StreamBoundException("Resource size exceeds limit.");
      }
      stream = new DelegatingServletInputStream(new BoundedInputStream(super.getInputStream(), sizeLimit, super.getHeader("Content-Location")));
    }
    return stream;
  }
}

相关文章

HttpServletRequestWrapper类方法