1 /* taken from freenet (http://www.freenetproject.org/) */
2 package de.todesbaum.util.mime;
4 import java.util.HashMap;
7 import java.util.Vector;
10 * Holds the default MIME types.
12 public class DefaultMIMETypes {
14 /** Default MIME type - what to set it to if we don't know any better */
15 public static final String DEFAULT_MIME_TYPE = "application/octet-stream";
17 /** MIME types: number -> name */
18 private static List<String> mimeTypesByNumber = new Vector<String>();
20 /** MIME types: name -> number */
21 private static Map<String, Short> mimeTypesByName = new HashMap<String, Short>();
23 /** MIME types by extension. One extension maps to one MIME type, but not necessarily
24 * the other way around. */
25 private static Map<String, Short> mimeTypesByExtension = new HashMap<String, Short>();
27 /** Primary extension by MIME type number. */
28 private static Map<Short, String> primaryExtensionByMimeNumber = new HashMap<Short, String>();
31 * Add a MIME type, without any extensions.
32 * @param number The number of the MIME type for compression. This *must not change*
33 * for a given type, or the metadata format will be affected.
34 * @param type The actual MIME type string. Do not include ;charset= etc; these are
35 * parameters and there is a separate mechanism for them.
37 protected static synchronized void addMIMEType(short number, String type) {
38 if(mimeTypesByNumber.size() > number) {
39 String s = mimeTypesByNumber.get(number);
40 if(s != null) throw new IllegalArgumentException("Already used: "+number);
42 mimeTypesByNumber.add(number, null);
44 mimeTypesByNumber.set(number, type);
45 mimeTypesByName.put(type, new Short(number));
50 * @param number The number of the MIME type for compression. This *must not change*
51 * for a given type, or the metadata format will be affected.
52 * @param type The actual MIME type string. Do not include ;charset= etc; these are
53 * parameters and there is a separate mechanism for them.
54 * @param extensions An array of common extensions for files of this type. Must be
55 * unique for the type.
57 protected static synchronized void addMIMEType(short number, String type, String[] extensions, String outExtension) {
58 addMIMEType(number, type);
59 Short t = new Short(number);
60 if(extensions != null) {
61 for(int i=0;i<extensions.length;i++) {
62 String ext = extensions[i].toLowerCase();
63 if(mimeTypesByExtension.containsKey(ext)) {
65 //Short s = mimeTypesByExtension.get(ext);
67 // If only one, make it primary
68 if(outExtension == null && extensions.length == 1)
69 primaryExtensionByMimeNumber.put(t, ext);
70 mimeTypesByExtension.put(ext, t);
74 if(outExtension != null)
75 primaryExtensionByMimeNumber.put(t, outExtension);
80 * Add a MIME type, with extensions separated by spaces. This is more or less
81 * the format in /etc/mime-types.
83 protected static synchronized void addMIMEType(short number, String type, String extensions) {
84 addMIMEType(number, type, extensions.split(" "), null);
88 * Add a MIME type, with extensions separated by spaces. This is more or less
89 * the format in /etc/mime-types.
91 protected static synchronized void addMIMEType(short number, String type, String extensions, String outExtension) {
92 addMIMEType(number, type, extensions.split(" "), outExtension);
96 * Get a known MIME type by number.
98 public static String byNumber(short x) {
99 if(x > mimeTypesByNumber.size() || x < 0)
101 return mimeTypesByNumber.get(x);
105 * Get the number of a MIME type, or -1 if it is not in the table of known MIME
106 * types, in which case it will have to be sent uncompressed.
108 public static short byName(String s) {
109 Short x = mimeTypesByName.get(s);
110 if(x != null) return x.shortValue();
114 /* From toad's /etc/mime.types
115 * cat /etc/mime.types | sed "/^$/d;/#/d" | tr --squeeze '\t' ' ' |
116 * (y=0; while read x; do echo "$x" |
117 * sed -n "s/^\([^ ]*\)$/addMIMEType\($y, \"\1\"\);/p;s/^\([^ (),]\+\) \(.*\)$/addMIMEType\($y, \"\1\", \"\2\"\);/p;"; y=$((y+1)); done)
121 addMIMEType((short) 0, "application/activemessage");
122 addMIMEType((short) 1, "application/andrew-inset", "ez");
123 addMIMEType((short) 2, "application/applefile");
124 addMIMEType((short) 3, "application/atomicmail");
125 addMIMEType((short) 4, "application/batch-SMTP");
126 addMIMEType((short) 5, "application/beep+xml");
127 addMIMEType((short) 6, "application/cals-1840");
128 addMIMEType((short) 7, "application/commonground");
129 addMIMEType((short) 8, "application/cu-seeme", "cu");
130 addMIMEType((short) 9, "application/cybercash");
131 addMIMEType((short) 10, "application/dca-rft");
132 addMIMEType((short) 11, "application/dec-dx");
133 addMIMEType((short) 12, "application/docbook+xml");
134 addMIMEType((short) 13, "application/dsptype", "tsp");
135 addMIMEType((short) 14, "application/dvcs");
136 addMIMEType((short) 15, "application/edi-consent");
137 addMIMEType((short) 16, "application/edi-x12");
138 addMIMEType((short) 17, "application/edifact");
139 addMIMEType((short) 18, "application/eshop");
140 addMIMEType((short) 19, "application/font-tdpfr");
141 addMIMEType((short) 20, "application/futuresplash", "spl");
142 addMIMEType((short) 21, "application/ghostview");
143 addMIMEType((short) 22, "application/hta", "hta");
144 addMIMEType((short) 23, "application/http");
145 addMIMEType((short) 24, "application/hyperstudio");
146 addMIMEType((short) 25, "application/iges");
147 addMIMEType((short) 26, "application/index");
148 addMIMEType((short) 27, "application/index.cmd");
149 addMIMEType((short) 28, "application/index.obj");
150 addMIMEType((short) 29, "application/index.response");
151 addMIMEType((short) 30, "application/index.vnd");
152 addMIMEType((short) 31, "application/iotp");
153 addMIMEType((short) 32, "application/ipp");
154 addMIMEType((short) 33, "application/isup");
155 addMIMEType((short) 34, "application/java-archive", "jar");
156 addMIMEType((short) 35, "application/java-serialized-object", "ser");
157 addMIMEType((short) 36, "application/java-vm", "class");
158 addMIMEType((short) 37, "application/mac-binhex40", "hqx");
159 addMIMEType((short) 38, "application/mac-compactpro", "cpt");
160 addMIMEType((short) 39, "application/macwriteii");
161 addMIMEType((short) 40, "application/marc");
162 addMIMEType((short) 41, "application/mathematica", "nb");
163 addMIMEType((short) 42, "application/mathematica-old");
164 addMIMEType((short) 43, "application/msaccess", "mdb");
165 addMIMEType((short) 44, "application/msword", "doc dot");
166 addMIMEType((short) 45, "application/news-message-id");
167 addMIMEType((short) 46, "application/news-transmission");
168 addMIMEType((short) 47, "application/ocsp-request");
169 addMIMEType((short) 48, "application/ocsp-response");
170 addMIMEType((short) 49, "application/octet-stream", "bin");
171 addMIMEType((short) 50, "application/oda", "oda");
172 addMIMEType((short) 51, "application/ogg", "ogg");
173 addMIMEType((short) 52, "application/parityfec");
174 addMIMEType((short) 53, "application/pdf", "pdf");
175 addMIMEType((short) 54, "application/pgp-encrypted");
176 addMIMEType((short) 55, "application/pgp-keys", "key");
177 addMIMEType((short) 56, "application/pgp-signature", "pgp");
178 addMIMEType((short) 57, "application/pics-rules", "prf");
179 addMIMEType((short) 58, "application/pkcs10");
180 addMIMEType((short) 59, "application/pkcs7-mime");
181 addMIMEType((short) 60, "application/pkcs7-signature");
182 addMIMEType((short) 61, "application/pkix-cert");
183 addMIMEType((short) 62, "application/pkix-crl");
184 addMIMEType((short) 63, "application/pkixcmp");
185 addMIMEType((short) 64, "application/postscript", "ps ai eps");
186 addMIMEType((short) 65, "application/prs.alvestrand.titrax-sheet");
187 addMIMEType((short) 66, "application/prs.cww");
188 addMIMEType((short) 67, "application/prs.nprend");
189 addMIMEType((short) 68, "application/qsig");
190 addMIMEType((short) 69, "application/rar", "rar");
191 addMIMEType((short) 70, "application/rdf+xml", "rdf");
192 addMIMEType((short) 71, "application/remote-printing");
193 addMIMEType((short) 72, "application/riscos");
194 addMIMEType((short) 73, "application/rss+xml", "rss");
195 addMIMEType((short) 74, "application/rtf");
196 addMIMEType((short) 75, "application/sdp");
197 addMIMEType((short) 76, "application/set-payment");
198 addMIMEType((short) 77, "application/set-payment-initiation");
199 addMIMEType((short) 78, "application/set-registration");
200 addMIMEType((short) 79, "application/set-registration-initiation");
201 addMIMEType((short) 80, "application/sgml");
202 addMIMEType((short) 81, "application/sgml-open-catalog");
203 addMIMEType((short) 82, "application/sieve");
204 addMIMEType((short) 83, "application/slate");
205 addMIMEType((short) 84, "application/smil", "smi smil");
206 addMIMEType((short) 85, "application/timestamp-query");
207 addMIMEType((short) 86, "application/timestamp-reply");
208 addMIMEType((short) 87, "application/vemmi");
209 addMIMEType((short) 88, "application/whoispp-query");
210 addMIMEType((short) 89, "application/whoispp-response");
211 addMIMEType((short) 90, "application/wita");
212 addMIMEType((short) 91, "application/wordperfect", "wpd");
213 addMIMEType((short) 92, "application/wordperfect5.1", "wp5");
214 addMIMEType((short) 93, "application/x400-bp");
215 addMIMEType((short) 94, "application/xhtml+xml", "xhtml xht");
216 addMIMEType((short) 95, "application/xml", "xml xsl");
217 addMIMEType((short) 96, "application/xml-dtd");
218 addMIMEType((short) 97, "application/xml-external-parsed-entity");
219 addMIMEType((short) 98, "application/zip", "zip");
220 addMIMEType((short) 99, "application/vnd.3M.Post-it-Notes");
221 addMIMEType((short) 100, "application/vnd.accpac.simply.aso");
222 addMIMEType((short) 101, "application/vnd.accpac.simply.imp");
223 addMIMEType((short) 102, "application/vnd.acucobol");
224 addMIMEType((short) 103, "application/vnd.aether.imp");
225 addMIMEType((short) 104, "application/vnd.anser-web-certificate-issue-initiation");
226 addMIMEType((short) 105, "application/vnd.anser-web-funds-transfer-initiation");
227 addMIMEType((short) 106, "application/vnd.audiograph");
228 addMIMEType((short) 107, "application/vnd.bmi");
229 addMIMEType((short) 108, "application/vnd.businessobjects");
230 addMIMEType((short) 109, "application/vnd.canon-cpdl");
231 addMIMEType((short) 110, "application/vnd.canon-lips");
232 addMIMEType((short) 111, "application/vnd.cinderella", "cdy");
233 addMIMEType((short) 112, "application/vnd.claymore");
234 addMIMEType((short) 113, "application/vnd.commerce-battelle");
235 addMIMEType((short) 114, "application/vnd.commonspace");
236 addMIMEType((short) 115, "application/vnd.comsocaller");
237 addMIMEType((short) 116, "application/vnd.contact.cmsg");
238 addMIMEType((short) 117, "application/vnd.cosmocaller");
239 addMIMEType((short) 118, "application/vnd.ctc-posml");
240 addMIMEType((short) 119, "application/vnd.cups-postscript");
241 addMIMEType((short) 120, "application/vnd.cups-raster");
242 addMIMEType((short) 121, "application/vnd.cups-raw");
243 addMIMEType((short) 122, "application/vnd.cybank");
244 addMIMEType((short) 123, "application/vnd.dna");
245 addMIMEType((short) 124, "application/vnd.dpgraph");
246 addMIMEType((short) 125, "application/vnd.dxr");
247 addMIMEType((short) 126, "application/vnd.ecdis-update");
248 addMIMEType((short) 127, "application/vnd.ecowin.chart");
249 addMIMEType((short) 128, "application/vnd.ecowin.filerequest");
250 addMIMEType((short) 129, "application/vnd.ecowin.fileupdate");
251 addMIMEType((short) 130, "application/vnd.ecowin.series");
252 addMIMEType((short) 131, "application/vnd.ecowin.seriesrequest");
253 addMIMEType((short) 132, "application/vnd.ecowin.seriesupdate");
254 addMIMEType((short) 133, "application/vnd.enliven");
255 addMIMEType((short) 134, "application/vnd.epson.esf");
256 addMIMEType((short) 135, "application/vnd.epson.msf");
257 addMIMEType((short) 136, "application/vnd.epson.quickanime");
258 addMIMEType((short) 137, "application/vnd.epson.salt");
259 addMIMEType((short) 138, "application/vnd.epson.ssf");
260 addMIMEType((short) 139, "application/vnd.ericsson.quickcall");
261 addMIMEType((short) 140, "application/vnd.eudora.data");
262 addMIMEType((short) 141, "application/vnd.fdf");
263 addMIMEType((short) 142, "application/vnd.ffsns");
264 addMIMEType((short) 143, "application/vnd.flographit");
265 addMIMEType((short) 144, "application/vnd.framemaker");
266 addMIMEType((short) 145, "application/vnd.fsc.weblaunch");
267 addMIMEType((short) 146, "application/vnd.fujitsu.oasys");
268 addMIMEType((short) 147, "application/vnd.fujitsu.oasys2");
269 addMIMEType((short) 148, "application/vnd.fujitsu.oasys3");
270 addMIMEType((short) 149, "application/vnd.fujitsu.oasysgp");
271 addMIMEType((short) 150, "application/vnd.fujitsu.oasysprs");
272 addMIMEType((short) 151, "application/vnd.fujixerox.ddd");
273 addMIMEType((short) 152, "application/vnd.fujixerox.docuworks");
274 addMIMEType((short) 153, "application/vnd.fujixerox.docuworks.binder");
275 addMIMEType((short) 154, "application/vnd.fut-misnet");
276 addMIMEType((short) 155, "application/vnd.grafeq");
277 addMIMEType((short) 156, "application/vnd.groove-account");
278 addMIMEType((short) 157, "application/vnd.groove-identity-message");
279 addMIMEType((short) 158, "application/vnd.groove-injector");
280 addMIMEType((short) 159, "application/vnd.groove-tool-message");
281 addMIMEType((short) 160, "application/vnd.groove-tool-template");
282 addMIMEType((short) 161, "application/vnd.groove-vcard");
283 addMIMEType((short) 162, "application/vnd.hhe.lesson-player");
284 addMIMEType((short) 163, "application/vnd.hp-HPGL");
285 addMIMEType((short) 164, "application/vnd.hp-PCL");
286 addMIMEType((short) 165, "application/vnd.hp-PCLXL");
287 addMIMEType((short) 166, "application/vnd.hp-hpid");
288 addMIMEType((short) 167, "application/vnd.hp-hps");
289 addMIMEType((short) 168, "application/vnd.httphone");
290 addMIMEType((short) 169, "application/vnd.hzn-3d-crossword");
291 addMIMEType((short) 170, "application/vnd.ibm.MiniPay");
292 addMIMEType((short) 171, "application/vnd.ibm.afplinedata");
293 addMIMEType((short) 172, "application/vnd.ibm.modcap");
294 addMIMEType((short) 173, "application/vnd.informix-visionary");
295 addMIMEType((short) 174, "application/vnd.intercon.formnet");
296 addMIMEType((short) 175, "application/vnd.intertrust.digibox");
297 addMIMEType((short) 176, "application/vnd.intertrust.nncp");
298 addMIMEType((short) 177, "application/vnd.intu.qbo");
299 addMIMEType((short) 178, "application/vnd.intu.qfx");
300 addMIMEType((short) 179, "application/vnd.irepository.package+xml");
301 addMIMEType((short) 180, "application/vnd.is-xpr");
302 addMIMEType((short) 181, "application/vnd.japannet-directory-service");
303 addMIMEType((short) 182, "application/vnd.japannet-jpnstore-wakeup");
304 addMIMEType((short) 183, "application/vnd.japannet-payment-wakeup");
305 addMIMEType((short) 184, "application/vnd.japannet-registration");
306 addMIMEType((short) 185, "application/vnd.japannet-registration-wakeup");
307 addMIMEType((short) 186, "application/vnd.japannet-setstore-wakeup");
308 addMIMEType((short) 187, "application/vnd.japannet-verification");
309 addMIMEType((short) 188, "application/vnd.japannet-verification-wakeup");
310 addMIMEType((short) 189, "application/vnd.koan");
311 addMIMEType((short) 190, "application/vnd.lotus-1-2-3");
312 addMIMEType((short) 191, "application/vnd.lotus-approach");
313 addMIMEType((short) 192, "application/vnd.lotus-freelance");
314 addMIMEType((short) 193, "application/vnd.lotus-notes");
315 addMIMEType((short) 194, "application/vnd.lotus-organizer");
316 addMIMEType((short) 195, "application/vnd.lotus-screencam");
317 addMIMEType((short) 196, "application/vnd.lotus-wordpro");
318 addMIMEType((short) 197, "application/vnd.mcd");
319 addMIMEType((short) 198, "application/vnd.mediastation.cdkey");
320 addMIMEType((short) 199, "application/vnd.meridian-slingshot");
321 addMIMEType((short) 200, "application/vnd.mif");
322 addMIMEType((short) 201, "application/vnd.minisoft-hp3000-save");
323 addMIMEType((short) 202, "application/vnd.mitsubishi.misty-guard.trustweb");
324 addMIMEType((short) 203, "application/vnd.mobius.daf");
325 addMIMEType((short) 204, "application/vnd.mobius.dis");
326 addMIMEType((short) 205, "application/vnd.mobius.msl");
327 addMIMEType((short) 206, "application/vnd.mobius.plc");
328 addMIMEType((short) 207, "application/vnd.mobius.txf");
329 addMIMEType((short) 208, "application/vnd.motorola.flexsuite");
330 addMIMEType((short) 209, "application/vnd.motorola.flexsuite.adsi");
331 addMIMEType((short) 210, "application/vnd.motorola.flexsuite.fis");
332 addMIMEType((short) 211, "application/vnd.motorola.flexsuite.gotap");
333 addMIMEType((short) 212, "application/vnd.motorola.flexsuite.kmr");
334 addMIMEType((short) 213, "application/vnd.motorola.flexsuite.ttc");
335 addMIMEType((short) 214, "application/vnd.motorola.flexsuite.wem");
336 addMIMEType((short) 215, "application/vnd.mozilla.xul+xml", "xul");
337 addMIMEType((short) 216, "application/vnd.ms-artgalry");
338 addMIMEType((short) 217, "application/vnd.ms-asf");
339 addMIMEType((short) 218, "application/vnd.ms-excel", "xls xlb xlt");
340 addMIMEType((short) 219, "application/vnd.ms-lrm");
341 addMIMEType((short) 220, "application/vnd.ms-pki.seccat", "cat");
342 addMIMEType((short) 221, "application/vnd.ms-pki.stl", "stl");
343 addMIMEType((short) 222, "application/vnd.ms-powerpoint", "ppt pps");
344 addMIMEType((short) 223, "application/vnd.ms-project");
345 addMIMEType((short) 224, "application/vnd.ms-tnef");
346 addMIMEType((short) 225, "application/vnd.ms-works");
347 addMIMEType((short) 226, "application/vnd.mseq");
348 addMIMEType((short) 227, "application/vnd.msign");
349 addMIMEType((short) 228, "application/vnd.music-niff");
350 addMIMEType((short) 229, "application/vnd.musician");
351 addMIMEType((short) 230, "application/vnd.netfpx");
352 addMIMEType((short) 231, "application/vnd.noblenet-directory");
353 addMIMEType((short) 232, "application/vnd.noblenet-sealer");
354 addMIMEType((short) 233, "application/vnd.noblenet-web");
355 addMIMEType((short) 234, "application/vnd.novadigm.EDM");
356 addMIMEType((short) 235, "application/vnd.novadigm.EDX");
357 addMIMEType((short) 236, "application/vnd.novadigm.EXT");
358 addMIMEType((short) 237, "application/vnd.oasis.opendocument.chart", "odc");
359 addMIMEType((short) 238, "application/vnd.oasis.opendocument.database", "odb");
360 addMIMEType((short) 239, "application/vnd.oasis.opendocument.formula", "odf");
361 addMIMEType((short) 240, "application/vnd.oasis.opendocument.graphics", "odg");
362 addMIMEType((short) 241, "application/vnd.oasis.opendocument.graphics-template", "otg");
363 addMIMEType((short) 242, "application/vnd.oasis.opendocument.image", "odi");
364 addMIMEType((short) 243, "application/vnd.oasis.opendocument.presentation", "odp");
365 addMIMEType((short) 244, "application/vnd.oasis.opendocument.presentation-template", "otp");
366 addMIMEType((short) 245, "application/vnd.oasis.opendocument.spreadsheet", "ods");
367 addMIMEType((short) 246, "application/vnd.oasis.opendocument.spreadsheet-template", "ots");
368 addMIMEType((short) 247, "application/vnd.oasis.opendocument.text", "odt");
369 addMIMEType((short) 248, "application/vnd.oasis.opendocument.text-master", "odm");
370 addMIMEType((short) 249, "application/vnd.oasis.opendocument.text-template", "ott");
371 addMIMEType((short) 250, "application/vnd.oasis.opendocument.text-web", "oth");
372 addMIMEType((short) 251, "application/vnd.osa.netdeploy");
373 addMIMEType((short) 252, "application/vnd.palm");
374 addMIMEType((short) 253, "application/vnd.pg.format");
375 addMIMEType((short) 254, "application/vnd.pg.osasli");
376 addMIMEType((short) 255, "application/vnd.powerbuilder6");
377 addMIMEType((short) 256, "application/vnd.powerbuilder6-s");
378 addMIMEType((short) 257, "application/vnd.powerbuilder7");
379 addMIMEType((short) 258, "application/vnd.powerbuilder7-s");
380 addMIMEType((short) 259, "application/vnd.powerbuilder75");
381 addMIMEType((short) 260, "application/vnd.powerbuilder75-s");
382 addMIMEType((short) 261, "application/vnd.previewsystems.box");
383 addMIMEType((short) 262, "application/vnd.publishare-delta-tree");
384 addMIMEType((short) 263, "application/vnd.pvi.ptid1");
385 addMIMEType((short) 264, "application/vnd.pwg-xhtml-print+xml");
386 addMIMEType((short) 265, "application/vnd.rapid");
387 addMIMEType((short) 266, "application/vnd.rim.cod", "cod");
388 addMIMEType((short) 267, "application/vnd.s3sms");
389 addMIMEType((short) 268, "application/vnd.seemail");
390 addMIMEType((short) 269, "application/vnd.shana.informed.formdata");
391 addMIMEType((short) 270, "application/vnd.shana.informed.formtemplate");
392 addMIMEType((short) 271, "application/vnd.shana.informed.interchange");
393 addMIMEType((short) 272, "application/vnd.shana.informed.package");
394 addMIMEType((short) 273, "application/vnd.smaf", "mmf");
395 addMIMEType((short) 274, "application/vnd.sss-cod");
396 addMIMEType((short) 275, "application/vnd.sss-dtf");
397 addMIMEType((short) 276, "application/vnd.sss-ntf");
398 addMIMEType((short) 277, "application/vnd.stardivision.calc", "sdc");
399 addMIMEType((short) 278, "application/vnd.stardivision.draw", "sda");
400 addMIMEType((short) 279, "application/vnd.stardivision.impress", "sdd sdp");
401 addMIMEType((short) 280, "application/vnd.stardivision.math", "smf");
402 addMIMEType((short) 281, "application/vnd.stardivision.writer", "sdw vor");
403 addMIMEType((short) 282, "application/vnd.stardivision.writer-global", "sgl");
404 addMIMEType((short) 283, "application/vnd.street-stream");
405 addMIMEType((short) 284, "application/vnd.sun.xml.calc", "sxc");
406 addMIMEType((short) 285, "application/vnd.sun.xml.calc.template", "stc");
407 addMIMEType((short) 286, "application/vnd.sun.xml.draw", "sxd");
408 addMIMEType((short) 287, "application/vnd.sun.xml.draw.template", "std");
409 addMIMEType((short) 288, "application/vnd.sun.xml.impress", "sxi");
410 addMIMEType((short) 289, "application/vnd.sun.xml.impress.template", "sti");
411 addMIMEType((short) 290, "application/vnd.sun.xml.math", "sxm");
412 addMIMEType((short) 291, "application/vnd.sun.xml.writer", "sxw");
413 addMIMEType((short) 292, "application/vnd.sun.xml.writer.global", "sxg");
414 addMIMEType((short) 293, "application/vnd.sun.xml.writer.template", "stw");
415 addMIMEType((short) 294, "application/vnd.svd");
416 addMIMEType((short) 295, "application/vnd.swiftview-ics");
417 addMIMEType((short) 296, "application/vnd.symbian.install", "sis");
418 addMIMEType((short) 297, "application/vnd.triscape.mxs");
419 addMIMEType((short) 298, "application/vnd.trueapp");
420 addMIMEType((short) 299, "application/vnd.truedoc");
421 addMIMEType((short) 300, "application/vnd.tve-trigger");
422 addMIMEType((short) 301, "application/vnd.ufdl");
423 addMIMEType((short) 302, "application/vnd.uplanet.alert");
424 addMIMEType((short) 303, "application/vnd.uplanet.alert-wbxml");
425 addMIMEType((short) 304, "application/vnd.uplanet.bearer-choice");
426 addMIMEType((short) 305, "application/vnd.uplanet.bearer-choice-wbxml");
427 addMIMEType((short) 306, "application/vnd.uplanet.cacheop");
428 addMIMEType((short) 307, "application/vnd.uplanet.cacheop-wbxml");
429 addMIMEType((short) 308, "application/vnd.uplanet.channel");
430 addMIMEType((short) 309, "application/vnd.uplanet.channel-wbxml");
431 addMIMEType((short) 310, "application/vnd.uplanet.list");
432 addMIMEType((short) 311, "application/vnd.uplanet.list-wbxml");
433 addMIMEType((short) 312, "application/vnd.uplanet.listcmd");
434 addMIMEType((short) 313, "application/vnd.uplanet.listcmd-wbxml");
435 addMIMEType((short) 314, "application/vnd.uplanet.signal");
436 addMIMEType((short) 315, "application/vnd.vcx");
437 addMIMEType((short) 316, "application/vnd.vectorworks");
438 addMIMEType((short) 317, "application/vnd.vidsoft.vidconference");
439 addMIMEType((short) 318, "application/vnd.visio", "vsd");
440 addMIMEType((short) 319, "application/vnd.vividence.scriptfile");
441 addMIMEType((short) 320, "application/vnd.wap.sic");
442 addMIMEType((short) 321, "application/vnd.wap.slc");
443 addMIMEType((short) 322, "application/vnd.wap.wbxml", "wbxml");
444 addMIMEType((short) 323, "application/vnd.wap.wmlc", "wmlc");
445 addMIMEType((short) 324, "application/vnd.wap.wmlscriptc", "wmlsc");
446 addMIMEType((short) 325, "application/vnd.webturbo");
447 addMIMEType((short) 326, "application/vnd.wrq-hp3000-labelled");
448 addMIMEType((short) 327, "application/vnd.wt.stf");
449 addMIMEType((short) 328, "application/vnd.xara");
450 addMIMEType((short) 329, "application/vnd.xfdl");
451 addMIMEType((short) 330, "application/vnd.yellowriver-custom-menu");
452 addMIMEType((short) 331, "application/x-123", "wk");
453 addMIMEType((short) 332, "application/x-abiword", "abw");
454 addMIMEType((short) 333, "application/x-apple-diskimage", "dmg");
455 addMIMEType((short) 334, "application/x-bcpio", "bcpio");
456 addMIMEType((short) 335, "application/x-bittorrent", "torrent");
457 addMIMEType((short) 336, "application/x-cdf", "cdf");
458 addMIMEType((short) 337, "application/x-cdlink", "vcd");
459 addMIMEType((short) 338, "application/x-chess-pgn", "pgn");
460 addMIMEType((short) 339, "application/x-core");
461 addMIMEType((short) 340, "application/x-cpio", "cpio");
462 addMIMEType((short) 341, "application/x-csh", "csh");
463 addMIMEType((short) 342, "application/x-debian-package", "deb udeb");
464 addMIMEType((short) 343, "application/x-director", "dcr dir dxr");
465 addMIMEType((short) 344, "application/x-dms", "dms");
466 addMIMEType((short) 345, "application/x-doom", "wad");
467 addMIMEType((short) 346, "application/x-dvi", "dvi");
468 addMIMEType((short) 347, "application/x-executable");
469 addMIMEType((short) 348, "application/x-flac", "flac");
470 addMIMEType((short) 349, "application/x-font", "pfa pfb gsf pcf pcf.Z");
471 addMIMEType((short) 350, "application/x-freemind", "mm");
472 addMIMEType((short) 351, "application/x-futuresplash", "spl");
473 addMIMEType((short) 352, "application/x-gnumeric", "gnumeric");
474 addMIMEType((short) 353, "application/x-go-sgf", "sgf");
475 addMIMEType((short) 354, "application/x-graphing-calculator", "gcf");
476 addMIMEType((short) 355, "application/x-gtar", "gtar tgz taz");
477 addMIMEType((short) 356, "application/x-hdf", "hdf");
478 addMIMEType((short) 357, "application/x-httpd-php", "phtml pht php");
479 addMIMEType((short) 358, "application/x-httpd-php-source", "phps");
480 addMIMEType((short) 359, "application/x-httpd-php3", "php3");
481 addMIMEType((short) 360, "application/x-httpd-php3-preprocessed", "php3p");
482 addMIMEType((short) 361, "application/x-httpd-php4", "php4");
483 addMIMEType((short) 362, "application/x-ica", "ica");
484 addMIMEType((short) 363, "application/x-internet-signup", "ins isp");
485 addMIMEType((short) 364, "application/x-iphone", "iii");
486 addMIMEType((short) 365, "application/x-iso9660-image", "iso");
487 addMIMEType((short) 366, "application/x-java-applet");
488 addMIMEType((short) 367, "application/x-java-bean");
489 addMIMEType((short) 368, "application/x-java-jnlp-file", "jnlp");
490 addMIMEType((short) 369, "application/x-javascript", "js");
491 addMIMEType((short) 370, "application/x-jmol", "jmz");
492 addMIMEType((short) 371, "application/x-kchart", "chrt");
493 addMIMEType((short) 372, "application/x-kdelnk");
494 addMIMEType((short) 373, "application/x-killustrator", "kil");
495 addMIMEType((short) 374, "application/x-koan", "skp skd skt skm");
496 addMIMEType((short) 375, "application/x-kpresenter", "kpr kpt");
497 addMIMEType((short) 376, "application/x-kspread", "ksp");
498 addMIMEType((short) 377, "application/x-kword", "kwd kwt");
499 addMIMEType((short) 378, "application/x-latex", "latex");
500 addMIMEType((short) 379, "application/x-lha", "lha");
501 addMIMEType((short) 380, "application/x-lzh", "lzh");
502 addMIMEType((short) 381, "application/x-lzx", "lzx");
503 addMIMEType((short) 382, "application/x-maker", "frm maker frame fm fb book fbdoc");
504 addMIMEType((short) 383, "application/x-mif", "mif");
505 addMIMEType((short) 384, "application/x-ms-wmd", "wmd");
506 addMIMEType((short) 385, "application/x-ms-wmz", "wmz");
507 addMIMEType((short) 386, "application/x-msdos-program", "com exe bat dll");
508 addMIMEType((short) 387, "application/x-msi", "msi");
509 addMIMEType((short) 388, "application/x-netcdf", "nc");
510 addMIMEType((short) 389, "application/x-ns-proxy-autoconfig", "pac");
511 addMIMEType((short) 390, "application/x-nwc", "nwc");
512 addMIMEType((short) 391, "application/x-object", "o");
513 addMIMEType((short) 392, "application/x-oz-application", "oza");
514 addMIMEType((short) 393, "application/x-pkcs7-certreqresp", "p7r");
515 addMIMEType((short) 394, "application/x-pkcs7-crl", "crl");
516 addMIMEType((short) 395, "application/x-python-code", "pyc pyo");
517 addMIMEType((short) 396, "application/x-quicktimeplayer", "qtl");
518 addMIMEType((short) 397, "application/x-redhat-package-manager", "rpm");
519 addMIMEType((short) 398, "application/x-rx");
520 addMIMEType((short) 399, "application/x-sh", "sh");
521 addMIMEType((short) 400, "application/x-shar", "shar");
522 addMIMEType((short) 401, "application/x-shellscript");
523 addMIMEType((short) 402, "application/x-shockwave-flash", "swf swfl");
524 addMIMEType((short) 403, "application/x-stuffit", "sit");
525 addMIMEType((short) 404, "application/x-sv4cpio", "sv4cpio");
526 addMIMEType((short) 405, "application/x-sv4crc", "sv4crc");
527 addMIMEType((short) 406, "application/x-tar", "tar");
528 addMIMEType((short) 407, "application/x-tcl", "tcl");
529 addMIMEType((short) 408, "application/x-tex-gf", "gf");
530 addMIMEType((short) 409, "application/x-tex-pk", "pk");
531 addMIMEType((short) 410, "application/x-texinfo", "texinfo texi");
532 addMIMEType((short) 411, "application/x-trash", "~ % bak old sik");
533 addMIMEType((short) 412, "application/x-troff", "t tr roff");
534 addMIMEType((short) 413, "application/x-troff-man", "man");
535 addMIMEType((short) 414, "application/x-troff-me", "me");
536 addMIMEType((short) 415, "application/x-troff-ms", "ms");
537 addMIMEType((short) 416, "application/x-ustar", "ustar");
538 addMIMEType((short) 417, "application/x-videolan");
539 addMIMEType((short) 418, "application/x-wais-source", "src");
540 addMIMEType((short) 419, "application/x-wingz", "wz");
541 addMIMEType((short) 420, "application/x-x509-ca-cert", "crt");
542 addMIMEType((short) 421, "application/x-xcf", "xcf");
543 addMIMEType((short) 422, "application/x-xfig", "fig");
544 addMIMEType((short) 423, "application/x-xpinstall", "xpi");
545 addMIMEType((short) 424, "audio/32kadpcm");
546 addMIMEType((short) 425, "audio/basic", "au snd");
547 addMIMEType((short) 426, "audio/g.722.1");
548 addMIMEType((short) 427, "audio/l16");
549 addMIMEType((short) 428, "audio/midi", "mid midi kar");
550 addMIMEType((short) 429, "audio/mp4a-latm");
551 addMIMEType((short) 430, "audio/mpa-robust");
552 addMIMEType((short) 431, "audio/mpeg", "mpga mpega mp2 mp3 m4a");
553 addMIMEType((short) 432, "audio/mpegurl", "m3u");
554 addMIMEType((short) 433, "audio/parityfec");
555 addMIMEType((short) 434, "audio/prs.sid", "sid");
556 addMIMEType((short) 435, "audio/telephone-event");
557 addMIMEType((short) 436, "audio/tone");
558 addMIMEType((short) 437, "audio/vnd.cisco.nse");
559 addMIMEType((short) 438, "audio/vnd.cns.anp1");
560 addMIMEType((short) 439, "audio/vnd.cns.inf1");
561 addMIMEType((short) 440, "audio/vnd.digital-winds");
562 addMIMEType((short) 441, "audio/vnd.everad.plj");
563 addMIMEType((short) 442, "audio/vnd.lucent.voice");
564 addMIMEType((short) 443, "audio/vnd.nortel.vbk");
565 addMIMEType((short) 444, "audio/vnd.nuera.ecelp4800");
566 addMIMEType((short) 445, "audio/vnd.nuera.ecelp7470");
567 addMIMEType((short) 446, "audio/vnd.nuera.ecelp9600");
568 addMIMEType((short) 447, "audio/vnd.octel.sbc");
569 addMIMEType((short) 448, "audio/vnd.qcelp");
570 addMIMEType((short) 449, "audio/vnd.rhetorex.32kadpcm");
571 addMIMEType((short) 450, "audio/vnd.vmx.cvsd");
572 addMIMEType((short) 451, "audio/x-aiff", "aif aiff aifc");
573 addMIMEType((short) 452, "audio/x-gsm", "gsm");
574 addMIMEType((short) 453, "audio/x-mpegurl", "m3u");
575 addMIMEType((short) 454, "audio/x-ms-wma", "wma");
576 addMIMEType((short) 455, "audio/x-ms-wax", "wax");
577 addMIMEType((short) 456, "audio/x-pn-realaudio-plugin");
578 addMIMEType((short) 457, "audio/x-pn-realaudio", "ra rm ram");
579 addMIMEType((short) 458, "audio/x-realaudio", "ra");
580 addMIMEType((short) 459, "audio/x-scpls", "pls");
581 addMIMEType((short) 460, "audio/x-sd2", "sd2");
582 addMIMEType((short) 461, "audio/x-wav", "wav");
583 addMIMEType((short) 462, "chemical/x-alchemy", "alc");
584 addMIMEType((short) 463, "chemical/x-cache", "cac cache");
585 addMIMEType((short) 464, "chemical/x-cache-csf", "csf");
586 addMIMEType((short) 465, "chemical/x-cactvs-binary", "cbin cascii ctab");
587 addMIMEType((short) 466, "chemical/x-cdx", "cdx");
588 addMIMEType((short) 467, "chemical/x-cerius", "cer");
589 addMIMEType((short) 468, "chemical/x-chem3d", "c3d");
590 addMIMEType((short) 469, "chemical/x-chemdraw", "chm");
591 addMIMEType((short) 470, "chemical/x-cif", "cif");
592 addMIMEType((short) 471, "chemical/x-cmdf", "cmdf");
593 addMIMEType((short) 472, "chemical/x-cml", "cml");
594 addMIMEType((short) 473, "chemical/x-compass", "cpa");
595 addMIMEType((short) 474, "chemical/x-crossfire", "bsd");
596 addMIMEType((short) 475, "chemical/x-csml", "csml csm");
597 addMIMEType((short) 476, "chemical/x-ctx", "ctx");
598 addMIMEType((short) 477, "chemical/x-cxf", "cxf cef");
599 addMIMEType((short) 478, "chemical/x-embl-dl-nucleotide", "emb embl");
600 addMIMEType((short) 479, "chemical/x-galactic-spc", "spc");
601 addMIMEType((short) 480, "chemical/x-gamess-input", "inp gam gamin");
602 addMIMEType((short) 481, "chemical/x-gaussian-checkpoint", "fch fchk");
603 addMIMEType((short) 482, "chemical/x-gaussian-cube", "cub");
604 addMIMEType((short) 483, "chemical/x-gaussian-input", "gau gjc gjf");
605 addMIMEType((short) 484, "chemical/x-gaussian-log", "gal");
606 addMIMEType((short) 485, "chemical/x-gcg8-sequence", "gcg");
607 addMIMEType((short) 486, "chemical/x-genbank", "gen");
608 addMIMEType((short) 487, "chemical/x-hin", "hin");
609 addMIMEType((short) 488, "chemical/x-isostar", "istr ist");
610 addMIMEType((short) 489, "chemical/x-jcamp-dx", "jdx dx");
611 addMIMEType((short) 490, "chemical/x-kinemage", "kin");
612 addMIMEType((short) 491, "chemical/x-macmolecule", "mcm");
613 addMIMEType((short) 492, "chemical/x-macromodel-input", "mmd mmod");
614 addMIMEType((short) 493, "chemical/x-mdl-molfile", "mol");
615 addMIMEType((short) 494, "chemical/x-mdl-rdfile", "rd");
616 addMIMEType((short) 495, "chemical/x-mdl-rxnfile", "rxn");
617 addMIMEType((short) 496, "chemical/x-mdl-sdfile", "sd sdf");
618 addMIMEType((short) 497, "chemical/x-mdl-tgf", "tgf");
619 addMIMEType((short) 498, "chemical/x-mmcif", "mcif");
620 addMIMEType((short) 499, "chemical/x-mol2", "mol2");
621 addMIMEType((short) 500, "chemical/x-molconn-Z", "b");
622 addMIMEType((short) 501, "chemical/x-mopac-graph", "gpt");
623 addMIMEType((short) 502, "chemical/x-mopac-input", "mop mopcrt mpc dat zmt");
624 addMIMEType((short) 503, "chemical/x-mopac-out", "moo");
625 addMIMEType((short) 504, "chemical/x-mopac-vib", "mvb");
626 addMIMEType((short) 505, "chemical/x-ncbi-asn1", "asn");
627 addMIMEType((short) 506, "chemical/x-ncbi-asn1-ascii", "prt ent");
628 addMIMEType((short) 507, "chemical/x-ncbi-asn1-binary", "val aso");
629 addMIMEType((short) 508, "chemical/x-ncbi-asn1-spec", "asn");
630 addMIMEType((short) 509, "chemical/x-pdb", "pdb ent");
631 addMIMEType((short) 510, "chemical/x-rosdal", "ros");
632 addMIMEType((short) 511, "chemical/x-swissprot", "sw");
633 addMIMEType((short) 512, "chemical/x-vamas-iso14976", "vms");
634 addMIMEType((short) 513, "chemical/x-vmd", "vmd");
635 addMIMEType((short) 514, "chemical/x-xtel", "xtel");
636 addMIMEType((short) 515, "chemical/x-xyz", "xyz");
637 addMIMEType((short) 516, "image/cgm");
638 addMIMEType((short) 517, "image/g3fax");
639 addMIMEType((short) 518, "image/gif", "gif");
640 addMIMEType((short) 519, "image/ief", "ief");
641 addMIMEType((short) 520, "image/jpeg", "jpeg jpg jpe");
642 addMIMEType((short) 521, "image/naplps");
643 addMIMEType((short) 522, "image/pcx", "pcx");
644 addMIMEType((short) 523, "image/png", "png");
645 addMIMEType((short) 524, "image/prs.btif");
646 addMIMEType((short) 525, "image/prs.pti");
647 addMIMEType((short) 526, "image/svg+xml", "svg svgz");
648 addMIMEType((short) 527, "image/tiff", "tiff tif");
649 addMIMEType((short) 528, "image/vnd.cns.inf2");
650 addMIMEType((short) 529, "image/vnd.djvu", "djvu djv");
651 addMIMEType((short) 530, "image/vnd.dwg");
652 addMIMEType((short) 531, "image/vnd.dxf");
653 addMIMEType((short) 532, "image/vnd.fastbidsheet");
654 addMIMEType((short) 533, "image/vnd.fpx");
655 addMIMEType((short) 534, "image/vnd.fst");
656 addMIMEType((short) 535, "image/vnd.fujixerox.edmics-mmr");
657 addMIMEType((short) 536, "image/vnd.fujixerox.edmics-rlc");
658 addMIMEType((short) 537, "image/vnd.mix");
659 addMIMEType((short) 538, "image/vnd.net-fpx");
660 addMIMEType((short) 539, "image/vnd.svf");
661 addMIMEType((short) 540, "image/vnd.wap.wbmp", "wbmp");
662 addMIMEType((short) 541, "image/vnd.xiff");
663 addMIMEType((short) 542, "image/x-cmu-raster", "ras");
664 addMIMEType((short) 543, "image/x-coreldraw", "cdr");
665 addMIMEType((short) 544, "image/x-coreldrawpattern", "pat");
666 addMIMEType((short) 545, "image/x-coreldrawtemplate", "cdt");
667 addMIMEType((short) 546, "image/x-corelphotopaint", "cpt");
668 addMIMEType((short) 547, "image/x-icon", "ico");
669 addMIMEType((short) 548, "image/x-jg", "art");
670 addMIMEType((short) 549, "image/x-jng", "jng");
671 addMIMEType((short) 550, "image/x-ms-bmp", "bmp");
672 addMIMEType((short) 551, "image/x-photoshop", "psd");
673 addMIMEType((short) 552, "image/x-portable-anymap", "pnm");
674 addMIMEType((short) 553, "image/x-portable-bitmap", "pbm");
675 addMIMEType((short) 554, "image/x-portable-graymap", "pgm");
676 addMIMEType((short) 555, "image/x-portable-pixmap", "ppm");
677 addMIMEType((short) 556, "image/x-rgb", "rgb");
678 addMIMEType((short) 557, "image/x-xbitmap", "xbm");
679 addMIMEType((short) 558, "image/x-xpixmap", "xpm");
680 addMIMEType((short) 559, "image/x-xwindowdump", "xwd");
681 addMIMEType((short) 560, "inode/chardevice");
682 addMIMEType((short) 561, "inode/blockdevice");
683 addMIMEType((short) 562, "inode/directory-locked");
684 addMIMEType((short) 563, "inode/directory");
685 addMIMEType((short) 564, "inode/fifo");
686 addMIMEType((short) 565, "inode/socket");
687 addMIMEType((short) 566, "message/delivery-status");
688 addMIMEType((short) 567, "message/disposition-notification");
689 addMIMEType((short) 568, "message/external-body");
690 addMIMEType((short) 569, "message/http");
691 addMIMEType((short) 570, "message/s-http");
692 addMIMEType((short) 571, "message/news");
693 addMIMEType((short) 572, "message/partial");
694 addMIMEType((short) 573, "message/rfc822");
695 addMIMEType((short) 574, "model/iges", "igs iges");
696 addMIMEType((short) 575, "model/mesh", "msh mesh silo");
697 addMIMEType((short) 576, "model/vnd.dwf");
698 addMIMEType((short) 577, "model/vnd.flatland.3dml");
699 addMIMEType((short) 578, "model/vnd.gdl");
700 addMIMEType((short) 579, "model/vnd.gs-gdl");
701 addMIMEType((short) 580, "model/vnd.gtw");
702 addMIMEType((short) 581, "model/vnd.mts");
703 addMIMEType((short) 582, "model/vnd.vtu");
704 addMIMEType((short) 583, "model/vrml", "wrl vrml");
705 addMIMEType((short) 584, "multipart/alternative");
706 addMIMEType((short) 585, "multipart/appledouble");
707 addMIMEType((short) 586, "multipart/byteranges");
708 addMIMEType((short) 587, "multipart/digest");
709 addMIMEType((short) 588, "multipart/encrypted");
710 addMIMEType((short) 589, "multipart/form-data");
711 addMIMEType((short) 590, "multipart/header-set");
712 addMIMEType((short) 591, "multipart/mixed");
713 addMIMEType((short) 592, "multipart/parallel");
714 addMIMEType((short) 593, "multipart/related");
715 addMIMEType((short) 594, "multipart/report");
716 addMIMEType((short) 595, "multipart/signed");
717 addMIMEType((short) 596, "multipart/voice-message");
718 addMIMEType((short) 597, "text/calendar", "ics icz");
719 addMIMEType((short) 598, "text/comma-separated-values", "csv");
720 addMIMEType((short) 599, "text/css", "css");
721 addMIMEType((short) 600, "text/directory");
722 addMIMEType((short) 601, "text/english");
723 addMIMEType((short) 602, "text/enriched");
724 addMIMEType((short) 603, "text/h323", "323");
725 addMIMEType((short) 604, "text/html", "html htm shtml");
726 addMIMEType((short) 605, "text/iuls", "uls");
727 addMIMEType((short) 606, "text/mathml", "mml");
728 addMIMEType((short) 607, "text/parityfec");
729 addMIMEType((short) 608, "text/plain", "asc txt text diff pot");
730 addMIMEType((short) 609, "text/prs.lines.tag");
731 addMIMEType((short) 610, "text/x-psp", "psp");
732 addMIMEType((short) 611, "text/rfc822-headers");
733 addMIMEType((short) 612, "text/richtext", "rtx");
734 addMIMEType((short) 613, "text/rtf", "rtf");
735 addMIMEType((short) 614, "text/scriptlet", "sct wsc");
736 addMIMEType((short) 615, "text/t140");
737 addMIMEType((short) 616, "text/texmacs", "tm ts");
738 addMIMEType((short) 617, "text/tab-separated-values", "tsv");
739 addMIMEType((short) 618, "text/uri-list");
740 addMIMEType((short) 619, "text/vnd.abc");
741 addMIMEType((short) 620, "text/vnd.curl");
742 addMIMEType((short) 621, "text/vnd.DMClientScript");
743 addMIMEType((short) 622, "text/vnd.flatland.3dml");
744 addMIMEType((short) 623, "text/vnd.fly");
745 addMIMEType((short) 624, "text/vnd.fmi.flexstor");
746 addMIMEType((short) 625, "text/vnd.in3d.3dml");
747 addMIMEType((short) 626, "text/vnd.in3d.spot");
748 addMIMEType((short) 627, "text/vnd.IPTC.NewsML");
749 addMIMEType((short) 628, "text/vnd.IPTC.NITF");
750 addMIMEType((short) 629, "text/vnd.latex-z");
751 addMIMEType((short) 630, "text/vnd.motorola.reflex");
752 addMIMEType((short) 631, "text/vnd.ms-mediapackage");
753 addMIMEType((short) 632, "text/vnd.sun.j2me.app-descriptor", "jad");
754 addMIMEType((short) 633, "text/vnd.wap.si");
755 addMIMEType((short) 634, "text/vnd.wap.sl");
756 addMIMEType((short) 635, "text/vnd.wap.wml", "wml");
757 addMIMEType((short) 636, "text/vnd.wap.wmlscript", "wmls");
758 addMIMEType((short) 637, "text/x-bibtex", "bib");
759 addMIMEType((short) 638, "text/x-c++hdr", "h++ hpp hxx hh");
760 addMIMEType((short) 639, "text/x-c++src", "c++ cpp cxx cc");
761 addMIMEType((short) 640, "text/x-chdr", "h");
762 addMIMEType((short) 641, "text/x-crontab");
763 addMIMEType((short) 642, "text/x-csh", "csh");
764 addMIMEType((short) 643, "text/x-csrc", "c");
765 addMIMEType((short) 644, "text/x-haskell", "hs");
766 addMIMEType((short) 645, "text/x-java", "java");
767 addMIMEType((short) 646, "text/x-literate-haskell", "lhs");
768 addMIMEType((short) 647, "text/x-makefile");
769 addMIMEType((short) 648, "text/x-moc", "moc");
770 addMIMEType((short) 649, "text/x-pascal", "p pas");
771 addMIMEType((short) 650, "text/x-pcs-gcd", "gcd");
772 addMIMEType((short) 651, "text/x-perl", "pl pm");
773 addMIMEType((short) 652, "text/x-python", "py");
774 addMIMEType((short) 653, "text/x-server-parsed-html");
775 addMIMEType((short) 654, "text/x-setext", "etx");
776 addMIMEType((short) 655, "text/x-sh", "sh");
777 addMIMEType((short) 656, "text/x-tcl", "tcl tk");
778 addMIMEType((short) 657, "text/x-tex", "tex ltx sty cls");
779 addMIMEType((short) 658, "text/x-vcalendar", "vcs");
780 addMIMEType((short) 659, "text/x-vcard", "vcf");
781 addMIMEType((short) 660, "video/dl", "dl");
782 addMIMEType((short) 661, "video/dv", "dif dv");
783 addMIMEType((short) 662, "video/fli", "fli");
784 addMIMEType((short) 663, "video/gl", "gl");
785 addMIMEType((short) 664, "video/mpeg", "mpeg mpg mpe");
786 addMIMEType((short) 665, "video/mp4", "mp4");
787 addMIMEType((short) 666, "video/quicktime", "qt mov");
788 addMIMEType((short) 667, "video/mp4v-es");
789 addMIMEType((short) 668, "video/parityfec");
790 addMIMEType((short) 669, "video/pointer");
791 addMIMEType((short) 670, "video/vnd.fvt");
792 addMIMEType((short) 671, "video/vnd.motorola.video");
793 addMIMEType((short) 672, "video/vnd.motorola.videop");
794 addMIMEType((short) 673, "video/vnd.mpegurl", "mxu");
795 addMIMEType((short) 674, "video/vnd.mts");
796 addMIMEType((short) 675, "video/vnd.nokia.interleaved-multimedia");
797 addMIMEType((short) 676, "video/vnd.vivo");
798 addMIMEType((short) 677, "video/x-la-asf", "lsf lsx");
799 addMIMEType((short) 678, "video/x-mng", "mng");
800 addMIMEType((short) 679, "video/x-ms-asf", "asf asx");
801 addMIMEType((short) 680, "video/x-ms-wm", "wm");
802 addMIMEType((short) 681, "video/x-ms-wmv", "wmv");
803 addMIMEType((short) 682, "video/x-ms-wmx", "wmx");
804 addMIMEType((short) 683, "video/x-ms-wvx", "wvx");
805 addMIMEType((short) 684, "video/x-msvideo", "avi");
806 addMIMEType((short) 685, "video/x-sgi-movie", "movie");
807 addMIMEType((short) 686, "x-conference/x-cooltalk", "ice");
808 addMIMEType((short) 687, "x-world/x-vrml", "vrm vrml wrl");
811 /** Guess a MIME type from a filename */
812 public static String guessMIMEType(String arg) {
813 int x = arg.lastIndexOf('.');
814 if(x == -1 || x == arg.length()-1)
815 return DEFAULT_MIME_TYPE;
816 String ext = arg.substring(x+1).toLowerCase();
817 Short mimeIndexOb = mimeTypesByExtension.get(ext);
818 if(mimeIndexOb != null) {
819 return mimeTypesByNumber.get(mimeIndexOb.intValue());
821 return DEFAULT_MIME_TYPE;
824 public static String getExtension(String type) {
825 short typeNumber = byName(type);
826 if(typeNumber < 0) return null;
827 return primaryExtensionByMimeNumber.get(typeNumber);
830 public static String[] getAllMIMETypes() {
831 return mimeTypesByNumber.toArray(new String[mimeTypesByNumber.size()]);