Java 类javax.activation.MimeTypeParameterList 实例源码

项目:Tundra.java    文件:MIMETypeHelper.java   
/**
 * Converts a MimeType to an IData representation.
 *
 * @param mimeType The MimeType to convert.
 * @return An IData representation of the given MimeType.
 */
public static IData toIData(MimeType mimeType) {
    if (mimeType == null) return null;

    IDataMap output = new IDataMap();

    output.put("type", mimeType.getPrimaryType());
    output.put("subtype", mimeType.getSubType());

    MimeTypeParameterList mimeTypeParameterList = mimeType.getParameters();
    if (mimeTypeParameterList.size() > 0) output.put("parameters", toIData(mimeTypeParameterList));

    return output;
}
项目:Tundra.java    文件:MIMETypeHelper.java   
/**
 * Converts a MimeTypeParameterList to an IData representation.
 *
 * @param mimeTypeParameterList The MimeTypeParameterList to convert.
 * @return An IData representation of the given MimeTypeParameterList.
 */
public static IData toIData(MimeTypeParameterList mimeTypeParameterList) {
    if (mimeTypeParameterList == null) return null;

    IDataMap output = new IDataMap();

    Enumeration names = mimeTypeParameterList.getNames();
    while (names.hasMoreElements()) {
        String name = (String)names.nextElement();
        String value = mimeTypeParameterList.get(name);
        output.put(name, value);
    }

    return output;
}
项目:event-store-commons    文件:EnhancedMimeTypeTest.java   
@Test
public void testEqualsHashCode() throws MimeTypeParseException {
    final MimeTypeParameterList listA = new MimeTypeParameterList(";charset=utf-8");
    final MimeTypeParameterList listB = new MimeTypeParameterList(";charset=iso-8859-2");
    EqualsVerifier.forClass(EnhancedMimeType.class)
            .suppress(Warning.NULL_FIELDS, Warning.NONFINAL_FIELDS)
            .withPrefabValues(MimeTypeParameterList.class, listA, listB)
            .verify();
}
项目:openjdk-jdk10    文件:TryAccess.java   
static void setAccessibleNotPublicMemberUpgradeableModule() throws Exception {
    Method method = MimeTypeParameterList.class.getDeclaredMethod("parse",
            String.class);
    method.setAccessible(true);
}