Class ContentDirectoryStructureAttachmentDataFileSystemV003

  • All Implemented Interfaces:
    AttachmentDataFileSystem, AttachmentDataFileSystemInternals

    public class ContentDirectoryStructureAttachmentDataFileSystemV003
    extends Object
    implements AttachmentDataFileSystem, AttachmentDataFileSystemInternals
    An implementation of AttachmentDataFileSystem which stores the attachment data as files on a filesystem, using the standard File API.

    The files are stored within a hierarchical directory structure that incorporates the IDs of the space, content entity and attachment IDs to which the attachment data belongs to. Data corresponding to each version of the attachment are stored, as are different "streams" of data for each version (see AttachmentDataStreamType.

    For attachments belonging to "spaced" content entities (e.g. pages, blogs), the directory structure is described by the following pattern: "h1/h2/spaceId/h3/h4/contentId/attachmentId/attachmentFile"

    where h1 and h2 are hashcodes generated from the spaceId, h3 and h4 are hashcodes generated from the contentId, and attachmentFile represents a combination of the attachment version and the data stream type. For backwards compatibility attachment files of type AttachmentDataStreamType.RAW_BINARY have a filename of just the numeric attachment version. For other stream types, the filename is "version.streamType" (e.g. "1.extracted_text").

    For "non-spaced" entity attachments (e.g. user profile pictures), a simpler but similar structure is used: "nonspaced/h3/h4/contentId/attachmentId/attachmentFile"