use of com.zimbra.cs.mime.MockMimeTypeInfo in project zm-mailbox by Zimbra.
the class MockProvisioning method initializeMimeHandlers.
private void initializeMimeHandlers() {
MockMimeTypeInfo plain = new MockMimeTypeInfo();
plain.setMimeTypes(MimeConstants.CT_TEXT_PLAIN);
plain.setHandlerClass(TextPlainHandler.class.getName());
plain.setIndexingEnabled(true);
addMimeType(MimeConstants.CT_TEXT_PLAIN, plain);
MockMimeTypeInfo html = new MockMimeTypeInfo();
html.setMimeTypes(MimeConstants.CT_TEXT_HTML);
html.setHandlerClass(TextHtmlHandler.class.getName());
html.setFileExtensions("html", "htm");
html.setIndexingEnabled(true);
addMimeType(MimeConstants.CT_TEXT_HTML, html);
MockMimeTypeInfo calendar = new MockMimeTypeInfo();
calendar.setMimeTypes(MimeConstants.CT_TEXT_CALENDAR);
calendar.setHandlerClass(TextCalendarHandler.class.getName());
calendar.setIndexingEnabled(true);
addMimeType(MimeConstants.CT_TEXT_CALENDAR, calendar);
MockMimeTypeInfo message = new MockMimeTypeInfo();
message.setMimeTypes(MimeConstants.CT_MESSAGE_RFC822);
message.setHandlerClass(MessageRFC822Handler.class.getName());
message.setIndexingEnabled(true);
addMimeType(MimeConstants.CT_MESSAGE_RFC822, message);
}
use of com.zimbra.cs.mime.MockMimeTypeInfo in project zm-mailbox by Zimbra.
the class MockProvisioning method getMimeTypes.
@Override
public List<MimeTypeInfo> getMimeTypes(String mime) {
List<MimeTypeInfo> result = mimeConfig.get(mime);
if (result != null) {
return result;
} else {
MockMimeTypeInfo info = new MockMimeTypeInfo();
info.setHandlerClass(UnknownTypeHandler.class.getName());
return Collections.<MimeTypeInfo>singletonList(info);
}
}
Aggregations