Package org.apache.http.impl
Class DefaultHttpResponseFactory
java.lang.Object
org.apache.http.impl.DefaultHttpResponseFactory
- All Implemented Interfaces:
HttpResponseFactory
@Contract(threading=IMMUTABLE_CONDITIONAL)
public class DefaultHttpResponseFactory
extends Object
implements HttpResponseFactory
Default factory for creating
HttpResponse
objects.- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new response factory with the default catalog.Creates a new response factory with the given catalog. -
Method Summary
Modifier and TypeMethodDescriptionnewHttpResponse
(ProtocolVersion ver, int status, HttpContext context) Creates a new response from status line elements.newHttpResponse
(StatusLine statusline, HttpContext context) Creates a new response from a status line.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultHttpResponseFactory
Creates a new response factory with the given catalog.- Parameters:
catalog
- the catalog of reason phrases
-
DefaultHttpResponseFactory
public DefaultHttpResponseFactory()Creates a new response factory with the default catalog. The default catalog isEnglishReasonPhraseCatalog
.
-
-
Method Details
-
newHttpResponse
Description copied from interface:HttpResponseFactory
Creates a new response from status line elements.- Specified by:
newHttpResponse
in interfaceHttpResponseFactory
- Parameters:
ver
- the protocol versionstatus
- the status codecontext
- the context from which to determine the locale for looking up a reason phrase to the status code, ornull
to use the default locale- Returns:
- the new response with an initialized status line
-
newHttpResponse
Description copied from interface:HttpResponseFactory
Creates a new response from a status line.- Specified by:
newHttpResponse
in interfaceHttpResponseFactory
- Parameters:
statusline
- the status linecontext
- the context from which to determine the locale for looking up a reason phrase if the status code is updated, ornull
to use the default locale- Returns:
- the new response with the argument status line
-