public void test() { ParseUserMetadataFromHeaders parser = Guice.createInjector().getInstance(ParseUserMetadataFromHeaders.class); UserMetadata data = parser.apply(ParseObjectFromHeadersAndHttpContentTest.RESPONSE); assertEquals(data, EXPECTED); } }
public void test() { ParseUserMetadataFromHeaders parser = Guice.createInjector().getInstance(ParseUserMetadataFromHeaders.class); UserMetadata data = parser.apply(ParseObjectFromHeadersAndHttpContentTest.RESPONSE); assertEquals(data, EXPECTED); } }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5()); return object; }
/** * First, calls {@link ParseSystemAndUserMetadataFromHeaders}. * * Then, sets the object size based on the Content-Length header and adds the content to the * {@link AtmosObject} result. * * @throws org.jclouds.http.HttpException */ public AtmosObject apply(HttpResponse from) { checkNotNull(from, "http response"); AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from)); object.getContentMetadata().setName(object.getSystemMetadata().getObjectName()); object.getContentMetadata().setPath(path); object.getContentMetadata().setUri(uri); object.getAllHeaders().putAll(from.getHeaders()); object.setPayload(from.getPayload()); object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from)); object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5()); return object; }