1 /* 2 * Copyright 2009-2017 Alibaba Cloud All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 #include <string> 19 #include <alibabacloud/oss/Export.h> 20 #include <alibabacloud/oss/Types.h> 21 22 namespace AlibabaCloud 23 { 24 namespace OSS 25 { 26 class ALIBABACLOUD_OSS_EXPORT ObjectMetaData 27 { 28 public: 29 ObjectMetaData() = default; 30 ObjectMetaData(const HeaderCollection& data); 31 ObjectMetaData& operator=(const HeaderCollection& data); 32 const std::string& LastModified() const; 33 const std::string& ExpirationTime() const; 34 int64_t ContentLength() const ; 35 const std::string& ContentType() const; 36 const std::string& ContentEncoding() const; 37 const std::string& CacheControl() const; 38 const std::string& ContentDisposition() const; 39 const std::string& ETag() const; 40 const std::string& ContentMd5() const; 41 const std::string& ObjectType() const; 42 const std::string& VersionId() const; 43 uint64_t CRC64() const; 44 void setExpirationTime(const std::string& value); 45 void setContentLength(int64_t value); 46 void setContentType(const std::string& value); 47 void setContentEncoding(const std::string& value); 48 void setCacheControl(const std::string& value); 49 void setContentDisposition(const std::string& value); 50 void setETag(const std::string& value); 51 void setContentMd5(const std::string& value); 52 void setCrc64(uint64_t value); 53 void addHeader(const std::string& key, const std::string& value); 54 bool hasHeader(const std::string& key) const; 55 void removeHeader(const std::string& key); 56 MetaData& HttpMetaData(); 57 const MetaData& HttpMetaData() const; 58 void addUserHeader(const std::string& key, const std::string& value); 59 bool hasUserHeader(const std::string& key) const; 60 void removeUserHeader(const std::string& key); 61 MetaData& UserMetaData(); 62 const MetaData& UserMetaData() const; 63 HeaderCollection toHeaderCollection() const; 64 private: 65 MetaData userMetaData_; 66 MetaData metaData_; 67 }; 68 } 69 } 70