com.atlassian.jira.web.servlet
Class MimeSniffingKit
java.lang.Object
com.atlassian.jira.web.servlet.MimeSniffingKit
public class MimeSniffingKit
- extends Object
This class can sniff a file according to the current JIRA settings and determine jow an atatchment should be handled
- Since:
- v4.1
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTENT_DISPOSITION_ATTACHMENT
public static final String CONTENT_DISPOSITION_ATTACHMENT
- See Also:
- Constant Field Values
CONTENT_DISPOSITION_INLINE
public static final String CONTENT_DISPOSITION_INLINE
- See Also:
- Constant Field Values
MimeSniffingKit
public MimeSniffingKit(ApplicationProperties applicationProperties)
getContentDisposition
public String getContentDisposition(Attachment attachment,
String userAgent)
throws IOException
- This will suggest a content disposition type (inline or attachment) for the given
Attachment
, respecting the settings in JIRA and taking IE badness into
account.
- Parameters:
attachment
- the Attachment in playuserAgent
- the browser in play
- Returns:
- either INLINE or ATTACHMENT ready for a Content-Disposition header
- Throws:
IOException
- if stuff goes wrong
getContentDisposition
public String getContentDisposition(String fileName,
String mimeContentType,
String userAgent,
File file)
throws IOException
- This will suggest a content disposition type (inline or attachment) for the given file, respecting the settings
in JIRA and taking IE badness into account.
- Parameters:
fileName
- the name of the filemimeContentType
- the exisiting content typeuserAgent
- the browser in playfile
- the File to be checked
- Returns:
- either INLINE or ATTACHMENT ready for a Content-Disposition header
- Throws:
IOException
- if stuff goes wrong
Copyright © 2002-2012 Atlassian. All Rights Reserved.