/*
@see javax.servlet.ServletRequest#getContentLength()
331896
@Trivial
    @Override
    public int getContentLength() {
        long rc = this.request.getContentLength();
        // TODO what should we be doing here?
        if (rc > Integer.MAX_VALUE) {
            rc = Integer.MAX_VALUE;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getContentLength: " + rc);
        }
        return (int) rc;

    }
1088181
@Override
    public String getLayoutContent(LayoutIdentifier layout) {
        return propertyService.getValue(getPropertyName(layout.shared), layout.name);
    }
653913
public Content getContentHeader() {
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
        div.addStyle(HtmlStyle.contentContainer);
        return div;
    }
1289866
public String getContentId() {
        String[] values = getMimeHeader("Content-ID");
        if (values != null && values.length > 0)
            return values[0];
        return null;
    }
745240
public function getContentLength(): ?int
    {
        $result = $this->serverRequest->getHeader('Content-Length');
        return $result ? (int) $result[0] : null;
    }
582061
public long getContentLength() {
		String value = getFirst(CONTENT_LENGTH);
		return (value != null ? Long.parseLong(value) : -1);
	}
7410
public static void setContentLength(HttpMessage message, long length) {
        message.headers().set(HttpHeaderNames.CONTENT_LENGTH, length);
    }
1006124
static long getContentLength(SignableRequest<?> request) throws IOException {
        final InputStream content = request.getContent();
        if (!content.markSupported())
            throw new IllegalStateException("Bug: request input stream must have been made mark-and-resettable at this point");
        ReadLimitInfo info = request.getReadLimitInfo();
        final int readLimit = info.getReadLimit();
        long contentLength = 0;
        byte[] tmp = new byte[4096];
        int read;
        content.mark(readLimit);
        while ((read = content.read(tmp)) != -1) {
            contentLength += read;
        }
        try {
            content.reset();
        } catch(IOException ex) {
            throw new ResetException("Failed to reset the input stream", ex);
        }
        return contentLength;
    }
851031
public long contentLengthSent()
  {
    OutHttpApp stream = _responseStream;
    
    // stream can be null for duplex (websocket)
    if (stream != null) {
      return stream.contentLength();
    }
    else {
      return Math.max(_contentLengthOut, 0);
    }
  }
669006
protected function _setContentLength()
    {
        $headers = $this->headers();
        if ($headers['Transfer-Encoding']->value() === 'chunked') {
            return;
        }
        $length = $this->stream()->length();
        if ($length === null) {
            throw new NetException("A Content-Length header is required but the request stream has a `null` length.");
        }

        $headers['Content-Length'] = $this->stream()->length();
    }
1010527
@Override
    protected String calculateContentHash(SignableRequest<?> request) {
        // To be consistent with other service clients using sig-v4,
        // we just set the header as "required", and AWS4Signer.sign() will be
        // notified to pick up the header value returned by this method.
        request.addHeader(X_AMZ_CONTENT_SHA256, "required");

        if (isPayloadSigningEnabled(request)) {
            if (useChunkEncoding(request)) {
                final String contentLength = request.getHeaders().get(Headers.CONTENT_LENGTH);
                final long originalContentLength;
                if (contentLength != null) {
                    originalContentLength = Long.parseLong(contentLength);
                } else {
                    /**
                     * "Content-Length" header could be missing if the caller is
                     * uploading a stream without setting Content-Length in
                     * ObjectMetadata. Before using sigv4, we rely on HttpClient to
                     * add this header by using BufferedHttpEntity when creating the
                     * HttpRequest object. But now, we need this information
                     * immediately for the signing process, so we have to cache the
                     * stream here.
                     */
                    try {
                        originalContentLength = getContentLength(request);
                    } catch (IOException e) {
                        throw new SdkClientException(
                                "Cannot get the content-length of the request content.", e);
                    }
                }
                request.addHeader("x-amz-decoded-content-length",
                                  Long.toString(originalContentLength));
                // Make sure "Content-Length" header is not empty so that HttpClient
                // won't cache the stream again to recover Content-Length
                request.addHeader(Headers.CONTENT_LENGTH, Long.toString(
                        AwsChunkedEncodingInputStream
                                .calculateStreamContentLength(originalContentLength)));
                return CONTENT_SHA_256;
            } else {
                return super.calculateContentHash(request);
            }
        }

        return UNSIGNED_PAYLOAD;
    }
392779
@GET
    public Response getContent(@PathParam("spaceID") String spaceID,
                               @PathParam("contentID") String contentID,
                               @QueryParam("storeID") String storeID,
                               @QueryParam("attachment") boolean attachment,
                               @HeaderParam(RANGE_HEADER) String range) {
        StringBuilder msg = new StringBuilder("getting content(");
        msg.append(spaceID);
        msg.append(", ");
        msg.append(contentID);
        msg.append(", ");
        msg.append(storeID);
        msg.append(", ");
        msg.append(attachment);
        msg.append(", ");
        msg.append(range);
        msg.append(")");

        try {
            log.debug(msg.toString());
            return doGetContent(spaceID, contentID, storeID, attachment, range);

        } catch (InvalidRequestException e) {
            return responseBad(msg.toString(), e, BAD_REQUEST);

        } catch (ResourceNotFoundException e) {
            return responseNotFound(msg.toString(), e, NOT_FOUND);

        } catch (ResourceStateException e) {
            return responseBad(msg.toString(), e, CONFLICT);

        } catch (ResourceException e) {
            return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR);

        } catch (Exception e) {
            return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR);
        }
    }
370928
private String getContentText(JsonNode node) throws UnsupportedDashletContentException {
		if (node.hasNonNull("textContent")) {
			return node.get("textContent").asText();
		} else {
			throw new UnsupportedDashletContentException("Text content missing");
		}
	}
31439
public function getContentLength()
    {
        if (null !== $this->requestStack && null !== $request = $this->requestStack->getCurrentRequest()) {
            return $request->server->get('CONTENT_LENGTH');
        }

        return isset($_SERVER['CONTENT_LENGTH'])
            ? (int) $_SERVER['CONTENT_LENGTH']
            : null;
    }
1300727
@Override
  public String getStringCellValue() {
    Object c = contentsSupplier.getContent();

    return c == null ? "" : c.toString();
  }
450500
public String getContent() {
        String content = attrMixin.getAttribute(CONTENT);
        return content.isEmpty() ? null : content;
    }
206757
public String getTextContent() throws DOMException {
	// dynamic load to support jre 1.4 and 1.5
	try {
	    Method m = node.getClass().getMethod("getTextContent", new Class[] {});
	    return Caster.toString(m.invoke(node, ArrayUtil.OBJECT_EMPTY));
	}
	catch (Exception e) {
	    throw new PageRuntimeException(Caster.toPageException(e));
	}
    }