public class

FileNameBasedVersionedAttachmentsList

extends Object
implements VersionedAttachmentsList
java.lang.Object
   ↳ com.atlassian.jira.bc.issue.attachment.FileNameBasedVersionedAttachmentsList

Class Overview

This implementation wraps a list of attachments and adds the concept of attachment 'versions' by grouping attachments that have the same filename as versions of the same file. It stores this 'version' information when constructed by building up a Map with keys for every distinct file name in the underlying List of attachments. Then, each key's value is a java.util.TreeSet of attachments which have that filename.

Summary

Public Constructors
FileNameBasedVersionedAttachmentsList(List<Attachment> attachments)
Public Methods
List<Attachment> asList()
Returns the underlying list of attachments.
boolean isLatestVersion(Attachment attachment)
Determines whether the specified attachment is the latest file uploaded amongst the group of files with the same name in the underlying list.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.bc.issue.attachment.VersionedAttachmentsList

Public Constructors

public FileNameBasedVersionedAttachmentsList (List<Attachment> attachments)

Public Methods

public List<Attachment> asList ()

Returns the underlying list of attachments.

Returns

public boolean isLatestVersion (Attachment attachment)

Determines whether the specified attachment is the latest file uploaded amongst the group of files with the same name in the underlying list.

Parameters
attachment The attachment in play. Should not be null.
Returns
  • true if this is the latest (or only) file with this name; otherwise false.