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 Constructor Description AS2HttpRequestDataProviderInputStream(InputStream aIS)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AS2HttpRequestDataProviderInputStreamcreateForUtf8(String s)com.helger.commons.http.HttpHeaderMapgetHttpHeaderMap()InputStreamgetHttpInputStream()Will return a buffered,NonClosingInputStreamthat when closed, will not close in source stream.StringgetHttpRequestMethod()StringgetHttpRequestUrl()StringgetHttpRequestVersion()
-
-
-
Constructor Detail
-
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 Detail
-
getHttpInputStream
@Nonnull public InputStream getHttpInputStream() throws IOException
Will return a buffered,NonClosingInputStreamthat when closed, will not close in source stream. This is useful when working withjava.net.SocketInputStreamas close() on a socket stream closes theSocket- Specified by:
getHttpInputStreamin interfaceIAS2HttpRequestDataProvider- Returns:
InputStream- Throws:
IOException- in case of error
-
getHttpRequestMethod
@Nonnull public String getHttpRequestMethod()
- Specified by:
getHttpRequestMethodin interfaceIAS2HttpRequestDataProvider- Returns:
- The HTTP request method used. Usually this should be
POST.
-
getHttpRequestUrl
@Nonnull public String getHttpRequestUrl()
- Specified by:
getHttpRequestUrlin interfaceIAS2HttpRequestDataProvider- Returns:
- The HTTP request URL used. Something like
/as2.
-
getHttpRequestVersion
@Nonnull public String getHttpRequestVersion()
- Specified by:
getHttpRequestVersionin interfaceIAS2HttpRequestDataProvider- Returns:
- The HTTP request version used. Something like
HTTP/1.1.
-
getHttpHeaderMap
@Nonnull public com.helger.commons.http.HttpHeaderMap getHttpHeaderMap()
- Specified by:
getHttpHeaderMapin 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:
IOExceptionjakarta.mail.MessagingException
-
-