Tabnine Logo
MimeType.addParameter
Code IndexAdd Tabnine to your IDE (free)

How to use
addParameter
method
in
com.helger.commons.mime.MimeType

Best Java code snippets using com.helger.commons.mime.MimeType.addParameter (Showing top 9 results out of 315)

origin: com.helger/ph-as4-lib

/**
 * Get the mime type of this SOAP version with the passed charset.
 *
 * @param aCharset
 *        The charset to be used. May not be <code>null</code>.
 * @return Never <code>null</code>.
 */
@Nonnull
@ReturnsMutableCopy
public MimeType getMimeType (@Nonnull final Charset aCharset)
{
 return new MimeType (m_aMimeType).addParameter (CMimeType.PARAMETER_NAME_CHARSET, aCharset.name ());
}
origin: com.helger/ph-oton-core

/**
 * Get the HTML MIME type to use
 *
 * @param aRequestScope
 *        The request scope. May be <code>null</code>-
 * @return Never <code>null</code>.
 */
@Nonnull
public static IMimeType getMimeType (@Nullable final IRequestWebScopeWithoutResponse aRequestScope)
{
 // Add the charset to the MIME type
 return new MimeType (CMimeType.TEXT_HTML).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
                             HCSettings.getHTMLCharset ().name ());
}
origin: com.helger/ph-oton-core

public void xml (@Nullable final String sXML, @Nonnull final Charset aCharset)
{
 setContentAndCharset (StringHelper.getNotNull (sXML), aCharset);
 setMimeType (new MimeType (CMimeType.APPLICATION_XML).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
                                   aCharset.name ()));
}
origin: com.helger/ph-oton-core

public void json (@Nullable final IJson aValue)
{
 // Ensure it is valid JSON
 final String sResponse = aValue != null ? aValue.getAsJsonString () : "{}";
 final Charset aCharset = StandardCharsets.UTF_8;
 setContentAndCharset (sResponse, aCharset);
 setMimeType (new MimeType (CMimeType.APPLICATION_JSON).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
                                    aCharset.name ()));
}
origin: phax/ph-css

m_aMimeType = ((MimeType) aMimeType.getClone ()).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
                                aCharset.name ());
origin: phax/peppol-smp-server

 public void handleRequest (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
               @Nonnull final UnifiedResponse aUnifiedResponse) throws Exception
 {
  if (LOGGER.isDebugEnabled ())
   LOGGER.debug ("Status information requested");

  // Build data to provide
  IJsonObject aStatusData;
  if (SMPServerConfiguration.isStatusEnabled ())
   aStatusData = getDefaultStatusData ();
  else
  {
   // Status is disabled in the configuration
   aStatusData = new JsonObject ();
   aStatusData.add ("status.enabled", false);
  }

  // Put JSON on response
  aUnifiedResponse.disableCaching ();
  aUnifiedResponse.setMimeType (new MimeType (CMimeType.APPLICATION_JSON).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
                                             CHARSET.name ()));
  aUnifiedResponse.setContentAndCharset (aStatusData.getAsJsonString (), CHARSET);
 }
}
origin: com.helger/peppol-smp-server-webapp

 public void handleRequest (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
               @Nonnull final UnifiedResponse aUnifiedResponse) throws Exception
 {
  if (LOGGER.isDebugEnabled ())
   LOGGER.debug ("Status information requested");

  // Build data to provide
  IJsonObject aStatusData;
  if (SMPServerConfiguration.isStatusEnabled ())
   aStatusData = getDefaultStatusData ();
  else
  {
   // Status is disabled in the configuration
   aStatusData = new JsonObject ();
   aStatusData.add ("status.enabled", false);
  }

  // Put JSON on response
  aUnifiedResponse.disableCaching ();
  aUnifiedResponse.setMimeType (new MimeType (CMimeType.APPLICATION_JSON).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
                                             CHARSET.name ()));
  aUnifiedResponse.setContentAndCharset (aStatusData.getAsJsonString (), CHARSET);
 }
}
origin: com.helger/ph-webctrls

 public void execute (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
            @Nonnull final UnifiedResponse aUnifiedResponse) throws Exception
 {
  // Resolve language
  final String sLanguage = aRequestScope.getAttributeAsString (LANGUAGE_ID);
  Locale aLanguage = LocaleCache.getLocale (sLanguage);
  if (aLanguage == null)
  {
   // None or invalid locale specified - use default from constructor
   aLanguage = m_aDefaultLocale;
  }

  // Main action
  final IJsonObject aData = DataTables.createLanguageJson (aLanguage);

  // Fill HTTP response
  final Charset aCharset = CHTMLCharset.CHARSET_HTML_OBJ;
  aUnifiedResponse.setContentAndCharset (aData.getAsString (), aCharset)
          .setMimeType (new MimeType (CMimeType.APPLICATION_JSON).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
                                             aCharset.name ()))
          .enableCaching (ResponseHelperSettings.getExpirationSeconds ());
 }
}
origin: com.helger/ph-smtp

new MimeType (CMimeType.TEXT_HTML).addParameter (CMimeType.PARAMETER_NAME_CHARSET,
                         aCharset.name ())
                 .getAsString ());
com.helger.commons.mimeMimeTypeaddParameter

Popular methods of MimeType

  • <init>
  • getAsString
  • getCopyWithoutParameters
  • getParameterValueWithName

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now