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 Summary
Fields Modifier and Type Field Description static StringDEFAULT_MIME_TYPEstatic StringMIME_TYPE_CONFIGURATION_FILE
-
Constructor Summary
Constructors Constructor Description BambooContentTypeResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull StringgetContentType(String requestUrl)Uses the filename extension type to work out the mime type.StringgetContentTypeForFileExtension(@NotNull String extension)protected Map<String,String>getMimeTypes()voidinit()voidsetServletContext(@NotNull javax.servlet.ServletContext servletContext)
-
-
-
Field Detail
-
MIME_TYPE_CONFIGURATION_FILE
public static final String MIME_TYPE_CONFIGURATION_FILE
- See Also:
- Constant Field Values
-
DEFAULT_MIME_TYPE
public static final String DEFAULT_MIME_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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:
getContentTypein interfacecom.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:
setServletContextin interfaceorg.springframework.web.context.ServletContextAware
-
-