protected internal S3V4FileSystemSession(S3V4FileSystem fs, IFileSystemHandle handle, S3V4FileSystemSessionConnectParams cParams)
     : base(fs, handle, cParams)
 {
     m_Bucket = cParams.Bucket;
       m_Region = cParams.Region;
       m_TimeoutMs = cParams.TimeoutMs;
 }
Exemple #2
0
        static S3V4FilesystemTests()
        {
            try
              {
            string envVarsStr = System.Environment.GetEnvironmentVariable(NFX_S3);

            var cfg = Configuration.ProviderLoadFromString(envVarsStr, Configuration.CONFIG_LACONIC_FORMAT).Root;

            BUCKET = cfg.AttrByName(S3V4FileSystemSessionConnectParams.CONFIG_BUCKET_ATTR).Value;
            REGION = cfg.AttrByName(S3V4FileSystemSessionConnectParams.CONFIG_REGION_ATTR).Value;
            ACCESSKEY = cfg.AttrByName(S3V4FileSystemSessionConnectParams.CONFIG_ACCESSKEY_ATTR).Value;
            SECRETKEY = cfg.AttrByName(S3V4FileSystemSessionConnectParams.CONFIG_SECRETKEY_ATTR).Value;
              }
              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_S3,
              "s3{ bucket='bucket01' region='us-west-2' access-key='XXXXXXXXXXXXXXXXXXXX' secret-key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}"),
              ex);
              }

              CONN_PARAMS = FileSystemSessionConnectParams.Make<S3V4FileSystemSessionConnectParams>(
            "s3v3{{ name='s3v4' bucket='{0}' region='{1}' access-key='{2}' secret-key='{3}' }}"
              .Args(BUCKET, REGION, ACCESSKEY, SECRETKEY));
        }
Exemple #3
0
        public S3V4FileSystemSession StartSession(S3V4FileSystemSessionConnectParams cParams)
        {
            S3V4FileSystemSessionConnectParams s3CParams = cParams ?? (DefaultSessionConnectParams as S3V4FileSystemSessionConnectParams);
            if (s3CParams == null)
              throw new NFXException(NFX.Web.StringConsts.FS_SESSION_BAD_PARAMS_ERROR + this.GetType() + ".StartSession");

            return new S3V4FileSystemSession(this, null, s3CParams);
        }
Exemple #4
0
        public S3V4FileSystemSession StartSession(S3V4FileSystemSessionConnectParams cParams)
        {
            S3V4FileSystemSessionConnectParams s3CParams = cParams ?? (DefaultSessionConnectParams as S3V4FileSystemSessionConnectParams);

            if (s3CParams == null)
            {
                throw new NFXException(NFX.Web.StringConsts.FS_SESSION_BAD_PARAMS_ERROR + this.GetType() + ".StartSession");
            }

            return(new S3V4FileSystemSession(this, null, s3CParams));
        }
    public void SetUp()
    {
      CONN_PARAMS = FileSystemSessionConnectParams.Make<S3V4FileSystemSessionConnectParams>(
        "s3 {{ name='s3v4' bucket='{0}' region='{1}' access-key='{2}' secret-key='{3}' }}"
          .Args(S3_BUCKET, S3_REGION, S3_ACCESSKEY, S3_SECRETKEY));

      CONN_PARAMS_TIMEOUT = FileSystemSessionConnectParams.Make<S3V4FileSystemSessionConnectParams>(
        "s3 {{ name='s3v4' bucket='{0}' region='{1}' access-key='{2}' secret-key='{3}' timeout-ms=1 }}"
          .Args(S3_BUCKET, S3_REGION, S3_ACCESSKEY, S3_SECRETKEY));

      cleanUp();
      initialize();
    }
 protected internal S3V4FileSystemSession(S3V4FileSystem fs, IFileSystemHandle handle, S3V4FileSystemSessionConnectParams cParams)
     : base(fs, handle, cParams)
 {
     m_Bucket    = cParams.Bucket;
     m_Region    = cParams.Region;
     m_TimeoutMs = cParams.TimeoutMs;
 }