예제 #1
0
        public LocalSetUpConfiguration ConvertGenericSetterOption(ConfigType type, Options.ConfigOptions option)
        {
            LocalSetUpConfiguration config = new LocalSetUpConfiguration(type, CommandApi.Set);

            GetDefaultOptions(config, option);

            ConfigGetGlobalOptions(option);
            ConfigPrintInformation(option, type, string.Empty);
            config.GlobalPath                 = option.Global;
            config.ApiConnection.Token        = option.Token;
            config.ApiConnection.ApiUri       = option.Uri;
            config.ApiConnection.StorageUri   = option.Storage;
            config.ApiConnection.AccountEmail = option.AccountEmail;
            config.ApiConnection.SetForcePathStyleString(option.ForcePathStyle);
            config.ApiConnection.DisableBucketPathsSanitization = option.NoSanitizeBucketPaths;
            config.ApiConnection.UnsafeSsl        = option.UnsafeSslCertificate;
            config.ApiConnection.StorageUnsafeSsl = option.StorageUnsafeSsl;

            config.ShowConnectionInfo = option.ShowConnectionInfo;
            if (option.ShowConnectionInfo)
            {
                config.Command = CommandApi.Info;
            }

            return(config);
        }
예제 #2
0
        public string GetPath(LocalSetUpConfiguration config)
        {
            if (config.Path != null)
            {
                return(config.Path);
            }
            else if (config.GlobalPath)
            {
                return(QarnotCLI.ConfigurationFileGetter.DefaultPathName);
            }

            if (this.EnvironmentPathGetter.CanConfigurationFileBeCreated())
            {
                return(this.EnvironmentPathGetter.NewConfigurationFilePath);
            }

            throw new FileNotFoundException("Impossible to create a new configuration file.");
        }