/*
(non-Javadoc)
@see java.net.URLConnection#getContentLength()
4706
@Override
   public int getContentLength()
   {
      try
      {
         if (!connected)
         {
            connect();
         }

         return (int)nodeRepresentation.getContentLenght();
      }
      catch (IOException e)
      {
         if (LOG.isTraceEnabled())
         {
            LOG.trace("An exception occurred: " + e.getMessage());
         }
      }
      catch (RepositoryException e)
      {
         if (LOG.isTraceEnabled())
         {
            LOG.trace("An exception occurred: " + e.getMessage());
         }
      }
      return -1;
   }
984745
public String getContent() {
    	StringBuffer buf = new StringBuffer();
    	for (Iterator i = getChunks().iterator(); i.hasNext(); ) {
    		buf.append(i.next().toString());
    	}
    	return buf.toString();
    }
1365098
synchronized ContentHandler getContentHandler()
        throws IOException
    {
        String contentType = stripOffParameters(getContentType());
        ContentHandler handler = null;
        if (contentType == null) {
            if ((contentType = guessContentTypeFromName(url.getFile())) == null) {
                contentType = guessContentTypeFromStream(getInputStream());
            }
        }

        if (contentType == null) {
            return UnknownContentHandler.INSTANCE;
        }
        try {
            handler = (ContentHandler) handlers.get(contentType);
            if (handler != null)
                return handler;
        } catch(Exception e) {
        }

        if (factory != null)
            handler = factory.createContentHandler(contentType);
        if (handler == null) {
            try {
                handler = lookupContentHandlerClassFor(contentType);
            } catch(Exception e) {
                e.printStackTrace();
                handler = UnknownContentHandler.INSTANCE;
            }
            handlers.put(contentType, handler);
        }
        return handler;
    }
1227857
@Override
    public Content getContent(String key, Object o) {
        return contents.getContent(key, o);
    }
944831
public String getContent() {
		String content = "";
		
		NodeList list = dom.getChildNodes();
		for (int i=0;i<list.getLength();i++) {
			if (list.item(i) instanceof Text) {
				content += (list.item(i).getNodeValue());
			}
		}
		
		return content;
	}
990250
@Override
  public CharSequence getDisplayContents() {
    WifiParsedResult wifiResult = (WifiParsedResult) getResult();
    return wifiResult.getSsid() + " (" + wifiResult.getNetworkEncryption() + ')';
  }
255115
InputStream getContent(String url) throws IOException, NsApiException {
        Request request = new Request.Builder().url(url).get().build();
        try {
            Response response = client.newCall(request).execute();
            if (response.body() == null) {
                log.error("Error while calling the webservice, entity is null");
                throw new NsApiException("Error while calling the webservice, entity is null");
            }
            return response.body().byteStream();
        }
        catch (RuntimeException e) {
            log.error("Error while calling the webservice, entity is null");
            throw new NsApiException("Error while calling the webservice, entity is null", e);
        }
    }
451924
int getContentLength(HttpURLConnection conn) {
    String transferEncoding = conn.getHeaderField(TRANSFER_ENCODING);
    if (transferEncoding == null || transferEncoding.equalsIgnoreCase("chunked")) {
      return conn.getHeaderFieldInt(CONTENT_LENGTH, -1);
    } else {
      return -1;
    }
  }
703042
public void setContentLength(int len) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.entering(CLASS_NAME,"setContentLength", "length --> " + String.valueOf(len) + " ["+this+"]");
        }

        // d151464 - check the include flag
        WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
        if (dispatchContext.isInclude() == true) {
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                logger.logp(Level.FINE, CLASS_NAME,"setContentLength", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "setContentLength length --> " + String.valueOf(len));  //311717
            }
        }
        else
        {
            if (_response!=null) {
                if (!_response.isCommitted()) {
                    _response.setContentLength(len);
                }
            }
            _contentLength = len;
            // LIBERTY _bufferedOut.setLimit(_contentLength = len);
            _bufferedWriter.setLimitLong(_contentLength);
            //still want to try to set the header even if the response is committed to throw the warning
            setIntHeader(HEADER_CONTENT_LENGTH, len);
        }
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.exiting(CLASS_NAME,"setContentLength");
        }
    }
895360
public int getContentLength() {
        try {
            getInputStream();
        } catch (Exception e) {
            return -1;
        }
        int l = contentLength;
        if (l < 0) {
            try {
                l = Integer.parseInt(properties.findValue("content-length"));
                setContentLength(l);
            } catch(Exception e) {
            }
        }
        return l;
    }
1323541
public static String getContent(String stringUrl) throws IOException {
    InputStream stream = getContentStream(stringUrl);
    return MyStreamUtils.readContent(stream);
  }
188121
@Override
    public String getContent() {
        FileReader reader = null;
        try {
            reader = new FileReader(this.contentFile);
            return IOUtils.toString(reader);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            IOUtils.closeQuietly(reader);
        }
    }
866483
func actualContentLength(req *http.Request) int64 {
	if req.Body == nil {
		return 0
	}
	if req.ContentLength != 0 {
		return req.ContentLength
	}
	return -1
}
203682
public function getContentLength() {
        $contentLengthKey = OSSHeaders::CONTENT_LENGTH;
        if (isset($this->metadata[$contentLengthKey])) {
            return (int) $this->metadata[$contentLengthKey];
        }

        // mitmproxy's bug, return 'content-length' when head a request.
        $contentLengthKey = strtolower($contentLengthKey);
        if (isset($this->metadata[$contentLengthKey])) {
            return (int) $this->metadata[$contentLengthKey];
        }

        return (int) 0;
    }
282139
@Override
    public String getContentType() {
	URLConnection connection = null;
	try {
	    connection = url.openConnection();
	}
	catch (IOException e) {}
	if (connection == null) return DEFAULT_CONTENT_TYPE;

	return connection.getContentType();

    }
1062068
@Override
    public void addRequestContentLength(long contentLength) {
        if (contentLength < 0)
            throw new IllegalArgumentException();
        synchronized(lock) {
            if (this.requestContentLength == -1)
                this.requestContentLength = contentLength;
            else
                this.requestContentLength += contentLength;
        }
    }
1016620
@Override
  public long getSize() throws ResourceNotAvailableException {

    try {
      // return getUrl().openConnection().getContentLengthLong();
      return getUrl().openConnection().getContentLength();
    } catch (IOException e) {
      throw new ResourceNotAvailableException(e, getPath());
    }
  }