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
Provider for blobs getting information from Box.
- Since:
- 8.1
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
blobProviderId, propertiesFields inherited from interface org.nuxeo.ecm.liveconnect.update.BatchUpdateBlobProvider
MAX_RESULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfreezeVersion(ManagedBlob blob, Document doc) Returns a new managed blob pointing to a fixed version of the original blob.protected com.box.sdk.BoxAPIConnectiongetBoxClient(com.google.api.client.auth.oauth2.Credential credential) protected com.box.sdk.BoxAPIConnectiongetBoxClient(NuxeoOAuth2Token token) protected StringgetStream(ManagedBlob blob) Gets anInputStreamfor the data of a managed blob.getThumbnail(ManagedBlob blob) Gets anInputStreamfor a thumbnail of a managed blob.getURI(ManagedBlob blob, BlobManager.UsageHint usage, jakarta.servlet.http.HttpServletRequest servletRequest) Gets anURIfor the content of a managed blob.protected com.box.sdk.BoxFile.InforetrieveBoxFileInfo(LiveConnectFileInfo fileInfo) protected LiveConnectFileretrieveFile(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, writeBlobMethods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
allowByteRange, getProperties, hasCreateFromKeyPermission, initialize, isColdStorageMode, isRecordMode, isTransactional, isTransient, supportsUserUpdate, supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, writeBlobMethods inherited from interface org.nuxeo.ecm.core.blob.DocumentBlobProvider
getConvertedStream
-
Constructor Details
-
BoxBlobProvider
public BoxBlobProvider()
-
-
Method Details
-
getCacheName
- Specified by:
getCacheNamein classAbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
-
getPageProviderNameForUpdate
- Specified by:
getPageProviderNameForUpdatein classAbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
-
getURI
public URI getURI(ManagedBlob blob, BlobManager.UsageHint usage, jakarta.servlet.http.HttpServletRequest servletRequest) throws IOException Description copied from interface:BlobProviderGets anURIfor the content of a managed blob.- Parameters:
blob- the managed blobusage-BlobManager.UsageHintservletRequest- the servlet request, ornull- Returns:
- the
URI, ornullif none available - Throws:
IOException
-
getStream
Description copied from interface:BlobProviderGets anInputStreamfor 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
Description copied from interface:BlobProviderGets anInputStreamfor 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
Description copied from interface:DocumentBlobProviderReturns 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
nullif no change is needed - Throws:
IOException
-
getBoxClient
- Throws:
IOException
-
getBoxClient
protected com.box.sdk.BoxAPIConnection getBoxClient(com.google.api.client.auth.oauth2.Credential credential) throws IOException - Throws:
IOException
-
retrieveFile
Description copied from class:AbstractLiveConnectBlobProviderRetrieves the file with API.- Specified by:
retrieveFilein 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
-