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 |
|---|---|
com.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 com.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)
AttachmentIndexManagerNote 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 AttachmentIndexManagerfile - attachment.attachment - for which index provided.issue - to which attachment belongs.protected com.atlassian.fugue.Option<AttachmentArchive> processAttachmentAndCreateIndex(@Nonnull File file, @Nonnull Attachment attachment, @Nonnull Issue issue, int maxEntries)
public com.atlassian.fugue.Option<AttachmentArchive> getAttachmentContents(@Nonnull Attachment attachment, @Nonnull Issue issue, int maxEntries)
AttachmentIndexManagergetAttachmentContents in interface AttachmentIndexManagerattachment - 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)
AttachmentIndexManagerremoveAttachmentIndex in interface AttachmentIndexManagerattachment - for which index file will be removed.issue - to which attachment belongs.public boolean isExpandable(Attachment attachment)
AttachmentIndexManagerisExpandable in interface AttachmentIndexManagerattachment - to be tested.Copyright © 2002-2019 Atlassian. All Rights Reserved.