Class BoxServiceImpl

    • Constructor Detail

      • BoxServiceImpl

        public BoxServiceImpl()
    • Method Detail

      • setProfileLoader

        public void setProfileLoader​(SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.box.BoxProfile> profileLoader)
      • getConnection

        protected com.box.sdk.BoxAPIConnection getConnection​(org.craftercms.commons.config.profiles.box.BoxProfile profile)
      • getAccessToken

        public String getAccessToken​(String site,
                                     String profileId)
                              throws BoxException
        Gets an access token to allow direct access to the Box folder.
        Specified by:
        getAccessToken in interface BoxService
        Parameters:
        site - the name of the site to search for the configuration file
        profileId - the name of the profile to search
        Returns:
        the value of the access token
        Throws:
        BoxException - box error
      • getUrl

        public String getUrl​(String site,
                             String profileId,
                             String fileId,
                             String filename)
                      throws BoxException
        Builds a local URL for the given asset
        Specified by:
        getUrl in interface BoxService
        Parameters:
        site - site identifier
        profileId - the name of the profile to use
        fileId - the id of the file
        filename - the name of the file
        Returns:
        the local URL for the file
        Throws:
        BoxException - box error