com.atlassian.jira.web.servlet
Class MimeSniffingKit
java.lang.Object
com.atlassian.jira.web.servlet.MimeSniffingKit
public class MimeSniffingKit
- extends java.lang.Object
This class can sniff a file according to the current JIRA settings and determine jow an atatchment should be handled
- Since:
- v4.1
Method Summary |
java.lang.String |
getContentDisposition(Attachment attachment,
java.lang.String userAgent)
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. |
java.lang.String |
getContentDisposition(java.lang.String fileName,
java.lang.String mimeContentType,
java.lang.String userAgent,
java.io.File file)
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTENT_DISPOSITION_ATTACHMENT
public static final java.lang.String CONTENT_DISPOSITION_ATTACHMENT
- See Also:
- Constant Field Values
CONTENT_DISPOSITION_INLINE
public static final java.lang.String CONTENT_DISPOSITION_INLINE
- See Also:
- Constant Field Values
MimeSniffingKit
public MimeSniffingKit(ApplicationProperties applicationProperties)
getContentDisposition
public java.lang.String getContentDisposition(Attachment attachment,
java.lang.String userAgent)
throws java.io.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:
java.io.IOException
- if stuff goes wrong
getContentDisposition
public java.lang.String getContentDisposition(java.lang.String fileName,
java.lang.String mimeContentType,
java.lang.String userAgent,
java.io.File file)
throws java.io.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:
java.io.IOException
- if stuff goes wrong
Copyright © 2002-2011 Atlassian. All Rights Reserved.