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 AtmosObject
apply(HttpResponse from)
First, callsParseSystemAndUserMetadataFromHeaders
.ParseObjectFromHeadersAndHttpContent
setContext(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 theAtmosObject
result.- Specified by:
apply
in interfacecom.google.common.base.Function<HttpResponse,AtmosObject>
- Specified by:
apply
in interfaceFunction<HttpResponse,AtmosObject>
- Throws:
HttpException
-
setContext
public ParseObjectFromHeadersAndHttpContent setContext(HttpRequest request)
- Specified by:
setContext
in interfaceInvocationContext<ParseObjectFromHeadersAndHttpContent>
-
-