Forums

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

Is there a way to get the actual file of an attachment in Confluence via a Java API?

Robert Hall
Contributor
June 17, 2013

Is it possible to get the actual file stored on the file system for an attachment programatically in a Java plugin? i.e. versioned attachments seem to exist on the file system in a location such as

<install dir>/confluence/home/attachments/ver003/37/65/65537/24/200/950274/1081345/1

I haven't seen a way to get this path in the Attachment object--the urlPath, downloadPath and exportPath don't give me anything useful for this.

3 answers

0 votes
Robert Hall
Contributor
June 18, 2013

Thanks for the ideas. Found a way to do what I needed to using the content of the attachment instead (available as an InputStream from the Attachment object).

0 votes
Mirko Skramusky
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 17, 2013

Hi Robert,

there are different storages for files, on the filesystem or in the database. So getting the concrete path depends on the storage strategy and is not always the same.

For filebased storages the directory structure is described here. Hope this helps.

Regards,

Mirko

0 votes
PeterKoczan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 17, 2013

Hi,

I believe there should be a way, as the Confluence CLI plugin has such a function: https://bobswift.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-getAttachment

Would that work for you?

Kind regards,

Peter

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events