/** * Some filters need additional parameters from the response. All the * necessary reading can occur in that method, as this method is called * after the response header processing is complete. */ @Override public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
/** * Some filters need additional parameters from the response. All the * necessary reading can occur in that method, as this method is called * after the response header processing is complete. */ public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
/** * Some filters need additional parameters from the response. All the * necessary reading can occur in that method, as this method is called * after the response header processing is complete. */ public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
/** * Some filters need additional parameters from the response. All the * necessary reading can occur in that method, as this method is called * after the response header processing is complete. */ @Override public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
public int getContentLength() { long length = getContentLengthLong(); if (length < Integer.MAX_VALUE) { return (int) length; } return -1; }
/** * Some filters need additional parameters from the response. All the * necessary reading can occur in that method, as this method is called * after the response header processing is complete. */ @Override public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
public int getContentLength() { long length = getContentLengthLong(); if (length < Integer.MAX_VALUE) { return (int) length; } return -1; }
public int getContentLength() { long length = getContentLengthLong(); if (length < Integer.MAX_VALUE) { return (int) length; } return -1; }
/** * Some filters need additional parameters from the response. All the * necessary reading can occur in that method, as this method is called * after the response header processing is complete. */ public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
public int getContentLength() { long length = getContentLengthLong(); if (length < Integer.MAX_VALUE) { return (int) length; } return -1; }
/** * Some filters need additional parameters from the response. All the * necessary reading can occur in that method, as this method is called * after the response header processing is complete. */ @Override public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
public int getContentLength() { long length = getContentLengthLong(); if (length < Integer.MAX_VALUE) { return (int) length; } return -1; }
public int getContentLength() { long length = getContentLengthLong(); if (length < Integer.MAX_VALUE) { return (int) length; } return -1; }
public int getContentLength() { long length = getContentLengthLong(); if (length < Integer.MAX_VALUE) { return (int) length; } return -1; }
@Override public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
public int getContentLength() { long length = getContentLengthLong(); if (length < Integer.MAX_VALUE) { return (int) length; } return -1; }
/* */ public boolean containsHeader(String name) /* */ { /* 1056 */ char cc = name.charAt(0); /* 1057 */ if ((cc == 'C') || (cc == 'c')) { /* 1058 */ if (name.equalsIgnoreCase("Content-Type")) /* */ { /* 1060 */ return this.coyoteResponse.getContentType() != null; /* */ } /* 1062 */ if (name.equalsIgnoreCase("Content-Length")) /* */ { /* 1064 */ return this.coyoteResponse.getContentLengthLong() != -1L; /* */ } /* */ } /* */ /* 1068 */ return this.coyoteResponse.containsHeader(name); /* */ } /* */
/** * Has the specified header been set already in this response? * * @param name Name of the header to check */ public boolean containsHeader(String name) { // Need special handling for Content-Type and Content-Length due to // special handling of these in coyoteResponse char cc=name.charAt(0); if(cc=='C' || cc=='c') { if(name.equalsIgnoreCase("Content-Type")) { // Will return null if this has not been set return (coyoteResponse.getContentType() != null); } if(name.equalsIgnoreCase("Content-Length")) { // -1 means not known and is not sent to client return (coyoteResponse.getContentLengthLong() != -1); } } return coyoteResponse.containsHeader(name); }
/** * Has the specified header been set already in this response? * * @param name Name of the header to check * @return <code>true</code> if the header has been set */ @Override public boolean containsHeader(String name) { // Need special handling for Content-Type and Content-Length due to // special handling of these in coyoteResponse char cc=name.charAt(0); if(cc=='C' || cc=='c') { if(name.equalsIgnoreCase("Content-Type")) { // Will return null if this has not been set return (getCoyoteResponse().getContentType() != null); } if(name.equalsIgnoreCase("Content-Length")) { // -1 means not known and is not sent to client return (getCoyoteResponse().getContentLengthLong() != -1); } } return getCoyoteResponse().containsHeader(name); }
/** * When committing the response, we have to validate the set of headers, as * well as setup the response filters. */ protected void sendSynReply() { response.setCommitted(true); // Special headers MimeHeaders headers = response.getMimeHeaders(); String contentType = response.getContentType(); if (contentType != null) { headers.setValue("Content-Type").setString(contentType); } String contentLanguage = response.getContentLanguage(); if (contentLanguage != null) { headers.setValue("Content-Language").setString(contentLanguage); } long contentLength = response.getContentLengthLong(); if (contentLength >= 0) { headers.setValue("Content-Length").setLong(contentLength); } sendResponseHead(); }