Amazon.S3.Transfer.TransferUtilityUploadRequest.IsSetKey C# (CSharp) Метод

IsSetKey() приватный Метод

Checks if Key property is set.
private IsSetKey ( ) : bool
Результат bool
        internal bool IsSetKey()
        {
            return !System.String.IsNullOrEmpty(this.key);
        }

Usage Example

Пример #1
0
        void validate(TransferUtilityUploadRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            if (!request.IsSetBucketName())
            {
                throw new ArgumentNullException("bucketName");
            }

            if (!request.IsSetFilePath() &&
                !request.IsSetInputStream())
            {
                throw new ArgumentException(
                          "Please specify either a Filename or provide a Stream to PUT an object into Amazon S3.");
            }
            if (!request.IsSetKey())
            {
                if (request.IsSetFilePath())
                {
                    request.Key = new FileInfo(request.FilePath).Name;
                }
                else
                {
                    throw new ArgumentException(
                              "The Key property must be specified when using a Stream to upload into Amazon S3.");
                }
            }

            if (request.IsSetFilePath() && !File.Exists(request.FilePath))
            {
                throw new ArgumentException("The file indicated by the FilePath property does not exist!");
            }
        }
All Usage Examples Of Amazon.S3.Transfer.TransferUtilityUploadRequest::IsSetKey