Package com.helger.commons.mime
Class MimeTypeHelper
- java.lang.Object
-
- com.helger.commons.mime.MimeTypeHelper
-
@Immutable public final class MimeTypeHelper extends Object
Contains some utility methods for handling MIME types.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CharsetgetCharsetFromMimeType(IMimeType aMimeType)Determine the charset from the provided MIME type.static StringgetCharsetNameFromMimeType(IMimeType aMimeType)Determine the charset name from the provided MIME type.
-
-
-
Method Detail
-
getCharsetNameFromMimeType
@Nullable public static String getCharsetNameFromMimeType(@Nullable IMimeType aMimeType)
Determine the charset name from the provided MIME type.- Parameters:
aMimeType- The MIME type to query. May benull.- Returns:
nullif no MIME type was provided or if the MIME type does not contain a "charset" parameter
-
getCharsetFromMimeType
@Nullable public static Charset getCharsetFromMimeType(@Nullable IMimeType aMimeType)
Determine the charset from the provided MIME type.- Parameters:
aMimeType- The MIME type to query. May benull.- Returns:
nullif no MIME type was provided or if the MIME type does not contain a "charset" parameter or if the provided charset name is invalid.
-
-