use of com.zimbra.cs.account.ldap.entry.LdapMimeType in project zm-mailbox by Zimbra.
the class LdapProvisioning method getMimeTypesByQuery.
@Override
public List<MimeTypeInfo> getMimeTypesByQuery(String mimeType) throws ServiceException {
List<MimeTypeInfo> mimeTypes = new ArrayList<MimeTypeInfo>();
try {
ZSearchResultEnumeration ne = helper.searchDir(mDIT.mimeBaseDN(), filterFactory.mimeEntryByMimeType(mimeType), ZSearchControls.SEARCH_CTLS_SUBTREE());
while (ne.hasMore()) {
ZSearchResultEntry sr = ne.next();
mimeTypes.add(new LdapMimeType(sr, this));
}
ne.close();
} catch (ServiceException e) {
throw ServiceException.FAILURE("unable to get mime types for " + mimeType, e);
}
return mimeTypes;
}
use of com.zimbra.cs.account.ldap.entry.LdapMimeType in project zm-mailbox by Zimbra.
the class LdapProvisioning method getAllMimeTypesByQuery.
@Override
public List<MimeTypeInfo> getAllMimeTypesByQuery() throws ServiceException {
List<MimeTypeInfo> mimeTypes = new ArrayList<MimeTypeInfo>();
try {
ZSearchResultEnumeration ne = helper.searchDir(mDIT.mimeBaseDN(), filterFactory.allMimeEntries(), ZSearchControls.SEARCH_CTLS_SUBTREE());
while (ne.hasMore()) {
ZSearchResultEntry sr = ne.next();
mimeTypes.add(new LdapMimeType(sr, this));
}
ne.close();
} catch (ServiceException e) {
throw ServiceException.FAILURE("unable to get mime types", e);
}
return mimeTypes;
}
Aggregations