Class StudioAwsS3BlobStore

    • Constructor Detail

      • StudioAwsS3BlobStore

        public StudioAwsS3BlobStore​(ServicesConfig servicesConfig)
    • Method Detail

      • isFolder

        protected boolean isFolder​(String path)
      • getFullKey

        protected String getFullKey​(org.craftercms.commons.file.blob.impl.AbstractBlobStore.Mapping mapping,
                                    String path)
      • getReference

        public org.craftercms.commons.file.blob.Blob getReference​(String path)
        Description copied from interface: StudioBlobStore
        Return a reference to a file in the store
        Specified by:
        getReference in interface StudioBlobStore
        Parameters:
        path - the path of the file
        Returns:
        the blob object
      • contentExists

        public boolean contentExists​(String site,
                                     String path)
        Description copied from interface: ContentRepository
        Determine if content exists in the repository at a given path
        Specified by:
        contentExists in interface ContentRepository
        Specified by:
        contentExists in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path to check if content exists
        Returns:
        true if site has content object at path
      • shallowContentExists

        public boolean shallowContentExists​(String site,
                                            String path)
        Description copied from interface: ContentRepository
        This is a faster, but less accurate, version of contentExists. This prioritizes performance over checking the actual underlying repository if the content is actually in the store or we simply hold a reference to the object in the actual store.
        Specified by:
        shallowContentExists in interface ContentRepository
        Returns:
        true if site has content object at path
      • getContentSize

        public long getContentSize​(String site,
                                   String path)
        Description copied from interface: ContentRepository
        get file size
        Specified by:
        getContentSize in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path to content
        Returns:
        Size in bytes
      • writeContent

        public String writeContent​(String site,
                                   String path,
                                   InputStream content)
        Description copied from interface: ContentRepository
        write content
        Specified by:
        writeContent in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path to content
        content - stream of content to write
        Returns:
        Commit Id if successful, null otherwise
      • createFolder

        public String createFolder​(String site,
                                   String path,
                                   String name)
        Description copied from interface: ContentRepository
        create a folder
        Specified by:
        createFolder in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path to create a folder in
        name - a folder name to create
        Returns:
        Commit Id if successful, null otherwise
      • deleteContent

        public String deleteContent​(String site,
                                    String path,
                                    String approver)
        Description copied from interface: ContentRepository
        delete content
        Specified by:
        deleteContent in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        path - path to content
        approver - user that approves delete content
        Returns:
        Commit ID if successful, null otherwise
      • moveContent

        public Map<String,​String> moveContent​(String site,
                                                    String fromPath,
                                                    String toPath,
                                                    String newName)
        Description copied from interface: ContentRepository
        move content from PathA to pathB
        Specified by:
        moveContent in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        fromPath - source content
        toPath - target path
        newName - new file name for rename
        Returns:
        Commit ID if successful, empty string otherwise
      • copyContent

        public String copyContent​(String site,
                                  String fromPath,
                                  String toPath)
        Description copied from interface: ContentRepository
        copy content from PathA to pathB
        Specified by:
        copyContent in interface ContentRepository
        Parameters:
        site - site id where the operation will be executed
        fromPath - paths to content
        toPath - target path
        Returns:
        Commit ID if successful, empty string otherwise
      • publish

        public void publish​(String site,
                            String sandboxBranch,
                            List<DeploymentItemTO> deploymentItems,
                            String environment,
                            String author,
                            String comment)
        Description copied from interface: ContentRepository
        Publish content to specified environment.
        Specified by:
        publish in interface ContentRepository
        Parameters:
        site - site identifier
        sandboxBranch - sandbox branch name
        deploymentItems - items to be published
        environment - environment to publish to
        author - author
        comment - submission comment
      • preparePublishAll

        public RepositoryChanges preparePublishAll​(String siteId,
                                                   String publishingTarget)
        Description copied from interface: ContentRepository
        Prepares the repository to publish all changes for the given site & target
        Specified by:
        preparePublishAll in interface ContentRepository
        Parameters:
        siteId - the id of the site
        publishingTarget - the publishing target
        Returns:
        the set of changed files
      • completePublishAll

        public void completePublishAll​(String siteId,
                                       String publishingTarget,
                                       RepositoryChanges changes,
                                       String comment)
        Description copied from interface: ContentRepository
        Performs the actual publish of all changes for the given site & target
        Specified by:
        completePublishAll in interface ContentRepository
        Parameters:
        siteId - the id of the site
        publishingTarget - the publishing target
        changes - the set of changed files
        comment - submission comment
      • cancelPublishAll

        public void cancelPublishAll​(String siteId,
                                     String publishingTarget)
        Description copied from interface: ContentRepository
        Performs the cleanup after a failed publish all operation for the given site & target
        Specified by:
        cancelPublishAll in interface ContentRepository
        Parameters:
        siteId - the id of the site
        publishingTarget - the publishing target
      • populateGitLog

        public void populateGitLog​(String siteId)
        Description copied from interface: ContentRepository
        Populates the full git log of the sandbox repository into the database
        Specified by:
        populateGitLog in interface ContentRepository
        Parameters:
        siteId - the id of the site