comparison src/goodjava/webserver/handlers/ContentTypeHandler.java @ 1624:fe611f6e3c28

more content types
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 07 Aug 2021 20:01:46 -0600
parents fa066aaa068c
children 8a6e48371c66
comparison
equal deleted inserted replaced
1623:582384548a69 1624:fe611f6e3c28
21 map.put( "luan", textType ); 21 map.put( "luan", textType );
22 map.put( "luano", textType ); 22 map.put( "luano", textType );
23 map.put( "log", textType ); 23 map.put( "log", textType );
24 map.put( "html", "text/html; charset=utf-8" ); 24 map.put( "html", "text/html; charset=utf-8" );
25 map.put( "css", "text/css; charset=utf-8" ); 25 map.put( "css", "text/css; charset=utf-8" );
26 map.put( "xml", "text/xml; charset=utf-8" );
26 map.put( "js", "application/javascript; charset=utf-8" ); 27 map.put( "js", "application/javascript; charset=utf-8" );
27 map.put( "json", "application/json; charset=utf-8" ); 28 map.put( "json", "application/json; charset=utf-8" );
28 map.put( "mp4", "video/mp4" ); 29 map.put( "mp4", "video/mp4" );
29 map.put( "jpg", "image/jpeg" ); 30 map.put( "jpg", "image/jpeg" );
30 map.put( "jpeg", "image/jpeg" ); 31 map.put( "jpeg", "image/jpeg" );
31 map.put( "png", "image/png" ); 32 map.put( "png", "image/png" );
33 map.put( "gif", "image/gif" );
34 map.put( "pdf", "application/pdf" );
32 // add more as need 35 // add more as need
33 } 36 }
34 37
35 public static String getExtension(String path) { 38 public static String getExtension(String path) {
36 int iSlash = path.lastIndexOf('/'); 39 int iSlash = path.lastIndexOf('/');