How to resolve the "space:page^attachment" path to file system path?

Hi All,

Q: is there an exiting Java class/method to resolve the “space:page_title^my_data.csv”
into file system path? That is, to something like:

“/spool/confluence-data/attachments/ver003/103/182/88932353/151/218/132218901/133268016/1”
(where 1 is a version of the my_data.csv)

Appears, that it should be this: HierarchicalFileSystemAttachmentDataDao class
but all the methods there are marked DEPRECATED, what should be used instead?

I have tried using this class, however, it fails on the following line:

HierarchicalFileSystemAttachmentDataDao dao = (HierarchicalFileSystemAttachmentDataDao) ContainerManager.getComponent(“fileSystemAttachmentDataDao”);

with the error:
com.atlassian.confluence.pages.persistence.dao.filesystem.FileSystemAttachmentDataDao cannot be cast to com.atlassian.confluence.pages.persistence.dao.HierarchicalFileSystemAttachmentDataDao

There is a resolved issue about this (https://jira.atlassian.com/browse/CONFSERVER-34204)

I’ll be thankful for recommendations.