Пример #1
0
        private IEnumerable <S3V4ListBucketItem> getSubitemNames(FileSystemDirectory directory, bool recursive, int maxKeys = 1000)
        {
            var    s3session = (S3V4FileSystemSession)directory.Session;
            var    handle    = directory.Handle as S3V4FSH;
            string prefix    = handle.Path.ToDirectoryPath().TrimStart(PATH_SEPARATOR);

            string xml = S3V4.ListBucket(handle.Path, s3session.AccessKey, s3session.SecretKey, s3session.Bucket, s3session.Region, s3session.TimeoutMs,
                                         prefix, maxKeys: maxKeys);
            S3V4ListBucketResult list = S3V4ListBucketResult.FromXML(xml);

            while (list.IsTruncated)
            {
                xml = S3V4.ListBucket(handle.Path, s3session.AccessKey, s3session.SecretKey, s3session.Bucket, s3session.Region, s3session.TimeoutMs,
                                      prefix, marker: list.Items.Last().Key, maxKeys: maxKeys);
                list.AddXML(xml);
            }

            IEnumerable <S3V4ListBucketItem> q = list.Items;

            if (!recursive)
            {
                q = q.Where(i => !i.IsNested);
            }

            return(q.ToList());
        }
Пример #2
0
        public static S3V4ListBucketResult FromXML(string xml)
        {
            S3V4ListBucketResult result = new S3V4ListBucketResult();

            result.AddXML(xml);

            return(result);
        }
Пример #3
0
      public static S3V4ListBucketResult FromXML(string xml)
      {
        S3V4ListBucketResult result = new S3V4ListBucketResult();

        result.AddXML(xml);

        return result;
      }