Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete the history version of the attachment in the plugin

周冲
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 12, 2022

How to delete the history version of the attachment in the plugin?

I've written a confluence plugin and want to delete the historical versions of space attachments to clean up disk space。

I initially tried to use the attachmentManager.removeAttachmentVersionFromServer(att) method to remove attachments, but only the most open attachments were removed per run, after which the error occurred:

Exception in thread "Thread-85" org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.atlassian.confluence.pages.Attachment#884751]

I later saw CachingAttachmentManager and tried to use that method. But I somehow imported into the plugin. The constructor of CachingAttachmentManager contains parameters.

image.png

Can someone tell me how to delete the historical version of the attachment in the plugin?
Or tell me how to introduce that CachingAttachmentManager?

 

Thank you everyone

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events