Class GoogleDriveClient
Google Drive REST API wrapper.
Inheritance
System.Object
GoogleDriveClient
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: NFX.Web.dll
Syntax
public class GoogleDriveClient
Constructors
GoogleDriveClient(String, String)
Declaration
public GoogleDriveClient(string email, string certPath)
Parameters
Type |
Name |
Description |
System.String |
email |
|
System.String |
certPath |
|
GoogleDriveClient(String, String, Int32, Int32)
Declaration
public GoogleDriveClient(string email, string certPath, int timeout, int attempts)
Parameters
Type |
Name |
Description |
System.String |
email |
|
System.String |
certPath |
|
System.Int32 |
timeout |
|
System.Int32 |
attempts |
|
Methods
CreateDirectory(String, String)
Declaration
public GoogleDriveHandle CreateDirectory(string parentId, string name)
Parameters
Type |
Name |
Description |
System.String |
parentId |
|
System.String |
name |
|
Returns
CreateFile(String, String)
Declaration
public GoogleDriveHandle CreateFile(string parentId, string name)
Parameters
Type |
Name |
Description |
System.String |
parentId |
|
System.String |
name |
|
Returns
CreateFile(String, String, Stream)
Declaration
public GoogleDriveHandle CreateFile(string parentId, string name, Stream stream)
Parameters
Type |
Name |
Description |
System.String |
parentId |
|
System.String |
name |
|
System.IO.Stream |
stream |
|
Returns
Delete(String)
Declaration
public void Delete(string id)
Parameters
Type |
Name |
Description |
System.String |
id |
|
FileExists(String)
Checks whether the specified file exists
Declaration
public bool FileExists(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.Boolean |
|
FolderExists(String)
Checks whether the specified folder exists
Declaration
public bool FolderExists(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.Boolean |
|
GetDirectories(String, Boolean)
Returns directory names contained in the spicifed directory
Declaration
public IEnumerable<string> GetDirectories(string path, bool recursive)
Parameters
Type |
Name |
Description |
System.String |
path |
|
System.Boolean |
recursive |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
GetFile(String, Stream)
Declaration
public void GetFile(string id, Stream stream)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.IO.Stream |
stream |
|
GetFiles(String, Boolean)
Returns files contained in the spicifed directory
Declaration
public IEnumerable<GoogleDriveHandle> GetFiles(string parentId, bool recursive)
Parameters
Type |
Name |
Description |
System.String |
parentId |
|
System.Boolean |
recursive |
|
Returns
GetHandle(String)
Gets a handle for the specified file or folder.
Declaration
public GoogleDriveHandle GetHandle(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
GetItemInfoById(String)
Declaration
public GoogleDriveHandle GetItemInfoById(string id)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Returns
Rename(String, String)
Renames a file/folder by its ID
Declaration
public void Rename(string id, string name)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.String |
name |
|
SetModifiedDate(String, DateTime)
Sets modification timestamp
Declaration
public void SetModifiedDate(string id, DateTime date)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.DateTime |
date |
|
UpdateFile(String, Stream)
Updates content of a file by file ID
Declaration
public GoogleDriveHandle UpdateFile(string id, Stream stream)
Parameters
Type |
Name |
Description |
System.String |
id |
|
System.IO.Stream |
stream |
|
Returns
Extension Methods