Beispiel #1
0
        public CredentialData GetMigratedCredentials()
        {
            if (_migratedCreds == null && File.Exists(_migratedCredFilePath))
            {
                _migratedCreds = IOUtil.LoadObject <CredentialData>(_migratedCredFilePath);
            }

            return(_migratedCreds);
        }
Beispiel #2
0
        public CredentialData GetCredentials()
        {
            if (_creds == null)
            {
                _creds = IOUtil.LoadObject <CredentialData>(_credFilePath);
            }

            return(_creds);
        }
Beispiel #3
0
        public void SaveCredential(CredentialData credential)
        {
            Trace.Info("Saving {0} credential @ {1}", credential.Scheme, _credFilePath);
            if (File.Exists(_credFilePath))
            {
                // Delete existing credential file first, since the file is hidden and not able to overwrite.
                Trace.Info("Delete exist runner credential file.");
                IOUtil.DeleteFile(_credFilePath);
            }

            IOUtil.SaveObject(credential, _credFilePath);
            Trace.Info("Credentials Saved.");
            File.SetAttributes(_credFilePath, File.GetAttributes(_credFilePath) | FileAttributes.Hidden);
        }