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:

(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 (

I’ll be thankful for recommendations.