1 package org.apache.turbine.services.mimetype; 2 3 18 19 import java.io.File ; 20 import java.util.Locale ; 21 22 import org.apache.turbine.services.TurbineServices; 23 import org.apache.turbine.services.mimetype.util.MimeType; 24 25 31 public abstract class TurbineMimeTypes 32 { 33 39 public static String getContentType(File file) 40 { 41 return getService().getContentType(file); 42 } 43 44 50 public static String getContentType(String name) 51 { 52 return getService().getContentType(name); 53 } 54 55 62 public static String getContentType(String ext, 63 String def) 64 { 65 return getService().getContentType(ext, def); 66 } 67 68 74 public static MimeType getMimeContentType(File file) 75 { 76 return getService().getMimeContentType(file); 77 } 78 79 85 public static MimeType getMimeContentType(String name) 86 { 87 return getService().getMimeContentType(name); 88 } 89 90 97 public static MimeType getMimeContentType(String ext, 98 String def) 99 { 100 return getService().getMimeContentType(ext, def); 101 } 102 103 110 public static String getDefaultExtension(MimeType mime) 111 { 112 return getService().getDefaultExtension(mime); 113 } 114 115 123 public static String getCharSet(Locale locale) 124 { 125 return getService().getCharSet(locale); 126 } 127 128 144 public static String getCharSet(Locale locale, 145 String variant) 146 { 147 return getService().getCharSet(locale, variant); 148 } 149 150 156 public static String getCharSet(String key) 157 { 158 return getService().getCharSet(key); 159 } 160 161 168 public static String getCharSet(String key, 169 String def) 170 { 171 return getService().getCharSet(key, def); 172 } 173 174 179 protected static MimeTypeService getService() 180 { 181 return (MimeTypeService) TurbineServices. 182 getInstance().getService(MimeTypeService.SERVICE_NAME); 183 } 184 } 185 | Popular Tags |