/** * Retrieve the value associated with the given name, or null if there * is no current association. * * @param name the parameter name * @return the paramter's value */ public String getParameter(String name) { return parameters.get(name); }
private Map<String, String> convertParams(MimeTypeParameterList list) { Map<String, String> map = new HashMap<String, String>(); Enumeration names = list.getNames(); while (names.hasMoreElements()) { String name = (String) names.nextElement(); map.put(name, list.get(name)); } return map; }
/** * Retrieve the value associated with the given name, or null if there * is no current association. * * @param name the parameter name * @return the paramter's value */ public String getParameter(String name) { return parameters.get(name); }
@SuppressWarnings("unchecked") protected org.xcmis.spi.utils.MimeType convertMimeType(MimeType abderaMimeType) { if (abderaMimeType == null) { return new org.xcmis.spi.utils.MimeType(); } MimeTypeParameterList abderaParameters = abderaMimeType.getParameters(); Map<String, String> paremeters = new HashMap<String, String>(); for (Enumeration<String> names = abderaParameters.getNames(); names.hasMoreElements();) { String name = names.nextElement(); paremeters.put(name, abderaParameters.get(name)); } return new org.xcmis.spi.utils.MimeType(abderaMimeType.getPrimaryType(), abderaMimeType.getSubType(), paremeters); }
/** * Retrieve the value associated with the given name, or null if there * is no current association. * * @param name the parameter name * @return the paramter's value */ public String getParameter(String name) { return parameters.get(name); }
/** * Retrieve the value associated with the given name, or null if there * is no current association. * * @param name the parameter name * @return the paramter's value */ public String getParameter(String name) { return parameters.get(name); }
/** * Retrieve the value associated with the given name, or null if there * is no current association. * * @param name the parameter name * @return the paramter's value */ public String getParameter(String name) { return parameters.get(name); }
/** * Retrieve the value associated with the given name, or null if there * is no current association. * * @param name the parameter name * @return the paramter's value */ public String getParameter(String name) { return parameters.get(name); }
/** * Retrieve the value associated with the given name, or null if there * is no current association. * * @param name the parameter name * @return the paramter's value */ public String getParameter(String name) { return parameters.get(name); }
/** * Retrieve the value associated with the given name, or null if there * is no current association. * * @param name the parameter name * @return the paramter's value */ public String getParameter(String name) { return parameters.get(name); }
public String getParameter(String name) { return parameterList.get(name); }
public String getParameter(String name) { return parameterList.get(name); }
public String getParameter(String name) { return parameterList.get(name); }
private static float getQ(MimeType m) { String qString = m.getParameters().get("q"); if (qString == null) { return 1; } else { return Float.parseFloat(qString); } }
AcceptHeaderEntry(MimeType mediaType) { MimeTypeParameterList parametersWithoutQ = mediaType.getParameters(); String qValue = parametersWithoutQ.get("q"); parametersWithoutQ.remove("q"); this.mediaType = mimeType(mediaType.getBaseType() + parametersWithoutQ.toString()); if (qValue == null) { quality = 1000; } else { quality = (int) (Float.parseFloat(qValue) * 1000); } }
private String getContentEncodingfromContentType() { try { final String contentType = getContentType(); if (StringUtilities.isNullOrTrimmedEmpty(contentType)) { return "UTF-8"; //$NON-NLS-1$ } final MimeType mimeType = new MimeType(contentType); final MimeTypeParameterList parameters = mimeType.getParameters(); final String charset = parameters.get("charset"); //$NON-NLS-1$ if (StringUtilities.isNullOrTrimmedEmpty(charset)) { return "UTF-8"; //$NON-NLS-1$ } return charset; } catch (final MimeTypeParseException exception) { return "UTF-8"; //$NON-NLS-1$ } }