If a Content-Type handler has been specified, call it to clean up the Content-Type value. @param mp the MimePart @param contentType the Content-Type value @return the cleaned Content-Type value
(MimePart mp, String contentType)
| 72 | * @return the cleaned Content-Type value |
| 73 | */ |
| 74 | public static String cleanContentType(MimePart mp, String contentType) { |
| 75 | if (cleanContentType != null) { |
| 76 | try { |
| 77 | return (String)cleanContentType.invoke(null, |
| 78 | new Object[] { mp, contentType }); |
| 79 | } catch (Exception ex) { |
| 80 | return contentType; |
| 81 | } |
| 82 | } else |
| 83 | return contentType; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Convenience method to get our context class loader. |
no test coverage detected