Class BoxServiceImpl
java.lang.Object
org.craftercms.studio.impl.v1.service.box.BoxServiceImpl
- All Implemented Interfaces:
BoxService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.box.BoxProfile> protected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAccessToken(String site, String profileId) Gets an access token to allow direct access to the Box folder.protected com.box.sdk.BoxAPIConnectiongetConnection(org.craftercms.commons.config.profiles.box.BoxProfile profile) protected org.craftercms.commons.config.profiles.box.BoxProfilegetProfile(String site, String profileId) Builds a local URL for the given assetvoidsetProfileLoader(SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.box.BoxProfile> profileLoader)
-
Field Details
-
URL_FORMAT
- See Also:
-
profileLoader
protected SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.box.BoxProfile> profileLoader
-
-
Constructor Details
-
BoxServiceImpl
public BoxServiceImpl()
-
-
Method Details
-
setProfileLoader
public void setProfileLoader(SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.box.BoxProfile> profileLoader) -
getProfile
protected org.craftercms.commons.config.profiles.box.BoxProfile getProfile(String site, String profileId) throws BoxException, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException - Throws:
BoxExceptionorg.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:
getAccessTokenin interfaceBoxService- Parameters:
site- the name of the site to search for the configuration fileprofileId- the name of the profile to search- Returns:
- the value of the access token
- Throws:
BoxException- box errororg.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:
getUrlin interfaceBoxService- Parameters:
site- site identifierprofileId- the name of the profile to usefileId- the id of the filefilename- the name of the file- Returns:
- the local URL for the file
- Throws:
BoxException- box errororg.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException- if the profile is not found
-