protected internal GoogleDriveSession(GoogleDriveFileSystem fs, IFileSystemHandle handle, GoogleDriveParameters cParams) : base(fs, handle, cParams) { var email = (m_User.Credentials as GoogleDriveCredentials).Email; Client = new GoogleDriveClient(email, cParams.CertPath, cParams.TimeoutMs, cParams.Attempts); }
public GoogleDriveSession StartSession(GoogleDriveParameters cParams = null) { var gdParams = cParams ?? (DefaultSessionConnectParams as GoogleDriveParameters); if (gdParams == null) { throw new NFXException(NFX.Web.StringConsts.FS_SESSION_BAD_PARAMS_ERROR + this.GetType() + ".StartSession"); } return new GoogleDriveSession(this, null, gdParams); }
void IRunnableHook.Prologue(Runner runner, FID id) { var csDefault = "google-drive{{ email='{0}' cert-path=$'{1}' }}" .Args(GOOGLE_DRIVE_EMAIL, GOOGLE_DRIVE_CERT_PATH); CONN_PARAMS = FileSystemSessionConnectParams.Make <GoogleDriveParameters>(csDefault); var csTimeout = "google-drive{{ email='{0}' cert-path=$'{1}' timeout-ms=1 }}" .Args(GOOGLE_DRIVE_EMAIL, GOOGLE_DRIVE_CERT_PATH); CONN_PARAMS_TIMEOUT = FileSystemSessionConnectParams.Make <GoogleDriveParameters>(csTimeout); cleanUp(); initialize(); }
static GoogleDriveFileSystemTests() { try { var env = System.Environment.GetEnvironmentVariable(NFX_GOOGLE_DRIVE); var cfg = Configuration.ProviderLoadFromString(env, Configuration.CONFIG_LACONIC_FORMAT).Root; CONN_PARAMS = FileSystemSessionConnectParams.Make <GoogleDriveParameters>(env); } catch (Exception ex) { throw new Exception(string.Format( "May be environment variable \"{0}\" of format like \"{1}\" isn't present.\nDon't forget to reload VS after variable is added", NFX_GOOGLE_DRIVE, "google-drive{ client-id='<value>' client-secret='<value>' access-token='<value>' refresh-token='<value>' }" ), ex ); } }