public class DropboxBlobProvider extends AbstractLiveConnectBlobProvider<DropboxOAuth2ServiceProvider>
blobProviderId, properties
MAX_RESULT
Constructor and Description |
---|
DropboxBlobProvider() |
Modifier and Type | Method and Description |
---|---|
protected InputStream |
doGet(URI url)
Executes a GET request
|
ManagedBlob |
freezeVersion(ManagedBlob blob,
Document doc)
Returns a new managed blob pointing to a fixed version of the original blob.
|
Map<String,URI> |
getAvailableConversions(ManagedBlob blob,
BlobManager.UsageHint hint)
Gets a map of available MIME type conversions and corresponding
URI for a managed blob. |
protected String |
getCacheName() |
protected String |
getClientId() |
InputStream |
getConvertedStream(ManagedBlob blob,
String mimeType,
DocumentModel doc)
Gets an
InputStream for a conversion to the given MIME type. |
protected com.dropbox.core.v2.DbxClientV2 |
getDropboxClient(com.google.api.client.auth.oauth2.Credential credential) |
protected com.dropbox.core.v2.DbxClientV2 |
getDropboxClient(String accessToken) |
String |
getPageProviderNameForUpdate() |
InputStream |
getStream(ManagedBlob blob)
Gets an
InputStream for the data of a managed blob. |
InputStream |
getThumbnail(ManagedBlob blob)
Gets an
InputStream for a thumbnail of a managed blob. |
URI |
getURI(ManagedBlob blob,
BlobManager.UsageHint usage,
javax.servlet.http.HttpServletRequest servletRequest)
Gets an
URI for the content of a managed blob. |
protected LiveConnectFile |
retrieveFile(LiveConnectFileInfo fileInfo)
Retrieves the file with API.
|
asURI, buildBlobKey, checkChangesAndUpdateBlob, close, getCredential, getCredential, getCredential, getCredentialFactory, getFile, getFileFromCache, getFromCache, getOAuth2Provider, hasChanged, invalidateInCache, isVersion, performsExternalAccessControl, processDocumentsUpdate, putFileInCache, putInCache, readBlob, toBlob, toBlob, toFileInfo, toFileInfo, writeBlob
initialize, supportsUserUpdate, supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAppLinks, getBinaryManager, initialize, supportsUserUpdate
public DropboxBlobProvider()
protected String getCacheName()
getCacheName
in class AbstractLiveConnectBlobProvider<DropboxOAuth2ServiceProvider>
public String getPageProviderNameForUpdate()
getPageProviderNameForUpdate
in class AbstractLiveConnectBlobProvider<DropboxOAuth2ServiceProvider>
public URI getURI(ManagedBlob blob, BlobManager.UsageHint usage, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
BlobProvider
URI
for the content of a managed blob.blob
- the managed blobusage
- BlobManager.UsageHint
servletRequest
- the servlet request, or null
URI
, or null
if none availableIOException
public Map<String,URI> getAvailableConversions(ManagedBlob blob, BlobManager.UsageHint hint) throws IOException
BlobProvider
URI
for a managed blob.blob
- the managed blobhint
- BlobManager.UsageHint
URI
, which may be emptyIOException
public InputStream getThumbnail(ManagedBlob blob) throws IOException
BlobProvider
InputStream
for a thumbnail of a managed blob.
Like all InputStream
, the result must be closed when done with it to avoid resource leaks.
blob
- the managed blobIOException
public InputStream getStream(ManagedBlob blob) throws IOException
BlobProvider
InputStream
for the data of a managed blob.
Like all InputStream
, the result must be closed when done with it to avoid resource leaks.
blob
- the managed blobIOException
public InputStream getConvertedStream(ManagedBlob blob, String mimeType, DocumentModel doc) throws IOException
DocumentBlobProvider
InputStream
for a conversion to the given MIME type.
Like all InputStream
, the result must be closed when done with it to avoid resource leaks.
blob
- the managed blobmimeType
- the MIME type to convert todoc
- the document that holds the blobnull
if no conversion is available for the given MIME typeIOException
public ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException
DocumentBlobProvider
blob
- the original managed blobdoc
- the document that holds the blobnull
if no change is neededIOException
protected com.dropbox.core.v2.DbxClientV2 getDropboxClient(com.google.api.client.auth.oauth2.Credential credential) throws IOException
IOException
protected com.dropbox.core.v2.DbxClientV2 getDropboxClient(String accessToken) throws IOException
IOException
protected InputStream doGet(URI url) throws IOException
IOException
protected String getClientId()
protected LiveConnectFile retrieveFile(LiveConnectFileInfo fileInfo) throws IOException
AbstractLiveConnectBlobProvider
retrieveFile
in class AbstractLiveConnectBlobProvider<DropboxOAuth2ServiceProvider>
fileInfo
- the file infoIOException
Copyright © 2018 Nuxeo. All rights reserved.