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 ManagedBlobfreezeVersion(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 StringgetCacheName()StringgetPageProviderNameForUpdate()InputStreamgetStream(ManagedBlob blob)Gets anInputStreamfor the data of a managed blob.InputStreamgetThumbnail(ManagedBlob blob)Gets anInputStreamfor a thumbnail of a managed blob.URIgetURI(ManagedBlob blob, BlobManager.UsageHint usage, javax.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, writeBlob
-
Methods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
allowByteRange, getProperties, hasCreateFromKeyPermission, initialize, 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, canConvert, deleteBlob, getAppLinks, getAvailableConversions, getBinaryGarbageCollector, getBinaryManager, getFile, getProperties, getStatus, getStream, hasCreateFromKeyPermission, initialize, isRecordMode, isTransactional, isTransient, readBlob, supportsUserUpdate, updateBlob, writeBlob
-
Methods inherited from interface org.nuxeo.ecm.core.blob.DocumentBlobProvider
getConvertedStream
-
-
-
-
Constructor Detail
-
BoxBlobProvider
public BoxBlobProvider()
-
-
Method Detail
-
getCacheName
protected String getCacheName()
- Specified by:
getCacheNamein classAbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
-
getPageProviderNameForUpdate
public String getPageProviderNameForUpdate()
- Specified by:
getPageProviderNameForUpdatein classAbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider>
-
getURI
public URI getURI(ManagedBlob blob, BlobManager.UsageHint usage, javax.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
public InputStream getStream(ManagedBlob blob) throws IOException
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
public InputStream getThumbnail(ManagedBlob blob) throws IOException
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
public ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException
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
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: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
-
-