public class DefaultAttachmentIndexManager extends Object implements AttachmentIndexManager
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultAttachmentIndexManager.TotalLengthPredicate
JSONs are saved to the database by EntityProperty mechanism maximum length of whole index is
EntityConstants.EXTREMELY_LONG_MAXIMUM_LENGTH . |
Constructor and Description |
---|
DefaultAttachmentIndexManager(com.atlassian.plugin.PluginAccessor pluginAccessor,
StreamAttachmentStore attachmentStore,
JsonEntityPropertyManager jsonEntityPropertyManager,
IssuePropertyHelper entityPropertyHelper,
InputStreamFunctionFactory inputStreamFunctionFactory,
AttachmentKeyMapper attachmentKeyMapper) |
Modifier and Type | Method and Description |
---|---|
io.atlassian.fugue.Option<AttachmentArchive> |
getAttachmentContents(Attachment attachment,
Issue issue,
int maxEntries)
Retrieves index of given attachment file.
|
boolean |
isExpandable(Attachment attachment)
Checks if provided attachment is currently expandable.
|
void |
processAttachmentAndCreateIndex(File file,
Attachment attachment,
Issue issue)
This methods generates the index of and archive file.
|
protected io.atlassian.fugue.Option<AttachmentArchive> |
processAttachmentAndCreateIndex(File file,
Attachment attachment,
Issue issue,
int maxEntries) |
void |
removeAttachmentIndex(Attachment attachment,
Issue issue)
Removes the index data of the specified attachment.
|
public DefaultAttachmentIndexManager(com.atlassian.plugin.PluginAccessor pluginAccessor, StreamAttachmentStore attachmentStore, JsonEntityPropertyManager jsonEntityPropertyManager, IssuePropertyHelper entityPropertyHelper, InputStreamFunctionFactory inputStreamFunctionFactory, AttachmentKeyMapper attachmentKeyMapper)
public void processAttachmentAndCreateIndex(@Nonnull File file, @Nonnull Attachment attachment, @Nonnull Issue issue)
AttachmentIndexManager
Note that after processing file other than archive its index will still be saved as an empty JSON array ("[]") in order to store information that this file was already processed so that getAttachmentContents will not call this method unnecessarily on each issue display.
processAttachmentAndCreateIndex
in interface AttachmentIndexManager
file
- attachment.attachment
- for which index provided.issue
- to which attachment belongs.protected io.atlassian.fugue.Option<AttachmentArchive> processAttachmentAndCreateIndex(@Nonnull File file, @Nonnull Attachment attachment, @Nonnull Issue issue, int maxEntries)
public io.atlassian.fugue.Option<AttachmentArchive> getAttachmentContents(@Nonnull Attachment attachment, @Nonnull Issue issue, int maxEntries)
AttachmentIndexManager
getAttachmentContents
in interface AttachmentIndexManager
attachment
- for which index will be retrieved.issue
- to which attachment belongs.maxEntries
- maximum number of entries that should be returned inpublic void removeAttachmentIndex(@Nonnull Attachment attachment, @Nonnull Issue issue)
AttachmentIndexManager
removeAttachmentIndex
in interface AttachmentIndexManager
attachment
- for which index file will be removed.issue
- to which attachment belongs.public boolean isExpandable(Attachment attachment)
AttachmentIndexManager
isExpandable
in interface AttachmentIndexManager
attachment
- to be tested.Copyright © 2002-2022 Atlassian. All Rights Reserved.