Class DefaultAttachmentIndexManager
java.lang.Object
com.atlassian.jira.issue.managers.DefaultAttachmentIndexManager
- All Implemented Interfaces:
AttachmentIndexManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classJSONs are saved to the database by EntityProperty mechanism maximum length of whole index isEntityConstants.EXTREMELY_LONG_MAXIMUM_LENGTH. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultAttachmentIndexManager(com.atlassian.plugin.PluginAccessor pluginAccessor, StreamAttachmentStore attachmentStore, JsonEntityPropertyManager jsonEntityPropertyManager, IssuePropertyHelper entityPropertyHelper, InputStreamFunctionFactory inputStreamFunctionFactory, AttachmentKeyMapper attachmentKeyMapper) -
Method Summary
Modifier and TypeMethodDescriptionio.atlassian.fugue.Option<AttachmentArchive> getAttachmentContents(Attachment attachment, Issue issue, int maxEntries) Retrieves index of given attachment file.booleanisExpandable(Attachment attachment) Checks if provided attachment is currently expandable.voidprocessAttachmentAndCreateIndex(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) voidremoveAttachmentIndex(Attachment attachment, Issue issue) Removes the index data of the specified attachment.
-
Constructor Details
-
DefaultAttachmentIndexManager
public DefaultAttachmentIndexManager(com.atlassian.plugin.PluginAccessor pluginAccessor, StreamAttachmentStore attachmentStore, JsonEntityPropertyManager jsonEntityPropertyManager, IssuePropertyHelper entityPropertyHelper, InputStreamFunctionFactory inputStreamFunctionFactory, AttachmentKeyMapper attachmentKeyMapper)
-
-
Method Details
-
processAttachmentAndCreateIndex
public void processAttachmentAndCreateIndex(@Nonnull File file, @Nonnull Attachment attachment, @Nonnull Issue issue) Description copied from interface:AttachmentIndexManagerThis methods generates the index of and archive file. It looks up for plugins that can handle processing file with certain extension. Then it stores given attachment index to database.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.
- Specified by:
processAttachmentAndCreateIndexin interfaceAttachmentIndexManager- Parameters:
file- attachment.attachment- for which index provided.issue- to which attachment belongs.
-
processAttachmentAndCreateIndex
protected io.atlassian.fugue.Option<AttachmentArchive> processAttachmentAndCreateIndex(@Nonnull File file, @Nonnull Attachment attachment, @Nonnull Issue issue, int maxEntries) -
getAttachmentContents
public io.atlassian.fugue.Option<AttachmentArchive> getAttachmentContents(@Nonnull Attachment attachment, @Nonnull Issue issue, int maxEntries) Description copied from interface:AttachmentIndexManagerRetrieves index of given attachment file. If the index does not exist tries to obtain Attachment file from AttachmentStore and if obtained saves its index to the database.- Specified by:
getAttachmentContentsin interfaceAttachmentIndexManager- Parameters:
attachment- for which index will be retrieved.issue- to which attachment belongs.maxEntries- maximum number of entries that should be returned in- Returns:
- Option.none if no index was found or contents that were retrieved from database.
-
removeAttachmentIndex
Description copied from interface:AttachmentIndexManagerRemoves the index data of the specified attachment.- Specified by:
removeAttachmentIndexin interfaceAttachmentIndexManager- Parameters:
attachment- for which index file will be removed.issue- to which attachment belongs.
-
isExpandable
Description copied from interface:AttachmentIndexManagerChecks if provided attachment is currently expandable.- Specified by:
isExpandablein interfaceAttachmentIndexManager- Parameters:
attachment- to be tested.- Returns:
- true only if attachment can be expanded by JIRA.
-