Class Overview
This class can sniff a file according to the current JIRA settings and determine how an attachment should be handled
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Constants
public
static
final
String
CONTENT_DISPOSITION_ATTACHMENT
Constant Value:
"attachment"
public
static
final
String
CONTENT_DISPOSITION_INLINE
Public Constructors
public
MimeSniffingKit
(ApplicationProperties applicationProperties, HostileExtensionDetector hostileExtensionDetector)
Public Methods
public
void
setAttachmentResponseHeaders
(Attachment attachment, String userAgent, HttpServletResponse httpServletResponse)
Sets the appropriate HTTP response headers on an attachment download response. Depending on the JIRA security
settings and the browser making the request, this can contain headers such as Content-Disposition
and
X-Download-Options
to force downloading rather than opening attachments.
Parameters
attachment
| the Attachment in play |
userAgent
| the User-agent request header |
httpServletResponse
| the attachment download response |
public
void
setAttachmentResponseHeaders
(String fileName, String mimeContentType, HttpServletResponse httpServletResponse)
Sets the appropriate HTTP response headers on an attachment download response. Depending on the JIRA security
settings and the browser making the request, this can contain headers such as Content-Disposition
and
X-Download-Options
to force downloading rather than opening attachments.
Parameters
fileName
| the name of the file |
mimeContentType
| the content-type of the file |
httpServletResponse
| the attachment download response |