PublicApiHttpServletRequest.java 文件源码

java
阅读 37 收藏 0 点赞 0 评论 0

项目:alfresco-remote-api 作者:
private static HttpServletRequest getWrappedHttpServletRequest(HttpServletRequest request) throws IOException
{
    //TODO is it really necessary to wrap the request into a BufferedInputStream?
    // If not, then we could remove the check for multipart upload. 
    // The check is needed as we get an IOException (Resetting to invalid mark) for files more than 8193 bytes. 
    boolean resetSupported = true;
    String contentType = request.getHeader(HEADER_CONTENT_TYPE);
    if (contentType != null && contentType.startsWith(MULTIPART_FORM_DATA))
    {
       resetSupported = false;
    }
    final PublicApiServletInputStream sis = new PublicApiServletInputStream(request.getInputStream(), resetSupported);
    HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper(request)
    {
        public ServletInputStream getInputStream() throws java.io.IOException
        {
            return sis;
        }
    };
    return wrapper;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号