use of javax.activation.DataContentHandler in project sling by apache.
the class OsgiMailcapCommandMap method findDataContentHandler.
private DataContentHandler findDataContentHandler(String mimeType, boolean fallback) {
for (Map.Entry<Bundle, MailcapFile> entry : db.entrySet()) {
Map<?, ?> commandMap = fallback ? entry.getValue().getMailcapFallbackList(mimeType) : entry.getValue().getMailcapList(mimeType);
if (commandMap != null) {
List<?> v = (List<?>) commandMap.get("content-handler");
if (v == null) {
continue;
}
String name = (String) v.get(0);
DataContentHandler dch = getDataContentHandler(name, entry.getKey());
if (dch != null) {
return dch;
}
}
}
return null;
}
Aggregations