Class BambooContentTypeResolver

java.lang.Object
com.atlassian.bamboo.plugin.servlet.BambooContentTypeResolver
All Implemented Interfaces:
com.atlassian.plugin.servlet.ContentTypeResolver, org.springframework.beans.factory.Aware, org.springframework.web.context.ServletContextAware

public class BambooContentTypeResolver extends Object implements com.atlassian.plugin.servlet.ContentTypeResolver, org.springframework.web.context.ServletContextAware
Utility class to resolve content type of resources/files (aka mimetype)
  • Field Details

  • Constructor Details

    • BambooContentTypeResolver

      public BambooContentTypeResolver()
  • Method Details

    • init

      public void init()
    • getContentType

      @NotNull public @NotNull String getContentType(String requestUrl)
      Uses the filename extension type to work out the mime type. An unknown extension is classed as "application/octet-stream"
      Specified by:
      getContentType in interface com.atlassian.plugin.servlet.ContentTypeResolver
      Parameters:
      requestUrl - to check the mime type of.
      Returns:
      The mime type
    • getContentTypeForFileExtension

      public String getContentTypeForFileExtension(@NotNull @NotNull String extension)
    • setServletContext

      public void setServletContext(@NotNull @NotNull javax.servlet.ServletContext servletContext)
      Specified by:
      setServletContext in interface org.springframework.web.context.ServletContextAware
    • getMimeTypes

      protected Map<String,String> getMimeTypes()