Class HttpInputStreamUtil
java.lang.Object
org.apache.logging.log4j.core.util.internal.HttpInputStreamUtil
Utility method for reading data from an HTTP InputStream.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final Loggerprivate static final intprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatProtocol(Source source) static HttpInputStreamUtil.ResultgetInputStream(LastModifiedSource source, AuthorizationProvider authorizationProvider) Retrieves an HTTP resource if it has been modified.static byte[]
-
Field Details
-
LOGGER
-
NOT_MODIFIED
private static final int NOT_MODIFIED- See Also:
-
NOT_AUTHORIZED
private static final int NOT_AUTHORIZED- See Also:
-
FORBIDDEN
private static final int FORBIDDEN- See Also:
-
NOT_FOUND
private static final int NOT_FOUND- See Also:
-
OK
private static final int OK- See Also:
-
BUF_SIZE
private static final int BUF_SIZE- See Also:
-
-
Constructor Details
-
HttpInputStreamUtil
public HttpInputStreamUtil()
-
-
Method Details
-
getInputStream
public static HttpInputStreamUtil.Result getInputStream(LastModifiedSource source, AuthorizationProvider authorizationProvider) Retrieves an HTTP resource if it has been modified.Side effects: if the request is successful, the last modified time of the
sourceparameter is modified.- Parameters:
source- The location of the HTTP resourceauthorizationProvider- The authentication data for the HTTP request- Returns:
- A
HttpInputStreamUtil.Resultobject containing the status code and body of the response
-
formatProtocol
-
readStream
- Throws:
IOException
-