public static String guessContentTypeFromName(String fileName) {
String defaultValue = "application/octet-stream";
try {
Buffer buffer = mimeTypes.getMimeByExtension(fileName);
if (buffer != null) {
return new String(buffer.asArray());
}
String lowerName = fileName.toLowerCase();
if (lowerName.endsWith(".json")) {
return "application/json";
}