javaweb响应内容类型分析工具(tomcat)
前言
在模仿spring的MVC时,发现返回类型需要设置,不然默认返回text/txt文本的格式,在tomcat下的conf目录的web.xml文件下发现很多返回类型就通过代码读写,写成一个工具类,来判断是什么类型的内容。
提示:以下是本篇文章正文内容,下面案例可供参考
一、tomcat目录下的配置
发现这里有很多的请求内容的类型
二、生成工具
当然这不可能是手打的,使用io流进行书写的。你们可以直接复制使用。
代码如下(示例):
public class FileUtil {
public static String responseType(String type) {
switch (type.substring(type.lastIndexOf(".") + 1)) {
case "chm":
return "application/vnd.ms-htmlhelp";
case "snf":
return "application/x-font-snf";
case "atom":
return "application/atom+xml";
case "pvb":
return "application/vnd.3gpp.pic-bw-var";
case "ssdl":
return "application/ssdl+xml";
case "kia":
return "application/vnd.kidspiration";
case "ufd":
case "ufdl":
return "application/vnd.ufdl";
case "atx":
return "application/vnd.antix.game-component";
case "iso":
return "application/x-iso9660-image";
case "pfr":
return "application/font-tdpfr";
case "pwn":
return "application/vnd.3m.post-it-notes";
case "cfs":
return "application/x-cfs-compressed";
case "clkw":
return "application/vnd.crick.clicker.wordbank";
case "cmdf":
return "chemical/x-cmdf";
case "htke":
return "application/vnd.kenameaapp";
case "crd":
return "application/x-mscardfile";
case "rss":
return "application/rss+xml";
case "tcl":
return "application/x-tcl";
case "oas":
return "application/vnd.fujitsu.oasys";
case "vis":
return "application/vnd.visionary";
case "xdf":
return "application/xcap-diff+xml";
case "body":
case "htm":
case "html":
return "text/html";
case "pre":
return "application/vnd.lotus-freelance";
case "cil":
return "application/vnd.ms-artgalry";
case "gex":
case "gre":
return "application/vnd.geometry-explorer";
case "cb7":
case "cba":
case "cbr":
case "cbt":
case "cbz":
return "application/x-cbr";
case "cdx":
return "chemical/x-cdx";
case "txd":
return "application/vnd.genomatix.tuxedo";
case "wma":
return "audio/x-ms-wma";
case "csp":
return "application/vnd.commonspace";
case "xbd":
return "application/vnd.fujixerox.docuworks.binder";
case "mbk":
return "application/vnd.mobius.mbk";
case "scq":
return "application/scvp-cv-request";
case "src":
return "application/x-wais-source";
case "imp":
return "application/vnd.accpac.simply.imp";
case "air":
return "application/vnd.adobe.air-application-installer-package+zip";
case "lwp":
return "application/vnd.lotus-wordpro";
case "jar":
return "application/java-archive";
case "mpn":
return "application/vnd.mophun.application";
case "dp":
return "application/vnd.osgi.dp";
case "xlsm":
return "application/vnd.ms-excel.sheet.macroenabled.12";
case "vob":
return "video/x-ms-vob";
case "nlu":
return "application/vnd.neurolanguage.nlu";
case "wri":
return "application/x-mswrite";
case "cpt":
return "application/mac-compactpro";
case "hbci":
return "application/vnd.hbci";
case "cap":
case "dmp":
case "pcap":
return "application/vnd.tcpdump.pcap";
case "xltx":
return "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
case "tex":
return "application/x-tex";
case "c":
case "cc":
case "cpp":
case "cxx":
case "dic":
case "h":
case "hh":
return "text/x-c";
case "cdf":
return "application/x-cdf";
case "efif":
return "application/vnd.picsel";
case "cab":
return "application/vnd.ms-cab-compressed";
case "ice":
return "x-conference/x-cooltalk";
case "webp":
return "image/webp";
case "fdf":
return "application/vnd.fdf";
case "cryptonote":
return "application/vnd.rig.cryptonote";
case "m3u8":
return "application/vnd.apple.mpegurl";
case "lnk":
return "application/x-ms-shortcut";
case "rpst":
return "application/vnd.nokia.radio-preset";
case "xsm":
return "application/vnd.syncml+xml";
case "aif":
case "aifc":
case "aiff":
return "audio/x-aiff";
case "fpx":
return "image/vnd.fpx";
case "ncx":
return "application/x-dtbncx+xml";
case "sgl":
return "application/vnd.stardivision.writer-global";
case "book":
case "fm":
case "frame":
case "maker":
return "application/vnd.framemaker";
case "cer":
return "application/pkix-cert";
case "uvg":
case "uvi":
case "uvvg":
case "uvvi":
return "image/vnd.dece.graphic";
case "oti":
return "application/vnd.oasis.opendocument.image-template";
case "dis":
return "application/vnd.mobius.dis";
case "rtf":
return "application/rtf";
case "swi":
return "application/vnd.aristanetworks.swi";
case "ppm":
return "image/x-portable-pixmap";
case "ghf":
return "application/vnd.groove-help";
case "bdm":
return "application/vnd.syncml.dm+wbxml";
case "ei6":
return "application/vnd.pg.osasli";
case "ahead":
return "application/vnd.ahead.space";
case "unityweb":
return "application/vnd.unity";
case "p7r":
return "application/x-pkcs7-certreqresp";
case "cif":
return "chemical/x-cif";
case "uri":
case "uris":
case "urls":
return "text/uri-list";
case "fcdt":
return "application/vnd.adobe.formscentral.fcdt";
case "arc":
return "application/x-freearc";
case "ccxml":
return "application/ccxml+xml";
case "srt":
return "application/x-subrip";
case "es3":
case "et3":
return "application/vnd.eszigno3+xml";
case "png":
return "image/png";
case "f4v":
return "video/x-f4v";
case "mus":
return "application/vnd.musician";
case "saf":
return "application/vnd.yamaha.smaf-audio";
case "xps":
return "application/vnd.ms-xpsdocument";
case "cii":
return "application/vnd.anser-web-certificate-issue-initiation";
case "oga":
case "ogg":
case "spx":
return "audio/ogg";
case "tar":
return "application/x-tar";
case "smzip":
return "application/vnd.stepmania.package";
case "mc1":
return "application/vnd.medcalcdata";
case "str":
return "application/vnd.pg.format";
case "dotx":
return "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
case "sgm":
case "sgml":
return "text/sgml";
case "install":
return "application/x-install-instructions";
case "nns":
return "application/vnd.noblenet-sealer";
case "sdc":
return "application/vnd.stardivision.calc";
case "ifm":
return "application/vnd.shana.informed.formdata";
case "tpt":
return "application/vnd.trid.tpt";
case "cdbcmsg":
return "application/vnd.contact.cmsg";
case "mpm":
return "application/vnd.blueice.multipass";
case "qam":
return "application/vnd.epson.quickanime";
case "ris":
return "application/x-research-info-systems";
case "hps":
return "application/vnd.hp-hps";
case "rip":
return "audio/vnd.rip";
case "dfac":
return "application/vnd.dreamfactory";
case "ace":
return "application/x-ace-compressed";
case "epub":
return "application/epub+zip";
case "mpy":
return "application/vnd.ibm.minipay";
case "ac":
return "application/pkix-attr-cert";
case "rif":
return "application/reginfo+xml";
case "clkx":
return "application/vnd.crick.clicker";
case "sis":
case "sisx":
return "application/vnd.symbian.install";
case "cdkey":
return "application/vnd.mediastation.cdkey";
case "exi":
return "application/exi";
case "mrc":
return "application/marc";
case "evy":
return "application/x-envoy";
case "tcap":
return "application/vnd.3gpp2.tcap";
case "sxm":
return "application/vnd.sun.xml.math";
case "c11amc":
return "application/vnd.cluetrust.cartomobile-config";
case "dxp":
return "application/vnd.spotfire.dxp";
case "asm":
case "s":
return "text/x-asm";
case "mmf":
return "application/vnd.smaf";
case "joda":
return "application/vnd.joost.joda-archive";
case "cod":
return "application/vnd.rim.cod";
case "car":
return "application/vnd.curl.car";
case "sil":
return "audio/silk";
case "sxw":
return "application/vnd.sun.xml.writer";
case "mmr":
return "image/vnd.fujixerox.edmics-mmr";
case "dtb":
return "application/x-dtbook+xml";
case "rdz":
return "application/vnd.data-vision.rdz";
case "ppam":
return "application/vnd.ms-powerpoint.addin.macroenabled.12";
case "ptid":
return "application/vnd.pvi.ptid1";
case "sus":
case "susp":
return "application/vnd.sus-calendar";
case "tsd":
return "application/timestamped-data";
case "acu":
return "application/vnd.acucobol";
case "xo":
return "application/vnd.olpc-sugar";
case "pcurl":
return "application/vnd.curl.pcurl";
case "123":
return "application/vnd.lotus-1-2-3";
case "c4d":
case "c4f":
case "c4g":
case "c4p":
case "c4u":
return "application/vnd.clonk.c4group";
case "gxt":
return "application/vnd.geonext";
case "pub":
return "application/x-mspublisher";
case "gram":
return "application/srgs";
case "rar":
return "application/x-rar-compressed";
case "xbm":
return "image/x-xbitmap";
case "otg":
return "application/vnd.oasis.opendocument.graphics-template";
case "nnd":
return "application/vnd.noblenet-directory";
case "rm":
return "application/vnd.rn-realmedia";
case "wav":
return "audio/x-wav";
case "ktr":
case "ktz":
return "application/vnd.kahootz";
case "ttf":
return "font/ttf";
case "bin":
case "bpk":
case "deploy":
case "dist":
case "distz":
case "dms":
case "dump":
case "elc":
case "exe":
case "lrf":
case "mar":
case "pkg":
case "so":
return "application/octet-stream";
case "kne":
case "knp":
return "application/vnd.kinar";
case "asf":
case "asx":
return "video/x-ms-asf";
case "rdf":
return "application/rdf+xml";
case "sv4crc":
return "application/x-sv4crc";
case "3g2":
return "video/3gpp2";
case "kml":
return "application/vnd.google-earth.kml+xml";
case "ait":
return "application/vnd.dvb.ait";
case "mng":
return "video/x-mng";
case "m2a":
case "m3a":
case "mp1":
case "mp2":
case "mp2a":
case "mp3":
case "mpa":
case "mpga":
return "audio/mpeg";
case "davmount":
return "application/davmount+xml";
case "xer":
return "application/patch-ops-error+xml";
case "p":
case "pas":
return "text/x-pascal";
case "g2w":
return "application/vnd.geoplan";
case "xbap":
return "application/x-ms-xbap";
case "daf":
return "application/vnd.mobius.daf";
case "oprc":
case "pdb":
case "pqa":
return "application/vnd.palm";
case "gxf":
return "application/gxf";
case "m3u":
return "audio/x-mpegurl";
case "dwf":
return "model/vnd.dwf";
case "svg":
case "svgz":
return "image/svg+xml";
case "trm":
return "application/x-msterminal";
case "jlt":
return "application/vnd.hp-jlyt";
case "lbe":
return "application/vnd.llamagraphics.life-balance.exchange+xml";
case "mpkg":
return "application/vnd.apple.installer+xml";
case "viv":
return "video/vnd.vivo";
case "jam":
return "application/vnd.jam";
case "prf":
return "application/pics-rules";
case "abs":
case "mpega":
return "audio/x-mpeg";
case "ma":
case "mb":
case "nb":
return "application/mathematica";
case "setreg":
return "application/set-registration-initiation";
case "xm":
return "audio/xm";
case "m21":
case "mp21":
return "application/mp21";
case "rmp":
return "audio/x-pn-realaudio-plugin";
case "rsd":
return "application/rsd+xml";
case "pnm":
return "image/x-portable-anymap";
case "csml":
return "chemical/x-csml";
case "yin":
return "application/yin+xml";
case "dbk":
return "application/docbook+xml";
case "avi":
return "video/x-msvideo";
case "ppsm":
return "application/vnd.ms-powerpoint.slideshow.macroenabled.12";
case "ecma":
return "application/ecmascript";
case "esa":
return "application/vnd.osgi.subsystem";
case "kpr":
case "kpt":
return "application/vnd.kde.kpresenter";
case "kon":
return "application/vnd.kde.kontour";
case "g3w":
return "application/vnd.geospace";
case "xif":
return "image/vnd.xiff";
case "utz":
return "application/vnd.uiq.theme";
case "docm":
return "application/vnd.ms-word.document.macroenabled.12";
case "obd":
return "application/x-msbinder";
case "opf":
return "application/oebps-package+xml";
case "p12":
case "pfx":
return "application/x-pkcs12";
case "mscml":
return "application/mediaservercontrol+xml";
case "csv":
return "text/csv";
case "dssc":
return "application/dssc+der";
case "p10":
return "application/pkcs10";
case "nsf":
return "application/vnd.lotus-notes";
case "css":
return "text/css";
case "man":
case "me":
case "ms":
case "roff":
case "t":
case "tr":
return "text/troff";
case "xpr":
return "application/vnd.is-xpr";
case "cgm":
return "image/cgm";
case "hlp":
return "application/winhlp";
case "mts":
return "model/vnd.mts";
case "flw":
return "application/vnd.kde.kivio";
case "sru":
return "application/sru+xml";
case "onepkg":
case "onetmp":
case "onetoc":
case "onetoc2":
return "application/onenote";
case "rq":
return "application/sparql-query";
case "mif":
return "application/x-mif";
case "mie":
return "application/x-mie";
case "stc":
return "application/vnd.sun.xml.calc.template";
case "rl":
return "application/resource-lists+xml";
case "tmo":
return "application/vnd.tmobile-livetv";
case "dvi":
return "application/x-dvi";
case "latex":
return "application/x-latex";
case "ltf":
return "application/vnd.frogans.ltf";
case "x3d":
case "x3dz":
return "model/x3d+xml";
case "m1v":
case "m2v":
case "mpe":
case "mpeg":
case "mpg":
return "video/mpeg";
case "mqy":
return "application/vnd.mobius.mqy";
case "mcd":
return "application/vnd.mcd";
case "xenc":
return "application/xenc+xml";
case "oda":
return "application/oda";
case "odm":
return "application/vnd.oasis.opendocument.text-master";
case "tsv":
return "text/tab-separated-values";
case "pya":
return "audio/vnd.ms-playready.media.pya";
case "gif":
return "image/gif";
case "bmi":
return "application/vnd.bmi";
case "fbs":
return "image/vnd.fastbidsheet";
case "slt":
return "application/vnd.epson.salt";
case "npx":
return "image/vnd.net-fpx";
case "sdp":
return "application/sdp";
case "osfpvg":
return "application/vnd.yamaha.openscoreformat.osfpvg+xml";
case "grxml":
return "application/srgs+xml";
case "mxs":
return "application/vnd.triscape.mxs";
case "wg":
return "application/vnd.pmi.widget";
case "res":
return "application/x-dtbresource+xml";
case "dra":
return "audio/vnd.dra";
case "kfo":
return "application/vnd.kde.kformula";
case "appcache":
return "text/cache-manifest";
case "bcpio":
return "application/x-bcpio";
case "odt":
return "application/vnd.oasis.opendocument.text";
case "fig":
return "application/x-xfig";
case "potm":
return "application/vnd.ms-powerpoint.template.macroenabled.12";
case "fxp":
case "fxpl":
return "application/vnd.adobe.fxp";
case "gdl":
return "model/vnd.gdl";
case "scs":
return "application/scvp-cv-response";
case "woff":
return "font/woff";
case "dae":
return "model/vnd.collada+xml";
case "pcl":
return "application/vnd.hp-pcl";
case "dts":
return "audio/vnd.dts";
case "rep":
return "application/vnd.businessobjects";
case "wcm":
case "wdb":
case "wks":
case "wps":
return "application/vnd.ms-works";
case "rlc":
return "image/vnd.fujixerox.edmics-rlc";
case "sql":
return "application/x-sql";
case "axv":
return "video/annodex";
case "dna":
return "application/vnd.dna";
case "class":
return "application/java";
case "scm":
return "application/vnd.lotus-screencam";
case "fsc":
return "application/vnd.fsc.weblaunch";
case "geo":
return "application/vnd.dynageo";
case "ftc":
return "application/vnd.fluxtime.clip";
case "ktx":
return "image/ktx";
case "azw":
return "application/vnd.amazon.ebook";
case "opml":
return "text/x-opml";
case "mbox":
return "application/mbox";
case "aso":
return "application/vnd.accpac.simply.aso";
case "see":
return "application/vnd.seemail";
case "spp":
return "application/scvp-vp-response";
case "nnw":
return "application/vnd.noblenet-web";
case "xla":
case "xlc":
case "xlm":
case "xls":
case "xlt":
case "xlw":
return "application/vnd.ms-excel";
case "p8":
return "application/pkcs8";
case "sv4cpio":
return "application/x-sv4cpio";
case "dtd":
return "application/xml-dtd";
case "msty":
return "application/vnd.muvee.style";
case "fh":
case "fh4":
case "fh5":
case "fh7":
case "fhc":
return "image/x-freehand";
case "metalink":
return "application/metalink+xml";
case "odb":
return "application/vnd.oasis.opendocument.database";
case "dgc":
return "application/x-dgc-compressed";
case "wqd":
return "application/vnd.wqd";
case "curl":
return "text/vnd.curl";
case "sfv":
return "text/x-sfv";
case "cdy":
return "application/vnd.cinderella";
case "ai":
case "eps":
case "ps":
return "application/postscript";
case "ims":
return "application/vnd.ms-ims";
case "karbon":
return "application/vnd.kde.karbon";
case "rcprofile":
return "application/vnd.ipunplugged.rcprofile";
case "cml":
return "chemical/x-cml";
case "xaml":
return "application/xaml+xml";
case "java":
return "text/x-java-source";
case "osf":
return "application/vnd.yamaha.openscoreformat";
case "shf":
return "application/shf+xml";
case "teacher":
return "application/vnd.smart.teacher";
case "twd":
case "twds":
return "application/vnd.simtech-mindmapper";
case "bh2":
return "application/vnd.fujitsu.oasysprs";
case "sfs":
return "application/vnd.spotfire.sfs";
case "dvb":
return "video/vnd.dvb.file";
case "potx":
return "application/vnd.openxmlformats-officedocument.presentationml.template";
case "ulx":
return "application/x-glulx";
case "tei":
case "teicorpus":
return "application/tei+xml";
case "gtar":
return "application/x-gtar";
case "uvs":
case "uvvs":
return "video/vnd.dece.sd";
case "bdf":
return "application/x-font-bdf";
case "ief":
return "image/ief";
case "ngdat":
return "application/vnd.nokia.n-gage.data";
case "rnc":
return "application/relax-ng-compact-syntax";
case "sdw":
case "vor":
return "application/vnd.stardivision.writer";
case "afp":
case "list3820":
case "listafp":
return "application/vnd.ibm.modcap";
case "weba":
return "audio/webm";
case "gpx":
return "application/gpx+xml";
case "chrt":
return "application/vnd.kde.kchart";
case "cmp":
return "application/vnd.yellowriver-custom-menu";
case "docx":
return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
case "sldm":
return "application/vnd.ms-powerpoint.slide.macroenabled.12";
case "uvp":
case "uvvp":
return "video/vnd.dece.pd";
case "vcd":
return "application/x-cdlink";
case "clkk":
return "application/vnd.crick.clicker.keyboard";
case "flx":
return "text/vnd.fmi.flexstor";
case "tga":
return "image/x-tga";
case "3dml":
return "text/vnd.in3d.3dml";
case "smi":
case "smil":
return "application/smil+xml";
case "ssf":
return "application/vnd.epson.ssf";
case "cmc":
return "application/vnd.cosmocaller";
case "emf":
case "emz":
case "wmf":
case "wmz":
return "application/x-msmetafile";
case "plf":
return "application/vnd.pocketlearn";
case "svc":
return "application/vnd.dvb.service";
case "flac":
return "audio/flac";
case "musicxml":
return "application/vnd.recordare.musicxml+xml";
case "fnc":
return "application/vnd.frogans.fnc";
case "wmlsc":
return "application/vnd.wap.wmlscriptc";
case "crt":
case "der":
return "application/x-x509-ca-cert";
case "mxl":
return "application/vnd.recordare.musicxml";
case "iges":
case "igs":
return "model/iges";
case "rtx":
return "text/richtext";
case "bat":
case "com":
case "dll":
case "msi":
return "application/x-msdownload";
case "igl":
return "application/vnd.igloader";
case "ppd":
return "application/vnd.cups-ppd";
case "shar":
return "application/x-shar";
case "qps":
return "application/vnd.publishare-delta-tree";
case "clkp":
return "application/vnd.crick.clicker.palette";
case "deb":
case "udeb":
return "application/x-debian-package";
case "sxi":
return "application/vnd.sun.xml.impress";
case "hvp":
return "application/vnd.yamaha.hv-voice";
case "tpl":
return "application/vnd.groove-tool-template";
case "stl":
return "application/vnd.ms-pki.stl";
case "gz":
return "application/x-gzip";
case "xyz":
return "chemical/x-xyz";
case "mcurl":
return "text/vnd.curl.mcurl";
case "ppsx":
return "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
case "t3":
return "application/x-t3vm-image";
case "ggb":
return "application/vnd.geogebra.file";
case "sbml":
return "application/sbml+xml";
case "avx":
return "video/x-rad-screenplay";
case "vxml":
return "application/voicexml+xml";
case "mobi":
case "prc":
return "application/x-mobipocket-ebook";
case "kar":
case "mid":
case "midi":
case "rmi":
return "audio/midi";
case "xar":
return "application/vnd.xara";
case "hal":
return "application/vnd.hal+xml";
case "pcx":
return "image/x-pcx";
case "tao":
return "application/vnd.tao.intent-module-archive";
case "paw":
return "application/vnd.pawaafile";
case "wsdl":
return "application/wsdl+xml";
case "rgb":
return "image/x-rgb";
case "msf":
return "application/vnd.epson.msf";
case "ots":
return "application/vnd.oasis.opendocument.spreadsheet-template";
case "spl":
return "application/x-futuresplash";
case "mets":
return "application/mets+xml";
case "mp4s":
return "application/mp4";
case "m4u":
case "mxu":
return "video/vnd.mpegurl";
case "nc":
return "application/x-netcdf";
case "vcard":
return "text/vcard";
case "xpw":
case "xpx":
return "application/vnd.intercon.formnet";
case "ksp":
return "application/vnd.kde.kspread";
case "sda":
return "application/vnd.stardivision.draw";
case "cww":
return "application/prs.cww";
case "xop":
return "application/xop+xml";
case "xpm":
return "image/x-xpixmap";
case "apr":
return "application/vnd.lotus-approach";
case "mov":
case "qt":
return "video/quicktime";
case "m4v":
case "mp4":
case "mp4v":
case "mpg4":
return "video/mp4";
case "sh":
return "application/x-sh";
case "webm":
return "video/webm";
case "djv":
case "djvu":
return "image/vnd.djvu";
case "rpss":
return "application/vnd.nokia.radio-presets";
case "wm":
return "video/x-ms-wm";
case "mads":
return "application/mads+xml";
case "wdp":
return "image/vnd.ms-photo";
case "dotm":
return "application/vnd.ms-word.template.macroenabled.12";
case "pls":
return "audio/x-scpls";
case "scurl":
return "text/vnd.curl.scurl";
case "nzb":
return "application/x-nzb";
case "f":
case "f77":
case "f90":
case "for":
return "text/x-fortran";
case "mpc":
return "application/vnd.mophun.certificate";
case "xdw":
return "application/vnd.fujixerox.docuworks";
case "hvs":
return "application/vnd.yamaha.hv-script";
case "les":
return "application/vnd.hhe.lesson-player";
case "3gp":
return "video/3gpp";
case "pgn":
return "application/x-chess-pgn";
case "xap":
return "application/x-silverlight-app";
case "obj":
return "application/x-tgif";
case "cla":
return "application/vnd.claymore";
case "acutc":
case "atc":
return "application/vnd.acucorp";
case "fe_launch":
return "application/vnd.denovo.fcselayout-link";
case "sdd":
return "application/vnd.stardivision.impress";
case "zip":
return "application/zip";
case "roa":
return "application/rpki-roa";
case "xslt":
return "application/xslt+xml";
case "caf":
return "audio/x-caf";
case "jsonml":
return "application/jsonml+json";
case "vcg":
return "application/vnd.groove-vcard";
case "psd":
return "image/vnd.adobe.photoshop";
case "uvu":
case "uvvu":
return "video/vnd.uvvu.mp4";
case "aep":
return "application/vnd.audiograph";
case "uvh":
case "uvvh":
return "video/vnd.dece.hd";
case "uu":
return "text/x-uuencode";
case "vtu":
return "model/vnd.vtu";
case "sfd-hdstx":
return "application/vnd.hydrostatix.sof-data";
case "cmx":
return "image/x-cmx";
case "thmx":
return "application/vnd.ms-officetheme";
case "kmz":
return "application/vnd.google-earth.kmz";
case "xdm":
return "application/vnd.syncml.dm+xml";
case "vcx":
return "application/vnd.vcx";
case "gml":
return "application/gml+xml";
case "setpay":
return "application/set-payment-initiation";
case "fly":
return "text/vnd.fly";
case "dmg":
return "application/x-apple-diskimage";
case "wvx":
return "video/x-ms-wvx";
case "aab":
case "u32":
case "vox":
case "x32":
return "application/x-authorware-bin";
case "mgz":
return "application/vnd.proteus.magazine";
case "gramps":
return "application/x-gramps-xml";
case "ink":
case "inkml":
return "application/inkml+xml";
case "xz":
return "application/x-xz";
case "gtw":
return "model/vnd.gtw";
case "c11amz":
return "application/vnd.cluetrust.cartomobile-config-pkg";
case "psf":
return "application/x-font-linux-psf";
case "plb":
return "application/vnd.3gpp.pic-bw-large";
case "aam":
return "application/x-authorware-map";
case "cct":
case "cst":
case "cxt":
case "dcr":
case "dir":
case "dxr":
case "fgd":
case "swa":
case "w3d":
return "application/x-director";
case "grv":
return "application/vnd.groove-injector";
case "otf":
return "font/otf";
case "mdb":
return "application/x-msaccess";
case "p7b":
case "spc":
return "application/x-pkcs7-certificates";
case "crl":
return "application/pkix-crl";
case "xwd":
return "image/x-xwindowdump";
case "cpio":
return "application/x-cpio";
case "mdi":
return "image/vnd.ms-modi";
case "movie":
return "video/x-sgi-movie";
case "pcf":
return "application/x-font-pcf";
case "mpv2":
return "video/mpeg2";
case "st":
return "application/vnd.sailingtracker.track";
case "wbs":
return "application/vnd.criticaltools.wbs+xml";
case "aac":
return "audio/x-aac";
case "otp":
return "application/vnd.oasis.opendocument.presentation-template";
case "tfi":
return "application/thraud+xml";
case "pki":
return "application/pkixcmp";
case "pgm":
return "image/x-portable-graymap";
case "sc":
return "application/vnd.ibm.secure-container";
case "swf":
return "application/x-shockwave-flash";
case "jisp":
return "application/vnd.jisp";
case "mxml":
case "xhvml":
case "xvm":
case "xvml":
return "application/xv+xml";
case "box":
return "application/vnd.previewsystems.box";
case "pptm":
return "application/vnd.ms-powerpoint.presentation.macroenabled.12";
case "ustar":
return "application/x-ustar";
case "i2g":
return "application/vnd.intergeo";
case "wspolicy":
return "application/wspolicy+xml";
case "bed":
return "application/vnd.realvnc.bed";
case "mpp":
case "mpt":
return "application/vnd.ms-project";
case "xfdf":
return "application/vnd.adobe.xfdf";
case "mka":
return "audio/x-matroska";
case "oa2":
return "application/vnd.fujitsu.oasys2";
case "ott":
return "application/vnd.oasis.opendocument.text-template";
case "hdf":
return "application/x-hdf";
case "oa3":
return "application/vnd.fujitsu.oasys3";
case "texi":
case "texinfo":
return "application/x-texinfo";
case "gsf":
return "application/x-font-ghostscript";
case "gam":
return "application/x-tads";
case "bmp":
case "dib":
return "image/bmp";
case "yang":
return "application/yang";
case "mwf":
return "application/vnd.mfer";
case "pclxl":
return "application/vnd.hp-pclxl";
case "mods":
return "application/mods+xml";
case "spq":
return "application/scvp-vp-request";
case "ras":
return "image/x-cmu-raster";
case "application":
return "application/x-ms-application";
case "qwd":
case "qwt":
case "qxb":
case "qxd":
case "qxl":
case "qxt":
return "application/vnd.quark.quarkxpress";
case "tfm":
return "application/x-tex-tfm";
case "cdmiq":
return "application/cdmi-queue";
case "odft":
return "application/vnd.oasis.opendocument.formula-template";
case "xfdl":
return "application/vnd.xfdl";
case "n-gage":
return "application/vnd.nokia.n-gage.symbian.install";
case "gac":
return "application/vnd.groove-account";
case "wasm":
return "application/wasm";
case "pot":
case "pps":
case "ppt":
return "application/vnd.ms-powerpoint";
case "tif":
case "tiff":
return "image/tiff";
case "sit":
return "application/x-stuffit";
case "wbxml":
return "application/vnd.wap.wbxml";
case "uvvx":
case "uvx":
return "application/vnd.dece.unspecified";
case "wmd":
return "application/x-ms-wmd";
case "dtshd":
return "audio/vnd.dts.hd";
case "adp":
return "audio/adpcm";
case "stf":
return "application/vnd.wt.stf";
case "mk3d":
case "mks":
case "mkv":
return "video/x-matroska";
case "wgt":
return "application/widget";
case "aw":
return "application/applixware";
case "ez2":
return "application/vnd.ezpix-album";
case "sxc":
return "application/vnd.sun.xml.calc";
case "dd2":
return "application/vnd.oma.dd2+xml";
case "iota":
return "application/vnd.astraea-software.iota";
case "oth":
return "application/vnd.oasis.opendocument.text-web";
case "jpgv":
return "video/jpeg";
case "svd":
return "application/vnd.svd";
case "hpid":
return "application/vnd.hp-hpid";
case "bz":
return "application/x-bzip";
case "etx":
return "text/x-setext";
case "azs":
return "application/vnd.airzip.filesecure.azs";
case "jnlp":
return "application/x-java-jnlp-file";
case "meta4":
return "application/metalink4+xml";
case "ext":
return "application/vnd.novadigm.ext";
case "lasxml":
return "application/vnd.las.las+xml";
case "uva":
case "uvva":
return "audio/vnd.dece.audio";
case "sub":
return "text/vnd.dvb.subtitle";
case "fcs":
return "application/vnd.isac.fcs";
case "wad":
return "application/x-doom";
case "jad":
return "text/vnd.sun.j2me.app-descriptor";
case "sm":
return "application/vnd.stepmania.stepchart";
case "uoml":
return "application/vnd.uoml+xml";
case "azf":
return "application/vnd.airzip.filesecure.azf";
case "msl":
return "application/vnd.mobius.msl";
case "odp":
return "application/vnd.oasis.opendocument.presentation";
case "irp":
return "application/vnd.irepository.package+xml";
case "art":
return "image/x-jg";
case "hpgl":
return "application/vnd.hp-hpgl";
case "mj2":
case "mjp2":
return "video/mj2";
case "ico":
return "image/x-icon";
case "ogx":
return "application/ogg";
case "dart":
return "application/vnd.dart";
case "ami":
return "application/vnd.amiga.ami";
case "ttl":
return "text/turtle";
case "fvt":
return "video/vnd.fvt";
case "eol":
return "audio/vnd.digital-winds";
case "irm":
return "application/vnd.ibm.rights-management";
case "uvv":
case "uvvv":
return "video/vnd.dece.video";
case "fg5":
return "application/vnd.fujitsu.oasysgp";
case "btif":
return "image/prs.btif";
case "fti":
return "application/vnd.anser-web-funds-transfer-initiation";
case "sdkd":
case "sdkm":
return "application/vnd.solent.sdkm+xml";
case "aas":
return "application/x-authorware-seg";
case "chat":
return "application/x-chat";
case "odi":
return "application/vnd.oasis.opendocument.image";
case "boz":
case "bz2":
return "application/x-bzip2";
case "atomcat":
return "application/atomcat+xml";
case "flo":
return "application/vnd.micrografx.flo";
case "m13":
case "m14":
case "mvb":
return "application/x-msmediaview";
case "vcf":
return "text/x-vcard";
case "apk":
return "application/vnd.android.package-archive";
case "z1":
case "z2":
case "z3":
case "z4":
case "z5":
case "z6":
case "z7":
case "z8":
return "application/x-zmachine";
case "axa":
return "audio/annodex";
case "gnumeric":
return "application/x-gnumeric";
case "sema":
return "application/vnd.sema";
case "gqf":
case "gqs":
return "application/vnd.grafeq";
case "xpi":
return "application/x-xpinstall";
case "semd":
return "application/vnd.semd";
case "iif":
return "application/vnd.shana.informed.interchange";
case "semf":
return "application/vnd.semf";
case "ecelp4800":
return "audio/vnd.nuera.ecelp4800";
case "dxf":
return "image/vnd.dxf";
case "eml":
case "mime":
return "message/rfc822";
case "vsd":
case "vss":
case "vst":
case "vsw":
return "application/vnd.visio";
case "csh":
return "application/x-csh";
case "igm":
return "application/vnd.insors.igm";
case "rms":
return "application/vnd.jcp.javame.midlet-rms";
case "cdmia":
return "application/cdmi-capability";
case "esf":
return "application/vnd.epson.esf";
case "fzs":
return "application/vnd.fuzzysheet";
case "acc":
return "application/vnd.americandynamics.acc";
case "stk":
return "application/hyperstudio";
case "sldx":
return "application/vnd.openxmlformats-officedocument.presentationml.slide";
case "uvvz":
case "uvz":
return "application/vnd.dece.zip";
case "gph":
return "application/vnd.flographit";
case "m4a":
case "m4b":
case "m4r":
case "mp4a":
return "audio/mp4";
case "mseq":
return "application/vnd.mseq";
case "xlf":
return "application/x-xliff+xml";
case "omdoc":
return "application/omdoc+xml";
case "pdf":
return "application/pdf";
case "pgp":
return "application/pgp-encrypted";
case "torrent":
return "application/x-bittorrent";
case "wmlc":
return "application/vnd.wap.wmlc";
case "srx":
return "application/sparql-results+xml";
case "abw":
return "application/x-abiword";
case "fli":
return "video/x-fli";
case "kwd":
case "kwt":
return "application/vnd.kde.kword";
case "mathml":
return "application/mathml+xml";
case "wpl":
return "application/vnd.ms-wpl";
case "xdssc":
return "application/dssc+xml";
case "uvd":
case "uvf":
case "uvvd":
case "uvvf":
return "application/vnd.dece.data";
case "stw":
return "application/vnd.sun.xml.writer.template";
case "wpd":
return "application/vnd.wordperfect";
case "umj":
return "application/vnd.umajin";
case "vrml":
case "wrl":
return "model/vrml";
case "spf":
return "application/vnd.yamaha.smaf-phrase";
case "js":
return "application/javascript";
case "qti":
case "qtif":
return "image/x-quicktime";
case "qbo":
return "application/vnd.intu.qbo";
case "ssml":
return "application/ssml+xml";
case "g3":
return "image/g3fax";
case "rld":
return "application/resource-lists-diff+xml";
case "z":
return "application/x-compress";
case "dwg":
return "image/vnd.dwg";
case "gtm":
return "application/vnd.groove-tool-message";
case "sxg":
return "application/vnd.sun.xml.writer.global";
case "icc":
case "icm":
return "application/vnd.iccprofile";
case "oxps":
return "application/oxps";
case "mfm":
return "application/vnd.mfmp";
case "otc":
return "application/vnd.oasis.opendocument.chart-template";
case "xlsx":
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
case "sgi":
return "image/sgi";
case "ipk":
return "application/vnd.shana.informed.package";
case "cdmio":
return "application/cdmi-object";
case "mgp":
return "application/vnd.osgeo.mapguide.package";
case "rp9":
return "application/vnd.cloanto.rp9";
case "kpxx":
return "application/vnd.ds-keypoint";
case "nfo":
return "text/x-nfo";
case "ez":
return "application/andrew-inset";
case "smf":
return "application/vnd.stardivision.math";
case "ogv":
return "video/ogg";
case "atomsvc":
return "application/atomsvc+xml";
case "doc":
case "dot":
return "application/msword";
case "gv":
return "text/vnd.graphviz";
case "spot":
return "text/vnd.in3d.spot";
case "uvt":
case "uvvt":
return "application/vnd.dece.ttml+xml";
case "ez3":
return "application/vnd.ezpix-package";
case "mac":
case "pnt":
return "image/x-macpaint";
case "link66":
return "application/vnd.route66.link66+xml";
case "vsf":
return "application/vnd.vsf";
case "wbmp":
return "image/vnd.wap.wbmp";
case "pml":
return "application/vnd.ctc-posml";
case "p7c":
case "p7m":
return "application/pkcs7-mime";
case "cdmic":
return "application/cdmi-container";
case "pbd":
return "application/vnd.powerbuilder6";
case "x3dv":
case "x3dvz":
return "model/x3d+vrml";
case "qfx":
return "application/vnd.intu.qfx";
case "sid":
return "image/x-mrsid-image";
case "mft":
return "application/rpki-manifest";
case "n3":
return "text/n3";
case "ra":
case "ram":
return "audio/x-pn-realaudio";
case "skd":
case "skm":
case "skp":
case "skt":
return "application/vnd.koan";
case "conf":
case "def":
case "in":
case "jsf":
case "jspf":
case "list":
case "log":
case "text":
case "txt":
return "text/plain";
case "cu":
return "application/cu-seeme";
case "eva":
return "application/x-eva";
case "ipfix":
return "application/ipfix";
case "mag":
return "application/vnd.ecowin.chart";
case "gim":
return "application/vnd.groove-identity-message";
case "hvd":
return "application/vnd.yamaha.hv-dic";
case "nsc":
return "application/x-conference";
case "sitx":
return "application/x-stuffitx";
case "wmls":
return "text/vnd.wap.wmlscript";
case "xltm":
return "application/vnd.ms-excel.template.macroenabled.12";
case "h264":
return "video/h264";
case "sti":
return "application/vnd.sun.xml.impress.template";
case "h263":
return "video/h263";
case "odf":
return "application/vnd.oasis.opendocument.formula";
case "xpl":
return "application/xproc+xml";
case "h261":
return "video/h261";
case "pyv":
return "video/vnd.ms-playready.media.pyv";
case "x3db":
case "x3dbz":
return "model/x3d+binary";
case "asc":
case "sig":
return "application/pgp-signature";
case "pct":
case "pic":
case "pict":
return "image/pict";
case "afm":
case "pfa":
case "pfb":
case "pfm":
return "application/x-font-type1";
case "fst":
return "image/vnd.fst";
case "wtb":
return "application/vnd.webturbo";
case "xul":
return "application/vnd.mozilla.xul+xml";
case "std":
return "application/vnd.sun.xml.draw.template";
case "rmvb":
return "application/vnd.rn-realmedia-vbr";
case "itp":
return "application/vnd.shana.informed.formtemplate";
case "lostxml":
return "application/lost+xml";
case "zmm":
return "application/vnd.handheld-entertainment+xml";
case "pbm":
return "image/x-portable-bitmap";
case "org":
return "application/vnd.lotus-organizer";
case "ecelp7470":
return "audio/vnd.nuera.ecelp7470";
case "scd":
return "application/x-msschedule";
case "ggt":
return "application/vnd.geogebra.tool";
case "vcs":
return "text/x-vcalendar";
case "dsc":
return "text/prs.lines.tag";
case "woff2":
return "font/woff2";
case "json":
return "application/json";
case "lvp":
return "audio/vnd.lucent.voice";
case "smv":
return "video/x-smv";
case "3ds":
return "image/x-3ds";
case "jpgm":
case "jpm":
return "video/jpm";
case "mseed":
return "application/vnd.fdsn.mseed";
case "lha":
case "lzh":
return "application/x-lzh-compressed";
case "pptx":
return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
case "dataless":
case "seed":
return "application/vnd.fdsn.seed";
case "lrm":
return "application/vnd.ms-lrm";
case "edm":
return "application/vnd.novadigm.edm";
case "ics":
case "ifb":
return "text/calendar";
case "sse":
return "application/vnd.kodak-descriptor";
case "xml":
case "xsl":
return "application/xml";
case "portpkg":
return "application/vnd.macports.portpkg";
case "uvm":
case "uvvm":
return "video/vnd.dece.mobile";
case "mxf":
return "application/mxf";
case "htc":
return "text/x-component";
case "xht":
case "xhtml":
return "application/xhtml+xml";
case "aim":
return "application/x-aim";
case "p7s":
return "application/pkcs7-signature";
case "nml":
return "application/vnd.enliven";
case "igx":
return "application/vnd.micrografx.igx";
case "anx":
return "application/annodex";
case "ivu":
return "application/vnd.immervision-ivu";
case "mmd":
return "application/vnd.chipnuts.karaoke-mmd";
case "au":
case "snd":
case "ulw":
return "audio/basic";
case "ivp":
return "application/vnd.immervision-ivp";
case "psb":
return "application/vnd.3gpp.pic-bw-small";
case "pkipath":
return "application/pkix-pkipath";
case "txf":
return "application/vnd.mobius.txf";
case "zir":
case "zirz":
return "application/vnd.zul";
case "mlp":
return "application/vnd.dolby.mlp";
case "hqx":
return "application/mac-binhex40";
case "gca":
return "application/x-gca-compressed";
case "lbd":
return "application/vnd.llamagraphics.life-balance.desktop";
case "sxd":
return "application/vnd.sun.xml.draw";
case "xlam":
return "application/vnd.ms-excel.addin.macroenabled.12";
case "gbr":
return "application/rpki-ghostbusters";
case "nbp":
return "application/vnd.wolfram.player";
case "cat":
return "application/vnd.ms-pki.seccat";
case "ddd":
return "application/vnd.fujixerox.ddd";
case "odg":
return "application/vnd.oasis.opendocument.graphics";
case "pskcxml":
return "application/pskc+xml";
case "wax":
return "audio/x-ms-wax";
case "gmx":
return "application/vnd.gmx";
case "tra":
return "application/vnd.trueapp";
case "dpg":
return "application/vnd.dpgraph";
case "mny":
return "application/x-msmoney";
case "s3m":
return "audio/s3m";
case "wmv":
return "video/x-ms-wmv";
case "wmx":
return "video/x-ms-wmx";
case "rs":
return "application/rls-services+xml";
case "taglet":
return "application/vnd.mynfc";
case "wml":
return "text/vnd.wap.wml";
case "7z":
return "application/x-7z-compressed";
case "edx":
return "application/vnd.novadigm.edx";
case "mesh":
case "msh":
case "silo":
return "model/mesh";
case "jpe":
case "jpeg":
case "jpg":
return "image/jpeg";
case "odc":
return "application/vnd.oasis.opendocument.chart";
case "ttc":
return "font/collection";
case "xlsb":
return "application/vnd.ms-excel.sheet.binary.macroenabled.12";
case "flv":
return "video/x-flv";
case "clp":
return "application/x-msclip";
case "blb":
case "blorb":
return "application/x-blorb";
case "oxt":
return "application/vnd.openofficeorg.extension";
case "plc":
return "application/vnd.mobius.plc";
case "ods":
return "application/vnd.oasis.opendocument.spreadsheet";
case "nitf":
case "ntf":
return "application/vnd.nitf";
case "xdp":
return "application/vnd.adobe.xdp+xml";
case "cdxml":
return "application/vnd.chemdraw+xml";
case "ser":
return "application/java-serialized-object";
case "clkt":
return "application/vnd.crick.clicker.template";
case "cdmid":
return "application/cdmi-domain";
case "dv":
return "video/x-dv";
case "mrcx":
return "application/marcxml+xml";
case "ecelp9600":
return "audio/vnd.nuera.ecelp9600";
case "emma":
return "application/emma+xml";
case "dcurl":
return "text/vnd.curl.dcurl";
case "zaz":
return "application/vnd.zzazz.deck+xml";
case "xspf":
return "application/xspf+xml";
case "eot":
return "application/vnd.ms-fontobject";
}
return null;
}
}
总结
上面的代码是自动生成的,不可能手写的,想要的话,可以找我要。