All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.woorea.openstack.connector.JaxRs20Response Maven / Gradle / Ivy

There is a newer version: 3.2.9
Show newest version
package com.woorea.openstack.connector;

import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

import javax.ws.rs.core.Response;

import com.woorea.openstack.base.client.OpenStackResponse;

public class JaxRs20Response implements OpenStackResponse {
	
	private Response response;
	
	public JaxRs20Response(Response response) {
		this.response = response;
	}

	@Override
	public  T getEntity(Class returnType) {
		return response.readEntity(returnType);
	}

	@Override
	public InputStream getInputStream() {
		return (InputStream) response.getEntity();
	}

	@Override
	public String header(String name) {
		return response.getHeaderString(name);
	}

	@Override
	public Map headers() {
		Map headers = new HashMap();
		for(String k : response.getHeaders().keySet()) {
			headers.put(k, response.getHeaderString(k));
		}
		return headers;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy