com.applitools.eyes.Utils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eyes-connectivity-java3-jersey2x Show documentation
Show all versions of eyes-connectivity-java3-jersey2x Show documentation
Applitools Eyes SDK REST API communication implementation depending on Jersey version 2x
package com.applitools.eyes;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import java.util.List;
import java.util.Map;
public class Utils {
public static String getResponseContentType(Response response) {
return getHeaderString(response, "Content-Type");
}
public static String getResponseContentEncoding(Response response) {
return getHeaderString(response, "Content-Encoding");
}
private static String getHeaderString(Response response, String header) {
MultivaluedMap headers = response.getHeaders();
String contentType = null;
for (Map.Entry> entry: headers.entrySet()) {
boolean isContentType = entry.getKey().equalsIgnoreCase(header);
if(isContentType){
contentType = (String) entry.getValue().get(0);
break;
}
}
return contentType;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy