package com.nifty.cloud.ncs.service.parser;

import com.nifty.cloud.ncs.NiftyCloudResponse;
import com.nifty.cloud.ncs.http.HttpResponse;
import com.nifty.cloud.ncs.service.NcsObject;

/**
 * ニフクラストレージのオブジェクト応答解析用クラスです。
 *
 */
public class ObjectResponseParser extends AbstractStorageResponseParser<NcsObject>
{
	public ObjectResponseParser()
	{
		super();
	}

	@Override
	public NiftyCloudResponse<NcsObject> parse(HttpResponse response) throws Exception
	{
		NcsObject object = new NcsObject();
		object.setContent(response.getContent());

		setObjectMetadata(response, object);

		NiftyCloudResponse<NcsObject> ncsResponse = parseMetaData(response);
		ncsResponse.setResult(object);

		return (ncsResponse);
	}

}
