Class BoxServiceImpl

java.lang.Object
org.craftercms.studio.impl.v1.service.box.BoxServiceImpl
All Implemented Interfaces:
BoxService

public class BoxServiceImpl extends Object implements BoxService
  • Field Details

  • Constructor Details

  • Method Details

    • getProfile

      protected org.craftercms.commons.config.profiles.box.BoxProfile getProfile(String site, String profileId) throws BoxException, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
      Throws:
      BoxException
      org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
    • 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, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
      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
      org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException - if the profile is not found
    • getUrl

      public String getUrl(String site, String profileId, String fileId, String filename) throws BoxException, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
      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
      org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException - if the profile is not found