Package org.nuxeo.ecm.liveconnect.box
Class BoxBlobProvider
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.AbstractBlobProvider
-
- org.nuxeo.ecm.liveconnect.core.AbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
-
- org.nuxeo.ecm.liveconnect.box.BoxBlobProvider
-
- All Implemented Interfaces:
BlobProvider
,DocumentBlobProvider
,LiveConnectBlobProvider<BoxOAuth2ServiceProvider>
,BatchUpdateBlobProvider
public class BoxBlobProvider extends AbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
Provider for blobs getting information from Box.- Since:
- 8.1
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
blobProviderId, properties
-
Fields inherited from interface org.nuxeo.ecm.liveconnect.update.BatchUpdateBlobProvider
MAX_RESULT
-
-
Constructor Summary
Constructors Constructor Description BoxBlobProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManagedBlob
freezeVersion(ManagedBlob blob, Document doc)
Returns a new managed blob pointing to a fixed version of the original blob.protected com.box.sdk.BoxAPIConnection
getBoxClient(com.google.api.client.auth.oauth2.Credential credential)
protected com.box.sdk.BoxAPIConnection
getBoxClient(NuxeoOAuth2Token token)
protected String
getCacheName()
String
getPageProviderNameForUpdate()
InputStream
getStream(ManagedBlob blob)
Gets anInputStream
for the data of a managed blob.InputStream
getThumbnail(ManagedBlob blob)
Gets anInputStream
for a thumbnail of a managed blob.URI
getURI(ManagedBlob blob, BlobManager.UsageHint usage, javax.servlet.http.HttpServletRequest servletRequest)
Gets anURI
for the content of a managed blob.protected com.box.sdk.BoxFile.Info
retrieveBoxFileInfo(LiveConnectFileInfo fileInfo)
protected LiveConnectFile
retrieveFile(LiveConnectFileInfo fileInfo)
Retrieves the file with API.-
Methods inherited from class org.nuxeo.ecm.liveconnect.core.AbstractLiveConnectBlobProvider
asURI, buildBlobKey, checkChangesAndUpdateBlob, close, getCredential, getCredential, getCredential, getCredentialFactory, getFile, getFileFromCache, getFromCache, getOAuth2Provider, hasChanged, invalidateInCache, isVersion, performsExternalAccessControl, processDocumentsUpdate, putFileInCache, putInCache, readBlob, supportsSync, toBlob, toBlob, toFileInfo, toFileInfo, writeBlob
-
Methods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
allowByteRange, getProperties, hasCreateFromKeyPermission, initialize, isColdStorageMode, isRecordMode, isTransactional, isTransient, supportsUserUpdate, supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.blob.BlobProvider
allowByteRange, allowDirectDownload, canConvert, deleteBlob, getAppLinks, getAvailableConversions, getBinaryGarbageCollector, getBinaryManager, getFile, getProperties, getStatus, getStream, hasCreateFromKeyPermission, initialize, isColdStorageMode, isRecordMode, isTransactional, isTransient, readBlob, supportsUserUpdate, updateBlob, writeBlob
-
Methods inherited from interface org.nuxeo.ecm.core.blob.DocumentBlobProvider
getConvertedStream
-
-
-
-
Method Detail
-
getCacheName
protected String getCacheName()
- Specified by:
getCacheName
in classAbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
-
getPageProviderNameForUpdate
public String getPageProviderNameForUpdate()
- Specified by:
getPageProviderNameForUpdate
in classAbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
-
getURI
public URI getURI(ManagedBlob blob, BlobManager.UsageHint usage, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
Description copied from interface:BlobProvider
Gets anURI
for the content of a managed blob.- Parameters:
blob
- the managed blobusage
-BlobManager.UsageHint
servletRequest
- the servlet request, ornull
- Returns:
- the
URI
, ornull
if none available - Throws:
IOException
-
getStream
public InputStream getStream(ManagedBlob blob) throws IOException
Description copied from interface:BlobProvider
Gets anInputStream
for the data of a managed blob.Like all
InputStream
, the result must be closed when done with it to avoid resource leaks.- Parameters:
blob
- the managed blob- Returns:
- the stream
- Throws:
IOException
-
getThumbnail
public InputStream getThumbnail(ManagedBlob blob) throws IOException
Description copied from interface:BlobProvider
Gets anInputStream
for a thumbnail of a managed blob.Like all
InputStream
, the result must be closed when done with it to avoid resource leaks.- Parameters:
blob
- the managed blob- Returns:
- the stream
- Throws:
IOException
-
freezeVersion
public ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException
Description copied from interface:DocumentBlobProvider
Returns a new managed blob pointing to a fixed version of the original blob.- Parameters:
blob
- the original managed blobdoc
- the document that holds the blob- Returns:
- a managed blob with fixed version, or
null
if no change is needed - Throws:
IOException
-
getBoxClient
protected com.box.sdk.BoxAPIConnection getBoxClient(NuxeoOAuth2Token token) throws IOException
- Throws:
IOException
-
getBoxClient
protected com.box.sdk.BoxAPIConnection getBoxClient(com.google.api.client.auth.oauth2.Credential credential) throws IOException
- Throws:
IOException
-
retrieveFile
protected LiveConnectFile retrieveFile(LiveConnectFileInfo fileInfo) throws IOException
Description copied from class:AbstractLiveConnectBlobProvider
Retrieves the file with API.- Specified by:
retrieveFile
in classAbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
- Parameters:
fileInfo
- the file info- Returns:
- the file retrieved from API
- Throws:
IOException
-
retrieveBoxFileInfo
protected com.box.sdk.BoxFile.Info retrieveBoxFileInfo(LiveConnectFileInfo fileInfo) throws IOException
- Throws:
IOException
-
-