/** * @param extension the extension * * @return the content type associated with <code>extension</code>. If no association is found, this method will * return <code>text/plain</code> */ public static String get(String extension) { return get(extension, "text/plain"); }
/** * @param fileName the filename * * @return the content type associated with <code>extension</code> of the * given filename or if no associate is found, returns * <code>null</code> */ public static String getByFilename(String fileName) { String extn = getExtension(fileName); if (extn != null) { return get(extn); } else { // no extension, no content type return null; } }
/** * OSGi integration. Uses {@link HttpContext#getMimeType(String)}. * <p/> * {@inheritDoc} */ @Override public String getMimeType(String file) { String mime = httpContext.getMimeType(file); if (mime == null) { // if returned null, try figuring out by ourselfs. mime = MimeType.getByFilename(file); } return mime; }
if (!MimeType.contains(type) && !"/".equals(ext)) { initializeFileURLPattern(ext); mappingData.recycle();
/** * OSGi integration. Uses {@link HttpContext#getMimeType(String)}. * <p/> * {@inheritDoc} */ @Override public String getMimeType(String file) { String mime = httpContext.getMimeType(file); if (mime == null) { // if returned null, try figuring out by ourselfs. mime = MimeType.getByFilename(file); } return mime; }
/** * @param extension the extension * * @return the content type associated with <code>extension</code>. If no association is found, this method will * return <code>text/plain</code> */ public static String get(String extension) { return get(extension, "text/plain"); }
/** * @param fileName the filename * * @return the content type associated with <code>extension</code> of the * given filename or if no associate is found, returns * <code>null</code> */ public static String getByFilename(String fileName) { String extn = getExtension(fileName); if (extn != null) { return get(extn); } else { // no extension, no content type return null; } }
outputHeader.setContentType(MimeType.getByFilename(file.getName()));
/** * @param extension the extension * * @return the content type associated with <code>extension</code>. If no association is found, this method will * return <code>text/plain</code> */ public static String get(String extension) { return get(extension, "text/plain"); }
/** * @param fileName the filename * * @return the content type associated with <code>extension</code> of the * given filename or if no associate is found, returns * <code>null</code> */ public static String getByFilename(String fileName) { String extn = getExtension(fileName); if (extn != null) { return get(extn); } else { // no extension, no content type return null; } }
outputHeader.setContentType(MimeType.getByFilename(file.getName()));
/** * @param extension the extension * * @return the content type associated with <code>extension</code>. If no association is found, this method will * return <code>text/plain</code> */ public static String get(String extension) { return get(extension, "text/plain"); }
/** * @param fileName the filename * * @return the content type associated with <code>extension</code> of the * given filename or if no associate is found, returns * <code>null</code> */ public static String getByFilename(String fileName) { String extn = getExtension(fileName); if (extn != null) { return get(extn); } else { // no extension, no content type return null; } }
outputHeader.setContentType(MimeType.getByFilename(file.getName()));
/** * @param extension the extension * * @return the content type associated with <code>extension</code>. If no association is found, this method will * return <code>text/plain</code> */ public static String get(String extension) { return get(extension, "text/plain"); }
/** * @param fileName the filename * * @return the content type associated with <code>extension</code> of the * given filename or if no associate is found, returns * <code>null</code> */ public static String getByFilename(String fileName) { String extn = getExtension(fileName); if (extn != null) { return get(extn); } else { // no extension, no content type return null; } }
outputHeader.setContentType(MimeType.getByFilename(file.getName()));
/** * @param extension the extension * * @return the content type associated with <code>extension</code>. If no association is found, this method will * return <code>text/plain</code> */ public static String get(String extension) { return get(extension, "text/plain"); }
/** * @param fileName the filename * * @return the content type associated with <code>extension</code> of the * given filename or if no associate is found, returns * <code>null</code> */ public static String getByFilename(String fileName) { String extn = getExtension(fileName); if (extn != null) { return get(extn); } else { // no extension, no content type return null; } }
outputHeader.setContentType(MimeType.getByFilename(file.getName()));