Example usage for javax.activation MimeType MimeType

List of usage examples for javax.activation MimeType MimeType

Introduction

In this page you can find the example usage for javax.activation MimeType MimeType.

Prototype

public MimeType(String primary, String sub) throws MimeTypeParseException 

Source Link

Document

Constructor that builds a MimeType with the given primary and sub type but has an empty parameter list.

Usage

From source file:com.frank.search.solr.core.schema.MappingJacksonResponseParser.java

private static MimeType defaultMimeType() {
    try {//from  w  w w  .jav  a 2 s.c  o m
        return new MimeType("application", "json");
    } catch (MimeTypeParseException o_O) {
        throw new IllegalArgumentException(o_O);
    }
}

From source file:org.kalypso.commons.java.activation.MimeTypeFinder.java

public MimeTypeFinder() {
    try {// ww w.j  a  v  a2  s  . c o m
        m_knownTypes.put("dwg", new MimeType(MIME_APPLICATION, "acad")); // AutoCAD-Dateien (nach NCSA) //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("dxf", new MimeType(MIME_APPLICATION, "dxf")); // AutoCAD-Dateien (nach CERN) //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("gz", new MimeType(MIME_APPLICATION, "gzip")); // GNU Zip-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("xls", new MimeType(MIME_APPLICATION, "msexcel")); // Microsoft Excel Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("ppt", new MimeType(MIME_APPLICATION, "mspowerpoint")); // Microsoft Powerpoint Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("doc", new MimeType(MIME_APPLICATION, "msword")); // Microsoft Word Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("pdf", new MimeType(MIME_APPLICATION, "pdf")); // Adobe PDF-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("ps", new MimeType(MIME_APPLICATION, "postscript")); // Adobe PostScript-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("eps", new MimeType(MIME_APPLICATION, "postscript")); // Adobe PostScript-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("rtf", new MimeType(MIME_APPLICATION, "rtf")); // Microsoft RTF-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("htm", new MimeType(MIME_APPLICATION, "xhtml+xml")); // XHTML-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("html", new MimeType(MIME_APPLICATION, "xhtml+xml")); // XHTML-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("xhtml", new MimeType(MIME_APPLICATION, "xhtml+xml")); // XHTML-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("xml", new MimeType(MIME_APPLICATION, "xml")); // XML-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("gtar", new MimeType(MIME_APPLICATION, "x-gtar")); // GNU tar-Archivdateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("swf", new MimeType(MIME_APPLICATION, "x-shockwave-flash")); // Flash Shockwave-Dateien //$NON-NLS-1$ //$NON-NLS-2$

        m_knownTypes.put("tar", new MimeType(MIME_APPLICATION, "x-tar")); // tar-Archivdateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("zip", new MimeType(MIME_APPLICATION, "zip")); // ZIP-Archivdateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("mp2", new MimeType(MIME_AUDIO, "x-mpeg")); // MPEG-Dateien //$NON-NLS-1$ //$NON-NLS-2$

        m_knownTypes.put("jpg", new MimeType(MIME_IMAGE, "jpg")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("jpeg", new MimeType(MIME_IMAGE, "jpg")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("jpe", new MimeType(MIME_IMAGE, "jpg")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("gif", new MimeType(MIME_IMAGE, "gif")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("png", new MimeType(MIME_IMAGE, "png")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("tiff", new MimeType(MIME_IMAGE, "tiff")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("tif", new MimeType(MIME_IMAGE, "tiff")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("bmp", new MimeType(MIME_IMAGE, "bmp")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("ico", new MimeType(MIME_IMAGE, "ico")); //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("ico", new MimeType(MIME_IMAGE, "x-icon")); // Icon-Dateien (z.B. Favoriten-Icons) //$NON-NLS-1$ //$NON-NLS-2$

        m_knownTypes.put("csv", new MimeType(MIME_TEXT, "comma-separated-values")); // kommaseparierte //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("txt", new MimeType(MIME_TEXT, "plain")); // *.txt reine Textdateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("tsv", new MimeType(MIME_TEXT, "tab-separated-values")); // *.tsv tabulator-separierte //$NON-NLS-1$ //$NON-NLS-2$

        m_knownTypes.put("xml", new MimeType(MIME_TEXT, "xml")); // XML-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("mpeg", new MimeType(MIME_VIDEO, "mpeg")); // MPEG-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("mpg", new MimeType(MIME_VIDEO, "mpeg")); // MPEG-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("mpe", new MimeType(MIME_VIDEO, "mpeg")); // MPEG-Dateien //$NON-NLS-1$ //$NON-NLS-2$
        m_knownTypes.put("avi", new MimeType(MIME_VIDEO, "x-msvideo")); // Microsoft AVI-Dateien //$NON-NLS-1$ //$NON-NLS-2$
    } catch (final MimeTypeParseException e) {
        e.printStackTrace();
    }
}

From source file:com.googlecode.ddom.frontend.saaj.impl.SwAProfile.java

@Override
public String getContentType() {
    MimeType contentType;//ww  w  .  ja v a2s.com
    try {
        contentType = new MimeType("multipart", "related");
    } catch (MimeTypeParseException ex) {
        throw new Error(ex);
    }
    contentType.setParameter("type", getSOAPVersion().getContentType());
    contentType.setParameter("boundary", boundary);
    return contentType.toString();
}