Package co.arago.hiro.client.rest
Class AuthenticatedAPIHandler.SendStreamAPIRequestConf<T extends AuthenticatedAPIHandler.SendStreamAPIRequestConf<T,R>,R>
- java.lang.Object
-
- co.arago.hiro.client.rest.AuthenticatedAPIHandler.APIRequestConf<T,R>
-
- co.arago.hiro.client.rest.AuthenticatedAPIHandler.SendStreamAPIRequestConf<T,R>
-
- Type Parameters:
T- The Builder typeR- The type of the result expected fromAuthenticatedAPIHandler.APIRequestConf.execute()
- Direct Known Subclasses:
AuthAPI.PutMeAvatarCommand,GraphAPI.PostBlobCommand
- Enclosing class:
- AuthenticatedAPIHandler
public abstract static class AuthenticatedAPIHandler.SendStreamAPIRequestConf<T extends AuthenticatedAPIHandler.SendStreamAPIRequestConf<T,R>,R> extends AuthenticatedAPIHandler.APIRequestConf<T,R>
The basic configuration for all requests that upload binary data. Handle queries, headers and fragments as well as creation of theStreamContainer.
-
-
Field Summary
Fields Modifier and Type Field Description protected StreamContainerstreamContainer-
Fields inherited from class co.arago.hiro.client.rest.AuthenticatedAPIHandler.APIRequestConf
fragment, headers, httpRequestTimeout, maxRetries, path, query
-
-
Constructor Summary
Constructors Constructor Description SendStreamAPIRequestConf(StreamContainer streamContainer, java.lang.String... pathParts)Use an existingStreamContainerSendStreamAPIRequestConf(java.io.InputStream inputStream, java.lang.String... pathParts)Use an inputStream for data and nothing else.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TsetCharset(java.nio.charset.Charset charset)TsetContentType(java.lang.String contentType)Decodes mediaType and charset from the contentType.TsetHttpHeaders(HttpHeaderMap headers)If "Content-Type" is present in the headers, also set it in thestreamContainer.TsetMediaType(java.lang.String mediaType)-
Methods inherited from class co.arago.hiro.client.rest.AuthenticatedAPIHandler.APIRequestConf
execute, self, setHttpRequestTimeout, setMaxRetries, setUrlFragment, setUrlQuery
-
-
-
-
Field Detail
-
streamContainer
protected StreamContainer streamContainer
-
-
Constructor Detail
-
SendStreamAPIRequestConf
public SendStreamAPIRequestConf(StreamContainer streamContainer, java.lang.String... pathParts)
Use an existingStreamContainer- Parameters:
streamContainer- The existingStreamContainer. Must not be null.pathParts- Array for the path appended to the API path.
-
SendStreamAPIRequestConf
public SendStreamAPIRequestConf(java.io.InputStream inputStream, java.lang.String... pathParts)Use an inputStream for data and nothing else.- Parameters:
inputStream- The inputStream for the request body. Must not be null.pathParts- Array for the path appended to the API path.
-
-
Method Detail
-
setCharset
public T setCharset(java.nio.charset.Charset charset)
-
setMediaType
public T setMediaType(java.lang.String mediaType)
- Parameters:
mediaType- The mediaType / MIME-Type.- Returns:
AuthenticatedAPIHandler.APIRequestConf.self()
-
setContentType
public T setContentType(java.lang.String contentType)
Decodes mediaType and charset from the contentType.- Parameters:
contentType- The HTTP header field "Content-Type".- Returns:
AuthenticatedAPIHandler.APIRequestConf.self()- See Also:
- Documentation of Content-Type
-
setHttpHeaders
public T setHttpHeaders(HttpHeaderMap headers)
If "Content-Type" is present in the headers, also set it in thestreamContainer.- Overrides:
setHttpHeadersin classAuthenticatedAPIHandler.APIRequestConf<T extends AuthenticatedAPIHandler.SendStreamAPIRequestConf<T,R>,R>- Parameters:
headers- The headers to set.- Returns:
AuthenticatedAPIHandler.APIRequestConf.self()
-
-