Package org.jclouds.atmos.functions
Class ParseObjectFromHeadersAndHttpContent
- java.lang.Object
-
- org.jclouds.atmos.functions.ParseObjectFromHeadersAndHttpContent
-
- All Implemented Interfaces:
com.google.common.base.Function<HttpResponse,AtmosObject>,Function<HttpResponse,AtmosObject>,InvocationContext<ParseObjectFromHeadersAndHttpContent>
public class ParseObjectFromHeadersAndHttpContent extends Object implements com.google.common.base.Function<HttpResponse,AtmosObject>, InvocationContext<ParseObjectFromHeadersAndHttpContent>
Parses response headers and creates a new AtmosObject from them and the HTTP content.- See Also:
ParseMetadataFromHeaders
-
-
Constructor Summary
Constructors Constructor Description ParseObjectFromHeadersAndHttpContent(ParseSystemMetadataFromHeaders systemMetadataParser, ParseUserMetadataFromHeaders userMetadataParser, AtmosObject.Factory objectProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AtmosObjectapply(HttpResponse from)First, callsParseSystemAndUserMetadataFromHeaders.ParseObjectFromHeadersAndHttpContentsetContext(HttpRequest request)
-
-
-
Constructor Detail
-
ParseObjectFromHeadersAndHttpContent
@Inject public ParseObjectFromHeadersAndHttpContent(ParseSystemMetadataFromHeaders systemMetadataParser, ParseUserMetadataFromHeaders userMetadataParser, AtmosObject.Factory objectProvider)
-
-
Method Detail
-
apply
public AtmosObject apply(HttpResponse from)
First, callsParseSystemAndUserMetadataFromHeaders. Then, sets the object size based on the Content-Length header and adds the content to theAtmosObjectresult.- Specified by:
applyin interfacecom.google.common.base.Function<HttpResponse,AtmosObject>- Specified by:
applyin interfaceFunction<HttpResponse,AtmosObject>- Throws:
HttpException
-
setContext
public ParseObjectFromHeadersAndHttpContent setContext(HttpRequest request)
- Specified by:
setContextin interfaceInvocationContext<ParseObjectFromHeadersAndHttpContent>
-
-