text:
package org.apache.ignite.internal.visor.util;

import org.apache.ignite.internal.util.typedef.internal.*;
import org.jetbrains.annotations.*;

import java.io.*;
import java.util.*;

/**
 * Helper class to get MIME type.
 */
public class VisorMimeTypes {
    /** Bytes to read from file for mimetype detection. */
    private static final int PREVIEW_SIZE = 11;

    /** Common MIME types. */
    private static final Map<String, String> mimeTypes = U.newHashMap(810);

    static {
        mimeTypes.put("mseed", "application/vnd.fdsn.mseed");
        mimeTypes.put("vsf", "application/vnd.vsf");
        mimeTypes.put("cmdf", "chemical/x-cmdf");
        mimeTypes.put("mxs", "application/vnd.triscape.mxs");
        mimeTypes.put("m4v", "video/x-m4v");
        mimeTypes.put("oga", "audio/ogg");
        mimeTypes.put("ogg", "audio/ogg");
        mimeTypes.put("spx", "audio/ogg");
        mimeTypes.put("shf", "application/shf+xml");
        mimeTypes.put("jisp", "application/vnd.jisp");
        mimeTypes.put("sgl", "application/vnd.stardivision.writer-global");
        mimeTypes.put("gxt", "application/vnd.geonext");
        mimeTypes.put("mp4s", "application/mp4");
        mimeTypes.put("smi", "application/smil+xml");
        mimeTypes.put("smil", "application/smil+xml");
        mimeTypes.put("xop", "application/xop+xml");
        mimeTypes.put("spl", "application/x-futuresplash");
        mimeTypes.put("spq", "application/scvp-vp-request");
        mimeTypes.put("bh2", "application/vnd.fujitsu.oasysprs");
        mimeTypes.put("xpm", "image/x-xpixmap");
        mimeTypes.put("gdl", "model/vnd.gdl");
        mimeTypes.put("dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template");
        mimeTypes.put("ser", "application/java-serialized-object");
        mimeTypes.put("ghf", "application/vnd.groove-help");
        mimeTypes.put("mc1", "application/vnd.medcalcdata");
        mimeTypes.put("cdy", "application/vnd.cinderella");
        mimeTypes.put("nns", "application/vnd.noblenet-sealer");
        mimeTypes.put("msty", "application/vnd.muvee.style");
        mimeTypes.put("aas", "application/x-authorware-seg");
        mimeTypes.put("p", "text/x-pascal");
        mimeTypes.put("pas", "text/x-pascal");
        mimeTypes.put("rdz", "application/vnd.data-vision.rdz");
        mimeTypes.put("js", "text/javascript");
        mimeTypes.put("fzs", "application/vnd.fuzzysheet");
        mimeTypes.put("csml", "chemical/x-csml");
        mimeTypes.put("psf", "application/x-font-linux-psf");
        mimeTypes.put("afp", "application/vnd.ibm.modcap");
        mimeTypes.put("listafp", "application/vnd.ibm.modcap");
        mimeTypes.put("list3820", "application/vnd.ibm.modcap");
        mimeTypes.put("qt", "video/quicktime");
        mimeTypes.put("mov", "video/quicktime");
        mimeTypes.put("fly", "text/vnd.fly");
        mimeTypes.put("rlc", "image/vnd.fujixerox.edmics-rlc");
        mimeTypes.put("sxi", "application/vnd.sun.xml.impress");
        mimeTypes.put("vor", "application/vnd.stardivision.writer");
        mimeTypes.put("gac", "application/vnd.groove-account");
        mimeTypes.put("sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12");
        mimeTypes.put("pgn", "application/x-chess-pgn");
        mimeTypes.put("zaz", "application/vnd.zzazz.deck+xml");
        mimeTypes.put("ccxml", "application/ccxml+xml");
        mimeTypes.put("csh", "application/x-csh");
        mimeTypes.put("fvt", "video/vnd.fvt");
        mimeTypes.put("grv", "application/vnd.groove-injector");
        mimeTypes.put("scurl", "text/vnd.curl.scurl");
        mimeTypes.put("oa3", "application/vnd.fujitsu.oasys3");
        mimeTypes.put("oa2", "application/vnd.fujitsu.oasys2");
        mimeTypes.put("rgb", "image/x-rgb");
        mimeTypes.put("pfr", "application/font-tdpfr");
        mimeTypes.put("pbd", "application/vnd.powerbuilder6");
        mimeTypes.put("psd", "image/vnd.adobe.photoshop");
        mimeTypes.put("fh", "image/x-freehand");
        mimeTypes.put("fhc", "image/x-freehand");
        mimeTypes.put("fh4", "image/x-freehand");
        mimeTypes.put("fh5", "image/x-freehand");
        mimeTypes.put("fh7", "image/x-freehand");
        mimeTypes.put("doc", "application/msword");
        mimeTypes.put("dot", "application/msword");
        mimeTypes.put("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
        mimeTypes.put("plc", "application/vnd.mobius.plc");
        mimeTypes.put("rnc", "application/relax-ng-compact-syntax");
        mimeTypes.put("rpss", "application/vnd.nokia.radio-presets");
        mimeTypes.put("nlu", "application/vnd.neurolanguage.nlu");
        mimeTypes.put("pcl", "application/vnd.hp-pcl");
        mimeTypes.put("uu", "text/x-uuencode");
        mimeTypes.put("ami", "application/vnd.amiga.ami");
        mimeTypes.put("viv", "video/vnd.vivo");
        mimeTypes.put("mp4a", "audio/mp4");
        mimeTypes.put("vis", "application/vnd.visionary");
        mimeTypes.put("asc", "application/pgp-signature");
        mimeTypes.put("sig", "application/pgp-signature");
        mimeTypes.put("karbon", "application/vnd.kde.karbon");
        mimeTypes.put("htke", "application/vnd.kenameaapp");
        mimeTypes.put("nnd", "application/vnd.noblenet-directory");
        mimeTypes.put("xlsm", "application/vnd.ms-excel.sheet.macroenabled.12");
        mimeTypes.put("ez2", "application/vnd.ezpix-album");
        mimeTypes.put("otm", "application/vnd.oasis.opendocument.text-master");
        mimeTypes.put("f", "text/x-fortran");
        mimeTypes.put("for", "text/x-fortran");
        mimeTypes.put("f77", "text/x-fortran");
        mimeTypes.put("f90", "text/x-fortran");
        mimeTypes.put("apr", "application/vnd.lotus-approach");
        mimeTypes.put("mid", "audio/midi");
        mimeTypes.put("midi", "audio/midi");
        mimeTypes.put("kar", "audio/midi");
        mimeTypes.put("rmi", "audio/midi");
        mimeTypes.put("tmo", "application/vnd.tmobile-livetv");
        mimeTypes.put("pya", "audio/vnd.ms-playready.media.pya");
        mimeTypes.put("cgm", "image/cgm");
        mimeTypes.put("uri", "text/uri-list");
        mimeTypes.put("uris", "text/uri-list");
        mimeTypes.put("urls", "text/uri-list");
        mimeTypes.put("ipk", "application/vnd.shana.informed.package");
        mimeTypes.put("clkk", "application/vnd.crick.clicker.keyboard");
        mimeTypes.put("mbox", "application/mbox");
        mimeTypes.put("unityweb", "application/vnd.unity");
        mimeTypes.put("joda", "application/vnd.joost.joda-archive");
        mimeTypes.put("kwd", "application/vnd.kde.kword");
        mimeTypes.put("kwt", "application/vnd.kde.kword");
        mimeTypes.put("mpy", "application/vnd.ibm.minipay");
        mimeTypes.put("mpeg", "video/mpeg");
        mimeTypes.put("mpg", "video/mpeg");
        mimeTypes.put("mpe", "video/mpeg");
        mimeTypes.put("m1v", "video/mpeg");
        mimeTypes.put("m2v", "video/mpeg");
        mimeTypes.put("asf", "video/x-ms-asf");
        mimeTypes.put("asx", "video/x-ms-asf");
        mimeTypes.put("jad", "text/vnd.sun.j2me.app-descriptor");
        mimeTypes.put("rm", "application/vnd.rn-realmedia");
        mimeTypes.put("xer", "application/patch-ops-error+xml");
        mimeTypes.put("xml", "application/xml");
        mimeTypes.put("xsl", "application/xml");
        mimeTypes.put("icc", "application/vnd.iccprofile");
        mimeTypes.put("icm", "application/vnd.iccprofile");
        mimeTypes.put("mmr", "image/vnd.fujixerox.edmics-mmr");
        mimeTypes.put("hvd", "application/vnd.yamaha.hv-dic");
        mimeTypes.put("mbk", "application/vnd.mobius.mbk");
        mimeTypes.put("123", "application/vnd.lotus-1-2-3");
        mimeTypes.put("fe_launch", "application/vnd.denovo.fcselayout-link");
        mimeTypes.put("setpay", "application/set-payment-initiation");
        mimeTypes.put("sdc", "application/vnd.stardivision.calc");
        mimeTypes.put("swi", "application/vnd.aristanetworks.swi");
        mimeTypes.put("g3", "image/g3fax");
        mimeTypes.put("cil", "application/vnd.ms-artgalry");
        mimeTypes.put("vcg", "application/vnd.groove-vcard");
        mimeTypes.put("chm", "application/vnd.ms-htmlhelp");
        mimeTypes.put("grxml", "application/srgs+xml");
        mimeTypes.put("ext", "application/vnd.novadigm.ext");
        mimeTypes.put("opf", "application/oebps-package+xml");
        mimeTypes.put("gtm", "application/vnd.groove-tool-message");
        mimeTypes.put("au", "audio/basic");
        mimeTypes.put("snd", "audio/basic");
        mimeTypes.put("ppsm", "application/vnd.ms-powerpoint.slideshow.macroenabled.12");
        mimeTypes.put("wbxml", "application/vnd.wap.wbxml");
        mimeTypes.put("oxt", "application/vnd.openofficeorg.extension");
        mimeTypes.put("davmount", "application/davmount+xml");
        mimeTypes.put("ivu", "application/vnd.immervision-ivu");
        mimeTypes.put("wrl", "model/vrml");
        mimeTypes.put("vrml", "model/vrml");
        mimeTypes.put("p7m", "application/pkcs7-mime");
        mimeTypes.put("p7c", "application/pkcs7-mime");
        mimeTypes.put("ppt", "application/vnd.ms-powerpoint");
        mimeTypes.put("pps", "application/vnd.ms-powerpoint");
        mimeTypes.put("pot", "application/vnd.ms-powerpoint");
        mimeTypes.put("ivp", "application/vnd.immervision-ivp");
        mimeTypes.put("movie", "video/x-sgi-movie");
        mimeTypes.put("ecelp4800", "audio/vnd.nuera.ecelp4800");
        mimeTypes.put("tpl", "application/vnd.groove-tool-template");
        mimeTypes.put("fnc", "application/vnd.frogans.fnc");
        mimeTypes.put("wax", "audio/x-ms-wax");
        mimeTypes.put("3gp", "video/3gpp");
        mimeTypes.put("ppd", "application/vnd.cups-ppd");
        mimeTypes.put("mmf", "application/vnd.smaf");
        mimeTypes.put("exe", "application/x-msdownload");
        mimeTypes.put("dll", "application/x-msdownload");
        mimeTypes.put("com", "application/x-msdownload");
        mimeTypes.put("bat", "application/x-msdownload");
        mimeTypes.put("msi", "application/x-msdownload");
        mimeTypes.put("skp", "application/vnd.koan");
        mimeTypes.put("skd", "application/vnd.koan");
        mimeTypes.put("skt", "application/vnd.koan");
        mimeTypes.put("skm", "application/vnd.koan");
        mimeTypes.put("ice", "x-conference/x-cooltalk");
        mimeTypes.put("emma", "application/emma+xml");
        mimeTypes.put("odc", "application/vnd.oasis.opendocument.chart");
        mimeTypes.put("atomcat", "application/atomcat+xml");
        mimeTypes.put("onetoc", "application/onenote");
        mimeTypes.put("onetoc2", "application/onenote");
        mimeTypes.put("onetmp", "application/onenote");
        mimeTypes.put("onepkg", "application/onenote");
        mimeTypes.put("otp", "application/vnd.oasis.opendocument.presentation-template");
        mimeTypes.put("irm", "application/vnd.ibm.rights-management");
        mimeTypes.put("texinfo", "application/x-texinfo");
        mimeTypes.put("texi", "application/x-texinfo");
        mimeTypes.put("spp", "application/scvp-vp-response");
        mimeTypes.put("xif", "image/vnd.xiff");
        mimeTypes.put("sitx", "application/x-stuffitx");
        mimeTypes.put("eol", "audio/vnd.digital-winds");
        mimeTypes.put("c4g", "application/vnd.clonk.c4group");
        mimeTypes.put("c4d", "application/vnd.clonk.c4group");
        mimeTypes.put("c4f", "application/vnd.clonk.c4group");
        mimeTypes.put("c4p", "application/vnd.clonk.c4group");
        mimeTypes.put("c4u", "application/vnd.clonk.c4group");
        mimeTypes.put("flo", "application/vnd.micrografx.flo");
        mimeTypes.put("svg", "image/svg+xml");
        mimeTypes.put("svgz", "image/svg+xml");
        mimeTypes.put("xsm", "application/vnd.syncml+xml");
        mimeTypes.put("hdf", "application/x-hdf");
        mimeTypes.put("cml", "chemical/x-cml");
        mimeTypes.put("atx", "application/vnd.antix.game-component");
        mimeTypes.put("flv", "video/x-flv");
        mimeTypes.put("m3u8", "application/vnd.apple.mpegurl");
        mimeTypes.put("wbs", "application/vnd.criticaltools.wbs+xml");
        mimeTypes.put("bz2", "application/x-bzip2");
        mimeTypes.put("boz", "application/x-bzip2");
        mimeTypes.put("plf", "application/vnd.pocketlearn");
        mimeTypes.put("lbe", "application/vnd.llamagraphics.life-balance.exchange+xml");
        mimeTypes.put("vcd", "application/x-cdlink");
        mimeTypes.put("sxg", "application/vnd.sun.xml.writer.global");
        mimeTypes.put("fli", "video/x-fli");
        mimeTypes.put("wsdl", "application/wsdl+xml");
        mimeTypes.put("slt", "application/vnd.epson.salt");
        mimeTypes.put("lwp", "application/vnd.lotus-wordpro");
        mimeTypes.put("ddd", "application/vnd.fujixerox.ddd");
        mimeTypes.put("xfdf", "application/vnd.adobe.xfdf");
        mimeTypes.put("portpkg", "application/vnd.macports.portpkg");
        mimeTypes.put("pfa", "application/x-font-type1");
        mimeTypes.put("pfb", "application/x-font-type1");
        mimeTypes.put("pfm", "application/x-font-type1");
        mimeTypes.put("afm", "application/x-font-type1");
        mimeTypes.put("nc", "application/x-netcdf");
        mimeTypes.put("cdf", "application/x-netcdf");
        mimeTypes.put("mpm", "application/vnd.blueice.multipass");
        mimeTypes.put("sis", "application/vnd.symbian.install");
        mimeTypes.put("sisx", "application/vnd.symbian.install");
        mimeTypes.put("ustar", "application/x-ustar");
        mimeTypes.put("rpst", "application/vnd.nokia.radio-preset");
        mimeTypes.put("eml", "message/rfc822");
        mimeTypes.put("mime", "message/rfc822");
        mimeTypes.put("g2w", "application/vnd.geoplan");
        mimeTypes.put("ma", "application/mathematica");
        mimeTypes.put("nb", "application/mathematica");
        mimeTypes.put("mb", "application/mathematica");
        mimeTypes.put("csv", "text/csv");
        mimeTypes.put("css", "text/css");
        mimeTypes.put("wvx", "video/x-ms-wvx");
        mimeTypes.put("jlt", "application/vnd.hp-jlyt");
        mimeTypes.put("vcx", "application/vnd.vcx");
        mimeTypes.put("html", "text/html");
        mimeTypes.put("htm", "text/html");
        mimeTypes.put("docm", "application/vnd.ms-word.document.macroenabled.12");
        mimeTypes.put("xdssc", "application/dssc+xml");
        mimeTypes.put("pbm", "image/x-portable-bitmap");
        mimeTypes.put("fdf", "application/vnd.fdf");
        mimeTypes.put("ggt", "application/vnd.geogebra.tool");
        mimeTypes.put("cii", "application/vnd.anser-web-certificate-issue-initiation");
        mimeTypes.put("atomsvc", "application/atomsvc+xml");
        mimeTypes.put("stw", "application/vnd.sun.xml.writer.template");
        mimeTypes.put("vtu", "model/vnd.vtu");
        mimeTypes.put("latex", "application/x-latex");
        mimeTypes.put("cat", "application/vnd.ms-pki.seccat");
        mimeTypes.put("odf", "application/vnd.oasis.opendocument.formula");
        mimeTypes.put("trm", "application/x-msterminal");
        mimeTypes.put("pptm", "application/vnd.ms-powerpoint.presentation.macroenabled.12");
        mimeTypes.put("stl", "application/vnd.ms-pki.stl");
        mimeTypes.put("ltf", "application/vnd.frogans.ltf");
        mimeTypes.put("obd", "application/x-msbinder");
        mimeTypes.put("sda", "application/vnd.stardivision.draw");
        mimeTypes.put("org", "application/vnd.lotus-organizer");
        mimeTypes.put("ftc", "application/vnd.fluxtime.clip");
        mimeTypes.put("rcprofile", "application/vnd.ipunplugged.rcprofile");
        mimeTypes.put("cmx", "image/x-cmx");
        mimeTypes.put("cif", "chemical/x-cif");
        mimeTypes.put("rp9", "application/vnd.cloanto.rp9");
        mimeTypes.put("pvb", "application/vnd.3gpp.pic-bw-var");
        mimeTypes.put("aw", "application/applixware");
        mimeTypes.put("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
        mimeTypes.put("rld", "application/resource-lists-diff+xml");
        mimeTypes.put("xar", "application/vnd.xara");
        mimeTypes.put("ecelp7470", "audio/vnd.nuera.ecelp7470");
        mimeTypes.put("xls", "application/vnd.ms-excel");
        mimeTypes.put("xlm", "application/vnd.ms-excel");
        mimeTypes.put("xla", "application/vnd.ms-excel");
        mimeTypes.put("xlc", "application/vnd.ms-excel");
        mimeTypes.put("xlt", "application/vnd.ms-excel");
        mimeTypes.put("xlw", "application/vnd.ms-excel");
        mimeTypes.put("txf", "application/vnd.mobius.txf");
        mimeTypes.put("prc", "application/x-mobipocket-ebook");
        mimeTypes.put("mobi", "application/x-mobipocket-ebook");
        mimeTypes.put("swf", "application/x-shockwave-flash");
        mimeTypes.put("sfs", "application/vnd.spotfire.sfs");
        mimeTypes.put("dp", "application/vnd.osgi.dp");
        mimeTypes.put("potx", "application/vnd.openxmlformats-officedocument.presentationml.template");
        mimeTypes.put("efif", "application/vnd.picsel");
        mimeTypes.put("pdf", "application/pdf");
        mimeTypes.put("dsc", "text/prs.lines.tag");
        mimeTypes.put("mathml", "application/mathml+xml");
        mimeTypes.put("bed", "application/vnd.realvnc.bed");
        mimeTypes.put("bcpio", "application/x-bcpio");
        mimeTypes.put("shar", "application/x-shar");
        mimeTypes.put("xdm", "application/vnd.syncml.dm+xml");
        mimeTypes.put("teacher", "application/vnd.smart.teacher");
        mimeTypes.put("sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide");
        mimeTypes.put("stf", "application/vnd.wt.stf");
        mimeTypes.put("odb", "application/vnd.oasis.opendocument.database");
        mimeTypes.put("bdf", "application/x-font-bdf");
        mimeTypes.put("tcap", "application/vnd.3gpp2.tcap");
        mimeTypes.put("fm", "application/vnd.framemaker");
        mimeTypes.put("frame", "application/vnd.framemaker");
        mimeTypes.put("maker", "application/vnd.framemaker");
        mimeTypes.put("book", "application/vnd.framemaker");
        mimeTypes.put("src", "application/x-wais-source");
        mimeTypes.put("rep", "application/vnd.businessobjects");
        mimeTypes.put("dna", "application/vnd.dna");
        mimeTypes.put("jpgv", "video/jpeg");
        mimeTypes.put("ez", "application/andrew-inset");
        mimeTypes.put("vxml", "application/voicexml+xml");
        mimeTypes.put("x3d", "application/vnd.hzn-3d-crossword");
        mimeTypes.put("dxp", "application/vnd.spotfire.dxp");
        mimeTypes.put("dvi", "application/x-dvi");
        mimeTypes.put("f4v", "video/x-f4v");
        mimeTypes.put("fg5", "application/vnd.fujitsu.oasysgp");
        mimeTypes.put("clp", "application/x-msclip");
        mimeTypes.put("acu", "application/vnd.acucobol");
        mimeTypes.put("ksp", "application/vnd.kde.kspread");
        mimeTypes.put("rms", "application/vnd.jcp.javame.midlet-rms");
        mimeTypes.put("lvp", "audio/vnd.lucent.voice");
        mimeTypes.put("jpm", "video/jpm");
        mimeTypes.put("jpgm", "video/jpm");
        mimeTypes.put("pcx", "image/x-pcx");
        mimeTypes.put("sxm", "application/vnd.sun.xml.math");
        mimeTypes.put("g3w", "application/vnd.geospace");
        mimeTypes.put("ngdat", "application/vnd.nokia.n-gage.data");
        mimeTypes.put("clkp", "application/vnd.crick.clicker.palette");
        mimeTypes.put("osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml");
        mimeTypes.put("aep", "application/vnd.audiograph");
        mimeTypes.put("wqd", "application/vnd.wqd");
        mimeTypes.put("mdi", "image/vnd.ms-modi");
        mimeTypes.put("ecelp9600", "audio/vnd.nuera.ecelp9600");
        mimeTypes.put("fig", "application/x-xfig");
        mimeTypes.put("p7r", "application/x-pkcs7-certreqresp");
        mimeTypes.put("jar", "application/java-archive");
        mimeTypes.put("ief", "image/ief");
        mimeTypes.put("hvs", "application/vnd.yamaha.hv-script");
        mimeTypes.put("cdx", "chemical/x-cdx");
        mimeTypes.put("abw", "application/x-abiword");
        mimeTypes.put("deb", "application/x-debian-package");
        mimeTypes.put("udeb", "application/x-debian-package");
        mimeTypes.put("djvu", "image/vnd.djvu");
        mimeTypes.put("djv", "image/vnd.djvu");
        mimeTypes.put("wml", "text/vnd.wap.wml");
        mimeTypes.put("xhtml", "application/xhtml+xml");
        mimeTypes.put("xht", "application/xhtml+xml");
        mimeTypes.put("tpt", "application/vnd.trid.tpt");
        mimeTypes.put("wmz", "application/x-ms-wmz");
        mimeTypes.put("rtx", "text/richtext");
        mimeTypes.put("wspolicy", "application/wspolicy+xml");
        mimeTypes.put("odg", "application/vnd.oasis.opendocument.graphics");
        mimeTypes.put("res", "application/x-dtbresource+xml");
        mimeTypes.put("xbm", "image/x-xbitmap");
        mimeTypes.put("zir", "application/vnd.zul");
        mimeTypes.put("zirz", "application/vnd.zul");
        mimeTypes.put("cdkey", "application/vnd.mediastation.cdkey");
        mimeTypes.put("wmd", "application/x-ms-wmd");
        mimeTypes.put("ogv", "video/ogg");
        mimeTypes.put("scq", "application/scvp-cv-request");
        mimeTypes.put("sfd-hdstx", "application/vnd.hydrostatix.sof-data");
        mimeTypes.put("igx", "application/vnd.micrografx.igx");
        mimeTypes.put("xps", "application/vnd.ms-xpsdocument");
        mimeTypes.put("xdw", "application/vnd.fujixerox.docuworks");
        mimeTypes.put("kfo", "application/vnd.kde.kformula");
        mimeTypes.put("chrt", "application/vnd.kde.kchart");
        mimeTypes.put("sdp", "application/sdp");
        mimeTypes.put("oth", "application/vnd.oasis.opendocument.text-web");
        mimeTypes.put("3g2", "video/3gpp2");
        mimeTypes.put("utz", "application/vnd.uiq.theme");
        mimeTypes.put("mus", "application/vnd.musician");
        mimeTypes.put("wpd", "application/vnd.wordperfect");
        mimeTypes.put("oas", "application/vnd.fujitsu.oasys");
        mimeTypes.put("pic", "image/x-pict");
        mimeTypes.put("pct", "image/x-pict");
        mimeTypes.put("wmx", "video/x-ms-wmx");
        mimeTypes.put("p10", "application/pkcs10");
        mimeTypes.put("wmv", "video/x-ms-wmv");
        mimeTypes.put("xfdl", "application/vnd.xfdl");
        mimeTypes.put("pgp", "application/pgp-encrypted");
        mimeTypes.put("rs", "application/rls-services+xml");
        mimeTypes.put("cpt", "application/mac-compactpro");
        mimeTypes.put("gmx", "application/vnd.gmx");
        mimeTypes.put("potm", "application/vnd.ms-powerpoint.template.macroenabled.12");
        mimeTypes.put("iif", "application/vnd.shana.informed.interchange");
        mimeTypes.put("ace", "application/x-ace-compressed");
        mimeTypes.put("pcurl", "application/vnd.curl.pcurl");
        mimeTypes.put("ods", "application/vnd.oasis.opendocument.spreadsheet");
        mimeTypes.put("vsd", "application/vnd.visio");
        mimeTypes.put("vst", "application/vnd.visio");
        mimeTypes.put("vss", "application/vnd.visio");
        mimeTypes.put("vsw", "application/vnd.visio");
        mimeTypes.put("ifm", "application/vnd.shana.informed.formdata");
        mimeTypes.put("fbs", "image/vnd.fastbidsheet");
        mimeTypes.put("qxd", "application/vnd.quark.quarkxpress");
        mimeTypes.put("qxt", "application/vnd.quark.quarkxpress");
        mimeTypes.put("qwd", "application/vnd.quark.quarkxpress");
        mimeTypes.put("qwt", "application/vnd.quark.quarkxpress");
        mimeTypes.put("qxl", "application/vnd.quark.quarkxpress");
        mimeTypes.put("qxb", "application/vnd.quark.quarkxpress");
        mimeTypes.put("epub", "application/epub+zip");
        mimeTypes.put("crl", "application/pkix-crl");
        mimeTypes.put("nnw", "application/vnd.noblenet-web");
        mimeTypes.put("nbp", "application/vnd.wolfram.player");
        mimeTypes.put("plb", "application/vnd.3gpp.pic-bw-large");
        mimeTypes.put("itp", "application/vnd.shana.informed.formtemplate");
        mimeTypes.put("snf", "application/x-font-snf");
        mimeTypes.put("str", "application/vnd.pg.format");
        mimeTypes.put("wtb", "application/vnd.webturbo");
        mimeTypes.put("osf", "application/vnd.yamaha.openscoreformat");
        mimeTypes.put("xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template");
        mimeTypes.put("pre", "application/vnd.lotus-freelance");
        mimeTypes.put("clkt", "application/vnd.crick.clicker.template");
        mimeTypes.put("hbci", "application/vnd.hbci");
        mimeTypes.put("dwf", "model/vnd.dwf");
        mimeTypes.put("igs", "model/iges");
        mimeTypes.put("iges", "model/iges");
        mimeTypes.put("ktz", "application/vnd.kahootz");
        mimeTypes.put("ktr", "application/vnd.kahootz");
        mimeTypes.put("n-gage", "application/vnd.nokia.n-gage.symbian.install");
        mimeTypes.put("otg", "application/vnd.oasis.opendocument.graphics-template");
        mimeTypes.put("rsd", "application/rsd+xml");
        mimeTypes.put("hlp", "application/winhlp");
        mimeTypes.put("azw", "application/vnd.amazon.ebook");
        mimeTypes.put("msf", "application/vnd.epson.msf");
        mimeTypes.put("mp4", "video/mp4");
        mimeTypes.put("mp4v", "video/mp4");
        mimeTypes.put("mpg4", "video/mp4");
        mimeTypes.put("cod", "application/vnd.rim.cod");
        mimeTypes.put("st", "application/vnd.sailingtracker.track");
        mimeTypes.put("odi", "application/vnd.oasis.opendocument.image");
        mimeTypes.put("tra", "application/vnd.trueapp");
        mimeTypes.put("wm", "video/x-ms-wm");
        mimeTypes.put("bin", "application/octet-stream");
        mimeTypes.put("dms", "application/octet-stream");
        mimeTypes.put("lha", "application/octet-stream");
        mimeTypes.put("lrf", "application/octet-stream");
        mimeTypes.put("lzh", "application/octet-stream");
        mimeTypes.put("so", "application/octet-stream");
        mimeTypes.put("iso", "application/octet-stream");
        mimeTypes.put("dmg", "application/octet-stream");
        mimeTypes.put("dist", "application/octet-stream");
        mimeTypes.put("distz", "application/octet-stream");
        mimeTypes.put("pkg", "application/octet-stream");
        mimeTypes.put("bpk", "application/octet-stream");
        mimeTypes.put("dump", "application/octet-stream");
        mimeTypes.put("elc", "application/octet-stream");
        mimeTypes.put("deploy", "application/octet-stream");
        mimeTypes.put("tsv", "text/tab-separated-values");
        mimeTypes.put("esf", "application/vnd.epson.esf");
        mimeTypes.put("p7s", "application/pkcs7-signature");
        mimeTypes.put("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        mimeTypes.put("geo", "application/vnd.dynageo");
        mimeTypes.put("mmd", "application/vnd.chipnuts.karaoke-mmd");
        mimeTypes.put("mxml", "application/xv+xml");
        mimeTypes.put("xhvml", "application/xv+xml");
        mimeTypes.put("xvml", "application/xv+xml");
        mimeTypes.put("xvm", "application/xv+xml");
        mimeTypes.put("nsf", "application/vnd.lotus-notes");
        mimeTypes.put("crd", "application/x-mscardfile");
        mimeTypes.put("p12", "application/x-pkcs12");
        mimeTypes.put("pfx", "application/x-pkcs12");
        mimeTypes.put("c", "text/x-c");
        mimeTypes.put("cc", "text/x-c");
        mimeTypes.put("cxx", "text/x-c");
        mimeTypes.put("cpp", "text/x-c");
        mimeTypes.put("h", "text/x-c");
        mimeTypes.put("hh", "text/x-c");
        mimeTypes.put("dic", "text/x-c");
        mimeTypes.put("cla", "application/vnd.claymore");
        mimeTypes.put("avi", "video/x-msvideo");
        mimeTypes.put("edx", "application/vnd.novadigm.edx");
        mimeTypes.put("gph", "application/vnd.flographit");
        mimeTypes.put("rq", "application/sparql-query");
        mimeTypes.put("xdp", "application/vnd.adobe.xdp+xml");
        mimeTypes.put("umj", "application/vnd.umajin");
        mimeTypes.put("pclxl", "application/vnd.hp-pclxl");
        mimeTypes.put("edm", "application/vnd.novadigm.edm");
        mimeTypes.put("gif", "image/gif");
        mimeTypes.put("jpeg", "image/jpeg");
        mimeTypes.put("jpg", "image/jpeg");
        mimeTypes.put("jpe", "image/jpeg");
        mimeTypes.put("adp", "audio/adpcm");
        mimeTypes.put("txt", "text/plain");
        mimeTypes.put("text", "text/plain");
        mimeTypes.put("conf", "text/plain");
        mimeTypes.put("def", "text/plain");
        mimeTypes.put("list", "text/plain");
        mimeTypes.put("log", "text/plain");
        mimeTypes.put("in", "text/plain");
        mimeTypes.put("gsf", "application/x-font-ghostscript");
        mimeTypes.put("aab", "application/x-authorware-bin");
        mimeTypes.put("x32", "application/x-authorware-bin");
        mimeTypes.put("u32", "application/x-authorware-bin");
        mimeTypes.put("vox", "application/x-authorware-bin");
        mimeTypes.put("ott", "application/vnd.oasis.opendocument.text-template");
        mimeTypes.put("kmz", "application/vnd.google-earth.kmz");
        mimeTypes.put("etx", "text/x-setext");
        mimeTypes.put("sv4crc", "application/x-sv4crc");
        mimeTypes.put("xlam", "application/vnd.ms-excel.addin.macroenabled.12");
        mimeTypes.put("pcf", "application/x-font-pcf");
        mimeTypes.put("torrent", "application/x-bittorrent");
        mimeTypes.put("twd", "application/vnd.simtech-mindmapper");
        mimeTypes.put("twds", "application/vnd.simtech-mindmapper");
        mimeTypes.put("qam", "application/vnd.epson.quickanime");
        mimeTypes.put("bdm", "application/vnd.syncml.dm+wbxml");
        mimeTypes.put("3dml", "text/vnd.in3d.3dml");
        mimeTypes.put("saf", "application/vnd.yamaha.smaf-audio");
        mimeTypes.put("ncx", "application/x-dtbncx+xml");
        mimeTypes.put("ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow");
        mimeTypes.put("sc", "application/vnd.ibm.secure-container");
        mimeTypes.put("gnumeric", "application/x-gnumeric");
        mimeTypes.put("paw", "application/vnd.pawaafile");
        mimeTypes.put("bmp", "image/bmp");
        mimeTypes.put("bmi", "application/vnd.bmi");
        mimeTypes.put("sxc", "application/vnd.sun.xml.calc");
        mimeTypes.put("gim", "application/vnd.groove-identity-message");
        mimeTypes.put("qps", "application/vnd.publishare-delta-tree");
        mimeTypes.put("scd", "application/x-msschedule");
        mimeTypes.put("mgz", "application/vnd.proteus.magazine");
        mimeTypes.put("vcf", "text/x-vcard");
        mimeTypes.put("flw", "application/vnd.kde.kivio");
        mimeTypes.put("xslt", "application/xslt+xml");
        mimeTypes.put("stc", "application/vnd.sun.xml.calc.template");
        mimeTypes.put("dir", "application/x-director");
        mimeTypes.put("dcr", "application/x-director");
        mimeTypes.put("dxr", "application/x-director");
        mimeTypes.put("cst", "application/x-director");
        mimeTypes.put("cct", "application/x-director");
        mimeTypes.put("cxt", "application/x-director");
        mimeTypes.put("w3d", "application/x-director");
        mimeTypes.put("fgd", "application/x-director");
        mimeTypes.put("swa", "application/x-director");
        mimeTypes.put("rif", "application/reginfo+xml");
        mimeTypes.put("atc", "application/vnd.acucorp");
        mimeTypes.put("acutc", "application/vnd.acucorp");
        mimeTypes.put("fti", "application/vnd.anser-web-funds-transfer-initiation");
        mimeTypes.put("dis", "application/vnd.mobius.dis");
        mimeTypes.put("zmm", "application/vnd.handheld-entertainment+xml");
        mimeTypes.put("mag", "application/vnd.ecowin.chart");
        mimeTypes.put("mlp", "application/vnd.dolby.mlp");
        mimeTypes.put("psb", "application/vnd.3gpp.pic-bw-small");
        mimeTypes.put("mdb", "application/x-msaccess");
        mimeTypes.put("aso", "application/vnd.accpac.simply.aso");
        mimeTypes.put("pwn", "application/vnd.3m.post-it-notes");
        mimeTypes.put("ots", "application/vnd.oasis.opendocument.spreadsheet-template");
        mimeTypes.put("mj2", "video/mj2");
        mimeTypes.put("mjp2", "video/mj2");
        mimeTypes.put("link66", "application/vnd.route66.link66+xml");
        mimeTypes.put("les", "application/vnd.hhe.lesson-player");
        mimeTypes.put("sti", "application/vnd.sun.xml.impress.template");
        mimeTypes.put("cdbcmsg", "application/vnd.contact.cmsg");
        mimeTypes.put("cdxml", "application/vnd.chemdraw+xml");
        mimeTypes.put("aac", "audio/x-aac");
        mimeTypes.put("ipfix", "application/ipfix");
        mimeTypes.put("mxu", "video/vnd.mpegurl");
        mimeTypes.put("m4u", "video/vnd.mpegurl");
        mimeTypes.put("cer", "application/pkix-cert");
        mimeTypes.put("mny", "application/x-msmoney");
        mimeTypes.put("tex", "application/x-tex");
        mimeTypes.put("ics", "text/calendar");
        mimeTypes.put("ifb", "text/calendar");
        mimeTypes.put("ei6", "application/vnd.pg.osasli");
        mimeTypes.put("spf", "application/vnd.yamaha.smaf-phrase");
        mimeTypes.put("lostxml", "application/lost+xml");
        mimeTypes.put("apk", "application/vnd.android.package-archive");
        mimeTypes.put("pub", "application/x-mspublisher");
        mimeTypes.put("gtw", "model/vnd.gtw");
        mimeTypes.put("ufd", "application/vnd.ufdl");
        mimeTypes.put("ufdl", "application/vnd.ufdl");
        mimeTypes.put("jnlp", "application/x-java-jnlp-file");
        mimeTypes.put("air", "application/vnd.adobe.air-application-installer-package+zip");
        mimeTypes.put("dcurl", "text/vnd.curl.dcurl");
        mimeTypes.put("mxl", "application/vnd.recordare.musicxml");
        mimeTypes.put("cpio", "application/x-cpio");
        mimeTypes.put("mpp", "application/vnd.ms-project");
        mimeTypes.put("mpt", "application/vnd.ms-project");
        mimeTypes.put("pdb", "application/vnd.palm");
        mimeTypes.put("pqa", "application/vnd.palm");
        mimeTypes.put("oprc", "application/vnd.palm");
        mimeTypes.put("mrc", "application/marc");
        mimeTypes.put("hqx", "application/mac-binhex40");
        mimeTypes.put("json", "application/json");
        mimeTypes.put("mvb", "application/x-msmediaview");
        mimeTypes.put("m13", "application/x-msmediaview");
        mimeTypes.put("m14", "application/x-msmediaview");
        mimeTypes.put("mpga", "audio/mpeg");
        mimeTypes.put("mp2", "audio/mpeg");
        mimeTypes.put("mp2a", "audio/mpeg");
        mimeTypes.put("mp3", "audio/mpeg");
        mimeTypes.put("m2a", "audio/mpeg");
        mimeTypes.put("m3a", "audio/mpeg");
        mimeTypes.put("cmc", "application/vnd.cosmocaller");
        mimeTypes.put("wmf", "application/x-msmetafile");
        mimeTypes.put("odft", "application/vnd.oasis.opendocument.formula-template");
        mimeTypes.put("dtb", "application/x-dtbook+xml");
        mimeTypes.put("xbap", "application/x-ms-xbap");
        mimeTypes.put("csp", "application/vnd.commonspace");
        mimeTypes.put("stk", "application/hyperstudio");
        mimeTypes.put("mpn", "application/vnd.mophun.application");
        mimeTypes.put("gqf", "application/vnd.grafeq");
        mimeTypes.put("gqs", "application/vnd.grafeq");
        mimeTypes.put("rl", "application/resource-lists+xml");
        mimeTypes.put("gtar", "application/x-gtar");
        mimeTypes.put("pls", "application/pls+xml");
        mimeTypes.put("tcl", "application/x-tcl");
        mimeTypes.put("der", "application/x-x509-ca-cert");
        mimeTypes.put("crt", "application/x-x509-ca-cert");
        mimeTypes.put("xo", "application/vnd.olpc-sugar");
        mimeTypes.put("xltm", "application/vnd.ms-excel.template.macroenabled.12");
        mimeTypes.put("cu", "application/cu-seeme");
        mimeTypes.put("kml", "application/vnd.google-earth.kml+xml");
        mimeTypes.put("sh", "application/x-sh");
        mimeTypes.put("xpw", "application/vnd.intercon.formnet");
        mimeTypes.put("xpx", "application/vnd.intercon.formnet");
        mimeTypes.put("wg", "application/vnd.pmi.widget");
        mimeTypes.put("seed", "application/vnd.fdsn.seed");
        mimeTypes.put("dataless", "application/vnd.fdsn.seed");
        mimeTypes.put("sdd", "application/vnd.stardivision.impress");
        mimeTypes.put("ttf", "application/x-font-ttf");
        mimeTypes.put("ttc", "application/x-font-ttf");
        mimeTypes.put("npx", "image/vnd.net-fpx");
        mimeTypes.put("aif", "audio/x-aiff");
        mimeTypes.put("aiff", "audio/x-aiff");
        mimeTypes.put("aifc", "audio/x-aiff");
        mimeTypes.put("xlsb", "application/vnd.ms-excel.sheet.binary.macroenabled.12");
        mimeTypes.put("wbmp", "image/vnd.wap.wbmp");
        mimeTypes.put("rtf", "application/rtf");
        mimeTypes.put("sus", "application/vnd.sus-calendar");
        mimeTypes.put("susp", "application/vnd.sus-calendar");
        mimeTypes.put("prf", "application/pics-rules");
        mimeTypes.put("tar", "application/x-tar");
        mimeTypes.put("pml", "application/vnd.ctc-posml");
        mimeTypes.put("ims", "application/vnd.ms-ims");
        mimeTypes.put("imp", "application/vnd.accpac.simply.imp");
        mimeTypes.put("xul", "application/vnd.mozilla.xul+xml");
        mimeTypes.put("acc", "application/vnd.americandynamics.acc");
        mimeTypes.put("mfm", "application/vnd.mfmp");
        mimeTypes.put("dotm", "application/vnd.ms-word.template.macroenabled.12");
        mimeTypes.put("ptid", "application/vnd.pvi.ptid1");
        mimeTypes.put("pyv", "video/vnd.ms-playready.media.pyv");
        mimeTypes.put("ssf", "application/vnd.epson.ssf");
        mimeTypes.put("sxd", "application/vnd.sun.xml.draw");
        mimeTypes.put("xap", "application/x-silverlight-app");
        mimeTypes.put("fst", "image/vnd.fst");
        mimeTypes.put("rdf", "application/rdf+xml");
        mimeTypes.put("gv", "text/vnd.graphviz");
        mimeTypes.put("lrm", "application/vnd.ms-lrm");
        mimeTypes.put("box", "application/vnd.previewsystems.box");
        mimeTypes.put("mseq", "application/vnd.mseq");
        mimeTypes.put("xwd", "image/x-xwindowdump");
        mimeTypes.put("mscml", "application/mediaservercontrol+xml");
        mimeTypes.put("cmp", "application/vnd.yellowriver-custom-menu");
        mimeTypes.put("wad", "application/x-doom");
        mimeTypes.put("svd", "application/vnd.svd");
        mimeTypes.put("pki", "application/pkixcmp");
        mimeTypes.put("ai", "application/postscript");
        mimeTypes.put("eps", "application/postscript");
        mimeTypes.put("ps", "application/postscript");
        mimeTypes.put("msl", "application/vnd.mobius.msl");
        mimeTypes.put("sv4cpio", "application/x-sv4cpio");
        mimeTypes.put("java", "text/x-java-source");
        mimeTypes.put("mpc", "application/vnd.mophun.certificate");
        mimeTypes.put("daf", "application/vnd.mobius.daf");
        mimeTypes.put("qfx", "application/vnd.intu.qfx");
        mimeTypes.put("mxf", "application/mxf");
        mimeTypes.put("mif", "application/vnd.mif");
        mimeTypes.put("txd", "application/vnd.genomatix.tuxedo");
        mimeTypes.put("pkipath", "application/pkix-pkipath");
        mimeTypes.put("sse", "application/vnd.kodak-descriptor");
        mimeTypes.put("kon", "application/vnd.kde.kontour");
        mimeTypes.put("dfac", "application/vnd.dreamfactory");
        mimeTypes.put("gram", "application/srgs");
        mimeTypes.put("hps", "application/vnd.hp-hps");
        mimeTypes.put("cab", "application/vnd.ms-cab-compressed");
        mimeTypes.put("m3u", "audio/x-mpegurl");
        mimeTypes.put("odp", "application/vnd.oasis.opendocument.presentation");
        mimeTypes.put("ggb", "application/vnd.geogebra.file");
        mimeTypes.put("xyz", "chemical/x-xyz");
        mimeTypes.put("clkw", "application/vnd.crick.clicker.wordbank");
        mimeTypes.put("mqy", "application/vnd.mobius.mqy");
        mimeTypes.put("ico", "image/x-icon");
        mimeTypes.put("png", "image/png");
        mimeTypes.put("wmlc", "application/vnd.wap.wmlc");
        mimeTypes.put("kne", "application/vnd.kinar");
        mimeTypes.put("knp", "application/vnd.kinar");
        mimeTypes.put("kpr", "application/vnd.kde.kpresenter");
        mimeTypes.put("kpt", "application/vnd.kde.kpresenter");
        mimeTypes.put("sbml", "application/sbml+xml");
        mimeTypes.put("fpx", "image/vnd.fpx");
        mimeTypes.put("bz", "application/x-bzip");
        mimeTypes.put("flx", "text/vnd.fmi.flexstor");
        mimeTypes.put("application", "application/x-ms-application");
        mimeTypes.put("wmlsc", "application/vnd.wap.wmlscriptc");
        mimeTypes.put("lbd", "application/vnd.llamagraphics.life-balance.desktop");
        mimeTypes.put("sxw", "application/vnd.sun.xml.writer");
        mimeTypes.put("jam", "application/vnd.jam");
        mimeTypes.put("musicxml", "application/vnd.recordare.musicxml+xml");
        mimeTypes.put("see", "application/vnd.seemail");
        mimeTypes.put("irp", "application/vnd.irepository.package+xml");
        mimeTypes.put("tiff", "image/tiff");
        mimeTypes.put("tif", "image/tiff");
        mimeTypes.put("aam", "application/x-authorware-map");
        mimeTypes.put("chat", "application/x-chat");
        mimeTypes.put("mpkg", "application/vnd.apple.installer+xml");
        mimeTypes.put("otc", "application/vnd.oasis.opendocument.chart-template");
        mimeTypes.put("msh", "model/mesh");
        mimeTypes.put("mesh", "model/mesh");
        mimeTypes.put("silo", "model/mesh");
        mimeTypes.put("t", "text/troff");
        mimeTypes.put("tr", "text/troff");
        mimeTypes.put("roff", "text/troff");
        mimeTypes.put("man", "text/troff");
        mimeTypes.put("me", "text/troff");
        mimeTypes.put("ms", "text/troff");
        mimeTypes.put("dpg", "application/vnd.dpgraph");
        mimeTypes.put("wri", "application/x-mswrite");
        mimeTypes.put("dts", "audio/vnd.dts");
        mimeTypes.put("xpi", "application/x-xpinstall");
        mimeTypes.put("ram", "audio/x-pn-realaudio");
        mimeTypes.put("ra", "audio/x-pn-realaudio");
        mimeTypes.put("sdkm", "application/vnd.solent.sdkm+xml");
        mimeTypes.put("sdkd", "application/vnd.solent.sdkm+xml");
        mimeTypes.put("dtshd", "audio/vnd.dts.hd");
        mimeTypes.put("btif", "image/prs.btif");
        mimeTypes.put("scs", "application/scvp-cv-response");
        mimeTypes.put("car", "application/vnd.curl.car");
        mimeTypes.put("otf", "application/x-font-otf");
        mimeTypes.put("clkx", "application/vnd.crick.clicker");
        mimeTypes.put("xbd", "application/vnd.fujixerox.docuworks.binder");
        mimeTypes.put("ppm", "image/x-portable-pixmap");
        mimeTypes.put("wav", "audio/x-wav");
        mimeTypes.put("ssml", "application/ssml+xml");
        mimeTypes.put("p7b", "application/x-pkcs7-certificates");
        mimeTypes.put("spc", "application/x-pkcs7-certificates");
        mimeTypes.put("kia", "application/vnd.kidspiration");
        mimeTypes.put("rss", "application/rss+xml");
        mimeTypes.put("setreg", "application/set-registration-initiation");
        mimeTypes.put("qbo", "application/vnd.intu.qbo");
        mimeTypes.put("ras", "image/x-cmu-raster");
        mimeTypes.put("rar", "application/x-rar-compressed");
        mimeTypes.put("ogx", "application/ogg");
        mimeTypes.put("class", "application/java-vm");
        mimeTypes.put("smf", "application/vnd.stardivision.math");
        mimeTypes.put("atom", "application/atom+xml");
        mimeTypes.put("sit", "application/x-stuffit");
        mimeTypes.put("ez3", "application/vnd.ezpix-package");
        mimeTypes.put("mcurl", "text/vnd.curl.mcurl");
        mimeTypes.put("wmls", "text/vnd.wap.wmlscript");
        mimeTypes.put("srx", "application/sparql-results+xml");
        mimeTypes.put("wps", "application/vnd.ms-works");
        mimeTypes.put("wks", "application/vnd.ms-works");
        mimeTypes.put("wcm", "application/vnd.ms-works");
        mimeTypes.put("wdb", "application/vnd.ms-works");
        mimeTypes.put("vcs", "text/x-vcalendar");
        mimeTypes.put("ecma", "application/ecmascript");
        mimeTypes.put("curl", "text/vnd.curl");
        mimeTypes.put("std", "application/vnd.sun.xml.draw.template");
        mimeTypes.put("eot", "application/vnd.ms-fontobject");
        mimeTypes.put("fsc", "application/vnd.fsc.weblaunch");
        mimeTypes.put("tfm", "application/x-tex-tfm");
        mimeTypes.put("dra", "audio/vnd.dra");
        mimeTypes.put("mwf", "application/vnd.mfer");
        mimeTypes.put("hpid", "application/vnd.hp-hpid");
        mimeTypes.put("nml", "application/vnd.enliven");
        mimeTypes.put("hvp", "application/vnd.yamaha.hv-voice");
        mimeTypes.put("s", "text/x-asm");
        mimeTypes.put("asm", "text/x-asm");
        mimeTypes.put("mcd", "application/vnd.mcd");
        mimeTypes.put("mts", "model/vnd.mts");
        mimeTypes.put("igl", "application/vnd.igloader");
        mimeTypes.put("tao", "application/vnd.tao.intent-module-archive");
        mimeTypes.put("sgml", "text/sgml");
        mimeTypes.put("sgm", "text/sgml");
        mimeTypes.put("rmp", "audio/x-pn-realaudio-plugin");
        mimeTypes.put("xenc", "application/xenc+xml");
        mimeTypes.put("wpl", "application/vnd.ms-wpl");
        mimeTypes.put("dxf", "image/vnd.dxf");
        mimeTypes.put("pgm", "image/x-portable-graymap");
        mimeTypes.put("spot", "text/vnd.in3d.spot");
        mimeTypes.put("odt", "application/vnd.oasis.opendocument.text");
        mimeTypes.put("azs", "application/vnd.airzip.filesecure.azs");
        mimeTypes.put("es3", "application/vnd.eszigno3+xml");
        mimeTypes.put("et3", "application/vnd.eszigno3+xml");
        mimeTypes.put("dd2", "application/vnd.oma.dd2+xml");
        mimeTypes.put("semf", "application/vnd.semf");
        mimeTypes.put("semd", "application/vnd.semd");
        mimeTypes.put("pnm", "image/x-portable-anymap");
        mimeTypes.put("sema", "application/vnd.sema");
        mimeTypes.put("wma", "audio/x-ms-wma");
        mimeTypes.put("cww", "application/prs.cww");
        mimeTypes.put("scm", "application/vnd.lotus-screencam");
        mimeTypes.put("azf", "application/vnd.airzip.filesecure.azf");
        mimeTypes.put("oda", "application/oda");
        mimeTypes.put("dwg", "image/vnd.dwg");
        mimeTypes.put("h264", "video/h264");
        mimeTypes.put("hpgl", "application/vnd.hp-hpgl");
        mimeTypes.put("xpr", "application/vnd.is-xpr");
        mimeTypes.put("h263", "video/h263");
        mimeTypes.put("zip", "application/zip");
        mimeTypes.put("h261", "video/h261");
        mimeTypes.put("oti", "application/vnd.oasis.opendocument.image-template");
        mimeTypes.put("uoml", "application/vnd.uoml+xml");
        mimeTypes.put("xspf", "application/xspf+xml");
        mimeTypes.put("ppam", "application/vnd.ms-powerpoint.addin.macroenabled.12");
        mimeTypes.put("dtd", "application/xml-dtd");
        mimeTypes.put("gex", "application/vnd.geometry-explorer");
        mimeTypes.put("gre", "application/vnd.geometry-explorer");
        mimeTypes.put("dssc", "application/dssc+der");
    }

    /**
     * @param f File to detect content type.
     * @return Content type.
     */
    @Nullable public static String getContentType(File f) {
        try (FileInputStream is = new FileInputStream(f)) {
            byte[] data = new byte[Math.min((int)f.length(), PREVIEW_SIZE)];

            is.read(data);

            return getContentType(data, f.getName());
        }
        catch (IOException ignored) {
            return null;
        }
    }

    /**
     * @param data Bytes to detect content type.
     * @param name File name to detect content type by file name.
     * @return Content type.
     */
    @Nullable public static String getContentType(byte[] data, String name) {
        if (data == null)
            return null;

        byte[] hdr = new byte[PREVIEW_SIZE];

        System.arraycopy(data, 0, hdr, 0, Math.min(data.length, hdr.length));

        int c1 = hdr[0] & 0xff;
        int c2 = hdr[1] & 0xff;
        int c3 = hdr[2] & 0xff;
        int c4 = hdr[3] & 0xff;
        int c5 = hdr[4] & 0xff;
        int c6 = hdr[5] & 0xff;
        int c7 = hdr[6] & 0xff;
        int c8 = hdr[7] & 0xff;
        int c9 = hdr[8] & 0xff;
        int c10 = hdr[9] & 0xff;
        int c11 = hdr[10] & 0xff;

        if (c1 == 0xCA && c2 == 0xFE && c3 == 0xBA && c4 == 0xBE)
            return "application/java-vm";

        if (c1 == 0xD0 && c2 == 0xCF && c3 == 0x11 && c4 == 0xE0 && c5 == 0xA1 && c6 == 0xB1 && c7 == 0x1A && c8 == 0xE1) {
            // if the name is set then check if it can be validated by name, because it could be a xls or powerpoint
            String contentType = guessContentTypeFromName(name);

            if (contentType != null)
                return contentType;

            return "application/msword";
        }
        if (c1 == 0x25 && c2 == 0x50 && c3 == 0x44 && c4 == 0x46 && c5 == 0x2d && c6 == 0x31 && c7 == 0x2e)
            return "application/pdf";

        if (c1 == 0x38 && c2 == 0x42 && c3 == 0x50 && c4 == 0x53 && c5 == 0x00 && c6 == 0x01)
            return "image/photoshop";

        if (c1 == 0x25 && c2 == 0x21 && c3 == 0x50 && c4 == 0x53)
            return "application/postscript";

        if (c1 == 0xff && c2 == 0xfb && c3 == 0x30)
            return "audio/mp3";

        if (c1 == 0x49 && c2 == 0x44 && c3 == 0x33)
            return "audio/mp3";

        if (c1 == 0xAC && c2 == 0xED) {
            // next two bytes are version number, currently 0x00 0x05
            return "application/x-java-serialized-object";
        }

        if (c1 == '<') {
            if (c2 == '!' ||
                ((c2 == 'h' && (c3 == 't' && c4 == 'm' && c5 == 'l' || c3 == 'e' && c4 == 'a' && c5 == 'd') || (c2 == 'b' && c3 == 'o' && c4 == 'd' && c5 == 'y'))) ||
                ((c2 == 'H' && (c3 == 'T' && c4 == 'M' && c5 == 'L' || c3 == 'E' && c4 == 'A' && c5 == 'D') || (c2 == 'B' && c3 == 'O' && c4 == 'D' && c5 == 'Y'))))
                return "text/html";

            if (c2 == '?' && c3 == 'x' && c4 == 'm' && c5 == 'l' && c6 == ' ')
                return "application/xml";
        }

        // big and little endian UTF-16 encodings, with byte order mark
        if (c1 == 0xfe && c2 == 0xff) {
            if (c3 == 0 && c4 == '<' && c5 == 0 && c6 == '?' && c7 == 0 && c8 == 'x')
                return "application/xml";
        }

        if (c1 == 0xff && c2 == 0xfe) {
            if (c3 == '<' && c4 == 0 && c5 == '?' && c6 == 0 && c7 == 'x' && c8 == 0)
                return "application/xml";
        }

        if (c1 == 'B' && c2 == 'M')
            return "image/bmp";

        if (c1 == 0x49 && c2 == 0x49 && c3 == 0x2a && c4 == 0x00)
            return "image/tiff";

        if (c1 == 0x4D && c2 == 0x4D && c3 == 0x00 && c4 == 0x2a)
            return "image/tiff";

        if (c1 == 'G' && c2 == 'I' && c3 == 'F' && c4 == '8')
            return "image/gif";

        if (c1 == '#' && c2 == 'd' && c3 == 'e' && c4 == 'f')
            return "image/x-bitmap";

        if (c1 == '!' && c2 == ' ' && c3 == 'X' && c4 == 'P' && c5 == 'M' && c6 == '2')
            return "image/x-pixmap";

        if (c1 == 137 && c2 == 80 && c3 == 78 && c4 == 71 && c5 == 13 && c6 == 10 && c7 == 26 && c8 == 10)
            return "image/png";

        if (c1 == 0xFF && c2 == 0xD8 && c3 == 0xFF) {
            if (c4 == 0xE0)
                return "image/jpeg";

            /**
             * File format used by digital cameras to store images. Exif Format can be read by any application supporting JPEG. Exif Spec can be found at:
             * http://www.pima.net/standards/it10/PIMA15740/Exif_2-1.PDF
             */
            if ((c4 == 0xE1) && (c7 == 'E' && c8 == 'x' && c9 == 'i' && c10 == 'f' && c11 == 0))
                return "image/jpeg";

            if (c4 == 0xEE)
                return "image/jpg";
        }

        /**
         * According to http://www.opendesign.com/files/guestdownloads/OpenDesign_Specification_for_.dwg_files.pdf
         * first 6 bytes are of type "AC1018" (for example) and the next 5 bytes are 0x00.
         */
        if ((c1 == 0x41 && c2 == 0x43) && (c7 == 0x00 && c8 == 0x00 && c9 == 0x00 && c10 == 0x00 && c11 == 0x00))
            return "application/acad";

        if (c1 == 0x2E && c2 == 0x73 && c3 == 0x6E && c4 == 0x64)
            return "audio/basic"; // .au format, big endian

        if (c1 == 0x64 && c2 == 0x6E && c3 == 0x73 && c4 == 0x2E)
            return "audio/basic"; // .au format, little endian

        // I don't know if this is official but evidence suggests that .wav files start with "RIFF" - brown
        if (c1 == 'R' && c2 == 'I' && c3 == 'F' && c4 == 'F')
            return "audio/x-wav";

        if (c1 == 'P' && c2 == 'K') {
            // its application/zip but this could be a open office thing if name is given
            String contentType = guessContentTypeFromName(name);
            if (contentType != null)
                return contentType;
            return "application/zip";
        }
        return guessContentTypeFromName(name);
    }

    /**
     * @param name File name to detect content type by file name.
     * @return Content type.
     */
    @Nullable public static String guessContentTypeFromName(String name) {
        if (name == null)
            return null;

        int lastIdx = name.lastIndexOf('.');

        if (lastIdx != -1) {
            String extention = name.substring(lastIdx + 1).toLowerCase();

            return mimeTypes.get(extention);
        }

        return null;
    }
}


text:
using AWS
using AWS.AWSServices: support
using AWS.Compat
using AWS.UUIDs

"""
    add_attachments_to_set(attachments)
    add_attachments_to_set(attachments, params::Dict{String,<:Any})

Adds one or more attachments to an attachment set.  An attachment set is a temporary
container for attachments that you add to a case or case communication. The set is
available for 1 hour after it's created. The expiryTime returned in the response is when
the set expires.     You must have a Business, Enterprise On-Ramp, or Enterprise Support
plan to use the Amazon Web Services Support API.    If you call the Amazon Web Services
Support API from an account that does not have a Business, Enterprise On-Ramp, or
Enterprise Support plan, the SubscriptionRequiredException error message appears. For
information about changing your support plan, see Amazon Web Services Support.

# Arguments
- `attachments`: One or more attachments to add to the set. You can add up to three
  attachments per set. The size limit is 5 MB per attachment. In the Attachment object, use
  the data parameter to specify the contents of the attachment file. In the previous request
  syntax, the value for data appear as blob, which is represented as a base64-encoded string.
  The value for fileName is the name of the attachment, such as troubleshoot-screenshot.png.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"attachmentSetId"`: The ID of the attachment set. If an attachmentSetId is not
  specified, a new attachment set is created, and the ID of the set is returned in the
  response. If an attachmentSetId is specified, the attachments are added to the specified
  set, if it exists.
"""
function add_attachments_to_set(
    attachments; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "AddAttachmentsToSet",
        Dict{String,Any}("attachments" => attachments);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function add_attachments_to_set(
    attachments,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return support(
        "AddAttachmentsToSet",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("attachments" => attachments), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    add_communication_to_case(communication_body)
    add_communication_to_case(communication_body, params::Dict{String,<:Any})

Adds additional customer communication to an Amazon Web Services Support case. Use the
caseId parameter to identify the case to which to add communication. You can list a set of
email addresses to copy on the communication by using the ccEmailAddresses parameter. The
communicationBody value contains the text of the communication.    You must have a
Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services
Support API.    If you call the Amazon Web Services Support API from an account that does
not have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
SubscriptionRequiredException error message appears. For information about changing your
support plan, see Amazon Web Services Support.

# Arguments
- `communication_body`: The body of an email communication to add to the support case.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"attachmentSetId"`: The ID of a set of one or more attachments for the communication to
  add to the case. Create the set by calling AddAttachmentsToSet
- `"caseId"`: The support case ID requested or returned in the call. The case ID is an
  alphanumeric string formatted as shown in this example:
  case-12345678910-2013-c4c1d2bf33c5cf47
- `"ccEmailAddresses"`: The email addresses in the CC line of an email to be added to the
  support case.
"""
function add_communication_to_case(
    communicationBody; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "AddCommunicationToCase",
        Dict{String,Any}("communicationBody" => communicationBody);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function add_communication_to_case(
    communicationBody,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return support(
        "AddCommunicationToCase",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("communicationBody" => communicationBody), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_case(communication_body, subject)
    create_case(communication_body, subject, params::Dict{String,<:Any})

Creates a case in the Amazon Web Services Support Center. This operation is similar to how
you create a case in the Amazon Web Services Support Center Create Case page. The Amazon
Web Services Support API doesn't support requesting service limit increases. You can submit
a service limit increase in the following ways:    Submit a request from the Amazon Web
Services Support Center Create Case page.   Use the Service Quotas
RequestServiceQuotaIncrease operation.   A successful CreateCase request returns an Amazon
Web Services Support case number. You can use the DescribeCases operation and specify the
case number to get existing Amazon Web Services Support cases. After you create a case, use
the AddCommunicationToCase operation to add additional communication or attachments to an
existing case. The caseId is separate from the displayId that appears in the Amazon Web
Services Support Center. Use the DescribeCases operation to get the displayId.    You must
have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web
Services Support API.    If you call the Amazon Web Services Support API from an account
that does not have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
SubscriptionRequiredException error message appears. For information about changing your
support plan, see Amazon Web Services Support.

# Arguments
- `communication_body`: The communication body text that describes the issue. This text
  appears in the Description field on the Amazon Web Services Support Center Create Case page.
- `subject`: The title of the support case. The title appears in the Subject field on the
  Amazon Web Services Support Center Create Case page.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"attachmentSetId"`: The ID of a set of one or more attachments for the case. Create the
  set by using the AddAttachmentsToSet operation.
- `"categoryCode"`: The category of problem for the support case. You also use the
  DescribeServices operation to get the category code for a service. Each Amazon Web Services
  service defines its own set of category codes.
- `"ccEmailAddresses"`: A list of email addresses that Amazon Web Services Support copies
  on case correspondence. Amazon Web Services Support identifies the account that creates the
  case when you specify your Amazon Web Services credentials in an HTTP POST method or use
  the Amazon Web Services SDKs.
- `"issueType"`: The type of issue for the case. You can specify customer-service or
  technical. If you don't specify a value, the default is technical.
- `"language"`: The language in which Amazon Web Services Support handles the case. You
  must specify the ISO 639-1 code for the language parameter if you want support in that
  language. Currently, English (\"en\") and Japanese (\"ja\") are supported.
- `"serviceCode"`: The code for the Amazon Web Services service. You can use the
  DescribeServices operation to get the possible serviceCode values.
- `"severityCode"`: A value that indicates the urgency of the case. This value determines
  the response time according to your service level agreement with Amazon Web Services
  Support. You can use the DescribeSeverityLevels operation to get the possible values for
  severityCode.  For more information, see SeverityLevel and Choosing a Severity in the
  Amazon Web Services Support User Guide.  The availability of severity levels depends on the
  support plan for the Amazon Web Services account.
"""
function create_case(
    communicationBody, subject; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "CreateCase",
        Dict{String,Any}("communicationBody" => communicationBody, "subject" => subject);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_case(
    communicationBody,
    subject,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return support(
        "CreateCase",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "communicationBody" => communicationBody, "subject" => subject
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_attachment(attachment_id)
    describe_attachment(attachment_id, params::Dict{String,<:Any})

Returns the attachment that has the specified ID. Attachments can include screenshots,
error logs, or other files that describe your issue. Attachment IDs are generated by the
case management system when you add an attachment to a case or case communication.
Attachment IDs are returned in the AttachmentDetails objects that are returned by the
DescribeCommunications operation.    You must have a Business, Enterprise On-Ramp, or
Enterprise Support plan to use the Amazon Web Services Support API.    If you call the
Amazon Web Services Support API from an account that does not have a Business, Enterprise
On-Ramp, or Enterprise Support plan, the SubscriptionRequiredException error message
appears. For information about changing your support plan, see Amazon Web Services Support.

# Arguments
- `attachment_id`: The ID of the attachment to return. Attachment IDs are returned by the
  DescribeCommunications operation.

"""
function describe_attachment(
    attachmentId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeAttachment",
        Dict{String,Any}("attachmentId" => attachmentId);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_attachment(
    attachmentId,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return support(
        "DescribeAttachment",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("attachmentId" => attachmentId), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_cases()
    describe_cases(params::Dict{String,<:Any})

Returns a list of cases that you specify by passing one or more case IDs. You can use the
afterTime and beforeTime parameters to filter the cases by date. You can set values for the
includeResolvedCases and includeCommunications parameters to specify how much information
to return. The response returns the following in JSON format:   One or more CaseDetails
data types.   One or more nextToken values, which specify where to paginate the returned
records represented by the CaseDetails objects.   Case data is available for 12 months
after creation. If a case was created more than 12 months ago, a request might return an
error.    You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use
the Amazon Web Services Support API.    If you call the Amazon Web Services Support API
from an account that does not have a Business, Enterprise On-Ramp, or Enterprise Support
plan, the SubscriptionRequiredException error message appears. For information about
changing your support plan, see Amazon Web Services Support.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"afterTime"`: The start date for a filtered date search on support case communications.
  Case communications are available for 12 months after creation.
- `"beforeTime"`: The end date for a filtered date search on support case communications.
  Case communications are available for 12 months after creation.
- `"caseIdList"`: A list of ID numbers of the support cases you want returned. The maximum
  number of cases is 100.
- `"displayId"`: The ID displayed for a case in the Amazon Web Services Support Center user
  interface.
- `"includeCommunications"`: Specifies whether to include communications in the
  DescribeCases response. By default, communications are included.
- `"includeResolvedCases"`: Specifies whether to include resolved support cases in the
  DescribeCases response. By default, resolved cases aren't included.
- `"language"`: The ISO 639-1 code for the language in which Amazon Web Services provides
  support. Amazon Web Services Support currently supports English (\"en\") and Japanese
  (\"ja\"). Language parameters must be passed explicitly for operations that take them.
- `"maxResults"`: The maximum number of results to return before paginating.
- `"nextToken"`: A resumption point for pagination.
"""
function describe_cases(; aws_config::AbstractAWSConfig=global_aws_config())
    return support("DescribeCases"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET)
end
function describe_cases(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeCases", params; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end

"""
    describe_communications(case_id)
    describe_communications(case_id, params::Dict{String,<:Any})

Returns communications and attachments for one or more support cases. Use the afterTime and
beforeTime parameters to filter by date. You can use the caseId parameter to restrict the
results to a specific case. Case data is available for 12 months after creation. If a case
was created more than 12 months ago, a request for data might cause an error. You can use
the maxResults and nextToken parameters to control the pagination of the results. Set
maxResults to the number of cases that you want to display on each page, and use nextToken
to specify the resumption of pagination.    You must have a Business, Enterprise On-Ramp,
or Enterprise Support plan to use the Amazon Web Services Support API.    If you call the
Amazon Web Services Support API from an account that does not have a Business, Enterprise
On-Ramp, or Enterprise Support plan, the SubscriptionRequiredException error message
appears. For information about changing your support plan, see Amazon Web Services Support.

# Arguments
- `case_id`: The support case ID requested or returned in the call. The case ID is an
  alphanumeric string formatted as shown in this example:
  case-12345678910-2013-c4c1d2bf33c5cf47

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"afterTime"`: The start date for a filtered date search on support case communications.
  Case communications are available for 12 months after creation.
- `"beforeTime"`: The end date for a filtered date search on support case communications.
  Case communications are available for 12 months after creation.
- `"maxResults"`: The maximum number of results to return before paginating.
- `"nextToken"`: A resumption point for pagination.
"""
function describe_communications(caseId; aws_config::AbstractAWSConfig=global_aws_config())
    return support(
        "DescribeCommunications",
        Dict{String,Any}("caseId" => caseId);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_communications(
    caseId, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeCommunications",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("caseId" => caseId), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_services()
    describe_services(params::Dict{String,<:Any})

Returns the current list of Amazon Web Services services and a list of service categories
for each service. You then use service names and categories in your CreateCase requests.
Each Amazon Web Services service has its own set of categories. The service codes and
category codes correspond to the values that appear in the Service and Category lists on
the Amazon Web Services Support Center Create Case page. The values in those fields don't
necessarily match the service codes and categories returned by the DescribeServices
operation. Always use the service codes and categories that the DescribeServices operation
returns, so that you have the most recent set of service and category codes.    You must
have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web
Services Support API.    If you call the Amazon Web Services Support API from an account
that does not have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
SubscriptionRequiredException error message appears. For information about changing your
support plan, see Amazon Web Services Support.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"language"`: The ISO 639-1 code for the language in which Amazon Web Services provides
  support. Amazon Web Services Support currently supports English (\"en\") and Japanese
  (\"ja\"). Language parameters must be passed explicitly for operations that take them.
- `"serviceCodeList"`: A JSON-formatted list of service codes available for Amazon Web
  Services services.
"""
function describe_services(; aws_config::AbstractAWSConfig=global_aws_config())
    return support(
        "DescribeServices"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function describe_services(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeServices", params; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end

"""
    describe_severity_levels()
    describe_severity_levels(params::Dict{String,<:Any})

Returns the list of severity levels that you can assign to a support case. The severity
level for a case is also a field in the CaseDetails data type that you include for a
CreateCase request.    You must have a Business, Enterprise On-Ramp, or Enterprise Support
plan to use the Amazon Web Services Support API.    If you call the Amazon Web Services
Support API from an account that does not have a Business, Enterprise On-Ramp, or
Enterprise Support plan, the SubscriptionRequiredException error message appears. For
information about changing your support plan, see Amazon Web Services Support.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"language"`: The ISO 639-1 code for the language in which Amazon Web Services provides
  support. Amazon Web Services Support currently supports English (\"en\") and Japanese
  (\"ja\"). Language parameters must be passed explicitly for operations that take them.
"""
function describe_severity_levels(; aws_config::AbstractAWSConfig=global_aws_config())
    return support(
        "DescribeSeverityLevels"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function describe_severity_levels(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeSeverityLevels",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_trusted_advisor_check_refresh_statuses(check_ids)
    describe_trusted_advisor_check_refresh_statuses(check_ids, params::Dict{String,<:Any})

Returns the refresh status of the Trusted Advisor checks that have the specified check IDs.
You can get the check IDs by calling the DescribeTrustedAdvisorChecks operation. Some
checks are refreshed automatically, and you can't return their refresh statuses by using
the DescribeTrustedAdvisorCheckRefreshStatuses operation. If you call this operation for
these checks, you might see an InvalidParameterValue error.    You must have a Business,
Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support API.
  If you call the Amazon Web Services Support API from an account that does not have a
Business, Enterprise On-Ramp, or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information about changing your support plan, see Amazon Web
Services Support.

# Arguments
- `check_ids`: The IDs of the Trusted Advisor checks to get the status.  If you specify the
  check ID of a check that is automatically refreshed, you might see an InvalidParameterValue
  error.

"""
function describe_trusted_advisor_check_refresh_statuses(
    checkIds; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeTrustedAdvisorCheckRefreshStatuses",
        Dict{String,Any}("checkIds" => checkIds);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_trusted_advisor_check_refresh_statuses(
    checkIds,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return support(
        "DescribeTrustedAdvisorCheckRefreshStatuses",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("checkIds" => checkIds), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_trusted_advisor_check_result(check_id)
    describe_trusted_advisor_check_result(check_id, params::Dict{String,<:Any})

Returns the results of the Trusted Advisor check that has the specified check ID. You can
get the check IDs by calling the DescribeTrustedAdvisorChecks operation. The response
contains a TrustedAdvisorCheckResult object, which contains these three objects:
TrustedAdvisorCategorySpecificSummary     TrustedAdvisorResourceDetail
TrustedAdvisorResourcesSummary    In addition, the response contains these fields:
status - The alert status of the check can be ok (green), warning (yellow), error (red), or
not_available.    timestamp - The time of the last refresh of the check.    checkId - The
unique identifier for the check.      You must have a Business, Enterprise On-Ramp, or
Enterprise Support plan to use the Amazon Web Services Support API.    If you call the
Amazon Web Services Support API from an account that does not have a Business, Enterprise
On-Ramp, or Enterprise Support plan, the SubscriptionRequiredException error message
appears. For information about changing your support plan, see Amazon Web Services Support.

# Arguments
- `check_id`: The unique identifier for the Trusted Advisor check.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"language"`: The ISO 639-1 code for the language in which Amazon Web Services provides
  support. Amazon Web Services Support currently supports English (\"en\") and Japanese
  (\"ja\"). Language parameters must be passed explicitly for operations that take them.
"""
function describe_trusted_advisor_check_result(
    checkId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeTrustedAdvisorCheckResult",
        Dict{String,Any}("checkId" => checkId);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_trusted_advisor_check_result(
    checkId, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeTrustedAdvisorCheckResult",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("checkId" => checkId), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_trusted_advisor_check_summaries(check_ids)
    describe_trusted_advisor_check_summaries(check_ids, params::Dict{String,<:Any})

Returns the results for the Trusted Advisor check summaries for the check IDs that you
specified. You can get the check IDs by calling the DescribeTrustedAdvisorChecks operation.
The response contains an array of TrustedAdvisorCheckSummary objects.    You must have a
Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services
Support API.    If you call the Amazon Web Services Support API from an account that does
not have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
SubscriptionRequiredException error message appears. For information about changing your
support plan, see Amazon Web Services Support.

# Arguments
- `check_ids`: The IDs of the Trusted Advisor checks.

"""
function describe_trusted_advisor_check_summaries(
    checkIds; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeTrustedAdvisorCheckSummaries",
        Dict{String,Any}("checkIds" => checkIds);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_trusted_advisor_check_summaries(
    checkIds,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return support(
        "DescribeTrustedAdvisorCheckSummaries",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("checkIds" => checkIds), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    describe_trusted_advisor_checks(language)
    describe_trusted_advisor_checks(language, params::Dict{String,<:Any})

Returns information about all available Trusted Advisor checks, including the name, ID,
category, description, and metadata. You must specify a language code. The Amazon Web
Services Support API currently supports English (\"en\") and Japanese (\"ja\"). The
response contains a TrustedAdvisorCheckDescription object for each check. You must set the
Amazon Web Services Region to us-east-1.    You must have a Business, Enterprise On-Ramp,
or Enterprise Support plan to use the Amazon Web Services Support API.    If you call the
Amazon Web Services Support API from an account that does not have a Business, Enterprise
On-Ramp, or Enterprise Support plan, the SubscriptionRequiredException error message
appears. For information about changing your support plan, see Amazon Web Services Support.
  The names and descriptions for Trusted Advisor checks are subject to change. We recommend
that you specify the check ID in your code to uniquely identify a check.

# Arguments
- `language`: The ISO 639-1 code for the language in which Amazon Web Services provides
  support. Amazon Web Services Support currently supports English (\"en\") and Japanese
  (\"ja\"). Language parameters must be passed explicitly for operations that take them.

"""
function describe_trusted_advisor_checks(
    language; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "DescribeTrustedAdvisorChecks",
        Dict{String,Any}("language" => language);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function describe_trusted_advisor_checks(
    language,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return support(
        "DescribeTrustedAdvisorChecks",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("language" => language), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    refresh_trusted_advisor_check(check_id)
    refresh_trusted_advisor_check(check_id, params::Dict{String,<:Any})

Refreshes the Trusted Advisor check that you specify using the check ID. You can get the
check IDs by calling the DescribeTrustedAdvisorChecks operation.  Some checks are refreshed
automatically. If you call the RefreshTrustedAdvisorCheck operation to refresh them, you
might see the InvalidParameterValue error.  The response contains a
TrustedAdvisorCheckRefreshStatus object.    You must have a Business, Enterprise On-Ramp,
or Enterprise Support plan to use the Amazon Web Services Support API.    If you call the
Amazon Web Services Support API from an account that does not have a Business, Enterprise
On-Ramp, or Enterprise Support plan, the SubscriptionRequiredException error message
appears. For information about changing your support plan, see Amazon Web Services Support.

# Arguments
- `check_id`: The unique identifier for the Trusted Advisor check to refresh.  Specifying
  the check ID of a check that is automatically refreshed causes an InvalidParameterValue
  error.

"""
function refresh_trusted_advisor_check(
    checkId; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "RefreshTrustedAdvisorCheck",
        Dict{String,Any}("checkId" => checkId);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function refresh_trusted_advisor_check(
    checkId, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "RefreshTrustedAdvisorCheck",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("checkId" => checkId), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    resolve_case()
    resolve_case(params::Dict{String,<:Any})

Resolves a support case. This operation takes a caseId and returns the initial and final
state of the case.    You must have a Business, Enterprise On-Ramp, or Enterprise Support
plan to use the Amazon Web Services Support API.    If you call the Amazon Web Services
Support API from an account that does not have a Business, Enterprise On-Ramp, or
Enterprise Support plan, the SubscriptionRequiredException error message appears. For
information about changing your support plan, see Amazon Web Services Support.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"caseId"`: The support case ID requested or returned in the call. The case ID is an
  alphanumeric string formatted as shown in this example:
  case-12345678910-2013-c4c1d2bf33c5cf47
"""
function resolve_case(; aws_config::AbstractAWSConfig=global_aws_config())
    return support("ResolveCase"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET)
end
function resolve_case(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return support(
        "ResolveCase", params; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace _08.Refactor_Volume_of_Pyramid
{
    class Program
    {
        static void Main(string[] args)
        {

            Console.Write("Length: ");
            double lenght = double.Parse(Console.ReadLine());
            Console.Write("Width: ");
            double width = double.Parse(Console.ReadLine());
            Console.Write("Height: ");
            double volume = double.Parse(Console.ReadLine());
            volume = (lenght * width * volume) / 3;
            Console.WriteLine("Pyramid Volume: {0:F2}", volume);

        }
    }
}


text:
describe("Testing background extension script", function () {

    var runtime = {};

    var extension = {};
    var port;
    var $document = {};
    var element;
    var externalPort;
    beforeEach(function () {
        port = chrome.mocks.createMockPort();
        $document = {

            body: {
                appendChild: function (newElement) {
                    element = newElement;
                }
            },
            createElement: function () {
                return {
                    select: jasmine.createSpy("select")
                };
            },
            execCommand: function () {

            }

        };
        var mockChromeApi = chrome.mocks.mockChromeApi();
        extension = mockChromeApi.extension;
        runtime = mockChromeApi.runtime;
        port.name = "unique";
        externalPort = chrome.mocks.createMockPort(port.name);
        initializeExtension(runtime, extension, $document);
    });

    it("Should add proper listeners", function () {
        expect(runtime.onMessage.listeners.length).toBe(1);
        expect(extension.onConnectExternal.listeners.length).toBe(1);
        expect(extension.onConnect.listeners.length).toBe(1);
    });

    it("should post message on port when connected", function () {
        port.name = "uniquePort";
        extension.onConnect(port);
        expect(port.postMessage).toHaveBeenCalledWith("portConnected")
    });

    it("should disconnect external port when local port is disconnected", function () {
        extension.onConnect(port);
        extension.onConnectExternal(externalPort);
        port.onDisconnect();
        expect(externalPort.disconnect).toHaveBeenCalled();
    });

    it("should disconnect local port when external port is disconnected", function () {
        extension.onConnect(port);
        extension.onConnectExternal(externalPort);
        externalPort.onDisconnect();
        expect(port.disconnect).toHaveBeenCalled();
    });

    it("should disconnect local port if message received before external port is connected", function () {
        extension.onConnect(port);
        try {
            port.onMessage("message");
        } catch (e) {

        }
        expect(port.disconnect).toHaveBeenCalled();
    });

    it("should pass messages from external port to local", function () {
        extension.onConnect(port);
        extension.onConnectExternal(externalPort);
        port.postMessage = jasmine.createSpy();
        externalPort.onMessage("message");
        expect(port.postMessage).toHaveBeenCalled();
    });

    it("Should correctly listen on port", function () {
        port.name = "test";
        extension.onConnect(port);
        expect(port.onMessage.listeners.length).toBe(1);
        expect(port.onDisconnect.listeners.length).toBe(1);
    });
    it("Should throw error when port doesn't have a name", function () {
        var exception;
        delete port.name;
        try {
            extension.onConnect(port);
        } catch (e) {
            exception = e;
        }
        expect(exception).toBeDefined();
    });
    it("Should throw error when there are more than two ports with the same name", function () {
        extension.onConnect(port);
        var exception;
        try {
            extension.onConnect(port);
        } catch (e) {
            exception = e;
        }
        expect(exception).toBeDefined();
    });

    it("Should delete disconnected ports", function () {
        extension.onConnect(port);
        port.onDisconnect();
        extension.onConnect(port); //should throw exception otherwise
    });

    it("Should delegate message to correct port", function () {
        port.name = "uniquePort";
        port.postMessage = jasmine.createSpy("port.postMessage");
        extension.onConnect(port);
        runtime.onMessageExternal({}, {id: "uniquePort"});
        expect(port.postMessage).toHaveBeenCalled();
        port.postMessage = jasmine.createSpy("port.postMessage");

        var anotherPort = chrome.mocks.createMockPort();
        anotherPort.name = "uniquePort2";
        anotherPort.postMessage = jasmine.createSpy("port2.postMessage");
        extension.onConnect(anotherPort);
        runtime.onMessageExternal({}, {id: "uniquePort2"});
        expect(port.postMessage).not.toHaveBeenCalled();
        expect(anotherPort.postMessage).toHaveBeenCalled();
    });

    it("Should disconnect external port if it is not expected", function () {
        var mockPort = chrome.mocks.createMockPort();
        extension.onConnectExternal(mockPort);
        expect(mockPort.disconnect).toHaveBeenCalled();
    });

    it("Should delegate messages from port to the externalPort", function () {
        port.name = "uniquePort";
        extension.onConnect(port);
        var externalPort = chrome.mocks.createMockPort(port.name);
        extension.onConnectExternal(externalPort);
        expect(port.disconnect).not.toHaveBeenCalled();
        expect(externalPort.disconnect).not.toHaveBeenCalled();
        var message = {target: port.name};
        port.onMessage(message);
        expect(externalPort.postMessage).toHaveBeenCalledWith(message);
    });

    it("Should support 'copy' action message", function () {
        spyOn($document, 'execCommand');
        var callback = jasmine.createSpy("callback");
        runtime.onMessage({action: "copy", params: ["test"]}, {}, callback);
        expect($document.execCommand).toHaveBeenCalledWith('copy');
        expect(element.select).toHaveBeenCalled();
        expect(callback).toHaveBeenCalled();
        expect(element.value).toBe('');
    });

    it("Should support 'paste' action message", function () {
        spyOn($document, 'execCommand').andCallFake(function () {
            element.value = "newValue";
        });
        var callback = jasmine.createSpy("callback");
        runtime.onMessage({action: "paste"}, {}, callback);
        expect($document.execCommand).toHaveBeenCalledWith('paste');
        expect(element.select).toHaveBeenCalled();
        expect(callback).toHaveBeenCalledWith("newValue");
    });

    it("Should ignore unknown messages", function () {
        spyOn($document, 'execCommand');
        var callback = jasmine.createSpy("callback");
        runtime.onMessage({action: "cut"}, {}, callback);
        expect($document.execCommand).not.toHaveBeenCalled();
        expect(callback).not.toHaveBeenCalled();
    })

});


text:
import logging
from pkg_resources import iter_entry_points

from kore.plugins.models import Plugin

log = logging.getLogger(__name__)

class PluginIterator(object):

    def __init__(self, group_name):
        self.group_name = group_name

    def __iter__(self):
        log.debug("Looking for `%s` plugins", self.group_name)
        entry_points = iter_entry_points(group=self.group_name, name=None)
        for entry_point in entry_points:
            yield Plugin(entry_point.name, entry_point.load())


text:
#include "RenderingFramework.h"
#include "mem.h"

CShader::CShader():
	enableTexture(false),
	enableColor(false)
{
	// Do nothing.
}

CShader::~CShader() {
	// Do nothing.
}

CShaderSet::CShaderSet() {
	// Do nothing.
}

CShaderSet::~CShaderSet() {
	// Do nothing.
}

//
// ShaderSet
//

CShaderInstance* CShaderSet::createInstance() {
	CShaderInstance* pNewInstance = KLBNEW(CShaderInstance);
	if (pNewInstance) {
		bool err = false;
		pNewInstance->m_pShaderSet	= this;

		pNewInstance->enableColor	= this->enableColor;
		pNewInstance->enableTexture = this->enableTexture;

		// Count number of vertex input on shader
		pNewInstance->paramArrayVertexVertexShader	= KLBNEWA(CShaderInstance::SInternalParam,this->vertexShader->countStreamInfo);

		err = (pNewInstance->paramArrayVertexVertexShader == null);

		if (this->vertexShader->countUniform) {
			pNewInstance->paramArrayUniformVertexShader	= KLBNEWA(CShaderInstance::SInternalParam,this->vertexShader->countUniform);
			err |= (pNewInstance->paramArrayUniformVertexShader == null);
		} else {
			pNewInstance->paramArrayUniformVertexShader	= null;
		}

		if (this->pixelShader->countUniform) {
			pNewInstance->paramArrayUniformPixelShader	= KLBNEWA(CShaderInstance::SInternalParam,this->pixelShader->countUniform);
			err |= (pNewInstance->paramArrayUniformPixelShader == null);
		} else {
			pNewInstance->paramArrayUniformPixelShader	= null;
		}

		if (err != false) {
			// free arrays
			if (pNewInstance->paramArrayUniformPixelShader) {
				KLBDELETE(pNewInstance->paramArrayUniformPixelShader);
			}

			if (pNewInstance->paramArrayUniformVertexShader) {
				KLBDELETE(pNewInstance->paramArrayUniformVertexShader);
			}

			if (pNewInstance->paramArrayVertexVertexShader) {
				KLBDELETE(pNewInstance->paramArrayVertexVertexShader);
			}

			KLBDELETE(pNewInstance);
			pNewInstance = null;
		} else {
			//
			// Copy all params to instance.
			//
			CShaderInstance::SInternalParam* pParam = pNewInstance->paramArrayVertexVertexShader;
			CShader::SInternalParam* pSrc = &this->vertexShader->arrayParam[this->vertexShader->countUniform];
			for (s32 n=0; n < this->vertexShader->countStreamInfo; n++) {
				pParam->dType						= pSrc->param.dType;
				pParam->isConstantifiedOrUniform	= false;	// Vertex by default.
				pParam->vertexInfoID				= pSrc->param.vertexORuniformID;

				pParam++;
				pSrc++;
			}

			pParam = pNewInstance->paramArrayUniformVertexShader;
			pSrc = this->vertexShader->arrayParam;
			for (s32 n=0; n < this->vertexShader->countUniform; n++) {
				pParam->dType						= pSrc->param.dType;
				pParam->isConstantifiedOrUniform	= true;
				pParam->pTexture					= NULL;
				pParam->vertexInfoID				= pSrc->param.vertexORuniformID;
				memset32(pParam->values, 0, 16*4);
				pParam++;
				pSrc++;
			}

			pParam = pNewInstance->paramArrayUniformPixelShader;
			pSrc = this->pixelShader->arrayParam;
			for (s32 n=0; n < this->pixelShader->countUniform; n++) {
				pParam->dType						= pSrc->param.dType;
				pParam->isConstantifiedOrUniform	= true;
				pParam->pTexture					= NULL;
				pParam->vertexInfoID				= pSrc->param.vertexORuniformID;
				memset32(pParam->values, 0, 16*4);
				pParam++;
				pSrc++;
			}

			//
			// Link list.
			//
			pNewInstance->pNext = this->pInstances;
			this->pInstances	= pNewInstance;
		}
	}
	return pNewInstance;
}

void CShaderSet::releaseAllInstances() {
	CShaderInstance* p = this->pInstances;
	while (p) {
		CShaderInstance* pNext = p->pNext;

		if (p->paramArrayUniformPixelShader)	{	KLBDELETE(p->paramArrayUniformPixelShader);		}
		if (p->paramArrayUniformVertexShader)	{	KLBDELETE(p->paramArrayUniformVertexShader);		}
		if (p->paramArrayVertexVertexShader)	{	KLBDELETE(p->paramArrayVertexVertexShader);		}

		KLBDELETE(p);
		p = pNext;
	}
	this->pInstances = null;
}

void CShaderSet::releaseInstance(CShaderInstance* pInstance) {
	klb_assertc(pInstance != NULL,						"null shader");
	klb_assertc(pInstance->m_pShaderSet == this,"Invalid shader set");

	CShaderInstance* p		= this->pInstances;
	CShaderInstance* pPrev	= null;

	while (p != pInstance) {
		pPrev = p; p = p->pNext;
	}

	if (pPrev == null) {
		this->pInstances = p->pNext;
	} else {
		pPrev->pNext = p->pNext;
	}

	if (p->paramArrayUniformPixelShader)	{	KLBDELETE(p->paramArrayUniformPixelShader);	}
	if (p->paramArrayUniformVertexShader)	{	KLBDELETE(p->paramArrayUniformVertexShader);	}
	if (p->paramArrayVertexVertexShader)	{	KLBDELETE(p->paramArrayVertexVertexShader);	}

	KLBDELETE(p);
}


text:
namespace Google.Cloud.Vision.V1.Snippets
{
    // [START vision_v1_generated_ProductSearch_GetReferenceImage_async_flattened_resourceNames]
    using Google.Cloud.Vision.V1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedProductSearchClientSnippets
    {
        /// <summary>Snippet for GetReferenceImageAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public async Task GetReferenceImageResourceNamesAsync()
        {
            // Create client
            ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
            // Initialize request argument(s)
            ReferenceImageName name = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
            // Make the request
            ReferenceImage response = await productSearchClient.GetReferenceImageAsync(name);
        }
    }
    // [END vision_v1_generated_ProductSearch_GetReferenceImage_async_flattened_resourceNames]
}