|
|
|
@ -118,6 +118,12 @@ public class Response {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String doctype2mime(String ext, char doctype) {
|
|
|
|
|
if (doctype == DT_PDFPS) return "application/pdf";
|
|
|
|
|
if (doctype == DT_HTML) return "text/html";
|
|
|
|
|
if (doctype == DT_DOC) return "application/msword";
|
|
|
|
|
if (doctype == DT_FLASH) return "application/x-shockwave-flash";
|
|
|
|
|
if (doctype == DT_SHARE) return "text/plain";
|
|
|
|
|
if (doctype == DT_BINARY) return "application/octet-stream";
|
|
|
|
|
String mime = Classification.ext2mime(ext);
|
|
|
|
|
int p = mime.indexOf('/');
|
|
|
|
|
if (p < 0) return mime;
|
|
|
|
|