|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.netheos.pcsapi.storage.StorageProvider<OAuth2SessionManager>
net.netheos.pcsapi.providers.googledrive.GoogleDrive
public class GoogleDrive
Implements Google Drive storage provider. Note that OAuth2 refresh token is returned by oauth endpoint only if user approves an offline access. This is the purpose of query parameters "access_type=offline&approval_prompt=force" in authorizeUrl. Beware that old refresh tokens may be invalidated by such requests though : see https://developers.google.com/accounts/docs/OAuth2
| Field Summary | |
|---|---|
static String |
PROVIDER_NAME
|
| Fields inherited from class net.netheos.pcsapi.storage.StorageProvider |
|---|
retryStrategy, sessionManager |
| Constructor Summary | |
|---|---|
GoogleDrive(StorageBuilder builder)
|
|
| Method Summary | |
|---|---|
boolean |
createFolder(CPath path)
Create a folder at given path, with intermediate folders if needed. |
boolean |
delete(CPath path)
Deletes blob, or recursively delete folder at given path. |
void |
download(CDownloadRequest downloadRequest)
Downloads a blob from provider to a byte sink, as defined by the download_request object. |
CFile |
getFile(CPath path)
Return detailed file information at given path, or None if no object exists at this path |
CQuota |
getQuota()
Returns a CQuota object |
String |
getUserId()
Return user identifier (login in case of login/password, or email in case of OAuth |
CFolderContent |
listFolder(CFolder folder)
Return a map of files present in given CFolder. keys of map are CPath objects, values are CFile objects (CFolder or CBlob). |
CFolderContent |
listFolder(CPath path)
Return a map of files present in given CPath. keys of map are CPath objects, values are CFile objects (CFolder or CBlob). |
CFolderContent |
listRootFolder()
Equivalent to IStorageProvider.listFolder(net.netheos.pcsapi.models.CPath) with "/" |
void |
upload(CUploadRequest uploadRequest)
Uploads a byte source to provider, as defined by upload_request object. |
| Methods inherited from class net.netheos.pcsapi.storage.StorageProvider |
|---|
close, getProviderName, getSessionManager, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PROVIDER_NAME
| Constructor Detail |
|---|
public GoogleDrive(StorageBuilder builder)
| Method Detail |
|---|
public String getUserId()
throws CStorageException
IStorageProvider
CStorageException - Error getting the user identifier
public CQuota getQuota()
throws CStorageException
IStorageProvider
CStorageException - Error getting the quota
public CFolderContent listRootFolder()
throws CInvalidFileTypeException
IStorageProviderIStorageProvider.listFolder(net.netheos.pcsapi.models.CPath) with "/"
CInvalidFileTypeException
public CFolderContent listFolder(CPath path)
throws CStorageException
IStorageProvider
path - The folder path
CStorageException - Error getting the files in the folder
public CFolderContent listFolder(CFolder folder)
throws CStorageException
IStorageProvider
folder - The folder to get the files in
CStorageException - Error getting the files in the folder
public boolean createFolder(CPath path)
throws CStorageException
IStorageProvider
path - The folder path to create
CStorageException - Error creating the folder
public boolean delete(CPath path)
throws CStorageException
IStorageProvider
path - The file path to delete
CStorageException - Error deleting the file
public CFile getFile(CPath path)
throws CStorageException
IStorageProvider
path - The file path
CStorageException - Error getting the file
public void download(CDownloadRequest downloadRequest)
throws CStorageException
IStorageProvider
downloadRequest - The download request object
CStorageException - Download error
public void upload(CUploadRequest uploadRequest)
throws CStorageException
IStorageProvider
uploadRequest - The upload resuest object
CStorageException - Upload error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||