Package com.helger.as2lib.util.http
Class AS2HttpRequestDataProviderInputStream
java.lang.Object
com.helger.as2lib.util.http.AS2HttpRequestDataProviderInputStream
- All Implemented Interfaces:
IAS2HttpRequestDataProvider
@Immutable
public class AS2HttpRequestDataProviderInputStream
extends Object
implements IAS2HttpRequestDataProvider
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.helger.commons.http.HttpHeaderMap
Will return a buffered,NonClosingInputStream
that when closed, will not close in source stream.boolean
-
Constructor Details
-
AS2HttpRequestDataProviderInputStream
public AS2HttpRequestDataProviderInputStream(@Nonnull @WillNotClose InputStream aIS) throws IOException, jakarta.mail.MessagingException Constructor- Parameters:
aIS
- InputStream to read from. May not benull
.- Throws:
IOException
- If reading from the Socket failsjakarta.mail.MessagingException
- If reading the HTTP headers failed
-
-
Method Details
-
getHttpInputStream
Will return a buffered,NonClosingInputStream
that when closed, will not close in source stream. This is useful when working withjava.net.SocketInputStream
as close() on a socket stream closes theSocket
- Specified by:
getHttpInputStream
in interfaceIAS2HttpRequestDataProvider
- Returns:
InputStream
- Throws:
IOException
- in case of error
-
isChunkedEncodingAlreadyProcessed
public boolean isChunkedEncodingAlreadyProcessed()- Specified by:
isChunkedEncodingAlreadyProcessed
in interfaceIAS2HttpRequestDataProvider
- Returns:
true
if chunked encoding was already processed by an outside component (e.g. via Servlet), orfalse
if it needs to be processed internally.
-
getHttpRequestMethod
- Specified by:
getHttpRequestMethod
in interfaceIAS2HttpRequestDataProvider
- Returns:
- The HTTP request method used. Usually this should be
POST
.
-
getHttpRequestUrl
- Specified by:
getHttpRequestUrl
in interfaceIAS2HttpRequestDataProvider
- Returns:
- The HTTP request URL used. Something like
/as2
.
-
getHttpRequestVersion
- Specified by:
getHttpRequestVersion
in interfaceIAS2HttpRequestDataProvider
- Returns:
- The HTTP request version used. Something like
HTTP/1.1
.
-
getHttpHeaderMap
- Specified by:
getHttpHeaderMap
in interfaceIAS2HttpRequestDataProvider
- Returns:
- The provided HTTP header map. Mutable map is returned. Never
null
.
-
createForUtf8
@Nonnull public static AS2HttpRequestDataProviderInputStream createForUtf8(@Nonnull String s) throws IOException, jakarta.mail.MessagingException - Throws:
IOException
jakarta.mail.MessagingException
-