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
ConstructorsConstructorDescriptionBoxServiceImpl
(SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.box.BoxProfile> profileLoader) -
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.BoxAPIConnection
getConnection
(org.craftercms.commons.config.profiles.box.BoxProfile profile) protected org.craftercms.commons.config.profiles.box.BoxProfile
getProfile
(String site, String profileId) Builds a local URL for the given asset
-
Field Details
-
URL_FORMAT
- See Also:
-
profileLoader
protected SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.box.BoxProfile> profileLoader
-
-
Constructor Details
-
BoxServiceImpl
public BoxServiceImpl(SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.box.BoxProfile> profileLoader)
-
-
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 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:
getUrl
in 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
-