@ParametersAreNonnullByDefault public class

DefaultTemporaryWebAttachmentsMonitor

extends Object
implements TemporaryWebAttachmentsMonitor HttpSessionBindingListener
java.lang.Object
   ↳ com.atlassian.jira.web.action.issue.DefaultTemporaryWebAttachmentsMonitor

Class Overview

This class maintains a list of temporary attachments uploaded by a user. When the user's session expires or the user logs out, it is responsible of deleting any temporary files that were not converted to proper attachments.

Summary

Public Constructors
DefaultTemporaryWebAttachmentsMonitor(StreamAttachmentStore attachmentStore)
Public Methods
void add(TemporaryWebAttachment temporaryAttachment)
Adds new temporary attachment.
void cleanByFormToken(String formToken)
Removes all attachments from monitor and from attachment store, matched by form token.
Collection<TemporaryWebAttachment> getByFormToken(String formToken)
Gets all temporary attachments with given from token.
Option<TemporaryWebAttachment> getById(String temporaryAttachmentId)
Retrieves temporary attachment by id.
Option<TemporaryWebAttachment> removeById(String temporaryAttachmentId)
Removes temporary attachment with given id from monitor.
void valueBound(HttpSessionBindingEvent event)
void valueUnbound(HttpSessionBindingEvent event)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.web.action.issue.TemporaryWebAttachmentsMonitor
From interface javax.servlet.http.HttpSessionBindingListener

Public Constructors

public DefaultTemporaryWebAttachmentsMonitor (StreamAttachmentStore attachmentStore)

Public Methods

public void add (TemporaryWebAttachment temporaryAttachment)

Adds new temporary attachment.

Parameters
temporaryAttachment temporary attachment.

public void cleanByFormToken (String formToken)

Removes all attachments from monitor and from attachment store, matched by form token.

public Collection<TemporaryWebAttachment> getByFormToken (String formToken)

Gets all temporary attachments with given from token.

Parameters
formToken form token
Returns
  • Collection of matched temporary attachments

public Option<TemporaryWebAttachment> getById (String temporaryAttachmentId)

Retrieves temporary attachment by id.

Parameters
temporaryAttachmentId temporary attachment id.
Returns
  • selected temporary attachment if exists

public Option<TemporaryWebAttachment> removeById (String temporaryAttachmentId)

Removes temporary attachment with given id from monitor. Does not remove it from attachment store.

Parameters
temporaryAttachmentId Temporary Attachment Id which will be removed.
Returns
  • Removed temporary attachment if exists

public void valueBound (HttpSessionBindingEvent event)

public void valueUnbound (HttpSessionBindingEvent event)