org.mapfish.print.http.Utils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of print-lib Show documentation
Show all versions of print-lib Show documentation
Library for generating PDFs and images from online webmapping services
package org.mapfish.print.http;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* Network utils classe.
*/
public final class Utils {
private Utils() {
}
private static final List AUTH_HEADERS = Arrays.asList(
new String[]{"cookie", "set-cookie", "authorization"}
);
/**
* Get a list of printable (auth header will be hidden) headers 'header=value'.
*
* @param headers The headers
*/
public static List getPrintableHeadersList(final Map> headers) {
final List result = new ArrayList();
for (String header: headers.keySet()) {
List value = headers.get(header);
if (AUTH_HEADERS.contains(header.toLowerCase())) {
value = Arrays.asList(new String[]{"***"});
}
result.add(String.format("%s: %s", header, String.join(", ", value)));
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy