Browse Source

fix: AliyunOSSiOS.frameworupgrade

Albert Luo 6 years ago
parent
commit
b5686f9224
76 changed files with 6632 additions and 1392 deletions
  1. BIN
      Example/ios/AliyunOSSiOS.framework/AliyunOSSiOS
  2. 2
    1
      Example/ios/AliyunOSSiOS.framework/Headers/AliyunOSSiOS.h
  3. 15
    0
      Example/ios/AliyunOSSiOS.framework/Headers/NSMutableData+OSS_CRC.h
  4. 56
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSAllRequestNeededMessage.h
  5. 1
    1
      Example/ios/AliyunOSSiOS.framework/Headers/OSSCancellationToken.h
  6. 172
    95
      Example/ios/AliyunOSSiOS.framework/Headers/OSSClient.h
  7. 75
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSCocoaLumberjack.h
  8. 17
    13
      Example/ios/AliyunOSSiOS.framework/Headers/OSSCompat.h
  9. 111
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSConstants.h
  10. 860
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSDDLog.h
  11. 12
    1
      Example/ios/AliyunOSSiOS.framework/Headers/OSSDefine.h
  12. 31
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsRequest.h
  13. 17
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsResult.h
  14. 2
    2
      Example/ios/AliyunOSSiOS.framework/Headers/OSSExecutor.h
  15. 509
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSFileLogger.h
  16. 26
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSGetObjectACLRequest.h
  17. 19
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSGetObjectACLResult.h
  18. 39
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSHttpResponseParser.h
  19. 16
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSHttpdns.h
  20. 113
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSIPv6Adapter.h
  21. 23
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSIPv6PrefixResolver.h
  22. 16
    2
      Example/ios/AliyunOSSiOS.framework/Headers/OSSLog.h
  23. 82
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSLogMacros.h
  24. 666
    476
      Example/ios/AliyunOSSiOS.framework/Headers/OSSModel.h
  25. 14
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSNSLogger.h
  26. 3
    100
      Example/ios/AliyunOSSiOS.framework/Headers/OSSNetworking.h
  27. 76
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSNetworkingRequestDelegate.h
  28. 64
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSReachability.h
  29. 15
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSReachabilityManager.h
  30. 36
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSRequest.h
  31. 42
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSResult.h
  32. 12
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSService.h
  33. 2
    2
      Example/ios/AliyunOSSiOS.framework/Headers/OSSTask.h
  34. 36
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSURLRequestRetryHandler.h
  35. 36
    2
      Example/ios/AliyunOSSiOS.framework/Headers/OSSUtil.h
  36. 88
    0
      Example/ios/AliyunOSSiOS.framework/Headers/OSSXMLDictionary.h
  37. 11
    0
      Example/ios/AliyunOSSiOS.framework/PrivateHeaders/aos_crc64.h
  38. 1
    1
      Example/package.json
  39. BIN
      ios/AliyunSDK/AliyunOSSiOS.framework/AliyunOSSiOS
  40. 2
    1
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/AliyunOSSiOS.h
  41. 15
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/NSMutableData+OSS_CRC.h
  42. 56
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSAllRequestNeededMessage.h
  43. 1
    1
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSCancellationToken.h
  44. 172
    95
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSClient.h
  45. 75
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSCocoaLumberjack.h
  46. 17
    13
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSCompat.h
  47. 111
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSConstants.h
  48. 860
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSDDLog.h
  49. 12
    1
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSDefine.h
  50. 31
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsRequest.h
  51. 17
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsResult.h
  52. 2
    2
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSExecutor.h
  53. 509
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSFileLogger.h
  54. 26
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSGetObjectACLRequest.h
  55. 19
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSGetObjectACLResult.h
  56. 39
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSHttpResponseParser.h
  57. 16
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSHttpdns.h
  58. 113
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSIPv6Adapter.h
  59. 23
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSIPv6PrefixResolver.h
  60. 16
    2
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSLog.h
  61. 82
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSLogMacros.h
  62. 666
    476
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSModel.h
  63. 14
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSNSLogger.h
  64. 3
    100
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSNetworking.h
  65. 76
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSNetworkingRequestDelegate.h
  66. 64
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSReachability.h
  67. 15
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSReachabilityManager.h
  68. 36
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSRequest.h
  69. 42
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSResult.h
  70. 12
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSService.h
  71. 2
    2
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSTask.h
  72. 36
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSURLRequestRetryHandler.h
  73. 36
    2
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSUtil.h
  74. 88
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSXMLDictionary.h
  75. 11
    0
      ios/AliyunSDK/AliyunOSSiOS.framework/PrivateHeaders/aos_crc64.h
  76. 1
    1
      package.json

BIN
Example/ios/AliyunOSSiOS.framework/AliyunOSSiOS View File


+ 2
- 1
Example/ios/AliyunOSSiOS.framework/Headers/AliyunOSSiOS.h View File

@@ -6,7 +6,7 @@
6 6
 //  Copyright © 2016 xuyecan. All rights reserved.
7 7
 //
8 8
 
9
-#import <UIKit/UIKit.h>
9
+#import <Foundation/Foundation.h>
10 10
 
11 11
 //! Project version number for AliyunOSSiOS.
12 12
 FOUNDATION_EXPORT double AliyunOSSiOSVersionNumber;
@@ -18,3 +18,4 @@ FOUNDATION_EXPORT const unsigned char AliyunOSSiOSVersionString[];
18 18
 
19 19
 #import "OSSService.h"
20 20
 #import "OSSCompat.h"
21
+#import "OSSXMLDictionary.h"

+ 15
- 0
Example/ios/AliyunOSSiOS.framework/Headers/NSMutableData+OSS_CRC.h View File

@@ -0,0 +1,15 @@
1
+//
2
+//  NSMutableData+OSS_CRC.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by 怀叙 on 2017/11/29.
6
+//  Copyright © 2017年 阿里云. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@interface NSMutableData (OSS_CRC)
12
+
13
+- (uint64_t)oss_crc64;
14
+
15
+@end

+ 56
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSAllRequestNeededMessage.h View File

@@ -0,0 +1,56 @@
1
+//
2
+//  OSSAllRequestNeededMessage.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+#import "OSSTask.h"
12
+
13
+/**
14
+ All necessary information in one OSS request.
15
+ */
16
+@interface OSSAllRequestNeededMessage : NSObject
17
+@property (nonatomic, strong) NSString * endpoint;
18
+@property (nonatomic, strong) NSString * httpMethod;
19
+@property (nonatomic, strong) NSString * bucketName;
20
+@property (nonatomic, strong) NSString * objectKey;
21
+@property (nonatomic, strong) NSString * contentType;
22
+@property (nonatomic, strong) NSString * contentMd5;
23
+@property (nonatomic, strong) NSString * range;
24
+@property (nonatomic, strong) NSString * date;
25
+@property (nonatomic, strong) NSMutableDictionary * headerParams;
26
+@property (nonatomic, copy) NSDictionary * querys;
27
+@property (nonatomic, copy) NSString *contentSHA1;
28
+
29
+@property (nonatomic, assign) BOOL isHostInCnameExcludeList;
30
+
31
+- (instancetype)initWithEndpoint:(NSString *)endpoint
32
+                      httpMethod:(NSString *)httpMethod
33
+                      bucketName:(NSString *)bucketName
34
+                       objectKey:(NSString *)objectKey
35
+                            type:(NSString *)contentType
36
+                             md5:(NSString *)contentMd5
37
+                           range:(NSString *)range
38
+                            date:(NSString *)date
39
+                    headerParams:(NSMutableDictionary *)headerParams
40
+                          querys:(NSMutableDictionary *)querys __attribute__((deprecated("Use -initWithEndpoint:httpMethod:bucketName:objectKey:type:md5:range:date:headerParams:querys:sha1: instead")));
41
+
42
+- (instancetype)initWithEndpoint:(NSString *)endpoint
43
+                      httpMethod:(NSString *)httpMethod
44
+                      bucketName:(NSString *)bucketName
45
+                       objectKey:(NSString *)objectKey
46
+                            type:(NSString *)contentType
47
+                             md5:(NSString *)contentMd5
48
+                           range:(NSString *)range
49
+                            date:(NSString *)date
50
+                    headerParams:(NSMutableDictionary *)headerParams
51
+                          querys:(NSMutableDictionary *)querys
52
+                            sha1:(NSString *)contentSHA1;
53
+
54
+- (OSSTask *)validateRequestParamsInOperationType:(OSSOperationType)operType;
55
+
56
+@end

+ 1
- 1
Example/ios/AliyunOSSiOS.framework/Headers/OSSCancellationToken.h View File

@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
17 17
 /*!
18 18
  A block that will be called when a token is cancelled.
19 19
  */
20
-typedef void(^OSSCancellationBlock)();
20
+typedef void(^OSSCancellationBlock)(void);
21 21
 
22 22
 /*!
23 23
  The consumer view of a CancellationToken.

+ 172
- 95
Example/ios/AliyunOSSiOS.framework/Headers/OSSClient.h View File

@@ -14,19 +14,25 @@
14 14
 @class OSSGetBucketRequest;
15 15
 @class OSSGetBucketACLRequest;
16 16
 @class OSSGetObjectRequest;
17
+@class OSSGetObjectACLRequest;
17 18
 @class OSSPutObjectRequest;
18 19
 @class OSSPutObjectACLRequest;
19 20
 @class OSSDeleteObjectRequest;
21
+@class OSSDeleteMultipleObjectsRequest;
20 22
 @class OSSCopyObjectRequest;
21 23
 @class OSSInitMultipartUploadRequest;
22 24
 @class OSSUploadPartRequest;
23 25
 @class OSSCompleteMultipartUploadRequest;
24 26
 @class OSSListPartsRequest;
27
+@class OSSListMultipartUploadsRequest;
25 28
 @class OSSAbortMultipartUploadRequest;
26 29
 @class OSSAppendObjectRequest;
27 30
 @class OSSResumableUploadRequest;
31
+@class OSSMultipartUploadRequest;
28 32
 @class OSSTask;
29 33
 @class OSSExecutor;
34
+@class OSSCallBackRequest;
35
+@class OSSImagePersistRequest;
30 36
 
31 37
 @class OSSNetworking;
32 38
 @class OSSClientConfiguration;
@@ -35,49 +41,51 @@
35 41
 NS_ASSUME_NONNULL_BEGIN
36 42
 
37 43
 /**
38
- OSSClient是OSS服务的iOS客户端,它为调用者提供了一系列的方法,用于和OSS服务进行交互。
39
- 一般来说,全局内只需要保持一个OSSClient,用来调用各种操作。
44
+ OSSClient is the entry class to access OSS in an iOS client. It provides all the methods to communicate with OSS.
45
+ Generally speaking, only one instance of OSSClient is needed in the whole app.
40 46
  */
41 47
 @interface OSSClient : NSObject
42 48
 
43 49
 /**
44
- OSS访问域名
50
+ OSS endpoint. It varies in different regions. Please check out OSS official website for the exact endpoints for your data.
45 51
  */
46 52
 @property (nonatomic, strong) NSString * endpoint;
47 53
 
48 54
 /**
49
- 用以收发网络请求
55
+ The networking instance for sending and receiving data
50 56
  */
51 57
 @property (nonatomic, strong) OSSNetworking * networking;
52 58
 
53 59
 /**
54
- 提供访问所需凭证
60
+ The credential provider instance
55 61
  */
56 62
 @property (nonatomic, strong) id<OSSCredentialProvider> credentialProvider;
57 63
 
58 64
 /**
59
- 客户端设置
65
+ Client configuration instance
60 66
  */
61 67
 @property (nonatomic, strong) OSSClientConfiguration * clientConfiguration;
62 68
 
63 69
 /**
64
- 任务队列
70
+ oss operation task queue
65 71
  */
66 72
 @property (nonatomic, strong, readonly) OSSExecutor * ossOperationExecutor;
67 73
 
68 74
 /**
69
- 初始化OSSClient,使用默认的本地设置
70
- @endpoint 指明Bucket所在的Region域名,2017年以后苹果要求APP符合ATS政策,这里要写https的endpoint,如 "https://oss-cn-hangzhou.aliyuncs.com"
71
- @credentialProvider 需要实现的签名器
75
+ Initializes an OSSClient instance with the default client configuration.
76
+ @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy.
77
+             For example: "https://oss-cn-hangzhou.aliyuncs.com"
78
+ @credentialProvider The credential provider
72 79
  */
73 80
 - (instancetype)initWithEndpoint:(NSString *)endpoint
74 81
               credentialProvider:(id<OSSCredentialProvider>) credentialProvider;
75 82
 
76 83
 /**
77
- 初始化OSSClient,使用自定义设置
78
- @endpoint 指明Bucket所在的Region域名,2017年以后苹果要求APP符合ATS政策,这里要写https的endpoint,如 "https://oss-cn-hangzhou.aliyuncs.com"
79
- @credentialProvider 需要实现的签名器
80
- @conf 可以设置一些本地参数如重试次数、超时时间等
84
+ Initializes an OSSClient with the custom client configuration.
85
+ @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy.
86
+             For example: "https://oss-cn-hangzhou.aliyuncs.com"
87
+ @credentialProvider The credential provider
88
+ @conf The custom client configuration such as retry time, timeout values, etc.
81 89
  */
82 90
 - (instancetype)initWithEndpoint:(NSString *)endpoint
83 91
               credentialProvider:(id<OSSCredentialProvider>)credentialProvider
@@ -86,188 +94,257 @@ NS_ASSUME_NONNULL_BEGIN
86 94
 #pragma mark restful-api
87 95
 
88 96
 /**
89
- 对应RESTFul API:GetService
90
- 获取请求者当前拥有的全部Bucket。
91
- 注意:
92
- 1. 尚不支持STS;
93
- 2. 当所有的bucket都返回时,返回的xml中不包含Prefix、Marker、MaxKeys、IsTruncated、NextMarker节点,如果还有部分结果未返回,则增加上述节点,其中NextMarker用于继续查询时给marker赋值。
97
+ The corresponding RESTFul API: GetService
98
+ Gets all the buckets of the current user
99
+ Notes:
100
+ 1. STS is not supported yet in this call.
101
+ 2. When all buckets are returned, the xml in response body does not have nodes of Prefix, Marker, MaxKeys, IsTruncated and NextMarker.
102
+    If there're remaining buckets to return, the xml will have these nodes. The nextMarker is the value of marker in the next call.
94 103
  */
95 104
 - (OSSTask *)getService:(OSSGetServiceRequest *)request;
96 105
 
97 106
 /**
98
- 对应RESTFul API:PutBucket
99
- 用于创建Bucket(不支持匿名访问)。默认情况下,创建的Bucket位于默认的数据中心:oss-cn-hangzhou。
100
- 用户可以显式指定Bucket位于的数据中心,从而最优化延迟,最小化费用或者满足监管要求等。
101
- 注意:
102
- 1. 尚不支持STS。
107
+ The corresponding RESTFul API: PutBucket
108
+ Creates a bucket--it does not support anonymous access. By default, the datacenter used is oss-cn-hangzhou.
109
+ Callers could explicitly specify the datacenter for the bucket to optimize the performance and cost or meet the regulation requirement.
110
+ Notes:
111
+ 1. STS is not supported yet.
103 112
  */
104 113
 - (OSSTask *)createBucket:(OSSCreateBucketRequest *)request;
105 114
 
106 115
 /**
107
- 对应RESTFul API:DeleteBucket
108
- 用于删除某个Bucket。
116
+ The corresponding RESTFul API: DeleteBucket
117
+ Deletes a bucket.
109 118
  */
110 119
 - (OSSTask *)deleteBucket:(OSSDeleteBucketRequest *)request;
111 120
 
112 121
 /**
113
- 对应RESTFul API:GetBucket
114
- 用来list Bucket中所有Object的信息,可以通过prefix,marker,delimiter和max-keys对list做限定,返回部分结果。
122
+The corresponding RESTFul API: GetBucket
123
+ Lists all objects in a bucket. It could be specified with filters such as prefix, marker, delimeter and max-keys.
115 124
  */
116 125
 - (OSSTask *)getBucket:(OSSGetBucketRequest *)request;
117 126
 
118 127
 /**
119
- 对应RESTFul API:GetBucketACL
120
- 用来获取某个Bucket的访问权限。
128
+The corresponding RESTFul API: GetBucketACL
129
+ Gets the bucket ACL.
121 130
  */
122 131
 - (OSSTask *)getBucketACL:(OSSGetBucketACLRequest *)request;
123 132
 
124 133
 /**
125
- 对应RESTFul API:HeadObject
126
- 只返回某个Object的meta信息,不返回文件内容。
134
+The corresponding RESTFul API: HeadObject
135
+ Gets the object's metadata information. The object's content is not returned.
127 136
  */
128 137
 - (OSSTask *)headObject:(OSSHeadObjectRequest *)request;
129 138
 
130 139
 /**
131
- 对应RESTFul API:GetObject
132
- 用于获取某个Object,此操作要求用户对该Object有读权限。
140
+The corresponding RESTFul API: GetObject
141
+ Gets the whole object (includes content). It requires caller have read permission on the object.
133 142
  */
134 143
 - (OSSTask *)getObject:(OSSGetObjectRequest *)request;
135 144
 
136 145
 /**
137
- 对应RESTFul API:PutObject
138
- 用于上传文件。
146
+ * Gets the Access Control List (ACL) of the OSS object.
147
+ *
148
+ * @param bucketName
149
+ *            Bucket name.
150
+ * @param key
151
+ *            Object Key.
152
+ * @return The OSSTask with result of objectAcls instance of the object.
153
+ */
154
+- (OSSTask *)getObjectACL:(OSSGetObjectACLRequest *)request;
155
+
156
+/**
157
+The corresponding RESTFul API: PutObject
158
+ Uploads a file.
139 159
  */
140 160
 - (OSSTask *)putObject:(OSSPutObjectRequest *)request;
141 161
 
142 162
 /**
143
- Put Object ACL接口用于修改Object的访问权限。目前Object有三种访问权限:private, public-read, public-read-write。
144
- Put Object ACL操作通过Put请求中的“x-oss-object-acl”头来设置,这个操作只有Bucket Owner有权限执行。如果操作成功,则返回200;否则返回相应的错误码和提示信息。
163
+ Sets the object's ACL. Right now an object has three access permissions: private, public-ready, public-read-write.
164
+ The operation specifies the x-oss-object-acl header in the put request. The caller must be the owner of the object.
165
+ If succeeds, it returns HTTP status 200; otherwise it returns related error code and error messages.
145 166
  */
146 167
 - (OSSTask *)putObjectACL:(OSSPutObjectACLRequest *)request;
147 168
 
148 169
 /**
149
- 对应RESTFul API:AppendObject
150
- 以追加写的方式上传文件。通过Append Object操作创建的Object类型为Appendable Object,而通过Put Object上传的Object是Normal Object。
170
+The corresponding RESTFul API: AppendObject
171
+ Appends data to an existing or non-existing object. The object created by this operation is appendable. 
172
+ As a comparison, the object created by Put Object is normal (non-appendable).
151 173
  */
152 174
 - (OSSTask *)appendObject:(OSSAppendObjectRequest *)request;
153 175
 
154 176
 /**
155
- 对应RESTFul API:copyObject
156
- 拷贝一个在OSS上已经存在的object成另外一个object,可以发送一个PUT请求给OSS,并在PUT请求头中添加元素“x-oss-copy-source”来指定拷贝源。
157
- OSS会自动判断出这是一个Copy操作,并直接在服务器端执行该操作。如果拷贝成功,则返回新的object信息给用户。
158
- 该操作适用于拷贝小于1GB的文件。
177
+ @brief : Appends data to an existing or non-existing object on the OSS server. The object created by this operation is appendable.
178
+ request    : request
179
+ crc64ecma  : 如果服务器上面已经存在对象,需要客户端先调用headObject获取到对象的crc64ecma,然后再调用
180
+              该接口上传数据
181
+ */
182
+- (OSSTask *)appendObject:(OSSAppendObjectRequest *)request withCrc64ecma:(nullable NSString *)crc64ecma;
183
+
184
+/**
185
+The corresponding RESTFul API: copyObject
186
+ Copies an existing object to another one.The operation sends a PUT request with x-oss-copy-source header to specify the source object.
187
+ OSS server side will detect and copy the object. If it succeeds, the new object's metadata information will be returned.
188
+ The operation applies for files less than 1GB. For big files, use UploadPartCopy RESTFul API.
159 189
  */
160 190
 - (OSSTask *)copyObject:(OSSCopyObjectRequest *)request;
161 191
 
162 192
 /**
163
- 对应RESTFul API:DeleteObject
164
- 用于删除某个Object。
193
+ * Batch deletes the specified files under a specific bucket. If the files
194
+ * are non-exist, the operation will still return successful.
195
+ *
196
+ * @param deleteObjectsRequest
197
+ *            A OSSDeleteMultipleObjectsRequest instance which specifies the
198
+ *            bucket and file keys to delete.
199
+ * @return A OSSTask with result of OSSDeleteMultipleObjectsResult instance which specifies each
200
+ *         file's result in normal mode or only failed deletions in quite
201
+ *         mode. By default it's quite mode.
202
+ */
203
+- (OSSTask *)deleteMultipleObjects:(OSSDeleteMultipleObjectsRequest *)request;
204
+
205
+/**
206
+ The corresponding RESTFul API: DeleteObject
207
+ Deletes an object
165 208
  */
166 209
 - (OSSTask *)deleteObject:(OSSDeleteObjectRequest *)request;
167 210
 
168 211
 /**
169
- 对应RESTFul API:InitiateMultipartUpload
170
- 使用Multipart Upload模式传输数据前,必须先调用该接口来通知OSS初始化一个Multipart Upload事件。该接口会返回一个OSS服务器创建的全局唯一的Upload ID,用于标识本次Multipart Upload事件。
171
- 用户可以根据这个ID来发起相关的操作,如中止Multipart Upload、查询Multipart Upload等。
212
+The corresponding RESTFul API: InitiateMultipartUpload
213
+ Initiates a multipart upload to get a upload Id. It's needed before starting uploading parts data. 
214
+ The upload Id is used for subsequential operations such as aborting the upload, querying the uploaded parts, etc.
172 215
  */
173 216
 - (OSSTask *)multipartUploadInit:(OSSInitMultipartUploadRequest *)request;
174 217
 
175 218
 /**
176
- 对应RESTFul API:UploadPart
177
- 初始化一个Multipart Upload之后,可以根据指定的Object名和Upload ID来分块(Part)上传数据。
178
- 每一个上传的Part都有一个标识它的号码(part number,范围是1~10,000)。
179
- 对于同一个Upload ID,该号码不但唯一标识这一块数据,也标识了这块数据在整个文件内的相对位置。
180
- 如果你用同一个part号码,上传了新的数据,那么OSS上已有的这个号码的Part数据将被覆盖。除了最后一块Part以外,其他的part最小为100KB;
181
- 最后一块Part没有大小限制。
219
+The corresponding RESTFul API: UploadPart
220
+ After the multipart upload is initiated, this API could be called to upload the data to the target file with the upload Id.
221
+ Every uploaded part has a unique id called part number, which ranges from 1 to 10,000. 
222
+ For a given upload Id, the part number identifies the specific range of the data in the whole file. 
223
+ If the same part number is used for another upload, the existing data will be overwritten by the new upload. 
224
+ Except the last part, all other part's minimal size is 100KB.
225
+ But no minimal size requirement on the last part.
182 226
  */
183 227
 - (OSSTask *)uploadPart:(OSSUploadPartRequest *)request;
184 228
 
185 229
 /**
186
- 对应RESTFul API:CompleteMultipartUpload
187
- 在将所有数据Part都上传完成后,必须调用Complete Multipart Upload API来完成整个文件的Multipart Upload。
188
- 在执行该操作时,用户必须提供所有有效的数据Part的列表(包括part号码和ETAG);OSS收到用户提交的Part列表后,会逐一验证每个数据Part的有效性。
189
- 当所有的数据Part验证通过后,OSS将把这些数据part组合成一个完整的Object。
230
+The corresponding RESTFul API: CompleteMultipartUpload
231
+ This API is to complete the multipart upload after all parts data have been uploaded.
232
+ It must be provided with a valid part list (each part has the part number and ETag). 
233
+ OSS will validate every part and then complete the multipart upload.
234
+ If any part is invalid (e.g. the part is updated by another part upload), this API will fail.
190 235
  */
191 236
 - (OSSTask *)completeMultipartUpload:(OSSCompleteMultipartUploadRequest *)request;
192 237
 
193 238
 /**
194
- 对应RESTFul API:ListParts
195
- 可以罗列出指定Upload ID所属的所有已经上传成功Part。
239
+The corresponding RESTFul API: ListParts
240
+ Lists all uploaded parts of the specified upload id.
196 241
  */
197 242
 - (OSSTask *)listParts:(OSSListPartsRequest *)request;
198 243
 
199 244
 /**
200
- 对应RESTFul API:AbortMultipartUpload
201
- 该接口可以根据用户提供的Upload ID中止其对应的Multipart Upload事件。
202
- 当一个Multipart Upload事件被中止后,就不能再使用这个Upload ID做任何操作,已经上传的Part数据也会被删除。
245
+ The corresponding RESTFul API: ListMultipartUploads
246
+ Lists all multipart uploads with the specified bucket.
247
+ */
248
+- (OSSTask *)listMultipartUploads:(OSSListMultipartUploadsRequest *)request;
249
+
250
+/**
251
+The corresponding RESTFul API: AbortMultipartUpload
252
+Aborts the multipart upload by the specified upload Id.
253
+ Once the multipart upload is aborted by this API, all parts data will be deleted and the upload Id is invalid anymore.
203 254
  */
204 255
 - (OSSTask *)abortMultipartUpload:(OSSAbortMultipartUploadRequest *)request;
205 256
 
257
+- (OSSTask *)abortResumableMultipartUpload:(OSSResumableUploadRequest *)request;
258
+
259
+- (OSSTask *)triggerCallBack:(OSSCallBackRequest *)request;
260
+
261
+
206 262
 #pragma mark extention method
207 263
 
208 264
 /**
209
- 对一个Object签名出一个URL,可以把该URL转给第三方实现授权访问。
210
- @bucketName Object所在的Bucket名称
211
- @objectKey Object名称
212
- @interval 签名URL时,可以指定这个URL的有效时长是多久,单位是秒,比如说需要有效时长为1小时的URL,这里传入3600
265
+ Generates a signed URL for the object and anyone has this URL will get the GET permission on the object.
266
+ @bucketName object's bucket name
267
+ @objectKey Object name
268
+ @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object.
213 269
  */
214 270
 - (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName
215 271
                                 withObjectKey:(NSString *)objectKey
216 272
                        withExpirationInterval:(NSTimeInterval)interval;
217 273
 
218 274
 /**
219
- 对一个Object签名出一个URL,可以把该URL转给第三方实现授权访问。
220
- @bucketName Object所在的Bucket名称
221
- @objectKey Object名称
222
- @interval 签名URL时,可以指定这个URL的有效时长是多久,单位是秒,比如说需要有效时长为1小时的URL,这里传入3600
223
- @parameter 参数
275
+ Generates a signed URL for the object and anyone has this URL will get the specified permission on the object.
276
+ @bucketName object's bucket name
277
+ @objectKey Object name
278
+ @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object.
279
+ @parameter it could specify allowed HTTP methods 
224 280
  */
225 281
 - (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName
226 282
                                  withObjectKey:(NSString *)objectKey
227 283
                         withExpirationInterval:(NSTimeInterval)interval
228 284
                                 withParameters:(NSDictionary *)parameters;
229 285
 
230
-/**
231
- 如果Object的权限是公共读或者公共读写,调用这个接口对该Object签名出一个URL,可以把该URL转给第三方实现授权访问。
232
- @bucketName Object所在的Bucket名称
233
- @objectKey Object名称
286
+/** TODOTODO
287
+ If the object's ACL is public read or public read-write, use this API to generate a signed url for sharing.
288
+ @bucketName Object's bucket name
289
+ @objectKey Object name
234 290
  */
235 291
 - (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
236 292
                             withObjectKey:(NSString *)objectKey;
237 293
 
238
-/**
239
- 如果Object的权限是公共读或者公共读写,调用这个接口对该Object签名出一个URL,可以把该URL转给第三方实现授权访问。
240
- @bucketName Object所在的Bucket名称
241
- @objectKey Object名称
242
- @parameter 参数
294
+/** TODOTODO
295
+ If the object's ACL is public read or public read-write, use this API to generate a signed url for sharing.
296
+ @bucketName Object's bucket name
297
+ @objectKey Object name
298
+ @parameter the request parameters.
243 299
  */
244 300
 - (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
245 301
                              withObjectKey:(NSString *)objectKey
246 302
                              withParameters:(NSDictionary *)parameters;
247 303
 
248 304
 /**
249
- 断点上传接口
250
- 这个接口封装了分块上传的若干接口以实现断点上传,但是需要用户自行保存UploadId。
251
- 对一个新文件,用户需要首先调用multipartUploadInit接口获得一个UploadId,然后调用此接口上传这个文件。
252
- 如果上传失败,首先需要检查一下失败原因:
253
-     如果非不可恢复的失败,那么可以用同一个UploadId和同一文件继续调用这个接口续传
254
-     否则,需要重新获取UploadId,重新上传这个文件。
255
- 详细参考demo。
305
+ TODOTODO
306
+ Multipart upload API
307
+ */
308
+- (OSSTask *)multipartUpload:(OSSMultipartUploadRequest *)request;
309
+/**
310
+ TODOTODO
311
+ Resumable upload API
312
+ This API wraps the multipart upload and also enables resuming upload by reading/writing  the checkpoint data.
313
+ For a new file, multipartUploadInit() needs to be called first to get the upload Id. Then use this upload id to call this API to upload the data.
314
+ If the upload fails, checks the error messages:
315
+     If it's a recoverable error, then call this API again with the same upload Id to retry. The uploaded data will not be uploaded again.
316
+     Otherwise then you may need to recreates a new upload Id and call this method again.
317
+ Check out demo for the detail.
256 318
  */
257 319
 - (OSSTask *)resumableUpload:(OSSResumableUploadRequest *)request;
258 320
 
259 321
 /**
260
- 查看某个Object是否存在
261
- @bucketName Object所在的Bucket名称
262
- @objectKey Object名称
322
+ Checks if the object exists
323
+ @bucketName Object's bucket name
324
+ @objectKey Object name
263 325
  
264
- return YES                     Object存在
265
- return NO && *error = nil      Object不存在
266
- return NO && *error != nil     发生错误
326
+ return YES                     Object exists
327
+ return NO && *error = nil      Object does not exist
328
+ return NO && *error != nil     Error occured.
267 329
  */
268 330
 - (BOOL)doesObjectExistInBucket:(NSString *)bucketName
269 331
                       objectKey:(NSString *)objectKey
270 332
                           error:(const NSError **)error;
333
+
334
+/**
335
+ * multipart upload sequentially in order,support resume upload
336
+ */
337
+- (OSSTask *)sequentialMultipartUpload:(OSSResumableUploadRequest *)request;
338
+
339
+/*
340
+ * image persist action
341
+ * https://help.aliyun.com/document_detail/55811.html
342
+ */
343
+- (OSSTask *)imageActionPersist:(OSSImagePersistRequest *)request;
344
+
271 345
 @end
272 346
 
347
+
348
+
349
+
273 350
 NS_ASSUME_NONNULL_END

+ 75
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSCocoaLumberjack.h View File

@@ -0,0 +1,75 @@
1
+// Software License Agreement (BSD License)
2
+//
3
+// Copyright (c) 2010-2016, Deusty, LLC
4
+// All rights reserved.
5
+//
6
+// Redistribution and use of this software in source and binary forms,
7
+// with or without modification, are permitted provided that the following conditions are met:
8
+//
9
+// * Redistributions of source code must retain the above copyright notice,
10
+//   this list of conditions and the following disclaimer.
11
+//
12
+// * Neither the name of Deusty nor the names of its contributors may be used
13
+//   to endorse or promote products derived from this software without specific
14
+//   prior written permission of Deusty, LLC.
15
+
16
+/**
17
+ * Welcome to CocoaLumberjack!
18
+ *
19
+ * The project page has a wealth of documentation if you have any questions.
20
+ *
21
+ * If you're new to the project you may wish to read "Getting Started" at:
22
+ * Documentation/GettingStarted.md
23
+ *
24
+ * Otherwise, here is a quick refresher.
25
+ * There are three steps to using the macros:
26
+ *
27
+ * Step 1:
28
+ * Import the header in your implementation or prefix file:
29
+ *
30
+ * #import <CocoaLumberjack/CocoaLumberjack.h>
31
+ *
32
+ * Step 2:
33
+ * Define your logging level in your implementation file:
34
+ *
35
+ * // Log levels: off, error, warn, info, verbose
36
+ * static const DDLogLevel ddLogLevel = DDLogLevelVerbose;
37
+ *
38
+ * Step 2 [3rd party frameworks]:
39
+ *
40
+ * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel:
41
+ *
42
+ * // #undef LOG_LEVEL_DEF // Undefine first only if needed
43
+ * #define LOG_LEVEL_DEF myLibLogLevel
44
+ *
45
+ * Define your logging level in your implementation file:
46
+ *
47
+ * // Log levels: off, error, warn, info, verbose
48
+ * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose;
49
+ *
50
+ * Step 3:
51
+ * Replace your NSLog statements with DDLog statements according to the severity of the message.
52
+ *
53
+ * NSLog(@"Fatal error, no dohickey found!"); -> OSSLogError(@"Fatal error, no dohickey found!");
54
+ *
55
+ * DDLog works exactly the same as NSLog.
56
+ * This means you can pass it multiple variables just like NSLog.
57
+ **/
58
+
59
+#import <Foundation/Foundation.h>
60
+
61
+// Disable legacy macros
62
+#ifndef OSSDD_LEGACY_MACROS
63
+    #define OSSDD_LEGACY_MACROS 0
64
+#endif
65
+
66
+// Core
67
+#import "OSSDDLog.h"
68
+
69
+// Main macros
70
+#import "OSSLogMacros.h"
71
+
72
+// Loggers
73
+#import "OSSFileLogger.h"
74
+#import "OSSNSLogger.h"
75
+

+ 17
- 13
Example/ios/AliyunOSSiOS.framework/Headers/OSSCompat.h View File

@@ -13,11 +13,13 @@
13 13
 
14 14
 typedef OSSCancellationTokenSource OSSTaskHandler;
15 15
 
16
+NS_ASSUME_NONNULL_BEGIN
17
+
16 18
 @interface OSSClient (Compat)
17 19
 
18 20
 /**
19
- 兼容老版本用法的上传数据接口
20
- 建议更换使用:putObject
21
+ The old version's upload API.
22
+ Please use putObject instead.
21 23
  */
22 24
 - (OSSTaskHandler *)uploadData:(NSData *)data
23 25
                withContentType:(NSString *)contentType
@@ -28,8 +30,8 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
28 30
                     onProgress:(void(^)(float progress))onProgress;
29 31
 
30 32
 /**
31
- 兼容老版本用法的下载数据接口
32
- 建议更换使用:getObject
33
+ The old version's download API.
34
+ Please use getObject instead.
33 35
  */
34 36
 - (OSSTaskHandler *)downloadToDataFromBucket:(NSString *)bucketName
35 37
                    objectKey:(NSString *)objectKey
@@ -37,8 +39,8 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
37 39
                   onProgress:(void(^)(float progress))onProgress;
38 40
 
39 41
 /**
40
- 兼容老版本用法的上传文件接口
41
- 建议更换使用:putObject
42
+ The old version's upload API.
43
+ Please use putObject instead.
42 44
  */
43 45
 - (OSSTaskHandler *)uploadFile:(NSString *)filePath
44 46
                 withContentType:(NSString *)contentType
@@ -49,8 +51,8 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
49 51
                      onProgress:(void(^)(float progress))onProgress;
50 52
 
51 53
 /**
52
- 兼容老版本用法的下载文件接口
53
- 建议更换使用:getObject
54
+ The old version's download API.
55
+ Please use getObject instead.
54 56
  */
55 57
 - (OSSTaskHandler *)downloadToFileFromBucket:(NSString *)bucketName
56 58
                   objectKey:(NSString *)objectKey
@@ -60,8 +62,8 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
60 62
 
61 63
 
62 64
 /**
63
- 兼容老版本用法的断点上传文件接口
64
- 建议更换使用:resumableUpload
65
+ The old version's upload API with resumable upload support.
66
+ Please use resumableUpload instead.
65 67
  */
66 68
 - (OSSTaskHandler *)resumableUploadFile:(NSString *)filePath
67 69
           withContentType:(NSString *)contentType
@@ -72,10 +74,12 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
72 74
                onProgress:(void(^)(float progress))onProgress;
73 75
 
74 76
 /**
75
- 兼容老版本用法的删除Object接口
76
- 建议更换使用:deleteObject
77
+ The old version's delete API.
78
+ Please use deleteObject instead.
77 79
  */
78 80
 - (void)deleteObjectInBucket:(NSString *)bucketName
79 81
                    objectKey:(NSString *)objectKey
80 82
                  onCompleted:(void(^)(BOOL, NSError *))onCompleted;
81
-@end
83
+@end
84
+
85
+NS_ASSUME_NONNULL_END

+ 111
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSConstants.h View File

@@ -0,0 +1,111 @@
1
+//
2
+//  OSSConstants.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+
13
+typedef NSString* _Nullable (^OSSCustomSignContentBlock) (NSString * contentToSign, NSError **error);
14
+typedef NSData * _Nullable (^OSSResponseDecoderBlock) (NSData * data);
15
+
16
+typedef void (^OSSNetworkingUploadProgressBlock) (int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend);
17
+typedef void (^OSSNetworkingDownloadProgressBlock) (int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
18
+typedef void (^OSSNetworkingRetryBlock) (void);
19
+typedef void (^OSSNetworkingCompletionHandlerBlock) (id _Nullable responseObject, NSError * _Nullable error);
20
+typedef void (^OSSNetworkingOnRecieveDataBlock) (NSData * data);
21
+
22
+/**
23
+ The flag of verification about crc64
24
+ */
25
+typedef NS_ENUM(NSUInteger, OSSRequestCRCFlag) {
26
+    OSSRequestCRCUninitialized,
27
+    OSSRequestCRCOpen,
28
+    OSSRequestCRCClosed
29
+};
30
+
31
+/**
32
+ Retry type definition
33
+ */
34
+typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) {
35
+    OSSNetworkingRetryTypeUnknown,
36
+    OSSNetworkingRetryTypeShouldRetry,
37
+    OSSNetworkingRetryTypeShouldNotRetry,
38
+    OSSNetworkingRetryTypeShouldRefreshCredentialsAndRetry,
39
+    OSSNetworkingRetryTypeShouldCorrectClockSkewAndRetry
40
+};
41
+
42
+/**
43
+ * @brief: The following constants are provided by OSSNetworking as possible operation types.
44
+ */
45
+typedef NS_ENUM(NSInteger, OSSOperationType) {
46
+    OSSOperationTypeGetService,
47
+    OSSOperationTypeCreateBucket,
48
+    OSSOperationTypeDeleteBucket,
49
+    OSSOperationTypeGetBucket,
50
+    OSSOperationTypeGetBucketACL,
51
+    OSSOperationTypeHeadObject,
52
+    OSSOperationTypeGetObject,
53
+    OSSOperationTypeGetObjectACL,
54
+    OSSOperationTypePutObject,
55
+    OSSOperationTypePutObjectACL,
56
+    OSSOperationTypeAppendObject,
57
+    OSSOperationTypeDeleteObject,
58
+    OSSOperationTypeDeleteMultipleObjects,
59
+    OSSOperationTypeCopyObject,
60
+    OSSOperationTypeInitMultipartUpload,
61
+    OSSOperationTypeUploadPart,
62
+    OSSOperationTypeCompleteMultipartUpload,
63
+    OSSOperationTypeAbortMultipartUpload,
64
+    OSSOperationTypeListMultipart,
65
+    OSSOperationTypeListMultipartUploads,
66
+    OSSOperationTypeTriggerCallBack,
67
+    OSSOperationTypeImagePersist
68
+};
69
+
70
+/**
71
+ * @brief: The following constants are provided by OSSClient as possible error codes.
72
+ */
73
+typedef NS_ENUM(NSInteger, OSSClientErrorCODE) {
74
+    OSSClientErrorCodeNetworkingFailWithResponseCode0,
75
+    OSSClientErrorCodeSignFailed,
76
+    OSSClientErrorCodeFileCantWrite,
77
+    OSSClientErrorCodeInvalidArgument,
78
+    OSSClientErrorCodeNilUploadid,
79
+    OSSClientErrorCodeTaskCancelled,
80
+    OSSClientErrorCodeNetworkError,
81
+    OSSClientErrorCodeInvalidCRC,
82
+    OSSClientErrorCodeCannotResumeUpload,
83
+    OSSClientErrorCodeExcpetionCatched,
84
+    OSSClientErrorCodeNotKnown
85
+};
86
+
87
+typedef NS_ENUM(NSInteger, OSSXMLDictionaryAttributesMode)
88
+{
89
+    OSSXMLDictionaryAttributesModePrefixed = 0, //default
90
+    OSSXMLDictionaryAttributesModeDictionary,
91
+    OSSXMLDictionaryAttributesModeUnprefixed,
92
+    OSSXMLDictionaryAttributesModeDiscard
93
+};
94
+
95
+
96
+typedef NS_ENUM(NSInteger, OSSXMLDictionaryNodeNameMode)
97
+{
98
+    OSSXMLDictionaryNodeNameModeRootOnly = 0, //default
99
+    OSSXMLDictionaryNodeNameModeAlways,
100
+    OSSXMLDictionaryNodeNameModeNever
101
+};
102
+
103
+typedef NSString * OSSXMLDictionaryAttributeName NS_EXTENSIBLE_STRING_ENUM;
104
+
105
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributesKey;
106
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryCommentsKey;
107
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryTextKey;
108
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryNodeNameKey;
109
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributePrefix;
110
+
111
+NS_ASSUME_NONNULL_END

+ 860
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSDDLog.h View File

@@ -0,0 +1,860 @@
1
+// Software License Agreement (BSD License)
2
+//
3
+// Copyright (c) 2010-2016, Deusty, LLC
4
+// All rights reserved.
5
+//
6
+// Redistribution and use of this software in source and binary forms,
7
+// with or without modification, are permitted provided that the following conditions are met:
8
+//
9
+// * Redistributions of source code must retain the above copyright notice,
10
+//   this list of conditions and the following disclaimer.
11
+//
12
+// * Neither the name of Deusty nor the names of its contributors may be used
13
+//   to endorse or promote products derived from this software without specific
14
+//   prior written permission of Deusty, LLC.
15
+
16
+#import <Foundation/Foundation.h>
17
+
18
+// Enable 1.9.x legacy macros if imported directly
19
+#ifndef OSSDD_LEGACY_MACROS
20
+    #define OSSDD_LEGACY_MACROS 1
21
+#endif
22
+
23
+#if OS_OBJECT_USE_OBJC
24
+    #define DISPATCH_QUEUE_REFERENCE_TYPE strong
25
+#else
26
+    #define DISPATCH_QUEUE_REFERENCE_TYPE assign
27
+#endif
28
+
29
+@class OSSDDLogMessage;
30
+@class OSSDDLoggerInformation;
31
+@protocol OSSDDLogger;
32
+@protocol OSSDDLogFormatter;
33
+
34
+/**
35
+ * Define the standard options.
36
+ *
37
+ * We default to only 4 levels because it makes it easier for beginners
38
+ * to make the transition to a logging framework.
39
+ *
40
+ * More advanced users may choose to completely customize the levels (and level names) to suite their needs.
41
+ * For more information on this see the "Custom Log Levels" page:
42
+ * Documentation/CustomLogLevels.md
43
+ *
44
+ * Advanced users may also notice that we're using a bitmask.
45
+ * This is to allow for custom fine grained logging:
46
+ * Documentation/FineGrainedLogging.md
47
+ *
48
+ * -- Flags --
49
+ *
50
+ * Typically you will use the LOG_LEVELS (see below), but the flags may be used directly in certain situations.
51
+ * For example, say you have a lot of warning log messages, and you wanted to disable them.
52
+ * However, you still needed to see your error and info log messages.
53
+ * You could accomplish that with the following:
54
+ *
55
+ * static const DDLogLevel ddLogLevel = DDLogFlagError | DDLogFlagInfo;
56
+ *
57
+ * When LOG_LEVEL_DEF is defined as ddLogLevel.
58
+ *
59
+ * Flags may also be consulted when writing custom log formatters,
60
+ * as the DDLogMessage class captures the individual flag that caused the log message to fire.
61
+ *
62
+ * -- Levels --
63
+ *
64
+ * Log levels are simply the proper bitmask of the flags.
65
+ *
66
+ * -- Booleans --
67
+ *
68
+ * The booleans may be used when your logging code involves more than one line.
69
+ * For example:
70
+ *
71
+ * if (LOG_VERBOSE) {
72
+ *     for (id sprocket in sprockets)
73
+ *         DDLogVerbose(@"sprocket: %@", [sprocket description])
74
+ * }
75
+ *
76
+ * -- Async --
77
+ *
78
+ * Defines the default asynchronous options.
79
+ * The default philosophy for asynchronous logging is very simple:
80
+ *
81
+ * Log messages with errors should be executed synchronously.
82
+ *     After all, an error just occurred. The application could be unstable.
83
+ *
84
+ * All other log messages, such as debug output, are executed asynchronously.
85
+ *     After all, if it wasn't an error, then it was just informational output,
86
+ *     or something the application was easily able to recover from.
87
+ *
88
+ * -- Changes --
89
+ *
90
+ * You are strongly discouraged from modifying this file.
91
+ * If you do, you make it more difficult on yourself to merge future bug fixes and improvements from the project.
92
+ * Instead, create your own MyLogging.h or ApplicationNameLogging.h or CompanyLogging.h
93
+ *
94
+ * For an example of customizing your logging experience, see the "Custom Log Levels" page:
95
+ * Documentation/CustomLogLevels.md
96
+ **/
97
+
98
+/**
99
+ *  Flags accompany each log. They are used together with levels to filter out logs.
100
+ */
101
+typedef NS_OPTIONS(NSUInteger, OSSDDLogFlag){
102
+    /**
103
+     *  0...00001 DDLogFlagError
104
+     */
105
+    OSSDDLogFlagError      = (1 << 0),
106
+    
107
+    /**
108
+     *  0...00010 DDLogFlagWarning
109
+     */
110
+    OSSDDLogFlagWarning    = (1 << 1),
111
+    
112
+    /**
113
+     *  0...00100 DDLogFlagInfo
114
+     */
115
+    OSSDDLogFlagInfo       = (1 << 2),
116
+    
117
+    /**
118
+     *  0...01000 DDLogFlagDebug
119
+     */
120
+    OSSDDLogFlagDebug      = (1 << 3),
121
+    
122
+    /**
123
+     *  0...10000 DDLogFlagVerbose
124
+     */
125
+    OSSDDLogFlagVerbose    = (1 << 4)
126
+};
127
+
128
+/**
129
+ *  Log levels are used to filter out logs. Used together with flags.
130
+ */
131
+typedef NS_ENUM(NSUInteger, OSSDDLogLevel){
132
+    /**
133
+     *  No logs
134
+     */
135
+    OSSDDLogLevelOff       = 0,
136
+    
137
+    /**
138
+     *  Error logs only
139
+     */
140
+    OSSDDLogLevelError     = (OSSDDLogFlagError),
141
+    
142
+    /**
143
+     *  Error and warning logs
144
+     */
145
+    OSSDDLogLevelWarning   = (OSSDDLogLevelError   | OSSDDLogFlagWarning),
146
+    
147
+    /**
148
+     *  Error, warning and info logs
149
+     */
150
+    OSSDDLogLevelInfo      = (OSSDDLogLevelWarning | OSSDDLogFlagInfo),
151
+    
152
+    /**
153
+     *  Error, warning, info and debug logs
154
+     */
155
+    OSSDDLogLevelDebug     = (OSSDDLogLevelInfo    | OSSDDLogFlagDebug),
156
+    
157
+    /**
158
+     *  Error, warning, info, debug and verbose logs
159
+     */
160
+    OSSDDLogLevelVerbose   = (OSSDDLogLevelDebug   | OSSDDLogFlagVerbose),
161
+    
162
+    /**
163
+     *  All logs (1...11111)
164
+     */
165
+    OSSDDLogLevelAll       = NSUIntegerMax
166
+};
167
+
168
+NS_ASSUME_NONNULL_BEGIN
169
+
170
+/**
171
+ *  Extracts just the file name, no path or extension
172
+ *
173
+ *  @param filePath input file path
174
+ *  @param copy     YES if we want the result to be copied
175
+ *
176
+ *  @return the file name
177
+ */
178
+NSString * __nullable OSSDDExtractFileNameWithoutExtension(const char *filePath, BOOL copy);
179
+
180
+/**
181
+ * The THIS_FILE macro gives you an NSString of the file name.
182
+ * For simplicity and clarity, the file name does not include the full path or file extension.
183
+ *
184
+ * For example: DDLogWarn(@"%@: Unable to find thingy", THIS_FILE) -> @"MyViewController: Unable to find thingy"
185
+ **/
186
+#define THIS_FILE         (DDExtractFileNameWithoutExtension(__FILE__, NO))
187
+
188
+/**
189
+ * The THIS_METHOD macro gives you the name of the current objective-c method.
190
+ *
191
+ * For example: DDLogWarn(@"%@ - Requires non-nil strings", THIS_METHOD) -> @"setMake:model: requires non-nil strings"
192
+ *
193
+ * Note: This does NOT work in straight C functions (non objective-c).
194
+ * Instead you should use the predefined __FUNCTION__ macro.
195
+ **/
196
+#define THIS_METHOD       NSStringFromSelector(_cmd)
197
+
198
+
199
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
200
+#pragma mark -
201
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
202
+
203
+/**
204
+ *  The main class, exposes all logging mechanisms, loggers, ...
205
+ *  For most of the users, this class is hidden behind the logging functions like `DDLogInfo`
206
+ */
207
+@interface OSSDDLog : NSObject
208
+
209
+/**
210
+ *  Returns the singleton `DDLog`.
211
+ *  The instance is used by `DDLog` class methods.
212
+ */
213
+@property (class, nonatomic, strong, readonly) OSSDDLog *sharedInstance;
214
+
215
+/**
216
+ * Provides access to the underlying logging queue.
217
+ * This may be helpful to Logger classes for things like thread synchronization.
218
+ **/
219
+@property (class, nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggingQueue;
220
+
221
+/**
222
+ * Logging Primitive.
223
+ *
224
+ * This method is used by the macros or logging functions.
225
+ * It is suggested you stick with the macros as they're easier to use.
226
+ *
227
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
228
+ *  @param level        the log level
229
+ *  @param flag         the log flag
230
+ *  @param context      the context (if any is defined)
231
+ *  @param file         the current file
232
+ *  @param function     the current function
233
+ *  @param line         the current code line
234
+ *  @param tag          potential tag
235
+ *  @param format       the log format
236
+ */
237
++ (void)log:(BOOL)asynchronous
238
+      level:(OSSDDLogLevel)level
239
+       flag:(OSSDDLogFlag)flag
240
+    context:(NSInteger)context
241
+       file:(const char *)file
242
+   function:(const char *)function
243
+       line:(NSUInteger)line
244
+        tag:(id __nullable)tag
245
+     format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10);
246
+
247
+/**
248
+ * Logging Primitive.
249
+ *
250
+ * This method is used by the macros or logging functions.
251
+ * It is suggested you stick with the macros as they're easier to use.
252
+ *
253
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
254
+ *  @param level        the log level
255
+ *  @param flag         the log flag
256
+ *  @param context      the context (if any is defined)
257
+ *  @param file         the current file
258
+ *  @param function     the current function
259
+ *  @param line         the current code line
260
+ *  @param tag          potential tag
261
+ *  @param format       the log format
262
+ */
263
+- (void)log:(BOOL)asynchronous
264
+      level:(OSSDDLogLevel)level
265
+       flag:(OSSDDLogFlag)flag
266
+    context:(NSInteger)context
267
+       file:(const char *)file
268
+   function:(const char *)function
269
+       line:(NSUInteger)line
270
+        tag:(id __nullable)tag
271
+     format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10);
272
+
273
+/**
274
+ * Logging Primitive.
275
+ *
276
+ * This method can be used if you have a prepared va_list.
277
+ * Similar to `log:level:flag:context:file:function:line:tag:format:...`
278
+ *
279
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
280
+ *  @param level        the log level
281
+ *  @param flag         the log flag
282
+ *  @param context      the context (if any is defined)
283
+ *  @param file         the current file
284
+ *  @param function     the current function
285
+ *  @param line         the current code line
286
+ *  @param tag          potential tag
287
+ *  @param format       the log format
288
+ *  @param argList      the arguments list as a va_list
289
+ */
290
++ (void)log:(BOOL)asynchronous
291
+      level:(OSSDDLogLevel)level
292
+       flag:(OSSDDLogFlag)flag
293
+    context:(NSInteger)context
294
+       file:(const char *)file
295
+   function:(const char *)function
296
+       line:(NSUInteger)line
297
+        tag:(id __nullable)tag
298
+     format:(NSString *)format
299
+       args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:));
300
+
301
+/**
302
+ * Logging Primitive.
303
+ *
304
+ * This method can be used if you have a prepared va_list.
305
+ * Similar to `log:level:flag:context:file:function:line:tag:format:...`
306
+ *
307
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
308
+ *  @param level        the log level
309
+ *  @param flag         the log flag
310
+ *  @param context      the context (if any is defined)
311
+ *  @param file         the current file
312
+ *  @param function     the current function
313
+ *  @param line         the current code line
314
+ *  @param tag          potential tag
315
+ *  @param format       the log format
316
+ *  @param argList      the arguments list as a va_list
317
+ */
318
+- (void)log:(BOOL)asynchronous
319
+      level:(OSSDDLogLevel)level
320
+       flag:(OSSDDLogFlag)flag
321
+    context:(NSInteger)context
322
+       file:(const char *)file
323
+   function:(const char *)function
324
+       line:(NSUInteger)line
325
+        tag:(id __nullable)tag
326
+     format:(NSString *)format
327
+       args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:));
328
+
329
+/**
330
+ * Logging Primitive.
331
+ *
332
+ * This method can be used if you manualy prepared DDLogMessage.
333
+ *
334
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
335
+ *  @param logMessage   the log message stored in a `DDLogMessage` model object
336
+ */
337
++ (void)log:(BOOL)asynchronous
338
+    message:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:));
339
+
340
+/**
341
+ * Logging Primitive.
342
+ *
343
+ * This method can be used if you manualy prepared DDLogMessage.
344
+ *
345
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
346
+ *  @param logMessage   the log message stored in a `DDLogMessage` model object
347
+ */
348
+- (void)log:(BOOL)asynchronous
349
+    message:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:));
350
+
351
+/**
352
+ * Since logging can be asynchronous, there may be times when you want to flush the logs.
353
+ * The framework invokes this automatically when the application quits.
354
+ **/
355
++ (void)flushLog;
356
+
357
+/**
358
+ * Since logging can be asynchronous, there may be times when you want to flush the logs.
359
+ * The framework invokes this automatically when the application quits.
360
+ **/
361
+- (void)flushLog;
362
+
363
+/**
364
+ * Loggers
365
+ *
366
+ * In order for your log statements to go somewhere, you should create and add a logger.
367
+ *
368
+ * You can add multiple loggers in order to direct your log statements to multiple places.
369
+ * And each logger can be configured separately.
370
+ * So you could have, for example, verbose logging to the console, but a concise log file with only warnings & errors.
371
+ **/
372
+
373
+/**
374
+ * Adds the logger to the system.
375
+ *
376
+ * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`.
377
+ **/
378
++ (void)addLogger:(id <OSSDDLogger>)logger;
379
+
380
+/**
381
+ * Adds the logger to the system.
382
+ *
383
+ * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`.
384
+ **/
385
+- (void)addLogger:(id <OSSDDLogger>)logger;
386
+
387
+/**
388
+ * Adds the logger to the system.
389
+ *
390
+ * The level that you provide here is a preemptive filter (for performance).
391
+ * That is, the level specified here will be used to filter out logMessages so that
392
+ * the logger is never even invoked for the messages.
393
+ *
394
+ * More information:
395
+ * When you issue a log statement, the logging framework iterates over each logger,
396
+ * and checks to see if it should forward the logMessage to the logger.
397
+ * This check is done using the level parameter passed to this method.
398
+ *
399
+ * For example:
400
+ *
401
+ * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];`
402
+ * `[DDLog addLogger:fileLogger    withLogLevel:DDLogLevelWarning];`
403
+ *
404
+ * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger
405
+ * `DDLogInfo(@"hi");`     => gets forwarded to consoleLogger only
406
+ *
407
+ * It is important to remember that Lumberjack uses a BITMASK.
408
+ * Many developers & third party frameworks may define extra log levels & flags.
409
+ * For example:
410
+ *
411
+ * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000`
412
+ *
413
+ * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages.
414
+ *
415
+ * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO`
416
+ *
417
+ * Consider passing `DDLogLevelAll` to this method, which has all bits set.
418
+ * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set,
419
+ * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug:
420
+ *
421
+ * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)`
422
+ **/
423
++ (void)addLogger:(id <OSSDDLogger>)logger withLevel:(OSSDDLogLevel)level;
424
+
425
+/**
426
+ * Adds the logger to the system.
427
+ *
428
+ * The level that you provide here is a preemptive filter (for performance).
429
+ * That is, the level specified here will be used to filter out logMessages so that
430
+ * the logger is never even invoked for the messages.
431
+ *
432
+ * More information:
433
+ * When you issue a log statement, the logging framework iterates over each logger,
434
+ * and checks to see if it should forward the logMessage to the logger.
435
+ * This check is done using the level parameter passed to this method.
436
+ *
437
+ * For example:
438
+ *
439
+ * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];`
440
+ * `[DDLog addLogger:fileLogger    withLogLevel:DDLogLevelWarning];`
441
+ *
442
+ * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger
443
+ * `DDLogInfo(@"hi");`     => gets forwarded to consoleLogger only
444
+ *
445
+ * It is important to remember that Lumberjack uses a BITMASK.
446
+ * Many developers & third party frameworks may define extra log levels & flags.
447
+ * For example:
448
+ *
449
+ * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000`
450
+ *
451
+ * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages.
452
+ *
453
+ * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO`
454
+ *
455
+ * Consider passing `DDLogLevelAll` to this method, which has all bits set.
456
+ * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set,
457
+ * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug:
458
+ *
459
+ * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)`
460
+ **/
461
+- (void)addLogger:(id <OSSDDLogger>)logger withLevel:(OSSDDLogLevel)level;
462
+
463
+/**
464
+ *  Remove the logger from the system
465
+ */
466
++ (void)removeLogger:(id <OSSDDLogger>)logger;
467
+
468
+/**
469
+ *  Remove the logger from the system
470
+ */
471
+- (void)removeLogger:(id <OSSDDLogger>)logger;
472
+
473
+/**
474
+ *  Remove all the current loggers
475
+ */
476
++ (void)removeAllLoggers;
477
+
478
+/**
479
+ *  Remove all the current loggers
480
+ */
481
+- (void)removeAllLoggers;
482
+
483
+/**
484
+ *  Return all the current loggers
485
+ */
486
+@property (class, nonatomic, copy, readonly) NSArray<id<OSSDDLogger>> *allLoggers;
487
+
488
+/**
489
+ *  Return all the current loggers
490
+ */
491
+@property (nonatomic, copy, readonly) NSArray<id<OSSDDLogger>> *allLoggers;
492
+
493
+/**
494
+ *  Return all the current loggers with their level (aka DDLoggerInformation).
495
+ */
496
+@property (class, nonatomic, copy, readonly) NSArray<OSSDDLoggerInformation *> *allLoggersWithLevel;
497
+
498
+/**
499
+ *  Return all the current loggers with their level (aka DDLoggerInformation).
500
+ */
501
+@property (nonatomic, copy, readonly) NSArray<OSSDDLoggerInformation *> *allLoggersWithLevel;
502
+
503
+@end
504
+
505
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
506
+#pragma mark -
507
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
508
+
509
+/**
510
+ *  This protocol describes a basic logger behavior. 
511
+ *  Basically, it can log messages, store a logFormatter plus a bunch of optional behaviors.
512
+ *  (i.e. flush, get its loggerQueue, get its name, ...
513
+ */
514
+@protocol OSSDDLogger <NSObject>
515
+
516
+/**
517
+ *  The log message method
518
+ *
519
+ *  @param logMessage the message (model)
520
+ */
521
+- (void)logMessage:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(message:));
522
+
523
+/**
524
+ * Formatters may optionally be added to any logger.
525
+ *
526
+ * If no formatter is set, the logger simply logs the message as it is given in logMessage,
527
+ * or it may use its own built in formatting style.
528
+ **/
529
+@property (nonatomic, strong) id <OSSDDLogFormatter> logFormatter;
530
+
531
+@optional
532
+
533
+/**
534
+ * Since logging is asynchronous, adding and removing loggers is also asynchronous.
535
+ * In other words, the loggers are added and removed at appropriate times with regards to log messages.
536
+ *
537
+ * - Loggers will not receive log messages that were executed prior to when they were added.
538
+ * - Loggers will not receive log messages that were executed after they were removed.
539
+ *
540
+ * These methods are executed in the logging thread/queue.
541
+ * This is the same thread/queue that will execute every logMessage: invocation.
542
+ * Loggers may use these methods for thread synchronization or other setup/teardown tasks.
543
+ **/
544
+- (void)didAddLogger;
545
+
546
+/**
547
+ * Since logging is asynchronous, adding and removing loggers is also asynchronous.
548
+ * In other words, the loggers are added and removed at appropriate times with regards to log messages.
549
+ *
550
+ * - Loggers will not receive log messages that were executed prior to when they were added.
551
+ * - Loggers will not receive log messages that were executed after they were removed.
552
+ *
553
+ * These methods are executed in the logging thread/queue given in parameter.
554
+ * This is the same thread/queue that will execute every logMessage: invocation.
555
+ * Loggers may use the queue parameter to set specific values on the queue with dispatch_set_specific() function.
556
+ **/
557
+- (void)didAddLoggerInQueue:(dispatch_queue_t)queue;
558
+
559
+/**
560
+ *  See the above description for `didAddLoger`
561
+ */
562
+- (void)willRemoveLogger;
563
+
564
+/**
565
+ * Some loggers may buffer IO for optimization purposes.
566
+ * For example, a database logger may only save occasionaly as the disk IO is slow.
567
+ * In such loggers, this method should be implemented to flush any pending IO.
568
+ *
569
+ * This allows invocations of DDLog's flushLog method to be propogated to loggers that need it.
570
+ *
571
+ * Note that DDLog's flushLog method is invoked automatically when the application quits,
572
+ * and it may be also invoked manually by the developer prior to application crashes, or other such reasons.
573
+ **/
574
+- (void)flush;
575
+
576
+/**
577
+ * Each logger is executed concurrently with respect to the other loggers.
578
+ * Thus, a dedicated dispatch queue is used for each logger.
579
+ * Logger implementations may optionally choose to provide their own dispatch queue.
580
+ **/
581
+@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggerQueue;
582
+
583
+/**
584
+ * If the logger implementation does not choose to provide its own queue,
585
+ * one will automatically be created for it.
586
+ * The created queue will receive its name from this method.
587
+ * This may be helpful for debugging or profiling reasons.
588
+ **/
589
+@property (nonatomic, readonly) NSString *loggerName;
590
+
591
+@end
592
+
593
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
594
+#pragma mark -
595
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
596
+
597
+/**
598
+ *  This protocol describes the behavior of a log formatter
599
+ */
600
+@protocol OSSDDLogFormatter <NSObject>
601
+@required
602
+
603
+/**
604
+ * Formatters may optionally be added to any logger.
605
+ * This allows for increased flexibility in the logging environment.
606
+ * For example, log messages for log files may be formatted differently than log messages for the console.
607
+ *
608
+ * For more information about formatters, see the "Custom Formatters" page:
609
+ * Documentation/CustomFormatters.md
610
+ *
611
+ * The formatter may also optionally filter the log message by returning nil,
612
+ * in which case the logger will not log the message.
613
+ **/
614
+- (NSString * __nullable)formatLogMessage:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(format(message:));
615
+
616
+@optional
617
+
618
+/**
619
+ * A single formatter instance can be added to multiple loggers.
620
+ * These methods provides hooks to notify the formatter of when it's added/removed.
621
+ *
622
+ * This is primarily for thread-safety.
623
+ * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers.
624
+ * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter),
625
+ * it could possibly use these hooks to switch to thread-safe versions of the code.
626
+ **/
627
+- (void)didAddToLogger:(id <OSSDDLogger>)logger;
628
+
629
+/**
630
+ * A single formatter instance can be added to multiple loggers.
631
+ * These methods provides hooks to notify the formatter of when it's added/removed.
632
+ *
633
+ * This is primarily for thread-safety.
634
+ * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers.
635
+ * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter),
636
+ * it could possibly use these hooks to switch to thread-safe versions of the code or use dispatch_set_specific()
637
+.* to add its own specific values.
638
+ **/
639
+- (void)didAddToLogger:(id <OSSDDLogger>)logger inQueue:(dispatch_queue_t)queue;
640
+
641
+/**
642
+ *  See the above description for `didAddToLogger:`
643
+ */
644
+- (void)willRemoveFromLogger:(id <OSSDDLogger>)logger;
645
+
646
+@end
647
+
648
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
649
+#pragma mark -
650
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
651
+
652
+/**
653
+ *  This protocol describes a dynamic logging component
654
+ */
655
+@protocol OSSDDRegisteredDynamicLogging
656
+
657
+/**
658
+ * Implement these methods to allow a file's log level to be managed from a central location.
659
+ *
660
+ * This is useful if you'd like to be able to change log levels for various parts
661
+ * of your code from within the running application.
662
+ *
663
+ * Imagine pulling up the settings for your application,
664
+ * and being able to configure the logging level on a per file basis.
665
+ *
666
+ * The implementation can be very straight-forward:
667
+ *
668
+ * ```
669
+ * + (int)ddLogLevel
670
+ * {
671
+ *     return ddLogLevel;
672
+ * }
673
+ *
674
+ * + (void)ddSetLogLevel:(DDLogLevel)level
675
+ * {
676
+ *     ddLogLevel = level;
677
+ * }
678
+ * ```
679
+ **/
680
+@property (class, nonatomic, readwrite, setter=ddSetLogLevel:) OSSDDLogLevel ossLogLevel;
681
+
682
+@end
683
+
684
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
685
+#pragma mark -
686
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
687
+
688
+#ifndef NS_DESIGNATED_INITIALIZER
689
+    #define NS_DESIGNATED_INITIALIZER
690
+#endif
691
+
692
+/**
693
+ *  Log message options, allow copying certain log elements
694
+ */
695
+typedef NS_OPTIONS(NSInteger, OSSDDLogMessageOptions){
696
+    /**
697
+     *  Use this to use a copy of the file path
698
+     */
699
+    OSSDDLogMessageCopyFile        = 1 << 0,
700
+    /**
701
+     *  Use this to use a copy of the function name
702
+     */
703
+    OSSDDLogMessageCopyFunction    = 1 << 1,
704
+    /**
705
+     *  Use this to use avoid a copy of the message
706
+     */
707
+    OSSDDLogMessageDontCopyMessage = 1 << 2
708
+};
709
+
710
+/**
711
+ * The `DDLogMessage` class encapsulates information about the log message.
712
+ * If you write custom loggers or formatters, you will be dealing with objects of this class.
713
+ **/
714
+@interface OSSDDLogMessage : NSObject <NSCopying>
715
+{
716
+    // Direct accessors to be used only for performance
717
+    @public
718
+    NSString *_message;
719
+    OSSDDLogLevel _level;
720
+    OSSDDLogFlag _flag;
721
+    NSInteger _context;
722
+    NSString *_file;
723
+    NSString *_fileName;
724
+    NSString *_function;
725
+    NSUInteger _line;
726
+    id _tag;
727
+    OSSDDLogMessageOptions _options;
728
+    NSDate *_timestamp;
729
+    NSString *_threadID;
730
+    NSString *_threadName;
731
+    NSString *_queueLabel;
732
+}
733
+
734
+/**
735
+ *  Default `init` for empty messages.
736
+ */
737
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
738
+
739
+/**
740
+ * Standard init method for a log message object.
741
+ * Used by the logging primitives. (And the macros use the logging primitives.)
742
+ *
743
+ * If you find need to manually create logMessage objects, there is one thing you should be aware of:
744
+ *
745
+ * If no flags are passed, the method expects the file and function parameters to be string literals.
746
+ * That is, it expects the given strings to exist for the duration of the object's lifetime,
747
+ * and it expects the given strings to be immutable.
748
+ * In other words, it does not copy these strings, it simply points to them.
749
+ * This is due to the fact that __FILE__ and __FUNCTION__ are usually used to specify these parameters,
750
+ * so it makes sense to optimize and skip the unnecessary allocations.
751
+ * However, if you need them to be copied you may use the options parameter to specify this.
752
+ *
753
+ *  @param message   the message
754
+ *  @param level     the log level
755
+ *  @param flag      the log flag
756
+ *  @param context   the context (if any is defined)
757
+ *  @param file      the current file
758
+ *  @param function  the current function
759
+ *  @param line      the current code line
760
+ *  @param tag       potential tag
761
+ *  @param options   a bitmask which supports DDLogMessageCopyFile and DDLogMessageCopyFunction.
762
+ *  @param timestamp the log timestamp
763
+ *
764
+ *  @return a new instance of a log message model object
765
+ */
766
+- (instancetype)initWithMessage:(NSString *)message
767
+                          level:(OSSDDLogLevel)level
768
+                           flag:(OSSDDLogFlag)flag
769
+                        context:(NSInteger)context
770
+                           file:(NSString *)file
771
+                       function:(NSString * __nullable)function
772
+                           line:(NSUInteger)line
773
+                            tag:(id __nullable)tag
774
+                        options:(OSSDDLogMessageOptions)options
775
+                      timestamp:(NSDate * __nullable)timestamp NS_DESIGNATED_INITIALIZER;
776
+
777
+/**
778
+ * Read-only properties
779
+ **/
780
+
781
+/**
782
+ *  The log message
783
+ */
784
+@property (readonly, nonatomic) NSString *message;
785
+@property (readonly, nonatomic) OSSDDLogLevel level;
786
+@property (readonly, nonatomic) OSSDDLogFlag flag;
787
+@property (readonly, nonatomic) NSInteger context;
788
+@property (readonly, nonatomic) NSString *file;
789
+@property (readonly, nonatomic) NSString *fileName;
790
+@property (readonly, nonatomic) NSString * __nullable function;
791
+@property (readonly, nonatomic) NSUInteger line;
792
+@property (readonly, nonatomic) id __nullable tag;
793
+@property (readonly, nonatomic) OSSDDLogMessageOptions options;
794
+@property (readonly, nonatomic) NSDate *timestamp;
795
+@property (readonly, nonatomic) NSString *threadID; // ID as it appears in NSLog calculated from the machThreadID
796
+@property (readonly, nonatomic) NSString *threadName;
797
+@property (readonly, nonatomic) NSString *queueLabel;
798
+
799
+@end
800
+
801
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
802
+#pragma mark -
803
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
804
+
805
+/**
806
+ * The `DDLogger` protocol specifies that an optional formatter can be added to a logger.
807
+ * Most (but not all) loggers will want to support formatters.
808
+ *
809
+ * However, writting getters and setters in a thread safe manner,
810
+ * while still maintaining maximum speed for the logging process, is a difficult task.
811
+ *
812
+ * To do it right, the implementation of the getter/setter has strict requiremenets:
813
+ * - Must NOT require the `logMessage:` method to acquire a lock.
814
+ * - Must NOT require the `logMessage:` method to access an atomic property (also a lock of sorts).
815
+ *
816
+ * To simplify things, an abstract logger is provided that implements the getter and setter.
817
+ *
818
+ * Logger implementations may simply extend this class,
819
+ * and they can ACCESS THE FORMATTER VARIABLE DIRECTLY from within their `logMessage:` method!
820
+ **/
821
+@interface OSSDDAbstractLogger : NSObject <OSSDDLogger>
822
+{
823
+    // Direct accessors to be used only for performance
824
+    @public
825
+    id <OSSDDLogFormatter> _logFormatter;
826
+    dispatch_queue_t _loggerQueue;
827
+}
828
+
829
+@property (nonatomic, strong, nullable) id <OSSDDLogFormatter> logFormatter;
830
+@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE) dispatch_queue_t loggerQueue;
831
+
832
+// For thread-safety assertions
833
+
834
+/**
835
+ *  Return YES if the current logger uses a global queue for logging
836
+ */
837
+@property (nonatomic, readonly, getter=isOnGlobalLoggingQueue)  BOOL onGlobalLoggingQueue;
838
+
839
+/**
840
+ *  Return YES if the current logger uses the internal designated queue for logging
841
+ */
842
+@property (nonatomic, readonly, getter=isOnInternalLoggerQueue) BOOL onInternalLoggerQueue;
843
+
844
+@end
845
+
846
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
847
+#pragma mark -
848
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
849
+
850
+@interface OSSDDLoggerInformation : NSObject
851
+
852
+@property (nonatomic, readonly) id <OSSDDLogger> logger;
853
+@property (nonatomic, readonly) OSSDDLogLevel level;
854
+
855
++ (OSSDDLoggerInformation *)informationWithLogger:(id <OSSDDLogger>)logger
856
+                           andLevel:(OSSDDLogLevel)level;
857
+
858
+@end
859
+
860
+NS_ASSUME_NONNULL_END

+ 12
- 1
Example/ios/AliyunOSSiOS.framework/Headers/OSSDefine.h View File

@@ -11,17 +11,27 @@
11 11
 #ifndef OSSDefine_h
12 12
 #define OSSDefine_h
13 13
 
14
+#if TARGET_OS_IOS
14 15
 #define OSSUAPrefix                             @"aliyun-sdk-ios"
15
-#define OSSSDKVersion                           @"2.6.1"
16
+#elif TARGET_OS_OSX
17
+#define OSSUAPrefix                             @"aliyun-sdk-mac"
18
+#endif
19
+#define OSSSDKVersion                           @"2.10.4"
16 20
 
17 21
 #define OSSListBucketResultXMLTOKEN             @"ListBucketResult"
18 22
 #define OSSNameXMLTOKEN                         @"Name"
19 23
 #define OSSDelimiterXMLTOKEN                    @"Delimiter"
20 24
 #define OSSMarkerXMLTOKEN                       @"Marker"
25
+#define OSSKeyMarkerXMLTOKEN                    @"KeyMarker"
21 26
 #define OSSNextMarkerXMLTOKEN                   @"NextMarker"
27
+#define OSSNextKeyMarkerXMLTOKEN                @"NextKeyMarker"
28
+#define OSSUploadIdMarkerXMLTOKEN               @"UploadIdMarker"
29
+#define OSSNextUploadIdMarkerXMLTOKEN           @"NextUploadIdMarker"
22 30
 #define OSSMaxKeysXMLTOKEN                      @"MaxKeys"
31
+#define OSSMaxUploadsXMLTOKEN                   @"MaxUploads"
23 32
 #define OSSIsTruncatedXMLTOKEN                  @"IsTruncated"
24 33
 #define OSSContentsXMLTOKEN                     @"Contents"
34
+#define OSSUploadXMLTOKEN                       @"Upload"
25 35
 #define OSSKeyXMLTOKEN                          @"Key"
26 36
 #define OSSLastModifiedXMLTOKEN                 @"LastModified"
27 37
 #define OSSETagXMLTOKEN                         @"ETag"
@@ -58,6 +68,7 @@
58 68
 #define OSSHttpHeaderContentMD5                 @"Content-MD5"
59 69
 #define OSSHttpHeaderCacheControl               @"Cache-Control"
60 70
 #define OSSHttpHeaderExpires                    @"Expires"
71
+#define OSSHttpHeaderHashSHA1                   @"x-oss-hash-sha1"
61 72
 
62 73
 #define OSSDefaultRetryCount                    3
63 74
 #define OSSDefaultMaxConcurrentNum              5

+ 31
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsRequest.h View File

@@ -0,0 +1,31 @@
1
+//
2
+//  OSSDeleteMultipleObjectsRequest.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+#import <Foundation/Foundation.h>
9
+#import "OSSRequest.h"
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+
13
+@interface OSSDeleteMultipleObjectsRequest : OSSRequest
14
+
15
+@property (nonatomic, copy) NSString *bucketName;
16
+
17
+@property (nonatomic, copy) NSArray<NSString *> *keys;
18
+
19
+/**
20
+ invalid value is @"url"
21
+ */
22
+@property (nonatomic, copy, nullable) NSString *encodingType;
23
+
24
+/**
25
+ whether to show verbose result,the default value is YES.
26
+ */
27
+@property (nonatomic, assign) BOOL quiet;
28
+
29
+@end
30
+
31
+NS_ASSUME_NONNULL_END

+ 17
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsResult.h View File

@@ -0,0 +1,17 @@
1
+//
2
+//  OSSDeleteMultipleObjectsResult.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import "OSSResult.h"
10
+
11
+@interface OSSDeleteMultipleObjectsResult : OSSResult
12
+
13
+@property (nonatomic, copy) NSArray<NSString *> *deletedObjects;
14
+
15
+@property (nonatomic, copy) NSString *encodingType;
16
+
17
+@end

+ 2
- 2
Example/ios/AliyunOSSiOS.framework/Headers/OSSExecutor.h View File

@@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
37 37
  Returns a new executor that uses the given block to execute continuations.
38 38
  @param block The block to use.
39 39
  */
40
-+ (instancetype)executorWithBlock:(void(^)(void(^block)()))block;
40
++ (instancetype)executorWithBlock:(void(^)(void(^block)(void)))block;
41 41
 
42 42
 /*!
43 43
  Returns a new executor that runs continuations on the given queue.
@@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
55 55
  Runs the given block using this executor's particular strategy.
56 56
  @param block The block to execute.
57 57
  */
58
-- (void)execute:(void(^)())block;
58
+- (void)execute:(void(^)(void))block;
59 59
 
60 60
 @end
61 61
 

+ 509
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSFileLogger.h View File

@@ -0,0 +1,509 @@
1
+// Software License Agreement (BSD License)
2
+//
3
+// Copyright (c) 2010-2016, Deusty, LLC
4
+// All rights reserved.
5
+//
6
+// Redistribution and use of this software in source and binary forms,
7
+// with or without modification, are permitted provided that the following conditions are met:
8
+//
9
+// * Redistributions of source code must retain the above copyright notice,
10
+//   this list of conditions and the following disclaimer.
11
+//
12
+// * Neither the name of Deusty nor the names of its contributors may be used
13
+//   to endorse or promote products derived from this software without specific
14
+//   prior written permission of Deusty, LLC.
15
+
16
+// Disable legacy macros
17
+#ifndef DD_LEGACY_MACROS
18
+    #define DD_LEGACY_MACROS 0
19
+#endif
20
+
21
+#import "OSSDDLog.h"
22
+
23
+@class OSSDDLogFileInfo;
24
+
25
+/**
26
+ * This class provides a logger to write log statements to a file.
27
+ **/
28
+
29
+
30
+// Default configuration and safety/sanity values.
31
+//
32
+// maximumFileSize         -> kDDDefaultLogMaxFileSize
33
+// rollingFrequency        -> kDDDefaultLogRollingFrequency
34
+// maximumNumberOfLogFiles -> kDDDefaultLogMaxNumLogFiles
35
+// logFilesDiskQuota       -> kDDDefaultLogFilesDiskQuota
36
+//
37
+// You should carefully consider the proper configuration values for your application.
38
+
39
+extern unsigned long long const osskDDDefaultLogMaxFileSize;
40
+extern NSTimeInterval     const osskDDDefaultLogRollingFrequency;
41
+extern NSUInteger         const osskDDDefaultLogMaxNumLogFiles;
42
+extern unsigned long long const osskDDDefaultLogFilesDiskQuota;
43
+
44
+
45
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
46
+#pragma mark -
47
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
48
+
49
+/**
50
+ *  The LogFileManager protocol is designed to allow you to control all aspects of your log files.
51
+ *
52
+ *  The primary purpose of this is to allow you to do something with the log files after they have been rolled.
53
+ *  Perhaps you want to compress them to save disk space.
54
+ *  Perhaps you want to upload them to an FTP server.
55
+ *  Perhaps you want to run some analytics on the file.
56
+ *
57
+ *  A default LogFileManager is, of course, provided.
58
+ *  The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property.
59
+ *
60
+ *  This protocol provides various methods to fetch the list of log files.
61
+ *
62
+ *  There are two variants: sorted and unsorted.
63
+ *  If sorting is not necessary, the unsorted variant is obviously faster.
64
+ *  The sorted variant will return an array sorted by when the log files were created,
65
+ *  with the most recently created log file at index 0, and the oldest log file at the end of the array.
66
+ *
67
+ *  You can fetch only the log file paths (full path including name), log file names (name only),
68
+ *  or an array of `DDLogFileInfo` objects.
69
+ *  The `DDLogFileInfo` class is documented below, and provides a handy wrapper that
70
+ *  gives you easy access to various file attributes such as the creation date or the file size.
71
+ */
72
+@protocol OSSDDLogFileManager <NSObject>
73
+@required
74
+
75
+// Public properties
76
+
77
+/**
78
+ * The maximum number of archived log files to keep on disk.
79
+ * For example, if this property is set to 3,
80
+ * then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk.
81
+ * Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted.
82
+ *
83
+ * You may optionally disable this option by setting it to zero.
84
+ **/
85
+@property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles;
86
+
87
+/**
88
+ * The maximum space that logs can take. On rolling logfile all old logfiles that exceed logFilesDiskQuota will
89
+ * be deleted.
90
+ *
91
+ * You may optionally disable this option by setting it to zero.
92
+ **/
93
+@property (readwrite, assign, atomic) unsigned long long logFilesDiskQuota;
94
+
95
+// Public methods
96
+
97
+/**
98
+ *  Returns the logs directory (path)
99
+ */
100
+@property (nonatomic, readonly, copy) NSString *logsDirectory;
101
+
102
+/**
103
+ * Returns an array of `NSString` objects,
104
+ * each of which is the filePath to an existing log file on disk.
105
+ **/
106
+@property (nonatomic, readonly, strong) NSArray<NSString *> *unsortedLogFilePaths;
107
+
108
+/**
109
+ * Returns an array of `NSString` objects,
110
+ * each of which is the fileName of an existing log file on disk.
111
+ **/
112
+@property (nonatomic, readonly, strong) NSArray<NSString *> *unsortedLogFileNames;
113
+
114
+/**
115
+ * Returns an array of `DDLogFileInfo` objects,
116
+ * each representing an existing log file on disk,
117
+ * and containing important information about the log file such as it's modification date and size.
118
+ **/
119
+@property (nonatomic, readonly, strong) NSArray<OSSDDLogFileInfo *> *unsortedLogFileInfos;
120
+
121
+/**
122
+ * Just like the `unsortedLogFilePaths` method, but sorts the array.
123
+ * The items in the array are sorted by creation date.
124
+ * The first item in the array will be the most recently created log file.
125
+ **/
126
+@property (nonatomic, readonly, strong) NSArray<NSString *> *sortedLogFilePaths;
127
+
128
+/**
129
+ * Just like the `unsortedLogFileNames` method, but sorts the array.
130
+ * The items in the array are sorted by creation date.
131
+ * The first item in the array will be the most recently created log file.
132
+ **/
133
+@property (nonatomic, readonly, strong) NSArray<NSString *> *sortedLogFileNames;
134
+
135
+/**
136
+ * Just like the `unsortedLogFileInfos` method, but sorts the array.
137
+ * The items in the array are sorted by creation date.
138
+ * The first item in the array will be the most recently created log file.
139
+ **/
140
+@property (nonatomic, readonly, strong) NSArray<OSSDDLogFileInfo *> *sortedLogFileInfos;
141
+
142
+// Private methods (only to be used by DDFileLogger)
143
+
144
+/**
145
+ * Generates a new unique log file path, and creates the corresponding log file.
146
+ **/
147
+- (NSString *)createNewLogFile;
148
+
149
+@optional
150
+
151
+// Notifications from DDFileLogger
152
+
153
+/**
154
+ *  Called when a log file was archieved
155
+ */
156
+- (void)didArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didArchiveLogFile(atPath:));
157
+
158
+/**
159
+ *  Called when the roll action was executed and the log was archieved
160
+ */
161
+- (void)didRollAndArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didRollAndArchiveLogFile(atPath:));
162
+
163
+@end
164
+
165
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
166
+#pragma mark -
167
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
168
+
169
+/**
170
+ * Default log file manager.
171
+ *
172
+ * All log files are placed inside the logsDirectory.
173
+ * If a specific logsDirectory isn't specified, the default directory is used.
174
+ * On Mac, this is in `~/Library/Logs/<Application Name>`.
175
+ * On iPhone, this is in `~/Library/Caches/Logs`.
176
+ *
177
+ * Log files are named `"<bundle identifier> <date> <time>.log"`
178
+ * Example: `com.organization.myapp 2013-12-03 17-14.log`
179
+ *
180
+ * Archived log files are automatically deleted according to the `maximumNumberOfLogFiles` property.
181
+ **/
182
+@interface OSSDDLogFileManagerDefault : NSObject <OSSDDLogFileManager>
183
+
184
+/**
185
+ *  Default initializer
186
+ */
187
+- (instancetype)init;
188
+
189
+/**
190
+ *  Designated initialized, requires the logs directory
191
+ */
192
+- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory NS_DESIGNATED_INITIALIZER;
193
+
194
+#if TARGET_OS_IPHONE
195
+/*
196
+ * Calling this constructor you can override the default "automagically" chosen NSFileProtection level.
197
+ * Useful if you are writing a command line utility / CydiaSubstrate addon for iOS that has no NSBundle
198
+ * or like SpringBoard no BackgroundModes key in the NSBundle:
199
+ *    iPhone:~ root# cycript -p SpringBoard
200
+ *    cy# [NSBundle mainBundle]
201
+ *    #"NSBundle </System/Library/CoreServices/SpringBoard.app> (loaded)"
202
+ *    cy# [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
203
+ *    null
204
+ *    cy#
205
+ **/
206
+- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory defaultFileProtectionLevel:(NSFileProtectionType)fileProtectionLevel;
207
+#endif
208
+
209
+/*
210
+ * Methods to override.
211
+ *
212
+ * Log files are named `"<bundle identifier> <date> <time>.log"`
213
+ * Example: `com.organization.myapp 2013-12-03 17-14.log`
214
+ *
215
+ * If you wish to change default filename, you can override following two methods.
216
+ * - `newLogFileName` method would be called on new logfile creation.
217
+ * - `isLogFile:` method would be called to filter logfiles from all other files in logsDirectory.
218
+ *   You have to parse given filename and return YES if it is logFile.
219
+ *
220
+ * **NOTE**
221
+ * `newLogFileName` returns filename. If appropriate file already exists, number would be added
222
+ * to filename before extension. You have to handle this case in isLogFile: method.
223
+ *
224
+ * Example:
225
+ * - newLogFileName returns `"com.organization.myapp 2013-12-03.log"`,
226
+ *   file `"com.organization.myapp 2013-12-03.log"` would be created.
227
+ * - after some time `"com.organization.myapp 2013-12-03.log"` is archived
228
+ * - newLogFileName again returns `"com.organization.myapp 2013-12-03.log"`,
229
+ *   file `"com.organization.myapp 2013-12-03 2.log"` would be created.
230
+ * - after some time `"com.organization.myapp 2013-12-03 1.log"` is archived
231
+ * - newLogFileName again returns `"com.organization.myapp 2013-12-03.log"`,
232
+ *   file `"com.organization.myapp 2013-12-03 3.log"` would be created.
233
+ **/
234
+
235
+/**
236
+ * Generates log file name with default format `"<bundle identifier> <date> <time>.log"`
237
+ * Example: `MobileSafari 2013-12-03 17-14.log`
238
+ *
239
+ * You can change it by overriding `newLogFileName` and `isLogFile:` methods.
240
+ **/
241
+@property (readonly, copy) NSString *newLogFileName;
242
+
243
+/**
244
+ * Default log file name is `"<bundle identifier> <date> <time>.log"`.
245
+ * Example: `MobileSafari 2013-12-03 17-14.log`
246
+ *
247
+ * You can change it by overriding `newLogFileName` and `isLogFile:` methods.
248
+ **/
249
+- (BOOL)isLogFile:(NSString *)fileName NS_SWIFT_NAME(isLogFile(withName:));
250
+
251
+/* Inherited from DDLogFileManager protocol:
252
+
253
+   @property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles;
254
+   @property (readwrite, assign, atomic) NSUInteger logFilesDiskQuota;
255
+
256
+   - (NSString *)logsDirectory;
257
+
258
+   - (NSArray *)unsortedLogFilePaths;
259
+   - (NSArray *)unsortedLogFileNames;
260
+   - (NSArray *)unsortedLogFileInfos;
261
+
262
+   - (NSArray *)sortedLogFilePaths;
263
+   - (NSArray *)sortedLogFileNames;
264
+   - (NSArray *)sortedLogFileInfos;
265
+
266
+ */
267
+
268
+@end
269
+
270
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
271
+#pragma mark -
272
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
273
+
274
+/**
275
+ * Most users will want file log messages to be prepended with the date and time.
276
+ * Rather than forcing the majority of users to write their own formatter,
277
+ * we will supply a logical default formatter.
278
+ * Users can easily replace this formatter with their own by invoking the `setLogFormatter:` method.
279
+ * It can also be removed by calling `setLogFormatter:`, and passing a nil parameter.
280
+ *
281
+ * In addition to the convenience of having a logical default formatter,
282
+ * it will also provide a template that makes it easy for developers to copy and change.
283
+ **/
284
+@interface OSSDDLogFileFormatterDefault : NSObject <OSSDDLogFormatter>
285
+
286
+/**
287
+ *  Default initializer
288
+ */
289
+- (instancetype)init;
290
+
291
+/**
292
+ *  Designated initializer, requires a date formatter
293
+ */
294
+- (instancetype)initWithDateFormatter:(NSDateFormatter *)dateFormatter NS_DESIGNATED_INITIALIZER;
295
+
296
+@end
297
+
298
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
299
+#pragma mark -
300
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
301
+
302
+/**
303
+ *  The standard implementation for a file logger
304
+ */
305
+@interface OSSDDFileLogger : OSSDDAbstractLogger <OSSDDLogger> {
306
+	OSSDDLogFileInfo *_currentLogFileInfo;
307
+}
308
+
309
+/**
310
+ *  Default initializer
311
+ */
312
+- (instancetype)init;
313
+
314
+/**
315
+ *  Designated initializer, requires a `DDLogFileManager` instance
316
+ */
317
+- (instancetype)initWithLogFileManager:(id <OSSDDLogFileManager>)logFileManager NS_DESIGNATED_INITIALIZER;
318
+
319
+/**
320
+ *  Called when the logger is about to write message. Call super before your implementation.
321
+ */
322
+- (void)willLogMessage NS_REQUIRES_SUPER;
323
+
324
+/**
325
+ *  Called when the logger wrote message. Call super after your implementation.
326
+ */
327
+- (void)didLogMessage NS_REQUIRES_SUPER;
328
+
329
+/**
330
+ *  Called when the logger checks archive or not current log file. 
331
+ *  Override this method to exdend standart behavior. By default returns NO.
332
+ */
333
+- (BOOL)shouldArchiveRecentLogFileInfo:(OSSDDLogFileInfo *)recentLogFileInfo;
334
+
335
+/**
336
+ * Log File Rolling:
337
+ *
338
+ * `maximumFileSize`:
339
+ *   The approximate maximum size (in bytes) to allow log files to grow.
340
+ *   If a log file is larger than this value after a log statement is appended,
341
+ *   then the log file is rolled.
342
+ *
343
+ * `rollingFrequency`
344
+ *   How often to roll the log file.
345
+ *   The frequency is given as an `NSTimeInterval`, which is a double that specifies the interval in seconds.
346
+ *   Once the log file gets to be this old, it is rolled.
347
+ *
348
+ * `doNotReuseLogFiles`
349
+ *   When set, will always create a new log file at application launch.
350
+ *
351
+ * Both the `maximumFileSize` and the `rollingFrequency` are used to manage rolling.
352
+ * Whichever occurs first will cause the log file to be rolled.
353
+ *
354
+ * For example:
355
+ * The `rollingFrequency` is 24 hours,
356
+ * but the log file surpasses the `maximumFileSize` after only 20 hours.
357
+ * The log file will be rolled at that 20 hour mark.
358
+ * A new log file will be created, and the 24 hour timer will be restarted.
359
+ *
360
+ * You may optionally disable rolling due to filesize by setting `maximumFileSize` to zero.
361
+ * If you do so, rolling is based solely on `rollingFrequency`.
362
+ *
363
+ * You may optionally disable rolling due to time by setting `rollingFrequency` to zero (or any non-positive number).
364
+ * If you do so, rolling is based solely on `maximumFileSize`.
365
+ *
366
+ * If you disable both `maximumFileSize` and `rollingFrequency`, then the log file won't ever be rolled.
367
+ * This is strongly discouraged.
368
+ **/
369
+@property (readwrite, assign) unsigned long long maximumFileSize;
370
+
371
+/**
372
+ *  See description for `maximumFileSize`
373
+ */
374
+@property (readwrite, assign) NSTimeInterval rollingFrequency;
375
+
376
+/**
377
+ *  See description for `maximumFileSize`
378
+ */
379
+@property (readwrite, assign, atomic) BOOL doNotReuseLogFiles;
380
+
381
+/**
382
+ * The DDLogFileManager instance can be used to retrieve the list of log files,
383
+ * and configure the maximum number of archived log files to keep.
384
+ *
385
+ * @see DDLogFileManager.maximumNumberOfLogFiles
386
+ **/
387
+@property (strong, nonatomic, readonly) id <OSSDDLogFileManager> logFileManager;
388
+
389
+/**
390
+ * When using a custom formatter you can set the `logMessage` method not to append
391
+ * `\n` character after each output. This allows for some greater flexibility with
392
+ * custom formatters. Default value is YES.
393
+ **/
394
+@property (nonatomic, readwrite, assign) BOOL automaticallyAppendNewlineForCustomFormatters;
395
+
396
+/**
397
+ *  You can optionally force the current log file to be rolled with this method.
398
+ *  CompletionBlock will be called on main queue.
399
+ */
400
+- (void)rollLogFileWithCompletionBlock:(void (^)(void))completionBlock NS_SWIFT_NAME(rollLogFile(withCompletion:));
401
+
402
+/**
403
+ *  Method is deprecated.
404
+ *  @deprecated Use `rollLogFileWithCompletionBlock:` method instead.
405
+ */
406
+- (void)rollLogFile __attribute((deprecated));
407
+
408
+// Inherited from DDAbstractLogger
409
+
410
+// - (id <DDLogFormatter>)logFormatter;
411
+// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
412
+
413
+/**
414
+ * Returns the log file that should be used.
415
+ * If there is an existing log file that is suitable,
416
+ * within the constraints of `maximumFileSize` and `rollingFrequency`, then it is returned.
417
+ *
418
+ * Otherwise a new file is created and returned.
419
+ **/
420
+@property (nonatomic, readonly, strong) OSSDDLogFileInfo *currentLogFileInfo;
421
+
422
+@end
423
+
424
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
425
+#pragma mark -
426
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
427
+
428
+/**
429
+ * `DDLogFileInfo` is a simple class that provides access to various file attributes.
430
+ * It provides good performance as it only fetches the information if requested,
431
+ * and it caches the information to prevent duplicate fetches.
432
+ *
433
+ * It was designed to provide quick snapshots of the current state of log files,
434
+ * and to help sort log files in an array.
435
+ *
436
+ * This class does not monitor the files, or update it's cached attribute values if the file changes on disk.
437
+ * This is not what the class was designed for.
438
+ *
439
+ * If you absolutely must get updated values,
440
+ * you can invoke the reset method which will clear the cache.
441
+ **/
442
+@interface OSSDDLogFileInfo : NSObject
443
+
444
+@property (strong, nonatomic, readonly) NSString *filePath;
445
+@property (strong, nonatomic, readonly) NSString *fileName;
446
+
447
+#if FOUNDATION_SWIFT_SDK_EPOCH_AT_LEAST(8)
448
+@property (strong, nonatomic, readonly) NSDictionary<NSFileAttributeKey, id> *fileAttributes;
449
+#else
450
+@property (strong, nonatomic, readonly) NSDictionary<NSString *, id> *fileAttributes;
451
+#endif
452
+
453
+@property (strong, nonatomic, readonly) NSDate *creationDate;
454
+@property (strong, nonatomic, readonly) NSDate *modificationDate;
455
+
456
+@property (nonatomic, readonly) unsigned long long fileSize;
457
+
458
+@property (nonatomic, readonly) NSTimeInterval age;
459
+
460
+@property (nonatomic, readwrite) BOOL isArchived;
461
+
462
++ (instancetype)logFileWithPath:(NSString *)filePath NS_SWIFT_UNAVAILABLE("Use init(filePath:)");
463
+
464
+- (instancetype)init NS_UNAVAILABLE;
465
+- (instancetype)initWithFilePath:(NSString *)filePath NS_DESIGNATED_INITIALIZER;
466
+
467
+- (void)reset;
468
+- (void)renameFile:(NSString *)newFileName NS_SWIFT_NAME(renameFile(to:));
469
+
470
+#if TARGET_IPHONE_SIMULATOR
471
+
472
+// So here's the situation.
473
+// Extended attributes are perfect for what we're trying to do here (marking files as archived).
474
+// This is exactly what extended attributes were designed for.
475
+//
476
+// But Apple screws us over on the simulator.
477
+// Everytime you build-and-go, they copy the application into a new folder on the hard drive,
478
+// and as part of the process they strip extended attributes from our log files.
479
+// Normally, a copy of a file preserves extended attributes.
480
+// So obviously Apple has gone to great lengths to piss us off.
481
+//
482
+// Thus we use a slightly different tactic for marking log files as archived in the simulator.
483
+// That way it "just works" and there's no confusion when testing.
484
+//
485
+// The difference in method names is indicative of the difference in functionality.
486
+// On the simulator we add an attribute by appending a filename extension.
487
+//
488
+// For example:
489
+// "mylog.txt" -> "mylog.archived.txt"
490
+// "mylog"     -> "mylog.archived"
491
+
492
+- (BOOL)hasExtensionAttributeWithName:(NSString *)attrName;
493
+
494
+- (void)addExtensionAttributeWithName:(NSString *)attrName;
495
+- (void)removeExtensionAttributeWithName:(NSString *)attrName;
496
+
497
+#else /* if TARGET_IPHONE_SIMULATOR */
498
+
499
+// Normal use of extended attributes used everywhere else,
500
+// such as on Macs and on iPhone devices.
501
+
502
+- (BOOL)hasExtendedAttributeWithName:(NSString *)attrName;
503
+
504
+- (void)addExtendedAttributeWithName:(NSString *)attrName;
505
+- (void)removeExtendedAttributeWithName:(NSString *)attrName;
506
+
507
+#endif /* if TARGET_IPHONE_SIMULATOR */
508
+
509
+@end

+ 26
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSGetObjectACLRequest.h View File

@@ -0,0 +1,26 @@
1
+//
2
+//  OSSGetObjectACLRequest.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import "OSSRequest.h"
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+@interface OSSGetObjectACLRequest : OSSRequest
13
+
14
+/**
15
+ the bucket's name which object stored
16
+ */
17
+@property (nonatomic, copy) NSString *bucketName;
18
+
19
+/**
20
+ the name of object
21
+ */
22
+@property (nonatomic, copy) NSString *objectName;
23
+
24
+
25
+@end
26
+NS_ASSUME_NONNULL_END

+ 19
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSGetObjectACLResult.h View File

@@ -0,0 +1,19 @@
1
+//
2
+//  OSSGetObjectACLResult.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import "OSSResult.h"
10
+
11
+@interface OSSGetObjectACLResult : OSSResult
12
+
13
+/**
14
+ the ACL of object,valid values: @"private",@"public-read",@"public-read-write".
15
+ if object's ACL inherit from bucket,it will return @"default".
16
+ */
17
+@property (nonatomic, copy) NSString *grant;
18
+
19
+@end

+ 39
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSHttpResponseParser.h View File

@@ -0,0 +1,39 @@
1
+//
2
+//  OSSHttpResponseParser.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+#import "OSSTask.h"
12
+
13
+NS_ASSUME_NONNULL_BEGIN
14
+
15
+/**
16
+ HTTP response parser
17
+ */
18
+@interface OSSHttpResponseParser : NSObject
19
+
20
+@property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveBlock;
21
+
22
+@property (nonatomic, strong) NSURL *downloadingFileURL;
23
+
24
+/**
25
+ *  A Boolean value that determines whether verfifying crc64.
26
+ When set to YES, it will verify crc64 when transmission is completed normally.
27
+ The default value of this property is NO.
28
+ */
29
+@property (nonatomic, assign) BOOL crc64Verifiable;
30
+
31
+- (instancetype)initForOperationType:(OSSOperationType)operationType;
32
+- (void)consumeHttpResponse:(NSHTTPURLResponse *)response;
33
+- (OSSTask *)consumeHttpResponseBody:(NSData *)data;
34
+- (nullable id)constructResultObject;
35
+- (void)reset;
36
+
37
+@end
38
+
39
+NS_ASSUME_NONNULL_END

+ 16
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSHttpdns.h View File

@@ -0,0 +1,16 @@
1
+//
2
+//  OSSHttpdns.h
3
+//  AliyunOSSiOS
4
+//
5
+//  Created by zhouzhuo on 5/1/16.
6
+//  Copyright © 2016 zhouzhuo. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@interface OSSHttpdns : NSObject
12
+
13
++ (instancetype)sharedInstance;
14
+
15
+- (NSString *)asynGetIpByHost:(NSString *)host;
16
+@end

+ 113
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSIPv6Adapter.h View File

@@ -0,0 +1,113 @@
1
+/*
2
+ * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
3
+ *
4
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. The rights granted to you under the License
10
+ * may not be used to create, or enable the creation or redistribution of,
11
+ * unlawful or unlicensed copies of an Apple operating system, or to
12
+ * circumvent, violate, or enable the circumvention or violation of, any
13
+ * terms of an Apple operating system software license agreement.
14
+ *
15
+ * Please obtain a copy of the License at
16
+ * https://www.opensource.apple.com/apsl/ and read it before using this file.
17
+ *
18
+ * The Original Code and all software distributed under the License are
19
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23
+ * Please see the License for the specific language governing rights and
24
+ * limitations under the License.
25
+ *
26
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
+ */
28
+/*
29
+ * Copyright (c) 1980, 1986, 1993
30
+ *	The Regents of the University of California.  All rights reserved.
31
+ *
32
+ * Redistribution and use in source and binary forms, with or without
33
+ * modification, are permitted provided that the following conditions
34
+ * are met:
35
+ * 1. Redistributions of source code must retain the above copyright
36
+ *    notice, this list of conditions and the following disclaimer.
37
+ * 2. Redistributions in binary form must reproduce the above copyright
38
+ *    notice, this list of conditions and the following disclaimer in the
39
+ *    documentation and/or other materials provided with the distribution.
40
+ * 3. All advertising materials mentioning features or use of this software
41
+ *    must display the following acknowledgement:
42
+ *	This product includes software developed by the University of
43
+ *	California, Berkeley and its contributors.
44
+ * 4. Neither the name of the University nor the names of its contributors
45
+ *    may be used to endorse or promote products derived from this software
46
+ *    without specific prior written permission.
47
+ *
48
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58
+ * SUCH DAMAGE.
59
+ *
60
+ *	@(#)route.h	8.3 (Berkeley) 4/19/94
61
+ * $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $
62
+ */
63
+
64
+
65
+#ifndef AlicloudIPv6Adapter_h
66
+#define AlicloudIPv6Adapter_h
67
+#import <Foundation/Foundation.h>
68
+
69
+@interface OSSIPv6Adapter : NSObject
70
+
71
++ (instancetype)getInstance;
72
+
73
+/**
74
+ *	@brief	Checks if it's a IPv6-only network. If it's true, it's IPv6-only.
75
+ *
76
+ *	@return return YES for IPv6-only network,otherWise return NO
77
+ */
78
+- (BOOL)isIPv6OnlyNetwork;
79
+
80
+/**
81
+ *	@brief	Refresh the IPV6-only check
82
+ *
83
+ *	@return return YES for IPv6-only network,otherWise return NO
84
+ */
85
+- (BOOL)reResolveIPv6OnlyStatus;
86
+
87
+/**
88
+ *	@brief	Adapts the IPv4 address into IPv6 format under IPv6-only network.
89
+ *          For example:
90
+                42.156.220.114 -> 64:ff9b::2a9c:dc72
91
+ *	@param 	addr
92
+ *
93
+ *	@return return an IPv6 address
94
+ */
95
+- (NSString *)handleIpv4Address:(NSString *)addr;
96
+
97
+/**
98
+ *	@brief	Checks if it's an IPv4 address.
99
+ *
100
+ *	@return return YES while addr is an IPv4 address,otherwise return NO
101
+ */
102
+- (BOOL)isIPv4Address:(NSString *)addr;
103
+
104
+/**
105
+ *	@brief	Checks if it's an IPv6 address
106
+ *
107
+ *	@return return YES while addr is an IPv6 address,otherwise return NO
108
+ */
109
+- (BOOL)isIPv6Address:(NSString *)addr;
110
+
111
+@end
112
+
113
+#endif /* OSSIPv6Adapter_h */

+ 23
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSIPv6PrefixResolver.h View File

@@ -0,0 +1,23 @@
1
+//
2
+//  OSSIPv6PrefixResolver.h
3
+//
4
+//  Created by lingkun on 16/5/16.
5
+//  Edit by zhouzhuo on 16/5/22
6
+//  Copyright © 2016 Ali. All rights reserved.
7
+//
8
+
9
+#ifndef AlicloudIPv6PrefixResolver_h
10
+#define AlicloudIPv6PrefixResolver_h
11
+#import <Foundation/Foundation.h>
12
+
13
+@interface OSSIPv6PrefixResolver : NSObject
14
+
15
++ (instancetype)getInstance;
16
+
17
+- (void)updateIPv6Prefix;
18
+
19
+- (NSString *)convertIPv4toIPv6:(NSString *)ipv4;
20
+
21
+@end
22
+
23
+#endif /* OSSIPv6PrefixResolver_h */

+ 16
- 2
Example/ios/AliyunOSSiOS.framework/Headers/OSSLog.h View File

@@ -7,6 +7,8 @@
7 7
 //
8 8
 
9 9
 #import <Foundation/Foundation.h>
10
+#import "OSSCocoaLumberjack.h"
11
+static const OSSDDLogLevel ossLogLevel = OSSDDLogLevelAll;
10 12
 
11 13
 // colorful log configuration
12 14
 // see https://github.com/robbiehanson/XcodeColors
@@ -19,21 +21,33 @@
19 21
 
20 22
 #define OSSLogVerbose(frmt, ...)\
21 23
 if ([OSSLog isLogEnable]) {\
22
-NSLog(@"[Verbose]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
24
+OSSDDLogVerbose(@"[Verbose]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
23 25
 }
24 26
 
25 27
 #define OSSLogDebug(frmt, ...)\
26 28
 if ([OSSLog isLogEnable]) {\
29
+OSSDDLogDebug(@"[Debug]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
30
+}
31
+
32
+#define OSSLogDebugNoFile(frmt, ...)\
33
+if ([OSSLog isLogEnable]) {\
27 34
 NSLog(@"[Debug]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
28 35
 }
29 36
 
30 37
 #define OSSLogError(frmt, ...)\
31 38
 if ([OSSLog isLogEnable]) {\
32
-NSLog(@"[Error]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
39
+OSSDDLogError(@"[Error]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
40
+}
41
+
42
+#define OSSLogWarn(frmt, ...)\
43
+if ([OSSLog isLogEnable]) {\
44
+OSSDDLogWarn(@"[Warning]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
33 45
 }
46
+
34 47
 static BOOL isEnable;
35 48
 
36 49
 @interface OSSLog : NSObject
50
+
37 51
 + (void)enableLog;
38 52
 + (void)disableLog;
39 53
 + (BOOL)isLogEnable;

+ 82
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSLogMacros.h View File

@@ -0,0 +1,82 @@
1
+// Software License Agreement (BSD License)
2
+//
3
+// Copyright (c) 2010-2016, Deusty, LLC
4
+// All rights reserved.
5
+//
6
+// Redistribution and use of this software in source and binary forms,
7
+// with or without modification, are permitted provided that the following conditions are met:
8
+//
9
+// * Redistributions of source code must retain the above copyright notice,
10
+//   this list of conditions and the following disclaimer.
11
+//
12
+// * Neither the name of Deusty nor the names of its contributors may be used
13
+//   to endorse or promote products derived from this software without specific
14
+//   prior written permission of Deusty, LLC.
15
+
16
+// Disable legacy macros
17
+#ifndef OSSDD_LEGACY_MACROS
18
+    #define OSSDD_LEGACY_MACROS 0
19
+#endif
20
+
21
+#import "OSSDDLog.h"
22
+
23
+/**
24
+ * The constant/variable/method responsible for controlling the current log level.
25
+ **/
26
+#ifndef OSSLOG_LEVEL_DEF
27
+    #define OSSLOG_LEVEL_DEF ossLogLevel
28
+#endif
29
+
30
+/**
31
+ * Whether async should be used by log messages, excluding error messages that are always sent sync.
32
+ **/
33
+#ifndef OSSLOG_ASYNC_ENABLED
34
+    #define OSSLOG_ASYNC_ENABLED YES
35
+#endif
36
+
37
+/**
38
+ * These are the two macros that all other macros below compile into.
39
+ * These big multiline macros makes all the other macros easier to read.
40
+ **/
41
+#define OSSLOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \
42
+        [OSSDDLog log : isAsynchronous                                     \
43
+             level : lvl                                                \
44
+              flag : flg                                                \
45
+           context : ctx                                                \
46
+              file : __FILE__                                           \
47
+          function : fnct                                               \
48
+              line : __LINE__                                           \
49
+               tag : atag                                               \
50
+            format : (frmt), ## __VA_ARGS__]
51
+
52
+/**
53
+ * Define version of the macro that only execute if the log level is above the threshold.
54
+ * The compiled versions essentially look like this:
55
+ *
56
+ * if (logFlagForThisLogMsg & ddLogLevel) { execute log message }
57
+ *
58
+ * When LOG_LEVEL_DEF is defined as ddLogLevel.
59
+ *
60
+ * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels.
61
+ * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques.
62
+ *
63
+ * Note that when compiler optimizations are enabled (as they are for your release builds),
64
+ * the log messages above your logging threshold will automatically be compiled out.
65
+ *
66
+ * (If the compiler sees LOG_LEVEL_DEF/ddLogLevel declared as a constant, the compiler simply checks to see
67
+ *  if the 'if' statement would execute, and if not it strips it from the binary.)
68
+ *
69
+ * We also define shorthand versions for asynchronous and synchronous logging.
70
+ **/
71
+#define OSSLOG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, ...) \
72
+        do { if(lvl & flg) OSSLOG_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0)
73
+
74
+/**
75
+ * Ready to use log macros with no context or tag.
76
+ **/
77
+#define OSSDDLogError(frmt, ...)   OSSLOG_MAYBE(NO,                OSSLOG_LEVEL_DEF, OSSDDLogFlagError,   0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
78
+#define OSSDDLogWarn(frmt, ...)    OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
79
+#define OSSDDLogInfo(frmt, ...)    OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagInfo,    0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
80
+#define OSSDDLogDebug(frmt, ...)   OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagDebug,   0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
81
+#define OSSDDLogVerbose(frmt, ...) OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
82
+

+ 666
- 476
Example/ios/AliyunOSSiOS.framework/Headers/OSSModel.h
File diff suppressed because it is too large
View File


+ 14
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSNSLogger.h View File

@@ -0,0 +1,14 @@
1
+//
2
+//  OSSNSLogger.h
3
+//  AliyunOSSiOS
4
+//
5
+//  Created by jingdan on 2017/10/24.
6
+//  Copyright © 2017年 zhouzhuo. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSDDLog.h"
11
+
12
+@interface OSSNSLogger : OSSDDAbstractLogger <OSSDDLogger>
13
+@property (class, readonly, strong) OSSNSLogger *sharedInstance;
14
+@end

+ 3
- 100
Example/ios/AliyunOSSiOS.framework/Headers/OSSNetworking.h View File

@@ -13,36 +13,10 @@
13 13
 @class OSSNetworkingRequestDelegate;
14 14
 @class OSSExecutor;
15 15
 
16
-/**
17
- 定义重试类型
18
- */
19
-typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) {
20
-    OSSNetworkingRetryTypeUnknown,
21
-    OSSNetworkingRetryTypeShouldRetry,
22
-    OSSNetworkingRetryTypeShouldNotRetry,
23
-    OSSNetworkingRetryTypeShouldRefreshCredentialsAndRetry,
24
-    OSSNetworkingRetryTypeShouldCorrectClockSkewAndRetry
25
-};
26
-
27
-/**
28
- 重试处理器
29
- */
30
-@interface OSSURLRequestRetryHandler : NSObject
31
-@property (nonatomic, assign) uint32_t maxRetryCount;
32 16
 
33
-- (OSSNetworkingRetryType)shouldRetry:(uint32_t)currentRetryCount
34
-                      requestDelegate:(OSSNetworkingRequestDelegate *)delegate
35
-                             response:(NSHTTPURLResponse *)response
36
-                                error:(NSError *)error;
37
-
38
-- (NSTimeInterval)timeIntervalForRetry:(uint32_t)currentRetryCount
39
-                             retryType:(OSSNetworkingRetryType)retryType;
40
-
41
-+ (instancetype)defaultRetryHandler;
42
-@end
43 17
 
44 18
 /**
45
- 网络参数设置
19
+ Network parameters
46 20
  */
47 21
 @interface OSSNetworkingConfiguration : NSObject
48 22
 @property (nonatomic, assign) uint32_t maxRetryCount;
@@ -55,82 +29,11 @@ typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) {
55 29
 @property (nonatomic, strong) NSNumber * proxyPort;
56 30
 @end
57 31
 
58
-/**
59
- 对操作发起的每一次请求构造一个信息代理
60
- */
61
-@interface OSSNetworkingRequestDelegate : NSObject
62
-
63
-@property (nonatomic, strong) NSMutableArray * interceptors;
64
-@property (nonatomic, strong) OSSAllRequestNeededMessage * allNeededMessage;
65
-@property (nonatomic, strong) NSMutableURLRequest * internalRequest;
66
-@property (nonatomic, assign) OSSOperationType operType;
67
-@property (nonatomic, assign) BOOL isAccessViaProxy;
68
-
69
-@property (nonatomic, assign) BOOL isRequestCancelled;
70
-
71
-@property (nonatomic, strong) OSSHttpResponseParser * responseParser;
72
-
73
-@property (nonatomic, strong) NSData * uploadingData;
74
-@property (nonatomic, strong) NSURL * uploadingFileURL;
75
-
76
-@property (nonatomic, assign) int64_t payloadTotalBytesWritten;
77
-
78
-@property (nonatomic, assign) BOOL isBackgroundUploadFileTask;
79
-@property (nonatomic, assign) BOOL isHttpdnsEnable;
80
-
81
-@property (nonatomic, strong) OSSURLRequestRetryHandler * retryHandler;
82
-@property (nonatomic, assign) uint32_t currentRetryCount;
83
-@property (nonatomic, strong) NSError * error;
84
-@property (nonatomic, assign) BOOL isHttpRequestNotSuccessResponse;
85
-@property (nonatomic, strong) NSMutableData * httpRequestNotSuccessResponseBody;
86
-
87
-@property (atomic, strong) NSURLSessionDataTask * currentSessionTask;
88
-
89
-@property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
90
-@property (nonatomic, copy) OSSNetworkingDownloadProgressBlock downloadProgress;
91
-@property (nonatomic, copy) OSSNetworkingCompletionHandlerBlock completionHandler;
92
-@property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveData;
93
-
94
-- (OSSTask *)buildInternalHttpRequest;
95
-- (void)reset;
96
-- (void)cancel;
97
-@end
98
-
99
-/**
100
- 包含一次网络请求所需的所有信息
101
- */
102
-@interface OSSAllRequestNeededMessage : NSObject
103
-@property (nonatomic, strong) NSString * endpoint;
104
-@property (nonatomic, strong) NSString * httpMethod;
105
-@property (nonatomic, strong) NSString * bucketName;
106
-@property (nonatomic, strong) NSString * objectKey;
107
-@property (nonatomic, strong) NSString * contentType;
108
-@property (nonatomic, strong) NSString * contentMd5;
109
-@property (nonatomic, strong) NSString * range;
110
-@property (nonatomic, strong) NSString * date;
111
-@property (nonatomic, strong) NSMutableDictionary * headerParams;
112
-@property (nonatomic, strong) NSMutableDictionary * querys;
113
-
114
-@property (nonatomic, assign) BOOL isHostInCnameExcludeList;
115
-
116
-- (instancetype)initWithEndpoint:(NSString *)endpoint
117
-                      httpMethod:(NSString *)httpMethod
118
-                      bucketName:(NSString *)bucketName
119
-                       objectKey:(NSString *)objectKey
120
-                            type:(NSString *)contentType
121
-                             md5:(NSString *)contentMd5
122
-                           range:(NSString *)range
123
-                            date:(NSString *)date
124
-                    headerParams:(NSMutableDictionary *)headerParams
125
-                          querys:(NSMutableDictionary *)querys;
126
-
127
-- (OSSTask *)validateRequestParamsInOperationType:(OSSOperationType)operType;
128
-@end
129 32
 
130 33
 /**
131
- 每个OSSClient持有一个OSSNetworking用以收发网络请求
34
+ The network interface which OSSClient uses for network read and write operations.
132 35
  */
133
-@interface OSSNetworking : NSObject <NSURLSessionDelegate>
36
+@interface OSSNetworking : NSObject <NSURLSessionDelegate, NSURLSessionDataDelegate>
134 37
 @property (nonatomic, strong) NSURLSession * dataSession;
135 38
 @property (nonatomic, strong) NSURLSession * uploadFileSession;
136 39
 @property (nonatomic, assign) BOOL isUsingBackgroundSession;

+ 76
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSNetworkingRequestDelegate.h View File

@@ -0,0 +1,76 @@
1
+//
2
+//  OSSNetworkingRequestDelegate.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+#import "OSSTask.h"
12
+
13
+@class OSSAllRequestNeededMessage;
14
+@class OSSURLRequestRetryHandler;
15
+@class OSSHttpResponseParser;
16
+
17
+/**
18
+ The proxy object class for each OSS request.
19
+ */
20
+@interface OSSNetworkingRequestDelegate : NSObject
21
+
22
+@property (nonatomic, strong) NSMutableArray * interceptors;
23
+
24
+@property (nonatomic, strong) NSMutableURLRequest *internalRequest;
25
+@property (nonatomic, assign) OSSOperationType operType;
26
+@property (nonatomic, assign) BOOL isAccessViaProxy;
27
+
28
+@property (nonatomic, assign) BOOL isRequestCancelled;
29
+
30
+@property (nonatomic, strong) OSSAllRequestNeededMessage *allNeededMessage;
31
+@property (nonatomic, strong) OSSURLRequestRetryHandler *retryHandler;
32
+@property (nonatomic, strong) OSSHttpResponseParser *responseParser;
33
+
34
+@property (nonatomic, strong) NSData * uploadingData;
35
+@property (nonatomic, strong) NSURL * uploadingFileURL;
36
+
37
+@property (nonatomic, assign) int64_t payloadTotalBytesWritten;
38
+
39
+@property (nonatomic, assign) BOOL isBackgroundUploadFileTask;
40
+@property (nonatomic, assign) BOOL isHttpdnsEnable;
41
+
42
+
43
+@property (nonatomic, assign) uint32_t currentRetryCount;
44
+@property (nonatomic, strong) NSError * error;
45
+@property (nonatomic, assign) BOOL isHttpRequestNotSuccessResponse;
46
+@property (nonatomic, strong) NSMutableData *httpRequestNotSuccessResponseBody;
47
+
48
+@property (atomic, strong) NSURLSessionDataTask *currentSessionTask;
49
+
50
+@property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
51
+@property (nonatomic, copy) OSSNetworkingDownloadProgressBlock downloadProgress;
52
+@property (nonatomic, copy) OSSNetworkingRetryBlock retryCallback;
53
+@property (nonatomic, copy) OSSNetworkingCompletionHandlerBlock completionHandler;
54
+@property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveData;
55
+
56
+/**
57
+ * when put object to server,client caculate crc64 code and assigns it to
58
+ * this property.
59
+ */
60
+@property (nonatomic, copy) NSString *contentCRC;
61
+
62
+/** last crc64 code */
63
+@property (nonatomic, copy) NSString *lastCRC;
64
+
65
+/**
66
+ * determine whether to verify crc64 code
67
+ */
68
+@property (nonatomic, assign) BOOL crc64Verifiable;
69
+
70
+
71
+
72
+- (OSSTask *)buildInternalHttpRequest;
73
+- (void)reset;
74
+- (void)cancel;
75
+
76
+@end

+ 64
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSReachability.h View File

@@ -0,0 +1,64 @@
1
+/*
2
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
3
+ See LICENSE.txt for this sample’s licensing information
4
+ 
5
+ Abstract:
6
+ Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
7
+ */
8
+
9
+#import <Foundation/Foundation.h>
10
+#import <SystemConfiguration/SystemConfiguration.h>
11
+#import <netinet/in.h>
12
+
13
+
14
+typedef enum : NSInteger {
15
+	OSSNotReachable = 0,
16
+	OSSReachableViaWiFi,
17
+	OSSReachableViaWWAN
18
+} OSSNetworkStatus;
19
+
20
+#pragma mark IPv6 Support
21
+//Reachability fully support IPv6.  For full details, see ReadMe.md.
22
+
23
+
24
+extern NSString *ossReachabilityChangedNotification;
25
+
26
+
27
+@interface OSSReachability : NSObject
28
+
29
+/*!
30
+ * Use to check the reachability of a given host name.
31
+ */
32
++ (instancetype)reachabilityWithHostName:(NSString *)hostName;
33
+
34
+/*!
35
+ * Use to check the reachability of a given IP address.
36
+ */
37
++ (instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress;
38
+
39
+/*!
40
+ * Checks whether the default route is available. Should be used by applications that do not connect to a particular host.
41
+ */
42
++ (instancetype)reachabilityForInternetConnection;
43
+
44
+
45
+#pragma mark reachabilityForLocalWiFi
46
+//reachabilityForLocalWiFi has been removed from the sample.  See ReadMe.md for more information.
47
+//+ (instancetype)reachabilityForLocalWiFi;
48
+
49
+/*!
50
+ * Start listening for reachability notifications on the current run loop.
51
+ */
52
+- (BOOL)startNotifier;
53
+- (void)stopNotifier;
54
+
55
+- (OSSNetworkStatus)currentReachabilityStatus;
56
+
57
+/*!
58
+ * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand.
59
+ */
60
+- (BOOL)connectionRequired;
61
+
62
+@end
63
+
64
+

+ 15
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSReachabilityManager.h View File

@@ -0,0 +1,15 @@
1
+//
2
+//  OSSReachabilityManager.h
3
+//
4
+//  Created by 亿刀 on 14-1-9.
5
+//  Edited by junmo on 15-5-16
6
+//  Copyright (c) 2014 Twitter. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@interface OSSReachabilityManager : NSObject
12
+
13
++ (OSSReachabilityManager *)shareInstance;
14
+
15
+@end

+ 36
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSRequest.h View File

@@ -0,0 +1,36 @@
1
+//
2
+//  OSSRequest.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+
12
+/**
13
+ The base class of request to OSS.
14
+ */
15
+@interface OSSRequest : NSObject
16
+/**
17
+ Flag of requiring authentication. It's per each request.
18
+ */
19
+@property (nonatomic, assign) BOOL isAuthenticationRequired;
20
+
21
+/**
22
+ the flag of request canceled.
23
+ */
24
+@property (nonatomic, assign) BOOL isCancelled;
25
+
26
+/**
27
+ the flag of verification about crc64
28
+ */
29
+@property (nonatomic, assign) OSSRequestCRCFlag crcFlag;
30
+
31
+/**
32
+ Cancels the request
33
+ */
34
+- (void)cancel;
35
+
36
+@end

+ 42
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSResult.h View File

@@ -0,0 +1,42 @@
1
+//
2
+//  OSSResult.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+/**
12
+ The base class of result from OSS.
13
+ */
14
+@interface OSSResult : NSObject
15
+
16
+/**
17
+ The http response code.
18
+ */
19
+@property (nonatomic, assign) NSInteger httpResponseCode;
20
+
21
+/**
22
+ The http headers, in the form of key value dictionary.
23
+ */
24
+@property (nonatomic, strong) NSDictionary * httpResponseHeaderFields;
25
+
26
+/**
27
+ The request Id. It's the value of header x-oss-request-id, which is created from OSS server.
28
+ It's a unique Id represents this request. This is used for troubleshooting when you contact OSS support.
29
+ */
30
+@property (nonatomic, strong) NSString * requestId;
31
+
32
+/**
33
+ It's the value of header x-oss-hash-crc64ecma, which is created from OSS server.
34
+ */
35
+@property (nonatomic, copy) NSString *remoteCRC64ecma;
36
+
37
+/**
38
+ It's the value of local Data.
39
+ */
40
+@property (nonatomic, copy) NSString *localCRC64ecma;
41
+
42
+@end

+ 12
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSService.h View File

@@ -11,7 +11,19 @@
11 11
 #define OSS_IOS_SDK_VERSION OSSSDKVersion
12 12
 
13 13
 #import "OSSDefine.h"
14
+#import "OSSConstants.h"
15
+
14 16
 #import "OSSNetworking.h"
17
+#import "OSSNetworkingRequestDelegate.h"
18
+#import "OSSAllRequestNeededMessage.h"
19
+#import "OSSURLRequestRetryHandler.h"
20
+#import "OSSHttpResponseParser.h"
21
+#import "OSSRequest.h"
22
+#import "OSSGetObjectACLRequest.h"
23
+#import "OSSGetObjectACLResult.h"
24
+#import "OSSDeleteMultipleObjectsRequest.h"
25
+#import "OSSDeleteMultipleObjectsResult.h"
26
+
15 27
 #import "OSSClient.h"
16 28
 #import "OSSModel.h"
17 29
 #import "OSSUtil.h"

+ 2
- 2
Example/ios/AliyunOSSiOS.framework/Headers/OSSTask.h View File

@@ -60,7 +60,7 @@ typedef __nullable id(^OSSContinuationBlock)(OSSTask<ResultType> *task);
60 60
  Creates a task that is already completed with the given result.
61 61
  @param result The result for the task.
62 62
  */
63
-+ (instancetype)taskWithResult:(nullable ResultType)result;
63
++ (instancetype)taskWithResult:(_Nullable ResultType)result;
64 64
 
65 65
 /*!
66 66
  Creates a task that is already completed with the given error.
@@ -127,7 +127,7 @@ typedef __nullable id(^OSSContinuationBlock)(OSSTask<ResultType> *task);
127 127
  If block returns a OSSTask, then the task returned from
128 128
  this method will not be completed until that task is completed.
129 129
  */
130
-+ (instancetype)taskFromExecutor:(OSSExecutor *)executor withBlock:(nullable id (^)())block;
130
++ (instancetype)taskFromExecutor:(OSSExecutor *)executor withBlock:(nullable id (^)(void))block;
131 131
 
132 132
 // Properties that will be set on the task once it is completed.
133 133
 

+ 36
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSURLRequestRetryHandler.h View File

@@ -0,0 +1,36 @@
1
+//
2
+//  OSSURLRequestRetryHandler.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+
12
+@class OSSNetworkingRequestDelegate;
13
+
14
+
15
+NS_ASSUME_NONNULL_BEGIN
16
+
17
+/**
18
+ The retry handler interface
19
+ */
20
+@interface OSSURLRequestRetryHandler : NSObject
21
+
22
+@property (nonatomic, assign) uint32_t maxRetryCount;
23
+
24
+
25
++ (instancetype)defaultRetryHandler;
26
+
27
+- (OSSNetworkingRetryType)shouldRetry:(uint32_t)currentRetryCount
28
+                      requestDelegate:(OSSNetworkingRequestDelegate *)delegate
29
+                             response:(NSHTTPURLResponse *)response
30
+                                error:(NSError *)error;
31
+
32
+- (NSTimeInterval)timeIntervalForRetry:(uint32_t)currentRetryCount
33
+                             retryType:(OSSNetworkingRetryType)retryType;
34
+@end
35
+
36
+NS_ASSUME_NONNULL_END

+ 36
- 2
Example/ios/AliyunOSSiOS.framework/Headers/OSSUtil.h View File

@@ -7,6 +7,7 @@
7 7
 //
8 8
 
9 9
 #import <Foundation/Foundation.h>
10
+#import "OSSFileLogger.h"
10 11
 
11 12
 @class OSSFederationToken;
12 13
 
@@ -16,22 +17,55 @@
16 17
 + (NSString *)calBase64WithData:(uint8_t *)data;
17 18
 + (NSString *)encodeURL:(NSString *)url;
18 19
 + (NSData *)constructHttpBodyFromPartInfos:(NSArray *)partInfos;
19
-+ (NSData *)constructHttpBodyForCreateBucketWithLocation:(NSString *)location;
20
++ (NSData *)constructHttpBodyForDeleteMultipleObjects:(NSArray<NSString *> *)keys quiet:(BOOL)quiet;
21
++ (NSData *)constructHttpBodyForCreateBucketWithLocation:(NSString *)location __attribute__((deprecated("deprecated!")));
20 22
 + (BOOL)validateBucketName:(NSString *)bucketName;
21 23
 + (BOOL)validateObjectKey:(NSString *)objectKey;
22 24
 + (BOOL)isOssOriginBucketHost:(NSString *)host;
23 25
 + (NSString *)getIpByHost:(NSString *)host;
24 26
 + (BOOL)isNetworkDelegateState;
27
+
28
++ (NSData *)fileMD5:(NSString *)path;
25 29
 + (NSString *)dataMD5String:(NSData *)data;
26 30
 + (NSString *)fileMD5String:(NSString *)path;
27
-+ (NSString*)base64ForData:(uint8_t *)input length:(int32_t)length;
28 31
 + (NSString *)base64Md5ForData:(NSData *)data;
29 32
 + (NSString *)base64Md5ForFilePath:(NSString *)filePath;
30 33
 + (NSString *)base64Md5ForFileURL:(NSURL *)fileURL;
34
++ (NSString *)base64ForData:(uint8_t *)input length:(int32_t)length;
35
+
31 36
 + (NSString *)populateSubresourceStringFromParameter:(NSDictionary *)parameters;
32 37
 + (NSString *)populateQueryStringFromParameter:(NSDictionary *)parameters;
33 38
 + (BOOL)isSubresource:(NSString *)param;
34 39
 + (NSString *)sign:(NSString *)content withToken:(OSSFederationToken *)token;
35 40
 + (NSString *)getRelativePath:(NSString *)fullPath;
36 41
 + (NSString *)detemineMimeTypeForFilePath:(NSString *)filePath uploadName:(NSString *)uploadName;
42
++ (BOOL)hasPhoneFreeSpace;
43
++ (NSString*)buildNetWorkConnectedMsg;
44
++ (NSString*)buildOperatorMsg;
45
+
46
++ (uint64_t)crc64ecma:(uint64_t)crc1 buffer:(void *)buffer length:(size_t)len;
47
+
48
+/**
49
+ * @brief: combine crc1 and crc2
50
+ */
51
+
52
++ (uint64_t)crc64ForCombineCRC1:(uint64_t)crc1 CRC2:(uint64_t)crc2 length:(size_t)len2;
53
+
54
++ (NSString *)sha1WithString:(NSString *)string;
55
++ (NSString *)sha1WithData:(NSData *)data;
56
++ (NSString *)sha1WithFilePath:(NSString *)filePath;
57
+
58
++ (NSData *)constructHttpBodyForTriggerCallback:(NSString *)callbackParams callbackVaribles:(NSString *)callbackVaribles;
59
+
60
++ (NSData *)constructHttpBodyForImagePersist:(NSString *)action toBucket:(NSString *)toBucket toObjectKey:(NSString *)toObjectKey;
61
+
62
+@end
63
+
64
+@interface NSString (OSS)
65
+
66
+- (NSString *)oss_trim;
67
+- (BOOL)oss_isNotEmpty;
68
+- (NSString *)oss_stringByAppendingPathComponentForURL:(NSString *)path;
69
++ (NSString *)oss_documentDirectory;
70
+
37 71
 @end

+ 88
- 0
Example/ios/AliyunOSSiOS.framework/Headers/OSSXMLDictionary.h View File

@@ -0,0 +1,88 @@
1
+//
2
+//  XMLDictionary.h
3
+//
4
+//  Version 1.4
5
+//
6
+//  Created by Nick Lockwood on 15/11/2010.
7
+//  Copyright 2010 Charcoal Design. All rights reserved.
8
+//
9
+//  Get the latest version of XMLDictionary from here:
10
+//
11
+//  https://github.com/nicklockwood/XMLDictionary
12
+//
13
+//  This software is provided 'as-is', without any express or implied
14
+//  warranty.  In no event will the authors be held liable for any damages
15
+//  arising from the use of this software.
16
+//
17
+//  Permission is granted to anyone to use this software for any purpose,
18
+//  including commercial applications, and to alter it and redistribute it
19
+//  freely, subject to the following restrictions:
20
+//
21
+//  1. The origin of this software must not be misrepresented; you must not
22
+//  claim that you wrote the original software. If you use this software
23
+//  in a product, an acknowledgment in the product documentation would be
24
+//  appreciated but is not required.
25
+//
26
+//  2. Altered source versions must be plainly marked as such, and must not be
27
+//  misrepresented as being the original software.
28
+//
29
+//  3. This notice may not be removed or altered from any source distribution.
30
+//
31
+
32
+#import <Foundation/Foundation.h>
33
+#import "OSSConstants.h"
34
+
35
+#pragma GCC diagnostic push
36
+#pragma GCC diagnostic ignored "-Wobjc-missing-property-synthesis"
37
+@interface OSSXMLDictionaryParser : NSObject <NSCopying>
38
+
39
++ (OSSXMLDictionaryParser *)sharedInstance;
40
+
41
+@property (nonatomic, assign) BOOL collapseTextNodes; // defaults to YES
42
+@property (nonatomic, assign) BOOL stripEmptyNodes;   // defaults to YES
43
+@property (nonatomic, assign) BOOL trimWhiteSpace;    // defaults to YES
44
+@property (nonatomic, assign) BOOL alwaysUseArrays;   // defaults to NO
45
+@property (nonatomic, assign) BOOL preserveComments;  // defaults to NO
46
+@property (nonatomic, assign) BOOL wrapRootNode;      // defaults to NO
47
+
48
+@property (nonatomic, assign) OSSXMLDictionaryAttributesMode attributesMode;
49
+@property (nonatomic, assign) OSSXMLDictionaryNodeNameMode nodeNameMode;
50
+
51
+- (NSDictionary *)dictionaryWithParser:(NSXMLParser *)parser;
52
+- (NSDictionary *)dictionaryWithData:(NSData *)data;
53
+- (NSDictionary *)dictionaryWithString:(NSString *)string;
54
+- (NSDictionary *)dictionaryWithFile:(NSString *)path;
55
+
56
+@end
57
+
58
+
59
+@interface NSDictionary (OSSXMLDictionary)
60
+
61
++ (NSDictionary *)oss_dictionaryWithXMLParser:(NSXMLParser *)parser;
62
++ (NSDictionary *)oss_dictionaryWithXMLData:(NSData *)data;
63
++ (NSDictionary *)oss_dictionaryWithXMLString:(NSString *)string;
64
++ (NSDictionary *)oss_dictionaryWithXMLFile:(NSString *)path;
65
+
66
+- (NSDictionary *)oss_attributes;
67
+- (NSDictionary *)oss_childNodes;
68
+- (NSArray *)oss_comments;
69
+- (NSString *)oss_nodeName;
70
+- (NSString *)oss_innerText;
71
+- (NSString *)oss_innerXML;
72
+- (NSString *)oss_XMLString;
73
+
74
+- (NSArray *)oss_arrayValueForKeyPath:(NSString *)keyPath;
75
+- (NSString *)oss_stringValueForKeyPath:(NSString *)keyPath;
76
+- (NSDictionary *)oss_dictionaryValueForKeyPath:(NSString *)keyPath;
77
+
78
+@end
79
+
80
+
81
+@interface NSString (OSSXMLDictionary)
82
+
83
+- (NSString *)oss_XMLEncodedString;
84
+
85
+@end
86
+
87
+
88
+#pragma GCC diagnostic pop

+ 11
- 0
Example/ios/AliyunOSSiOS.framework/PrivateHeaders/aos_crc64.h View File

@@ -0,0 +1,11 @@
1
+#ifndef LIBAOS_CRC_H
2
+#define LIBAOS_CRC_H
3
+
4
+#include <_types/_uintmax_t.h>
5
+#include <_types/_uint64_t.h>
6
+#include <stddef.h>
7
+
8
+uint64_t aos_crc64(uint64_t crc, void *buf, size_t len);
9
+uint64_t aos_crc64_combine(uint64_t crc1, uint64_t crc2, uintmax_t len2);
10
+
11
+#endif

+ 1
- 1
Example/package.json View File

@@ -9,7 +9,7 @@
9 9
   "dependencies": {
10 10
     "react": "16.3.1",
11 11
     "react-native": "0.55.4",
12
-    "aliyun-oss-react-native": "^1.0.0-alpha.3",
12
+    "aliyun-oss-react-native": "^1.0.0-alpha.4",
13 13
     "react-native-image-picker": "^0.26.10"
14 14
   },
15 15
   "devDependencies": {

BIN
ios/AliyunSDK/AliyunOSSiOS.framework/AliyunOSSiOS View File


+ 2
- 1
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/AliyunOSSiOS.h View File

@@ -6,7 +6,7 @@
6 6
 //  Copyright © 2016 xuyecan. All rights reserved.
7 7
 //
8 8
 
9
-#import <UIKit/UIKit.h>
9
+#import <Foundation/Foundation.h>
10 10
 
11 11
 //! Project version number for AliyunOSSiOS.
12 12
 FOUNDATION_EXPORT double AliyunOSSiOSVersionNumber;
@@ -18,3 +18,4 @@ FOUNDATION_EXPORT const unsigned char AliyunOSSiOSVersionString[];
18 18
 
19 19
 #import "OSSService.h"
20 20
 #import "OSSCompat.h"
21
+#import "OSSXMLDictionary.h"

+ 15
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/NSMutableData+OSS_CRC.h View File

@@ -0,0 +1,15 @@
1
+//
2
+//  NSMutableData+OSS_CRC.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by 怀叙 on 2017/11/29.
6
+//  Copyright © 2017年 阿里云. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@interface NSMutableData (OSS_CRC)
12
+
13
+- (uint64_t)oss_crc64;
14
+
15
+@end

+ 56
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSAllRequestNeededMessage.h View File

@@ -0,0 +1,56 @@
1
+//
2
+//  OSSAllRequestNeededMessage.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+#import "OSSTask.h"
12
+
13
+/**
14
+ All necessary information in one OSS request.
15
+ */
16
+@interface OSSAllRequestNeededMessage : NSObject
17
+@property (nonatomic, strong) NSString * endpoint;
18
+@property (nonatomic, strong) NSString * httpMethod;
19
+@property (nonatomic, strong) NSString * bucketName;
20
+@property (nonatomic, strong) NSString * objectKey;
21
+@property (nonatomic, strong) NSString * contentType;
22
+@property (nonatomic, strong) NSString * contentMd5;
23
+@property (nonatomic, strong) NSString * range;
24
+@property (nonatomic, strong) NSString * date;
25
+@property (nonatomic, strong) NSMutableDictionary * headerParams;
26
+@property (nonatomic, copy) NSDictionary * querys;
27
+@property (nonatomic, copy) NSString *contentSHA1;
28
+
29
+@property (nonatomic, assign) BOOL isHostInCnameExcludeList;
30
+
31
+- (instancetype)initWithEndpoint:(NSString *)endpoint
32
+                      httpMethod:(NSString *)httpMethod
33
+                      bucketName:(NSString *)bucketName
34
+                       objectKey:(NSString *)objectKey
35
+                            type:(NSString *)contentType
36
+                             md5:(NSString *)contentMd5
37
+                           range:(NSString *)range
38
+                            date:(NSString *)date
39
+                    headerParams:(NSMutableDictionary *)headerParams
40
+                          querys:(NSMutableDictionary *)querys __attribute__((deprecated("Use -initWithEndpoint:httpMethod:bucketName:objectKey:type:md5:range:date:headerParams:querys:sha1: instead")));
41
+
42
+- (instancetype)initWithEndpoint:(NSString *)endpoint
43
+                      httpMethod:(NSString *)httpMethod
44
+                      bucketName:(NSString *)bucketName
45
+                       objectKey:(NSString *)objectKey
46
+                            type:(NSString *)contentType
47
+                             md5:(NSString *)contentMd5
48
+                           range:(NSString *)range
49
+                            date:(NSString *)date
50
+                    headerParams:(NSMutableDictionary *)headerParams
51
+                          querys:(NSMutableDictionary *)querys
52
+                            sha1:(NSString *)contentSHA1;
53
+
54
+- (OSSTask *)validateRequestParamsInOperationType:(OSSOperationType)operType;
55
+
56
+@end

+ 1
- 1
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSCancellationToken.h View File

@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
17 17
 /*!
18 18
  A block that will be called when a token is cancelled.
19 19
  */
20
-typedef void(^OSSCancellationBlock)();
20
+typedef void(^OSSCancellationBlock)(void);
21 21
 
22 22
 /*!
23 23
  The consumer view of a CancellationToken.

+ 172
- 95
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSClient.h View File

@@ -14,19 +14,25 @@
14 14
 @class OSSGetBucketRequest;
15 15
 @class OSSGetBucketACLRequest;
16 16
 @class OSSGetObjectRequest;
17
+@class OSSGetObjectACLRequest;
17 18
 @class OSSPutObjectRequest;
18 19
 @class OSSPutObjectACLRequest;
19 20
 @class OSSDeleteObjectRequest;
21
+@class OSSDeleteMultipleObjectsRequest;
20 22
 @class OSSCopyObjectRequest;
21 23
 @class OSSInitMultipartUploadRequest;
22 24
 @class OSSUploadPartRequest;
23 25
 @class OSSCompleteMultipartUploadRequest;
24 26
 @class OSSListPartsRequest;
27
+@class OSSListMultipartUploadsRequest;
25 28
 @class OSSAbortMultipartUploadRequest;
26 29
 @class OSSAppendObjectRequest;
27 30
 @class OSSResumableUploadRequest;
31
+@class OSSMultipartUploadRequest;
28 32
 @class OSSTask;
29 33
 @class OSSExecutor;
34
+@class OSSCallBackRequest;
35
+@class OSSImagePersistRequest;
30 36
 
31 37
 @class OSSNetworking;
32 38
 @class OSSClientConfiguration;
@@ -35,49 +41,51 @@
35 41
 NS_ASSUME_NONNULL_BEGIN
36 42
 
37 43
 /**
38
- OSSClient是OSS服务的iOS客户端,它为调用者提供了一系列的方法,用于和OSS服务进行交互。
39
- 一般来说,全局内只需要保持一个OSSClient,用来调用各种操作。
44
+ OSSClient is the entry class to access OSS in an iOS client. It provides all the methods to communicate with OSS.
45
+ Generally speaking, only one instance of OSSClient is needed in the whole app.
40 46
  */
41 47
 @interface OSSClient : NSObject
42 48
 
43 49
 /**
44
- OSS访问域名
50
+ OSS endpoint. It varies in different regions. Please check out OSS official website for the exact endpoints for your data.
45 51
  */
46 52
 @property (nonatomic, strong) NSString * endpoint;
47 53
 
48 54
 /**
49
- 用以收发网络请求
55
+ The networking instance for sending and receiving data
50 56
  */
51 57
 @property (nonatomic, strong) OSSNetworking * networking;
52 58
 
53 59
 /**
54
- 提供访问所需凭证
60
+ The credential provider instance
55 61
  */
56 62
 @property (nonatomic, strong) id<OSSCredentialProvider> credentialProvider;
57 63
 
58 64
 /**
59
- 客户端设置
65
+ Client configuration instance
60 66
  */
61 67
 @property (nonatomic, strong) OSSClientConfiguration * clientConfiguration;
62 68
 
63 69
 /**
64
- 任务队列
70
+ oss operation task queue
65 71
  */
66 72
 @property (nonatomic, strong, readonly) OSSExecutor * ossOperationExecutor;
67 73
 
68 74
 /**
69
- 初始化OSSClient,使用默认的本地设置
70
- @endpoint 指明Bucket所在的Region域名,2017年以后苹果要求APP符合ATS政策,这里要写https的endpoint,如 "https://oss-cn-hangzhou.aliyuncs.com"
71
- @credentialProvider 需要实现的签名器
75
+ Initializes an OSSClient instance with the default client configuration.
76
+ @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy.
77
+             For example: "https://oss-cn-hangzhou.aliyuncs.com"
78
+ @credentialProvider The credential provider
72 79
  */
73 80
 - (instancetype)initWithEndpoint:(NSString *)endpoint
74 81
               credentialProvider:(id<OSSCredentialProvider>) credentialProvider;
75 82
 
76 83
 /**
77
- 初始化OSSClient,使用自定义设置
78
- @endpoint 指明Bucket所在的Region域名,2017年以后苹果要求APP符合ATS政策,这里要写https的endpoint,如 "https://oss-cn-hangzhou.aliyuncs.com"
79
- @credentialProvider 需要实现的签名器
80
- @conf 可以设置一些本地参数如重试次数、超时时间等
84
+ Initializes an OSSClient with the custom client configuration.
85
+ @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy.
86
+             For example: "https://oss-cn-hangzhou.aliyuncs.com"
87
+ @credentialProvider The credential provider
88
+ @conf The custom client configuration such as retry time, timeout values, etc.
81 89
  */
82 90
 - (instancetype)initWithEndpoint:(NSString *)endpoint
83 91
               credentialProvider:(id<OSSCredentialProvider>)credentialProvider
@@ -86,188 +94,257 @@ NS_ASSUME_NONNULL_BEGIN
86 94
 #pragma mark restful-api
87 95
 
88 96
 /**
89
- 对应RESTFul API:GetService
90
- 获取请求者当前拥有的全部Bucket。
91
- 注意:
92
- 1. 尚不支持STS;
93
- 2. 当所有的bucket都返回时,返回的xml中不包含Prefix、Marker、MaxKeys、IsTruncated、NextMarker节点,如果还有部分结果未返回,则增加上述节点,其中NextMarker用于继续查询时给marker赋值。
97
+ The corresponding RESTFul API: GetService
98
+ Gets all the buckets of the current user
99
+ Notes:
100
+ 1. STS is not supported yet in this call.
101
+ 2. When all buckets are returned, the xml in response body does not have nodes of Prefix, Marker, MaxKeys, IsTruncated and NextMarker.
102
+    If there're remaining buckets to return, the xml will have these nodes. The nextMarker is the value of marker in the next call.
94 103
  */
95 104
 - (OSSTask *)getService:(OSSGetServiceRequest *)request;
96 105
 
97 106
 /**
98
- 对应RESTFul API:PutBucket
99
- 用于创建Bucket(不支持匿名访问)。默认情况下,创建的Bucket位于默认的数据中心:oss-cn-hangzhou。
100
- 用户可以显式指定Bucket位于的数据中心,从而最优化延迟,最小化费用或者满足监管要求等。
101
- 注意:
102
- 1. 尚不支持STS。
107
+ The corresponding RESTFul API: PutBucket
108
+ Creates a bucket--it does not support anonymous access. By default, the datacenter used is oss-cn-hangzhou.
109
+ Callers could explicitly specify the datacenter for the bucket to optimize the performance and cost or meet the regulation requirement.
110
+ Notes:
111
+ 1. STS is not supported yet.
103 112
  */
104 113
 - (OSSTask *)createBucket:(OSSCreateBucketRequest *)request;
105 114
 
106 115
 /**
107
- 对应RESTFul API:DeleteBucket
108
- 用于删除某个Bucket。
116
+ The corresponding RESTFul API: DeleteBucket
117
+ Deletes a bucket.
109 118
  */
110 119
 - (OSSTask *)deleteBucket:(OSSDeleteBucketRequest *)request;
111 120
 
112 121
 /**
113
- 对应RESTFul API:GetBucket
114
- 用来list Bucket中所有Object的信息,可以通过prefix,marker,delimiter和max-keys对list做限定,返回部分结果。
122
+The corresponding RESTFul API: GetBucket
123
+ Lists all objects in a bucket. It could be specified with filters such as prefix, marker, delimeter and max-keys.
115 124
  */
116 125
 - (OSSTask *)getBucket:(OSSGetBucketRequest *)request;
117 126
 
118 127
 /**
119
- 对应RESTFul API:GetBucketACL
120
- 用来获取某个Bucket的访问权限。
128
+The corresponding RESTFul API: GetBucketACL
129
+ Gets the bucket ACL.
121 130
  */
122 131
 - (OSSTask *)getBucketACL:(OSSGetBucketACLRequest *)request;
123 132
 
124 133
 /**
125
- 对应RESTFul API:HeadObject
126
- 只返回某个Object的meta信息,不返回文件内容。
134
+The corresponding RESTFul API: HeadObject
135
+ Gets the object's metadata information. The object's content is not returned.
127 136
  */
128 137
 - (OSSTask *)headObject:(OSSHeadObjectRequest *)request;
129 138
 
130 139
 /**
131
- 对应RESTFul API:GetObject
132
- 用于获取某个Object,此操作要求用户对该Object有读权限。
140
+The corresponding RESTFul API: GetObject
141
+ Gets the whole object (includes content). It requires caller have read permission on the object.
133 142
  */
134 143
 - (OSSTask *)getObject:(OSSGetObjectRequest *)request;
135 144
 
136 145
 /**
137
- 对应RESTFul API:PutObject
138
- 用于上传文件。
146
+ * Gets the Access Control List (ACL) of the OSS object.
147
+ *
148
+ * @param bucketName
149
+ *            Bucket name.
150
+ * @param key
151
+ *            Object Key.
152
+ * @return The OSSTask with result of objectAcls instance of the object.
153
+ */
154
+- (OSSTask *)getObjectACL:(OSSGetObjectACLRequest *)request;
155
+
156
+/**
157
+The corresponding RESTFul API: PutObject
158
+ Uploads a file.
139 159
  */
140 160
 - (OSSTask *)putObject:(OSSPutObjectRequest *)request;
141 161
 
142 162
 /**
143
- Put Object ACL接口用于修改Object的访问权限。目前Object有三种访问权限:private, public-read, public-read-write。
144
- Put Object ACL操作通过Put请求中的“x-oss-object-acl”头来设置,这个操作只有Bucket Owner有权限执行。如果操作成功,则返回200;否则返回相应的错误码和提示信息。
163
+ Sets the object's ACL. Right now an object has three access permissions: private, public-ready, public-read-write.
164
+ The operation specifies the x-oss-object-acl header in the put request. The caller must be the owner of the object.
165
+ If succeeds, it returns HTTP status 200; otherwise it returns related error code and error messages.
145 166
  */
146 167
 - (OSSTask *)putObjectACL:(OSSPutObjectACLRequest *)request;
147 168
 
148 169
 /**
149
- 对应RESTFul API:AppendObject
150
- 以追加写的方式上传文件。通过Append Object操作创建的Object类型为Appendable Object,而通过Put Object上传的Object是Normal Object。
170
+The corresponding RESTFul API: AppendObject
171
+ Appends data to an existing or non-existing object. The object created by this operation is appendable. 
172
+ As a comparison, the object created by Put Object is normal (non-appendable).
151 173
  */
152 174
 - (OSSTask *)appendObject:(OSSAppendObjectRequest *)request;
153 175
 
154 176
 /**
155
- 对应RESTFul API:copyObject
156
- 拷贝一个在OSS上已经存在的object成另外一个object,可以发送一个PUT请求给OSS,并在PUT请求头中添加元素“x-oss-copy-source”来指定拷贝源。
157
- OSS会自动判断出这是一个Copy操作,并直接在服务器端执行该操作。如果拷贝成功,则返回新的object信息给用户。
158
- 该操作适用于拷贝小于1GB的文件。
177
+ @brief : Appends data to an existing or non-existing object on the OSS server. The object created by this operation is appendable.
178
+ request    : request
179
+ crc64ecma  : 如果服务器上面已经存在对象,需要客户端先调用headObject获取到对象的crc64ecma,然后再调用
180
+              该接口上传数据
181
+ */
182
+- (OSSTask *)appendObject:(OSSAppendObjectRequest *)request withCrc64ecma:(nullable NSString *)crc64ecma;
183
+
184
+/**
185
+The corresponding RESTFul API: copyObject
186
+ Copies an existing object to another one.The operation sends a PUT request with x-oss-copy-source header to specify the source object.
187
+ OSS server side will detect and copy the object. If it succeeds, the new object's metadata information will be returned.
188
+ The operation applies for files less than 1GB. For big files, use UploadPartCopy RESTFul API.
159 189
  */
160 190
 - (OSSTask *)copyObject:(OSSCopyObjectRequest *)request;
161 191
 
162 192
 /**
163
- 对应RESTFul API:DeleteObject
164
- 用于删除某个Object。
193
+ * Batch deletes the specified files under a specific bucket. If the files
194
+ * are non-exist, the operation will still return successful.
195
+ *
196
+ * @param deleteObjectsRequest
197
+ *            A OSSDeleteMultipleObjectsRequest instance which specifies the
198
+ *            bucket and file keys to delete.
199
+ * @return A OSSTask with result of OSSDeleteMultipleObjectsResult instance which specifies each
200
+ *         file's result in normal mode or only failed deletions in quite
201
+ *         mode. By default it's quite mode.
202
+ */
203
+- (OSSTask *)deleteMultipleObjects:(OSSDeleteMultipleObjectsRequest *)request;
204
+
205
+/**
206
+ The corresponding RESTFul API: DeleteObject
207
+ Deletes an object
165 208
  */
166 209
 - (OSSTask *)deleteObject:(OSSDeleteObjectRequest *)request;
167 210
 
168 211
 /**
169
- 对应RESTFul API:InitiateMultipartUpload
170
- 使用Multipart Upload模式传输数据前,必须先调用该接口来通知OSS初始化一个Multipart Upload事件。该接口会返回一个OSS服务器创建的全局唯一的Upload ID,用于标识本次Multipart Upload事件。
171
- 用户可以根据这个ID来发起相关的操作,如中止Multipart Upload、查询Multipart Upload等。
212
+The corresponding RESTFul API: InitiateMultipartUpload
213
+ Initiates a multipart upload to get a upload Id. It's needed before starting uploading parts data. 
214
+ The upload Id is used for subsequential operations such as aborting the upload, querying the uploaded parts, etc.
172 215
  */
173 216
 - (OSSTask *)multipartUploadInit:(OSSInitMultipartUploadRequest *)request;
174 217
 
175 218
 /**
176
- 对应RESTFul API:UploadPart
177
- 初始化一个Multipart Upload之后,可以根据指定的Object名和Upload ID来分块(Part)上传数据。
178
- 每一个上传的Part都有一个标识它的号码(part number,范围是1~10,000)。
179
- 对于同一个Upload ID,该号码不但唯一标识这一块数据,也标识了这块数据在整个文件内的相对位置。
180
- 如果你用同一个part号码,上传了新的数据,那么OSS上已有的这个号码的Part数据将被覆盖。除了最后一块Part以外,其他的part最小为100KB;
181
- 最后一块Part没有大小限制。
219
+The corresponding RESTFul API: UploadPart
220
+ After the multipart upload is initiated, this API could be called to upload the data to the target file with the upload Id.
221
+ Every uploaded part has a unique id called part number, which ranges from 1 to 10,000. 
222
+ For a given upload Id, the part number identifies the specific range of the data in the whole file. 
223
+ If the same part number is used for another upload, the existing data will be overwritten by the new upload. 
224
+ Except the last part, all other part's minimal size is 100KB.
225
+ But no minimal size requirement on the last part.
182 226
  */
183 227
 - (OSSTask *)uploadPart:(OSSUploadPartRequest *)request;
184 228
 
185 229
 /**
186
- 对应RESTFul API:CompleteMultipartUpload
187
- 在将所有数据Part都上传完成后,必须调用Complete Multipart Upload API来完成整个文件的Multipart Upload。
188
- 在执行该操作时,用户必须提供所有有效的数据Part的列表(包括part号码和ETAG);OSS收到用户提交的Part列表后,会逐一验证每个数据Part的有效性。
189
- 当所有的数据Part验证通过后,OSS将把这些数据part组合成一个完整的Object。
230
+The corresponding RESTFul API: CompleteMultipartUpload
231
+ This API is to complete the multipart upload after all parts data have been uploaded.
232
+ It must be provided with a valid part list (each part has the part number and ETag). 
233
+ OSS will validate every part and then complete the multipart upload.
234
+ If any part is invalid (e.g. the part is updated by another part upload), this API will fail.
190 235
  */
191 236
 - (OSSTask *)completeMultipartUpload:(OSSCompleteMultipartUploadRequest *)request;
192 237
 
193 238
 /**
194
- 对应RESTFul API:ListParts
195
- 可以罗列出指定Upload ID所属的所有已经上传成功Part。
239
+The corresponding RESTFul API: ListParts
240
+ Lists all uploaded parts of the specified upload id.
196 241
  */
197 242
 - (OSSTask *)listParts:(OSSListPartsRequest *)request;
198 243
 
199 244
 /**
200
- 对应RESTFul API:AbortMultipartUpload
201
- 该接口可以根据用户提供的Upload ID中止其对应的Multipart Upload事件。
202
- 当一个Multipart Upload事件被中止后,就不能再使用这个Upload ID做任何操作,已经上传的Part数据也会被删除。
245
+ The corresponding RESTFul API: ListMultipartUploads
246
+ Lists all multipart uploads with the specified bucket.
247
+ */
248
+- (OSSTask *)listMultipartUploads:(OSSListMultipartUploadsRequest *)request;
249
+
250
+/**
251
+The corresponding RESTFul API: AbortMultipartUpload
252
+Aborts the multipart upload by the specified upload Id.
253
+ Once the multipart upload is aborted by this API, all parts data will be deleted and the upload Id is invalid anymore.
203 254
  */
204 255
 - (OSSTask *)abortMultipartUpload:(OSSAbortMultipartUploadRequest *)request;
205 256
 
257
+- (OSSTask *)abortResumableMultipartUpload:(OSSResumableUploadRequest *)request;
258
+
259
+- (OSSTask *)triggerCallBack:(OSSCallBackRequest *)request;
260
+
261
+
206 262
 #pragma mark extention method
207 263
 
208 264
 /**
209
- 对一个Object签名出一个URL,可以把该URL转给第三方实现授权访问。
210
- @bucketName Object所在的Bucket名称
211
- @objectKey Object名称
212
- @interval 签名URL时,可以指定这个URL的有效时长是多久,单位是秒,比如说需要有效时长为1小时的URL,这里传入3600
265
+ Generates a signed URL for the object and anyone has this URL will get the GET permission on the object.
266
+ @bucketName object's bucket name
267
+ @objectKey Object name
268
+ @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object.
213 269
  */
214 270
 - (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName
215 271
                                 withObjectKey:(NSString *)objectKey
216 272
                        withExpirationInterval:(NSTimeInterval)interval;
217 273
 
218 274
 /**
219
- 对一个Object签名出一个URL,可以把该URL转给第三方实现授权访问。
220
- @bucketName Object所在的Bucket名称
221
- @objectKey Object名称
222
- @interval 签名URL时,可以指定这个URL的有效时长是多久,单位是秒,比如说需要有效时长为1小时的URL,这里传入3600
223
- @parameter 参数
275
+ Generates a signed URL for the object and anyone has this URL will get the specified permission on the object.
276
+ @bucketName object's bucket name
277
+ @objectKey Object name
278
+ @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object.
279
+ @parameter it could specify allowed HTTP methods 
224 280
  */
225 281
 - (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName
226 282
                                  withObjectKey:(NSString *)objectKey
227 283
                         withExpirationInterval:(NSTimeInterval)interval
228 284
                                 withParameters:(NSDictionary *)parameters;
229 285
 
230
-/**
231
- 如果Object的权限是公共读或者公共读写,调用这个接口对该Object签名出一个URL,可以把该URL转给第三方实现授权访问。
232
- @bucketName Object所在的Bucket名称
233
- @objectKey Object名称
286
+/** TODOTODO
287
+ If the object's ACL is public read or public read-write, use this API to generate a signed url for sharing.
288
+ @bucketName Object's bucket name
289
+ @objectKey Object name
234 290
  */
235 291
 - (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
236 292
                             withObjectKey:(NSString *)objectKey;
237 293
 
238
-/**
239
- 如果Object的权限是公共读或者公共读写,调用这个接口对该Object签名出一个URL,可以把该URL转给第三方实现授权访问。
240
- @bucketName Object所在的Bucket名称
241
- @objectKey Object名称
242
- @parameter 参数
294
+/** TODOTODO
295
+ If the object's ACL is public read or public read-write, use this API to generate a signed url for sharing.
296
+ @bucketName Object's bucket name
297
+ @objectKey Object name
298
+ @parameter the request parameters.
243 299
  */
244 300
 - (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
245 301
                              withObjectKey:(NSString *)objectKey
246 302
                              withParameters:(NSDictionary *)parameters;
247 303
 
248 304
 /**
249
- 断点上传接口
250
- 这个接口封装了分块上传的若干接口以实现断点上传,但是需要用户自行保存UploadId。
251
- 对一个新文件,用户需要首先调用multipartUploadInit接口获得一个UploadId,然后调用此接口上传这个文件。
252
- 如果上传失败,首先需要检查一下失败原因:
253
-     如果非不可恢复的失败,那么可以用同一个UploadId和同一文件继续调用这个接口续传
254
-     否则,需要重新获取UploadId,重新上传这个文件。
255
- 详细参考demo。
305
+ TODOTODO
306
+ Multipart upload API
307
+ */
308
+- (OSSTask *)multipartUpload:(OSSMultipartUploadRequest *)request;
309
+/**
310
+ TODOTODO
311
+ Resumable upload API
312
+ This API wraps the multipart upload and also enables resuming upload by reading/writing  the checkpoint data.
313
+ For a new file, multipartUploadInit() needs to be called first to get the upload Id. Then use this upload id to call this API to upload the data.
314
+ If the upload fails, checks the error messages:
315
+     If it's a recoverable error, then call this API again with the same upload Id to retry. The uploaded data will not be uploaded again.
316
+     Otherwise then you may need to recreates a new upload Id and call this method again.
317
+ Check out demo for the detail.
256 318
  */
257 319
 - (OSSTask *)resumableUpload:(OSSResumableUploadRequest *)request;
258 320
 
259 321
 /**
260
- 查看某个Object是否存在
261
- @bucketName Object所在的Bucket名称
262
- @objectKey Object名称
322
+ Checks if the object exists
323
+ @bucketName Object's bucket name
324
+ @objectKey Object name
263 325
  
264
- return YES                     Object存在
265
- return NO && *error = nil      Object不存在
266
- return NO && *error != nil     发生错误
326
+ return YES                     Object exists
327
+ return NO && *error = nil      Object does not exist
328
+ return NO && *error != nil     Error occured.
267 329
  */
268 330
 - (BOOL)doesObjectExistInBucket:(NSString *)bucketName
269 331
                       objectKey:(NSString *)objectKey
270 332
                           error:(const NSError **)error;
333
+
334
+/**
335
+ * multipart upload sequentially in order,support resume upload
336
+ */
337
+- (OSSTask *)sequentialMultipartUpload:(OSSResumableUploadRequest *)request;
338
+
339
+/*
340
+ * image persist action
341
+ * https://help.aliyun.com/document_detail/55811.html
342
+ */
343
+- (OSSTask *)imageActionPersist:(OSSImagePersistRequest *)request;
344
+
271 345
 @end
272 346
 
347
+
348
+
349
+
273 350
 NS_ASSUME_NONNULL_END

+ 75
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSCocoaLumberjack.h View File

@@ -0,0 +1,75 @@
1
+// Software License Agreement (BSD License)
2
+//
3
+// Copyright (c) 2010-2016, Deusty, LLC
4
+// All rights reserved.
5
+//
6
+// Redistribution and use of this software in source and binary forms,
7
+// with or without modification, are permitted provided that the following conditions are met:
8
+//
9
+// * Redistributions of source code must retain the above copyright notice,
10
+//   this list of conditions and the following disclaimer.
11
+//
12
+// * Neither the name of Deusty nor the names of its contributors may be used
13
+//   to endorse or promote products derived from this software without specific
14
+//   prior written permission of Deusty, LLC.
15
+
16
+/**
17
+ * Welcome to CocoaLumberjack!
18
+ *
19
+ * The project page has a wealth of documentation if you have any questions.
20
+ *
21
+ * If you're new to the project you may wish to read "Getting Started" at:
22
+ * Documentation/GettingStarted.md
23
+ *
24
+ * Otherwise, here is a quick refresher.
25
+ * There are three steps to using the macros:
26
+ *
27
+ * Step 1:
28
+ * Import the header in your implementation or prefix file:
29
+ *
30
+ * #import <CocoaLumberjack/CocoaLumberjack.h>
31
+ *
32
+ * Step 2:
33
+ * Define your logging level in your implementation file:
34
+ *
35
+ * // Log levels: off, error, warn, info, verbose
36
+ * static const DDLogLevel ddLogLevel = DDLogLevelVerbose;
37
+ *
38
+ * Step 2 [3rd party frameworks]:
39
+ *
40
+ * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel:
41
+ *
42
+ * // #undef LOG_LEVEL_DEF // Undefine first only if needed
43
+ * #define LOG_LEVEL_DEF myLibLogLevel
44
+ *
45
+ * Define your logging level in your implementation file:
46
+ *
47
+ * // Log levels: off, error, warn, info, verbose
48
+ * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose;
49
+ *
50
+ * Step 3:
51
+ * Replace your NSLog statements with DDLog statements according to the severity of the message.
52
+ *
53
+ * NSLog(@"Fatal error, no dohickey found!"); -> OSSLogError(@"Fatal error, no dohickey found!");
54
+ *
55
+ * DDLog works exactly the same as NSLog.
56
+ * This means you can pass it multiple variables just like NSLog.
57
+ **/
58
+
59
+#import <Foundation/Foundation.h>
60
+
61
+// Disable legacy macros
62
+#ifndef OSSDD_LEGACY_MACROS
63
+    #define OSSDD_LEGACY_MACROS 0
64
+#endif
65
+
66
+// Core
67
+#import "OSSDDLog.h"
68
+
69
+// Main macros
70
+#import "OSSLogMacros.h"
71
+
72
+// Loggers
73
+#import "OSSFileLogger.h"
74
+#import "OSSNSLogger.h"
75
+

+ 17
- 13
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSCompat.h View File

@@ -13,11 +13,13 @@
13 13
 
14 14
 typedef OSSCancellationTokenSource OSSTaskHandler;
15 15
 
16
+NS_ASSUME_NONNULL_BEGIN
17
+
16 18
 @interface OSSClient (Compat)
17 19
 
18 20
 /**
19
- 兼容老版本用法的上传数据接口
20
- 建议更换使用:putObject
21
+ The old version's upload API.
22
+ Please use putObject instead.
21 23
  */
22 24
 - (OSSTaskHandler *)uploadData:(NSData *)data
23 25
                withContentType:(NSString *)contentType
@@ -28,8 +30,8 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
28 30
                     onProgress:(void(^)(float progress))onProgress;
29 31
 
30 32
 /**
31
- 兼容老版本用法的下载数据接口
32
- 建议更换使用:getObject
33
+ The old version's download API.
34
+ Please use getObject instead.
33 35
  */
34 36
 - (OSSTaskHandler *)downloadToDataFromBucket:(NSString *)bucketName
35 37
                    objectKey:(NSString *)objectKey
@@ -37,8 +39,8 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
37 39
                   onProgress:(void(^)(float progress))onProgress;
38 40
 
39 41
 /**
40
- 兼容老版本用法的上传文件接口
41
- 建议更换使用:putObject
42
+ The old version's upload API.
43
+ Please use putObject instead.
42 44
  */
43 45
 - (OSSTaskHandler *)uploadFile:(NSString *)filePath
44 46
                 withContentType:(NSString *)contentType
@@ -49,8 +51,8 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
49 51
                      onProgress:(void(^)(float progress))onProgress;
50 52
 
51 53
 /**
52
- 兼容老版本用法的下载文件接口
53
- 建议更换使用:getObject
54
+ The old version's download API.
55
+ Please use getObject instead.
54 56
  */
55 57
 - (OSSTaskHandler *)downloadToFileFromBucket:(NSString *)bucketName
56 58
                   objectKey:(NSString *)objectKey
@@ -60,8 +62,8 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
60 62
 
61 63
 
62 64
 /**
63
- 兼容老版本用法的断点上传文件接口
64
- 建议更换使用:resumableUpload
65
+ The old version's upload API with resumable upload support.
66
+ Please use resumableUpload instead.
65 67
  */
66 68
 - (OSSTaskHandler *)resumableUploadFile:(NSString *)filePath
67 69
           withContentType:(NSString *)contentType
@@ -72,10 +74,12 @@ typedef OSSCancellationTokenSource OSSTaskHandler;
72 74
                onProgress:(void(^)(float progress))onProgress;
73 75
 
74 76
 /**
75
- 兼容老版本用法的删除Object接口
76
- 建议更换使用:deleteObject
77
+ The old version's delete API.
78
+ Please use deleteObject instead.
77 79
  */
78 80
 - (void)deleteObjectInBucket:(NSString *)bucketName
79 81
                    objectKey:(NSString *)objectKey
80 82
                  onCompleted:(void(^)(BOOL, NSError *))onCompleted;
81
-@end
83
+@end
84
+
85
+NS_ASSUME_NONNULL_END

+ 111
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSConstants.h View File

@@ -0,0 +1,111 @@
1
+//
2
+//  OSSConstants.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+
13
+typedef NSString* _Nullable (^OSSCustomSignContentBlock) (NSString * contentToSign, NSError **error);
14
+typedef NSData * _Nullable (^OSSResponseDecoderBlock) (NSData * data);
15
+
16
+typedef void (^OSSNetworkingUploadProgressBlock) (int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend);
17
+typedef void (^OSSNetworkingDownloadProgressBlock) (int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
18
+typedef void (^OSSNetworkingRetryBlock) (void);
19
+typedef void (^OSSNetworkingCompletionHandlerBlock) (id _Nullable responseObject, NSError * _Nullable error);
20
+typedef void (^OSSNetworkingOnRecieveDataBlock) (NSData * data);
21
+
22
+/**
23
+ The flag of verification about crc64
24
+ */
25
+typedef NS_ENUM(NSUInteger, OSSRequestCRCFlag) {
26
+    OSSRequestCRCUninitialized,
27
+    OSSRequestCRCOpen,
28
+    OSSRequestCRCClosed
29
+};
30
+
31
+/**
32
+ Retry type definition
33
+ */
34
+typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) {
35
+    OSSNetworkingRetryTypeUnknown,
36
+    OSSNetworkingRetryTypeShouldRetry,
37
+    OSSNetworkingRetryTypeShouldNotRetry,
38
+    OSSNetworkingRetryTypeShouldRefreshCredentialsAndRetry,
39
+    OSSNetworkingRetryTypeShouldCorrectClockSkewAndRetry
40
+};
41
+
42
+/**
43
+ * @brief: The following constants are provided by OSSNetworking as possible operation types.
44
+ */
45
+typedef NS_ENUM(NSInteger, OSSOperationType) {
46
+    OSSOperationTypeGetService,
47
+    OSSOperationTypeCreateBucket,
48
+    OSSOperationTypeDeleteBucket,
49
+    OSSOperationTypeGetBucket,
50
+    OSSOperationTypeGetBucketACL,
51
+    OSSOperationTypeHeadObject,
52
+    OSSOperationTypeGetObject,
53
+    OSSOperationTypeGetObjectACL,
54
+    OSSOperationTypePutObject,
55
+    OSSOperationTypePutObjectACL,
56
+    OSSOperationTypeAppendObject,
57
+    OSSOperationTypeDeleteObject,
58
+    OSSOperationTypeDeleteMultipleObjects,
59
+    OSSOperationTypeCopyObject,
60
+    OSSOperationTypeInitMultipartUpload,
61
+    OSSOperationTypeUploadPart,
62
+    OSSOperationTypeCompleteMultipartUpload,
63
+    OSSOperationTypeAbortMultipartUpload,
64
+    OSSOperationTypeListMultipart,
65
+    OSSOperationTypeListMultipartUploads,
66
+    OSSOperationTypeTriggerCallBack,
67
+    OSSOperationTypeImagePersist
68
+};
69
+
70
+/**
71
+ * @brief: The following constants are provided by OSSClient as possible error codes.
72
+ */
73
+typedef NS_ENUM(NSInteger, OSSClientErrorCODE) {
74
+    OSSClientErrorCodeNetworkingFailWithResponseCode0,
75
+    OSSClientErrorCodeSignFailed,
76
+    OSSClientErrorCodeFileCantWrite,
77
+    OSSClientErrorCodeInvalidArgument,
78
+    OSSClientErrorCodeNilUploadid,
79
+    OSSClientErrorCodeTaskCancelled,
80
+    OSSClientErrorCodeNetworkError,
81
+    OSSClientErrorCodeInvalidCRC,
82
+    OSSClientErrorCodeCannotResumeUpload,
83
+    OSSClientErrorCodeExcpetionCatched,
84
+    OSSClientErrorCodeNotKnown
85
+};
86
+
87
+typedef NS_ENUM(NSInteger, OSSXMLDictionaryAttributesMode)
88
+{
89
+    OSSXMLDictionaryAttributesModePrefixed = 0, //default
90
+    OSSXMLDictionaryAttributesModeDictionary,
91
+    OSSXMLDictionaryAttributesModeUnprefixed,
92
+    OSSXMLDictionaryAttributesModeDiscard
93
+};
94
+
95
+
96
+typedef NS_ENUM(NSInteger, OSSXMLDictionaryNodeNameMode)
97
+{
98
+    OSSXMLDictionaryNodeNameModeRootOnly = 0, //default
99
+    OSSXMLDictionaryNodeNameModeAlways,
100
+    OSSXMLDictionaryNodeNameModeNever
101
+};
102
+
103
+typedef NSString * OSSXMLDictionaryAttributeName NS_EXTENSIBLE_STRING_ENUM;
104
+
105
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributesKey;
106
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryCommentsKey;
107
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryTextKey;
108
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryNodeNameKey;
109
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributePrefix;
110
+
111
+NS_ASSUME_NONNULL_END

+ 860
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSDDLog.h View File

@@ -0,0 +1,860 @@
1
+// Software License Agreement (BSD License)
2
+//
3
+// Copyright (c) 2010-2016, Deusty, LLC
4
+// All rights reserved.
5
+//
6
+// Redistribution and use of this software in source and binary forms,
7
+// with or without modification, are permitted provided that the following conditions are met:
8
+//
9
+// * Redistributions of source code must retain the above copyright notice,
10
+//   this list of conditions and the following disclaimer.
11
+//
12
+// * Neither the name of Deusty nor the names of its contributors may be used
13
+//   to endorse or promote products derived from this software without specific
14
+//   prior written permission of Deusty, LLC.
15
+
16
+#import <Foundation/Foundation.h>
17
+
18
+// Enable 1.9.x legacy macros if imported directly
19
+#ifndef OSSDD_LEGACY_MACROS
20
+    #define OSSDD_LEGACY_MACROS 1
21
+#endif
22
+
23
+#if OS_OBJECT_USE_OBJC
24
+    #define DISPATCH_QUEUE_REFERENCE_TYPE strong
25
+#else
26
+    #define DISPATCH_QUEUE_REFERENCE_TYPE assign
27
+#endif
28
+
29
+@class OSSDDLogMessage;
30
+@class OSSDDLoggerInformation;
31
+@protocol OSSDDLogger;
32
+@protocol OSSDDLogFormatter;
33
+
34
+/**
35
+ * Define the standard options.
36
+ *
37
+ * We default to only 4 levels because it makes it easier for beginners
38
+ * to make the transition to a logging framework.
39
+ *
40
+ * More advanced users may choose to completely customize the levels (and level names) to suite their needs.
41
+ * For more information on this see the "Custom Log Levels" page:
42
+ * Documentation/CustomLogLevels.md
43
+ *
44
+ * Advanced users may also notice that we're using a bitmask.
45
+ * This is to allow for custom fine grained logging:
46
+ * Documentation/FineGrainedLogging.md
47
+ *
48
+ * -- Flags --
49
+ *
50
+ * Typically you will use the LOG_LEVELS (see below), but the flags may be used directly in certain situations.
51
+ * For example, say you have a lot of warning log messages, and you wanted to disable them.
52
+ * However, you still needed to see your error and info log messages.
53
+ * You could accomplish that with the following:
54
+ *
55
+ * static const DDLogLevel ddLogLevel = DDLogFlagError | DDLogFlagInfo;
56
+ *
57
+ * When LOG_LEVEL_DEF is defined as ddLogLevel.
58
+ *
59
+ * Flags may also be consulted when writing custom log formatters,
60
+ * as the DDLogMessage class captures the individual flag that caused the log message to fire.
61
+ *
62
+ * -- Levels --
63
+ *
64
+ * Log levels are simply the proper bitmask of the flags.
65
+ *
66
+ * -- Booleans --
67
+ *
68
+ * The booleans may be used when your logging code involves more than one line.
69
+ * For example:
70
+ *
71
+ * if (LOG_VERBOSE) {
72
+ *     for (id sprocket in sprockets)
73
+ *         DDLogVerbose(@"sprocket: %@", [sprocket description])
74
+ * }
75
+ *
76
+ * -- Async --
77
+ *
78
+ * Defines the default asynchronous options.
79
+ * The default philosophy for asynchronous logging is very simple:
80
+ *
81
+ * Log messages with errors should be executed synchronously.
82
+ *     After all, an error just occurred. The application could be unstable.
83
+ *
84
+ * All other log messages, such as debug output, are executed asynchronously.
85
+ *     After all, if it wasn't an error, then it was just informational output,
86
+ *     or something the application was easily able to recover from.
87
+ *
88
+ * -- Changes --
89
+ *
90
+ * You are strongly discouraged from modifying this file.
91
+ * If you do, you make it more difficult on yourself to merge future bug fixes and improvements from the project.
92
+ * Instead, create your own MyLogging.h or ApplicationNameLogging.h or CompanyLogging.h
93
+ *
94
+ * For an example of customizing your logging experience, see the "Custom Log Levels" page:
95
+ * Documentation/CustomLogLevels.md
96
+ **/
97
+
98
+/**
99
+ *  Flags accompany each log. They are used together with levels to filter out logs.
100
+ */
101
+typedef NS_OPTIONS(NSUInteger, OSSDDLogFlag){
102
+    /**
103
+     *  0...00001 DDLogFlagError
104
+     */
105
+    OSSDDLogFlagError      = (1 << 0),
106
+    
107
+    /**
108
+     *  0...00010 DDLogFlagWarning
109
+     */
110
+    OSSDDLogFlagWarning    = (1 << 1),
111
+    
112
+    /**
113
+     *  0...00100 DDLogFlagInfo
114
+     */
115
+    OSSDDLogFlagInfo       = (1 << 2),
116
+    
117
+    /**
118
+     *  0...01000 DDLogFlagDebug
119
+     */
120
+    OSSDDLogFlagDebug      = (1 << 3),
121
+    
122
+    /**
123
+     *  0...10000 DDLogFlagVerbose
124
+     */
125
+    OSSDDLogFlagVerbose    = (1 << 4)
126
+};
127
+
128
+/**
129
+ *  Log levels are used to filter out logs. Used together with flags.
130
+ */
131
+typedef NS_ENUM(NSUInteger, OSSDDLogLevel){
132
+    /**
133
+     *  No logs
134
+     */
135
+    OSSDDLogLevelOff       = 0,
136
+    
137
+    /**
138
+     *  Error logs only
139
+     */
140
+    OSSDDLogLevelError     = (OSSDDLogFlagError),
141
+    
142
+    /**
143
+     *  Error and warning logs
144
+     */
145
+    OSSDDLogLevelWarning   = (OSSDDLogLevelError   | OSSDDLogFlagWarning),
146
+    
147
+    /**
148
+     *  Error, warning and info logs
149
+     */
150
+    OSSDDLogLevelInfo      = (OSSDDLogLevelWarning | OSSDDLogFlagInfo),
151
+    
152
+    /**
153
+     *  Error, warning, info and debug logs
154
+     */
155
+    OSSDDLogLevelDebug     = (OSSDDLogLevelInfo    | OSSDDLogFlagDebug),
156
+    
157
+    /**
158
+     *  Error, warning, info, debug and verbose logs
159
+     */
160
+    OSSDDLogLevelVerbose   = (OSSDDLogLevelDebug   | OSSDDLogFlagVerbose),
161
+    
162
+    /**
163
+     *  All logs (1...11111)
164
+     */
165
+    OSSDDLogLevelAll       = NSUIntegerMax
166
+};
167
+
168
+NS_ASSUME_NONNULL_BEGIN
169
+
170
+/**
171
+ *  Extracts just the file name, no path or extension
172
+ *
173
+ *  @param filePath input file path
174
+ *  @param copy     YES if we want the result to be copied
175
+ *
176
+ *  @return the file name
177
+ */
178
+NSString * __nullable OSSDDExtractFileNameWithoutExtension(const char *filePath, BOOL copy);
179
+
180
+/**
181
+ * The THIS_FILE macro gives you an NSString of the file name.
182
+ * For simplicity and clarity, the file name does not include the full path or file extension.
183
+ *
184
+ * For example: DDLogWarn(@"%@: Unable to find thingy", THIS_FILE) -> @"MyViewController: Unable to find thingy"
185
+ **/
186
+#define THIS_FILE         (DDExtractFileNameWithoutExtension(__FILE__, NO))
187
+
188
+/**
189
+ * The THIS_METHOD macro gives you the name of the current objective-c method.
190
+ *
191
+ * For example: DDLogWarn(@"%@ - Requires non-nil strings", THIS_METHOD) -> @"setMake:model: requires non-nil strings"
192
+ *
193
+ * Note: This does NOT work in straight C functions (non objective-c).
194
+ * Instead you should use the predefined __FUNCTION__ macro.
195
+ **/
196
+#define THIS_METHOD       NSStringFromSelector(_cmd)
197
+
198
+
199
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
200
+#pragma mark -
201
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
202
+
203
+/**
204
+ *  The main class, exposes all logging mechanisms, loggers, ...
205
+ *  For most of the users, this class is hidden behind the logging functions like `DDLogInfo`
206
+ */
207
+@interface OSSDDLog : NSObject
208
+
209
+/**
210
+ *  Returns the singleton `DDLog`.
211
+ *  The instance is used by `DDLog` class methods.
212
+ */
213
+@property (class, nonatomic, strong, readonly) OSSDDLog *sharedInstance;
214
+
215
+/**
216
+ * Provides access to the underlying logging queue.
217
+ * This may be helpful to Logger classes for things like thread synchronization.
218
+ **/
219
+@property (class, nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggingQueue;
220
+
221
+/**
222
+ * Logging Primitive.
223
+ *
224
+ * This method is used by the macros or logging functions.
225
+ * It is suggested you stick with the macros as they're easier to use.
226
+ *
227
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
228
+ *  @param level        the log level
229
+ *  @param flag         the log flag
230
+ *  @param context      the context (if any is defined)
231
+ *  @param file         the current file
232
+ *  @param function     the current function
233
+ *  @param line         the current code line
234
+ *  @param tag          potential tag
235
+ *  @param format       the log format
236
+ */
237
++ (void)log:(BOOL)asynchronous
238
+      level:(OSSDDLogLevel)level
239
+       flag:(OSSDDLogFlag)flag
240
+    context:(NSInteger)context
241
+       file:(const char *)file
242
+   function:(const char *)function
243
+       line:(NSUInteger)line
244
+        tag:(id __nullable)tag
245
+     format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10);
246
+
247
+/**
248
+ * Logging Primitive.
249
+ *
250
+ * This method is used by the macros or logging functions.
251
+ * It is suggested you stick with the macros as they're easier to use.
252
+ *
253
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
254
+ *  @param level        the log level
255
+ *  @param flag         the log flag
256
+ *  @param context      the context (if any is defined)
257
+ *  @param file         the current file
258
+ *  @param function     the current function
259
+ *  @param line         the current code line
260
+ *  @param tag          potential tag
261
+ *  @param format       the log format
262
+ */
263
+- (void)log:(BOOL)asynchronous
264
+      level:(OSSDDLogLevel)level
265
+       flag:(OSSDDLogFlag)flag
266
+    context:(NSInteger)context
267
+       file:(const char *)file
268
+   function:(const char *)function
269
+       line:(NSUInteger)line
270
+        tag:(id __nullable)tag
271
+     format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10);
272
+
273
+/**
274
+ * Logging Primitive.
275
+ *
276
+ * This method can be used if you have a prepared va_list.
277
+ * Similar to `log:level:flag:context:file:function:line:tag:format:...`
278
+ *
279
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
280
+ *  @param level        the log level
281
+ *  @param flag         the log flag
282
+ *  @param context      the context (if any is defined)
283
+ *  @param file         the current file
284
+ *  @param function     the current function
285
+ *  @param line         the current code line
286
+ *  @param tag          potential tag
287
+ *  @param format       the log format
288
+ *  @param argList      the arguments list as a va_list
289
+ */
290
++ (void)log:(BOOL)asynchronous
291
+      level:(OSSDDLogLevel)level
292
+       flag:(OSSDDLogFlag)flag
293
+    context:(NSInteger)context
294
+       file:(const char *)file
295
+   function:(const char *)function
296
+       line:(NSUInteger)line
297
+        tag:(id __nullable)tag
298
+     format:(NSString *)format
299
+       args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:));
300
+
301
+/**
302
+ * Logging Primitive.
303
+ *
304
+ * This method can be used if you have a prepared va_list.
305
+ * Similar to `log:level:flag:context:file:function:line:tag:format:...`
306
+ *
307
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
308
+ *  @param level        the log level
309
+ *  @param flag         the log flag
310
+ *  @param context      the context (if any is defined)
311
+ *  @param file         the current file
312
+ *  @param function     the current function
313
+ *  @param line         the current code line
314
+ *  @param tag          potential tag
315
+ *  @param format       the log format
316
+ *  @param argList      the arguments list as a va_list
317
+ */
318
+- (void)log:(BOOL)asynchronous
319
+      level:(OSSDDLogLevel)level
320
+       flag:(OSSDDLogFlag)flag
321
+    context:(NSInteger)context
322
+       file:(const char *)file
323
+   function:(const char *)function
324
+       line:(NSUInteger)line
325
+        tag:(id __nullable)tag
326
+     format:(NSString *)format
327
+       args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:));
328
+
329
+/**
330
+ * Logging Primitive.
331
+ *
332
+ * This method can be used if you manualy prepared DDLogMessage.
333
+ *
334
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
335
+ *  @param logMessage   the log message stored in a `DDLogMessage` model object
336
+ */
337
++ (void)log:(BOOL)asynchronous
338
+    message:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:));
339
+
340
+/**
341
+ * Logging Primitive.
342
+ *
343
+ * This method can be used if you manualy prepared DDLogMessage.
344
+ *
345
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
346
+ *  @param logMessage   the log message stored in a `DDLogMessage` model object
347
+ */
348
+- (void)log:(BOOL)asynchronous
349
+    message:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:));
350
+
351
+/**
352
+ * Since logging can be asynchronous, there may be times when you want to flush the logs.
353
+ * The framework invokes this automatically when the application quits.
354
+ **/
355
++ (void)flushLog;
356
+
357
+/**
358
+ * Since logging can be asynchronous, there may be times when you want to flush the logs.
359
+ * The framework invokes this automatically when the application quits.
360
+ **/
361
+- (void)flushLog;
362
+
363
+/**
364
+ * Loggers
365
+ *
366
+ * In order for your log statements to go somewhere, you should create and add a logger.
367
+ *
368
+ * You can add multiple loggers in order to direct your log statements to multiple places.
369
+ * And each logger can be configured separately.
370
+ * So you could have, for example, verbose logging to the console, but a concise log file with only warnings & errors.
371
+ **/
372
+
373
+/**
374
+ * Adds the logger to the system.
375
+ *
376
+ * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`.
377
+ **/
378
++ (void)addLogger:(id <OSSDDLogger>)logger;
379
+
380
+/**
381
+ * Adds the logger to the system.
382
+ *
383
+ * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`.
384
+ **/
385
+- (void)addLogger:(id <OSSDDLogger>)logger;
386
+
387
+/**
388
+ * Adds the logger to the system.
389
+ *
390
+ * The level that you provide here is a preemptive filter (for performance).
391
+ * That is, the level specified here will be used to filter out logMessages so that
392
+ * the logger is never even invoked for the messages.
393
+ *
394
+ * More information:
395
+ * When you issue a log statement, the logging framework iterates over each logger,
396
+ * and checks to see if it should forward the logMessage to the logger.
397
+ * This check is done using the level parameter passed to this method.
398
+ *
399
+ * For example:
400
+ *
401
+ * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];`
402
+ * `[DDLog addLogger:fileLogger    withLogLevel:DDLogLevelWarning];`
403
+ *
404
+ * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger
405
+ * `DDLogInfo(@"hi");`     => gets forwarded to consoleLogger only
406
+ *
407
+ * It is important to remember that Lumberjack uses a BITMASK.
408
+ * Many developers & third party frameworks may define extra log levels & flags.
409
+ * For example:
410
+ *
411
+ * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000`
412
+ *
413
+ * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages.
414
+ *
415
+ * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO`
416
+ *
417
+ * Consider passing `DDLogLevelAll` to this method, which has all bits set.
418
+ * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set,
419
+ * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug:
420
+ *
421
+ * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)`
422
+ **/
423
++ (void)addLogger:(id <OSSDDLogger>)logger withLevel:(OSSDDLogLevel)level;
424
+
425
+/**
426
+ * Adds the logger to the system.
427
+ *
428
+ * The level that you provide here is a preemptive filter (for performance).
429
+ * That is, the level specified here will be used to filter out logMessages so that
430
+ * the logger is never even invoked for the messages.
431
+ *
432
+ * More information:
433
+ * When you issue a log statement, the logging framework iterates over each logger,
434
+ * and checks to see if it should forward the logMessage to the logger.
435
+ * This check is done using the level parameter passed to this method.
436
+ *
437
+ * For example:
438
+ *
439
+ * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];`
440
+ * `[DDLog addLogger:fileLogger    withLogLevel:DDLogLevelWarning];`
441
+ *
442
+ * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger
443
+ * `DDLogInfo(@"hi");`     => gets forwarded to consoleLogger only
444
+ *
445
+ * It is important to remember that Lumberjack uses a BITMASK.
446
+ * Many developers & third party frameworks may define extra log levels & flags.
447
+ * For example:
448
+ *
449
+ * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000`
450
+ *
451
+ * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages.
452
+ *
453
+ * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO`
454
+ *
455
+ * Consider passing `DDLogLevelAll` to this method, which has all bits set.
456
+ * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set,
457
+ * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug:
458
+ *
459
+ * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)`
460
+ **/
461
+- (void)addLogger:(id <OSSDDLogger>)logger withLevel:(OSSDDLogLevel)level;
462
+
463
+/**
464
+ *  Remove the logger from the system
465
+ */
466
++ (void)removeLogger:(id <OSSDDLogger>)logger;
467
+
468
+/**
469
+ *  Remove the logger from the system
470
+ */
471
+- (void)removeLogger:(id <OSSDDLogger>)logger;
472
+
473
+/**
474
+ *  Remove all the current loggers
475
+ */
476
++ (void)removeAllLoggers;
477
+
478
+/**
479
+ *  Remove all the current loggers
480
+ */
481
+- (void)removeAllLoggers;
482
+
483
+/**
484
+ *  Return all the current loggers
485
+ */
486
+@property (class, nonatomic, copy, readonly) NSArray<id<OSSDDLogger>> *allLoggers;
487
+
488
+/**
489
+ *  Return all the current loggers
490
+ */
491
+@property (nonatomic, copy, readonly) NSArray<id<OSSDDLogger>> *allLoggers;
492
+
493
+/**
494
+ *  Return all the current loggers with their level (aka DDLoggerInformation).
495
+ */
496
+@property (class, nonatomic, copy, readonly) NSArray<OSSDDLoggerInformation *> *allLoggersWithLevel;
497
+
498
+/**
499
+ *  Return all the current loggers with their level (aka DDLoggerInformation).
500
+ */
501
+@property (nonatomic, copy, readonly) NSArray<OSSDDLoggerInformation *> *allLoggersWithLevel;
502
+
503
+@end
504
+
505
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
506
+#pragma mark -
507
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
508
+
509
+/**
510
+ *  This protocol describes a basic logger behavior. 
511
+ *  Basically, it can log messages, store a logFormatter plus a bunch of optional behaviors.
512
+ *  (i.e. flush, get its loggerQueue, get its name, ...
513
+ */
514
+@protocol OSSDDLogger <NSObject>
515
+
516
+/**
517
+ *  The log message method
518
+ *
519
+ *  @param logMessage the message (model)
520
+ */
521
+- (void)logMessage:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(message:));
522
+
523
+/**
524
+ * Formatters may optionally be added to any logger.
525
+ *
526
+ * If no formatter is set, the logger simply logs the message as it is given in logMessage,
527
+ * or it may use its own built in formatting style.
528
+ **/
529
+@property (nonatomic, strong) id <OSSDDLogFormatter> logFormatter;
530
+
531
+@optional
532
+
533
+/**
534
+ * Since logging is asynchronous, adding and removing loggers is also asynchronous.
535
+ * In other words, the loggers are added and removed at appropriate times with regards to log messages.
536
+ *
537
+ * - Loggers will not receive log messages that were executed prior to when they were added.
538
+ * - Loggers will not receive log messages that were executed after they were removed.
539
+ *
540
+ * These methods are executed in the logging thread/queue.
541
+ * This is the same thread/queue that will execute every logMessage: invocation.
542
+ * Loggers may use these methods for thread synchronization or other setup/teardown tasks.
543
+ **/
544
+- (void)didAddLogger;
545
+
546
+/**
547
+ * Since logging is asynchronous, adding and removing loggers is also asynchronous.
548
+ * In other words, the loggers are added and removed at appropriate times with regards to log messages.
549
+ *
550
+ * - Loggers will not receive log messages that were executed prior to when they were added.
551
+ * - Loggers will not receive log messages that were executed after they were removed.
552
+ *
553
+ * These methods are executed in the logging thread/queue given in parameter.
554
+ * This is the same thread/queue that will execute every logMessage: invocation.
555
+ * Loggers may use the queue parameter to set specific values on the queue with dispatch_set_specific() function.
556
+ **/
557
+- (void)didAddLoggerInQueue:(dispatch_queue_t)queue;
558
+
559
+/**
560
+ *  See the above description for `didAddLoger`
561
+ */
562
+- (void)willRemoveLogger;
563
+
564
+/**
565
+ * Some loggers may buffer IO for optimization purposes.
566
+ * For example, a database logger may only save occasionaly as the disk IO is slow.
567
+ * In such loggers, this method should be implemented to flush any pending IO.
568
+ *
569
+ * This allows invocations of DDLog's flushLog method to be propogated to loggers that need it.
570
+ *
571
+ * Note that DDLog's flushLog method is invoked automatically when the application quits,
572
+ * and it may be also invoked manually by the developer prior to application crashes, or other such reasons.
573
+ **/
574
+- (void)flush;
575
+
576
+/**
577
+ * Each logger is executed concurrently with respect to the other loggers.
578
+ * Thus, a dedicated dispatch queue is used for each logger.
579
+ * Logger implementations may optionally choose to provide their own dispatch queue.
580
+ **/
581
+@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggerQueue;
582
+
583
+/**
584
+ * If the logger implementation does not choose to provide its own queue,
585
+ * one will automatically be created for it.
586
+ * The created queue will receive its name from this method.
587
+ * This may be helpful for debugging or profiling reasons.
588
+ **/
589
+@property (nonatomic, readonly) NSString *loggerName;
590
+
591
+@end
592
+
593
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
594
+#pragma mark -
595
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
596
+
597
+/**
598
+ *  This protocol describes the behavior of a log formatter
599
+ */
600
+@protocol OSSDDLogFormatter <NSObject>
601
+@required
602
+
603
+/**
604
+ * Formatters may optionally be added to any logger.
605
+ * This allows for increased flexibility in the logging environment.
606
+ * For example, log messages for log files may be formatted differently than log messages for the console.
607
+ *
608
+ * For more information about formatters, see the "Custom Formatters" page:
609
+ * Documentation/CustomFormatters.md
610
+ *
611
+ * The formatter may also optionally filter the log message by returning nil,
612
+ * in which case the logger will not log the message.
613
+ **/
614
+- (NSString * __nullable)formatLogMessage:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(format(message:));
615
+
616
+@optional
617
+
618
+/**
619
+ * A single formatter instance can be added to multiple loggers.
620
+ * These methods provides hooks to notify the formatter of when it's added/removed.
621
+ *
622
+ * This is primarily for thread-safety.
623
+ * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers.
624
+ * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter),
625
+ * it could possibly use these hooks to switch to thread-safe versions of the code.
626
+ **/
627
+- (void)didAddToLogger:(id <OSSDDLogger>)logger;
628
+
629
+/**
630
+ * A single formatter instance can be added to multiple loggers.
631
+ * These methods provides hooks to notify the formatter of when it's added/removed.
632
+ *
633
+ * This is primarily for thread-safety.
634
+ * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers.
635
+ * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter),
636
+ * it could possibly use these hooks to switch to thread-safe versions of the code or use dispatch_set_specific()
637
+.* to add its own specific values.
638
+ **/
639
+- (void)didAddToLogger:(id <OSSDDLogger>)logger inQueue:(dispatch_queue_t)queue;
640
+
641
+/**
642
+ *  See the above description for `didAddToLogger:`
643
+ */
644
+- (void)willRemoveFromLogger:(id <OSSDDLogger>)logger;
645
+
646
+@end
647
+
648
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
649
+#pragma mark -
650
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
651
+
652
+/**
653
+ *  This protocol describes a dynamic logging component
654
+ */
655
+@protocol OSSDDRegisteredDynamicLogging
656
+
657
+/**
658
+ * Implement these methods to allow a file's log level to be managed from a central location.
659
+ *
660
+ * This is useful if you'd like to be able to change log levels for various parts
661
+ * of your code from within the running application.
662
+ *
663
+ * Imagine pulling up the settings for your application,
664
+ * and being able to configure the logging level on a per file basis.
665
+ *
666
+ * The implementation can be very straight-forward:
667
+ *
668
+ * ```
669
+ * + (int)ddLogLevel
670
+ * {
671
+ *     return ddLogLevel;
672
+ * }
673
+ *
674
+ * + (void)ddSetLogLevel:(DDLogLevel)level
675
+ * {
676
+ *     ddLogLevel = level;
677
+ * }
678
+ * ```
679
+ **/
680
+@property (class, nonatomic, readwrite, setter=ddSetLogLevel:) OSSDDLogLevel ossLogLevel;
681
+
682
+@end
683
+
684
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
685
+#pragma mark -
686
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
687
+
688
+#ifndef NS_DESIGNATED_INITIALIZER
689
+    #define NS_DESIGNATED_INITIALIZER
690
+#endif
691
+
692
+/**
693
+ *  Log message options, allow copying certain log elements
694
+ */
695
+typedef NS_OPTIONS(NSInteger, OSSDDLogMessageOptions){
696
+    /**
697
+     *  Use this to use a copy of the file path
698
+     */
699
+    OSSDDLogMessageCopyFile        = 1 << 0,
700
+    /**
701
+     *  Use this to use a copy of the function name
702
+     */
703
+    OSSDDLogMessageCopyFunction    = 1 << 1,
704
+    /**
705
+     *  Use this to use avoid a copy of the message
706
+     */
707
+    OSSDDLogMessageDontCopyMessage = 1 << 2
708
+};
709
+
710
+/**
711
+ * The `DDLogMessage` class encapsulates information about the log message.
712
+ * If you write custom loggers or formatters, you will be dealing with objects of this class.
713
+ **/
714
+@interface OSSDDLogMessage : NSObject <NSCopying>
715
+{
716
+    // Direct accessors to be used only for performance
717
+    @public
718
+    NSString *_message;
719
+    OSSDDLogLevel _level;
720
+    OSSDDLogFlag _flag;
721
+    NSInteger _context;
722
+    NSString *_file;
723
+    NSString *_fileName;
724
+    NSString *_function;
725
+    NSUInteger _line;
726
+    id _tag;
727
+    OSSDDLogMessageOptions _options;
728
+    NSDate *_timestamp;
729
+    NSString *_threadID;
730
+    NSString *_threadName;
731
+    NSString *_queueLabel;
732
+}
733
+
734
+/**
735
+ *  Default `init` for empty messages.
736
+ */
737
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
738
+
739
+/**
740
+ * Standard init method for a log message object.
741
+ * Used by the logging primitives. (And the macros use the logging primitives.)
742
+ *
743
+ * If you find need to manually create logMessage objects, there is one thing you should be aware of:
744
+ *
745
+ * If no flags are passed, the method expects the file and function parameters to be string literals.
746
+ * That is, it expects the given strings to exist for the duration of the object's lifetime,
747
+ * and it expects the given strings to be immutable.
748
+ * In other words, it does not copy these strings, it simply points to them.
749
+ * This is due to the fact that __FILE__ and __FUNCTION__ are usually used to specify these parameters,
750
+ * so it makes sense to optimize and skip the unnecessary allocations.
751
+ * However, if you need them to be copied you may use the options parameter to specify this.
752
+ *
753
+ *  @param message   the message
754
+ *  @param level     the log level
755
+ *  @param flag      the log flag
756
+ *  @param context   the context (if any is defined)
757
+ *  @param file      the current file
758
+ *  @param function  the current function
759
+ *  @param line      the current code line
760
+ *  @param tag       potential tag
761
+ *  @param options   a bitmask which supports DDLogMessageCopyFile and DDLogMessageCopyFunction.
762
+ *  @param timestamp the log timestamp
763
+ *
764
+ *  @return a new instance of a log message model object
765
+ */
766
+- (instancetype)initWithMessage:(NSString *)message
767
+                          level:(OSSDDLogLevel)level
768
+                           flag:(OSSDDLogFlag)flag
769
+                        context:(NSInteger)context
770
+                           file:(NSString *)file
771
+                       function:(NSString * __nullable)function
772
+                           line:(NSUInteger)line
773
+                            tag:(id __nullable)tag
774
+                        options:(OSSDDLogMessageOptions)options
775
+                      timestamp:(NSDate * __nullable)timestamp NS_DESIGNATED_INITIALIZER;
776
+
777
+/**
778
+ * Read-only properties
779
+ **/
780
+
781
+/**
782
+ *  The log message
783
+ */
784
+@property (readonly, nonatomic) NSString *message;
785
+@property (readonly, nonatomic) OSSDDLogLevel level;
786
+@property (readonly, nonatomic) OSSDDLogFlag flag;
787
+@property (readonly, nonatomic) NSInteger context;
788
+@property (readonly, nonatomic) NSString *file;
789
+@property (readonly, nonatomic) NSString *fileName;
790
+@property (readonly, nonatomic) NSString * __nullable function;
791
+@property (readonly, nonatomic) NSUInteger line;
792
+@property (readonly, nonatomic) id __nullable tag;
793
+@property (readonly, nonatomic) OSSDDLogMessageOptions options;
794
+@property (readonly, nonatomic) NSDate *timestamp;
795
+@property (readonly, nonatomic) NSString *threadID; // ID as it appears in NSLog calculated from the machThreadID
796
+@property (readonly, nonatomic) NSString *threadName;
797
+@property (readonly, nonatomic) NSString *queueLabel;
798
+
799
+@end
800
+
801
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
802
+#pragma mark -
803
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
804
+
805
+/**
806
+ * The `DDLogger` protocol specifies that an optional formatter can be added to a logger.
807
+ * Most (but not all) loggers will want to support formatters.
808
+ *
809
+ * However, writting getters and setters in a thread safe manner,
810
+ * while still maintaining maximum speed for the logging process, is a difficult task.
811
+ *
812
+ * To do it right, the implementation of the getter/setter has strict requiremenets:
813
+ * - Must NOT require the `logMessage:` method to acquire a lock.
814
+ * - Must NOT require the `logMessage:` method to access an atomic property (also a lock of sorts).
815
+ *
816
+ * To simplify things, an abstract logger is provided that implements the getter and setter.
817
+ *
818
+ * Logger implementations may simply extend this class,
819
+ * and they can ACCESS THE FORMATTER VARIABLE DIRECTLY from within their `logMessage:` method!
820
+ **/
821
+@interface OSSDDAbstractLogger : NSObject <OSSDDLogger>
822
+{
823
+    // Direct accessors to be used only for performance
824
+    @public
825
+    id <OSSDDLogFormatter> _logFormatter;
826
+    dispatch_queue_t _loggerQueue;
827
+}
828
+
829
+@property (nonatomic, strong, nullable) id <OSSDDLogFormatter> logFormatter;
830
+@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE) dispatch_queue_t loggerQueue;
831
+
832
+// For thread-safety assertions
833
+
834
+/**
835
+ *  Return YES if the current logger uses a global queue for logging
836
+ */
837
+@property (nonatomic, readonly, getter=isOnGlobalLoggingQueue)  BOOL onGlobalLoggingQueue;
838
+
839
+/**
840
+ *  Return YES if the current logger uses the internal designated queue for logging
841
+ */
842
+@property (nonatomic, readonly, getter=isOnInternalLoggerQueue) BOOL onInternalLoggerQueue;
843
+
844
+@end
845
+
846
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
847
+#pragma mark -
848
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
849
+
850
+@interface OSSDDLoggerInformation : NSObject
851
+
852
+@property (nonatomic, readonly) id <OSSDDLogger> logger;
853
+@property (nonatomic, readonly) OSSDDLogLevel level;
854
+
855
++ (OSSDDLoggerInformation *)informationWithLogger:(id <OSSDDLogger>)logger
856
+                           andLevel:(OSSDDLogLevel)level;
857
+
858
+@end
859
+
860
+NS_ASSUME_NONNULL_END

+ 12
- 1
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSDefine.h View File

@@ -11,17 +11,27 @@
11 11
 #ifndef OSSDefine_h
12 12
 #define OSSDefine_h
13 13
 
14
+#if TARGET_OS_IOS
14 15
 #define OSSUAPrefix                             @"aliyun-sdk-ios"
15
-#define OSSSDKVersion                           @"2.6.1"
16
+#elif TARGET_OS_OSX
17
+#define OSSUAPrefix                             @"aliyun-sdk-mac"
18
+#endif
19
+#define OSSSDKVersion                           @"2.10.4"
16 20
 
17 21
 #define OSSListBucketResultXMLTOKEN             @"ListBucketResult"
18 22
 #define OSSNameXMLTOKEN                         @"Name"
19 23
 #define OSSDelimiterXMLTOKEN                    @"Delimiter"
20 24
 #define OSSMarkerXMLTOKEN                       @"Marker"
25
+#define OSSKeyMarkerXMLTOKEN                    @"KeyMarker"
21 26
 #define OSSNextMarkerXMLTOKEN                   @"NextMarker"
27
+#define OSSNextKeyMarkerXMLTOKEN                @"NextKeyMarker"
28
+#define OSSUploadIdMarkerXMLTOKEN               @"UploadIdMarker"
29
+#define OSSNextUploadIdMarkerXMLTOKEN           @"NextUploadIdMarker"
22 30
 #define OSSMaxKeysXMLTOKEN                      @"MaxKeys"
31
+#define OSSMaxUploadsXMLTOKEN                   @"MaxUploads"
23 32
 #define OSSIsTruncatedXMLTOKEN                  @"IsTruncated"
24 33
 #define OSSContentsXMLTOKEN                     @"Contents"
34
+#define OSSUploadXMLTOKEN                       @"Upload"
25 35
 #define OSSKeyXMLTOKEN                          @"Key"
26 36
 #define OSSLastModifiedXMLTOKEN                 @"LastModified"
27 37
 #define OSSETagXMLTOKEN                         @"ETag"
@@ -58,6 +68,7 @@
58 68
 #define OSSHttpHeaderContentMD5                 @"Content-MD5"
59 69
 #define OSSHttpHeaderCacheControl               @"Cache-Control"
60 70
 #define OSSHttpHeaderExpires                    @"Expires"
71
+#define OSSHttpHeaderHashSHA1                   @"x-oss-hash-sha1"
61 72
 
62 73
 #define OSSDefaultRetryCount                    3
63 74
 #define OSSDefaultMaxConcurrentNum              5

+ 31
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsRequest.h View File

@@ -0,0 +1,31 @@
1
+//
2
+//  OSSDeleteMultipleObjectsRequest.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+#import <Foundation/Foundation.h>
9
+#import "OSSRequest.h"
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+
13
+@interface OSSDeleteMultipleObjectsRequest : OSSRequest
14
+
15
+@property (nonatomic, copy) NSString *bucketName;
16
+
17
+@property (nonatomic, copy) NSArray<NSString *> *keys;
18
+
19
+/**
20
+ invalid value is @"url"
21
+ */
22
+@property (nonatomic, copy, nullable) NSString *encodingType;
23
+
24
+/**
25
+ whether to show verbose result,the default value is YES.
26
+ */
27
+@property (nonatomic, assign) BOOL quiet;
28
+
29
+@end
30
+
31
+NS_ASSUME_NONNULL_END

+ 17
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSDeleteMultipleObjectsResult.h View File

@@ -0,0 +1,17 @@
1
+//
2
+//  OSSDeleteMultipleObjectsResult.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import "OSSResult.h"
10
+
11
+@interface OSSDeleteMultipleObjectsResult : OSSResult
12
+
13
+@property (nonatomic, copy) NSArray<NSString *> *deletedObjects;
14
+
15
+@property (nonatomic, copy) NSString *encodingType;
16
+
17
+@end

+ 2
- 2
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSExecutor.h View File

@@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
37 37
  Returns a new executor that uses the given block to execute continuations.
38 38
  @param block The block to use.
39 39
  */
40
-+ (instancetype)executorWithBlock:(void(^)(void(^block)()))block;
40
++ (instancetype)executorWithBlock:(void(^)(void(^block)(void)))block;
41 41
 
42 42
 /*!
43 43
  Returns a new executor that runs continuations on the given queue.
@@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
55 55
  Runs the given block using this executor's particular strategy.
56 56
  @param block The block to execute.
57 57
  */
58
-- (void)execute:(void(^)())block;
58
+- (void)execute:(void(^)(void))block;
59 59
 
60 60
 @end
61 61
 

+ 509
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSFileLogger.h View File

@@ -0,0 +1,509 @@
1
+// Software License Agreement (BSD License)
2
+//
3
+// Copyright (c) 2010-2016, Deusty, LLC
4
+// All rights reserved.
5
+//
6
+// Redistribution and use of this software in source and binary forms,
7
+// with or without modification, are permitted provided that the following conditions are met:
8
+//
9
+// * Redistributions of source code must retain the above copyright notice,
10
+//   this list of conditions and the following disclaimer.
11
+//
12
+// * Neither the name of Deusty nor the names of its contributors may be used
13
+//   to endorse or promote products derived from this software without specific
14
+//   prior written permission of Deusty, LLC.
15
+
16
+// Disable legacy macros
17
+#ifndef DD_LEGACY_MACROS
18
+    #define DD_LEGACY_MACROS 0
19
+#endif
20
+
21
+#import "OSSDDLog.h"
22
+
23
+@class OSSDDLogFileInfo;
24
+
25
+/**
26
+ * This class provides a logger to write log statements to a file.
27
+ **/
28
+
29
+
30
+// Default configuration and safety/sanity values.
31
+//
32
+// maximumFileSize         -> kDDDefaultLogMaxFileSize
33
+// rollingFrequency        -> kDDDefaultLogRollingFrequency
34
+// maximumNumberOfLogFiles -> kDDDefaultLogMaxNumLogFiles
35
+// logFilesDiskQuota       -> kDDDefaultLogFilesDiskQuota
36
+//
37
+// You should carefully consider the proper configuration values for your application.
38
+
39
+extern unsigned long long const osskDDDefaultLogMaxFileSize;
40
+extern NSTimeInterval     const osskDDDefaultLogRollingFrequency;
41
+extern NSUInteger         const osskDDDefaultLogMaxNumLogFiles;
42
+extern unsigned long long const osskDDDefaultLogFilesDiskQuota;
43
+
44
+
45
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
46
+#pragma mark -
47
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
48
+
49
+/**
50
+ *  The LogFileManager protocol is designed to allow you to control all aspects of your log files.
51
+ *
52
+ *  The primary purpose of this is to allow you to do something with the log files after they have been rolled.
53
+ *  Perhaps you want to compress them to save disk space.
54
+ *  Perhaps you want to upload them to an FTP server.
55
+ *  Perhaps you want to run some analytics on the file.
56
+ *
57
+ *  A default LogFileManager is, of course, provided.
58
+ *  The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property.
59
+ *
60
+ *  This protocol provides various methods to fetch the list of log files.
61
+ *
62
+ *  There are two variants: sorted and unsorted.
63
+ *  If sorting is not necessary, the unsorted variant is obviously faster.
64
+ *  The sorted variant will return an array sorted by when the log files were created,
65
+ *  with the most recently created log file at index 0, and the oldest log file at the end of the array.
66
+ *
67
+ *  You can fetch only the log file paths (full path including name), log file names (name only),
68
+ *  or an array of `DDLogFileInfo` objects.
69
+ *  The `DDLogFileInfo` class is documented below, and provides a handy wrapper that
70
+ *  gives you easy access to various file attributes such as the creation date or the file size.
71
+ */
72
+@protocol OSSDDLogFileManager <NSObject>
73
+@required
74
+
75
+// Public properties
76
+
77
+/**
78
+ * The maximum number of archived log files to keep on disk.
79
+ * For example, if this property is set to 3,
80
+ * then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk.
81
+ * Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted.
82
+ *
83
+ * You may optionally disable this option by setting it to zero.
84
+ **/
85
+@property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles;
86
+
87
+/**
88
+ * The maximum space that logs can take. On rolling logfile all old logfiles that exceed logFilesDiskQuota will
89
+ * be deleted.
90
+ *
91
+ * You may optionally disable this option by setting it to zero.
92
+ **/
93
+@property (readwrite, assign, atomic) unsigned long long logFilesDiskQuota;
94
+
95
+// Public methods
96
+
97
+/**
98
+ *  Returns the logs directory (path)
99
+ */
100
+@property (nonatomic, readonly, copy) NSString *logsDirectory;
101
+
102
+/**
103
+ * Returns an array of `NSString` objects,
104
+ * each of which is the filePath to an existing log file on disk.
105
+ **/
106
+@property (nonatomic, readonly, strong) NSArray<NSString *> *unsortedLogFilePaths;
107
+
108
+/**
109
+ * Returns an array of `NSString` objects,
110
+ * each of which is the fileName of an existing log file on disk.
111
+ **/
112
+@property (nonatomic, readonly, strong) NSArray<NSString *> *unsortedLogFileNames;
113
+
114
+/**
115
+ * Returns an array of `DDLogFileInfo` objects,
116
+ * each representing an existing log file on disk,
117
+ * and containing important information about the log file such as it's modification date and size.
118
+ **/
119
+@property (nonatomic, readonly, strong) NSArray<OSSDDLogFileInfo *> *unsortedLogFileInfos;
120
+
121
+/**
122
+ * Just like the `unsortedLogFilePaths` method, but sorts the array.
123
+ * The items in the array are sorted by creation date.
124
+ * The first item in the array will be the most recently created log file.
125
+ **/
126
+@property (nonatomic, readonly, strong) NSArray<NSString *> *sortedLogFilePaths;
127
+
128
+/**
129
+ * Just like the `unsortedLogFileNames` method, but sorts the array.
130
+ * The items in the array are sorted by creation date.
131
+ * The first item in the array will be the most recently created log file.
132
+ **/
133
+@property (nonatomic, readonly, strong) NSArray<NSString *> *sortedLogFileNames;
134
+
135
+/**
136
+ * Just like the `unsortedLogFileInfos` method, but sorts the array.
137
+ * The items in the array are sorted by creation date.
138
+ * The first item in the array will be the most recently created log file.
139
+ **/
140
+@property (nonatomic, readonly, strong) NSArray<OSSDDLogFileInfo *> *sortedLogFileInfos;
141
+
142
+// Private methods (only to be used by DDFileLogger)
143
+
144
+/**
145
+ * Generates a new unique log file path, and creates the corresponding log file.
146
+ **/
147
+- (NSString *)createNewLogFile;
148
+
149
+@optional
150
+
151
+// Notifications from DDFileLogger
152
+
153
+/**
154
+ *  Called when a log file was archieved
155
+ */
156
+- (void)didArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didArchiveLogFile(atPath:));
157
+
158
+/**
159
+ *  Called when the roll action was executed and the log was archieved
160
+ */
161
+- (void)didRollAndArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didRollAndArchiveLogFile(atPath:));
162
+
163
+@end
164
+
165
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
166
+#pragma mark -
167
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
168
+
169
+/**
170
+ * Default log file manager.
171
+ *
172
+ * All log files are placed inside the logsDirectory.
173
+ * If a specific logsDirectory isn't specified, the default directory is used.
174
+ * On Mac, this is in `~/Library/Logs/<Application Name>`.
175
+ * On iPhone, this is in `~/Library/Caches/Logs`.
176
+ *
177
+ * Log files are named `"<bundle identifier> <date> <time>.log"`
178
+ * Example: `com.organization.myapp 2013-12-03 17-14.log`
179
+ *
180
+ * Archived log files are automatically deleted according to the `maximumNumberOfLogFiles` property.
181
+ **/
182
+@interface OSSDDLogFileManagerDefault : NSObject <OSSDDLogFileManager>
183
+
184
+/**
185
+ *  Default initializer
186
+ */
187
+- (instancetype)init;
188
+
189
+/**
190
+ *  Designated initialized, requires the logs directory
191
+ */
192
+- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory NS_DESIGNATED_INITIALIZER;
193
+
194
+#if TARGET_OS_IPHONE
195
+/*
196
+ * Calling this constructor you can override the default "automagically" chosen NSFileProtection level.
197
+ * Useful if you are writing a command line utility / CydiaSubstrate addon for iOS that has no NSBundle
198
+ * or like SpringBoard no BackgroundModes key in the NSBundle:
199
+ *    iPhone:~ root# cycript -p SpringBoard
200
+ *    cy# [NSBundle mainBundle]
201
+ *    #"NSBundle </System/Library/CoreServices/SpringBoard.app> (loaded)"
202
+ *    cy# [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
203
+ *    null
204
+ *    cy#
205
+ **/
206
+- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory defaultFileProtectionLevel:(NSFileProtectionType)fileProtectionLevel;
207
+#endif
208
+
209
+/*
210
+ * Methods to override.
211
+ *
212
+ * Log files are named `"<bundle identifier> <date> <time>.log"`
213
+ * Example: `com.organization.myapp 2013-12-03 17-14.log`
214
+ *
215
+ * If you wish to change default filename, you can override following two methods.
216
+ * - `newLogFileName` method would be called on new logfile creation.
217
+ * - `isLogFile:` method would be called to filter logfiles from all other files in logsDirectory.
218
+ *   You have to parse given filename and return YES if it is logFile.
219
+ *
220
+ * **NOTE**
221
+ * `newLogFileName` returns filename. If appropriate file already exists, number would be added
222
+ * to filename before extension. You have to handle this case in isLogFile: method.
223
+ *
224
+ * Example:
225
+ * - newLogFileName returns `"com.organization.myapp 2013-12-03.log"`,
226
+ *   file `"com.organization.myapp 2013-12-03.log"` would be created.
227
+ * - after some time `"com.organization.myapp 2013-12-03.log"` is archived
228
+ * - newLogFileName again returns `"com.organization.myapp 2013-12-03.log"`,
229
+ *   file `"com.organization.myapp 2013-12-03 2.log"` would be created.
230
+ * - after some time `"com.organization.myapp 2013-12-03 1.log"` is archived
231
+ * - newLogFileName again returns `"com.organization.myapp 2013-12-03.log"`,
232
+ *   file `"com.organization.myapp 2013-12-03 3.log"` would be created.
233
+ **/
234
+
235
+/**
236
+ * Generates log file name with default format `"<bundle identifier> <date> <time>.log"`
237
+ * Example: `MobileSafari 2013-12-03 17-14.log`
238
+ *
239
+ * You can change it by overriding `newLogFileName` and `isLogFile:` methods.
240
+ **/
241
+@property (readonly, copy) NSString *newLogFileName;
242
+
243
+/**
244
+ * Default log file name is `"<bundle identifier> <date> <time>.log"`.
245
+ * Example: `MobileSafari 2013-12-03 17-14.log`
246
+ *
247
+ * You can change it by overriding `newLogFileName` and `isLogFile:` methods.
248
+ **/
249
+- (BOOL)isLogFile:(NSString *)fileName NS_SWIFT_NAME(isLogFile(withName:));
250
+
251
+/* Inherited from DDLogFileManager protocol:
252
+
253
+   @property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles;
254
+   @property (readwrite, assign, atomic) NSUInteger logFilesDiskQuota;
255
+
256
+   - (NSString *)logsDirectory;
257
+
258
+   - (NSArray *)unsortedLogFilePaths;
259
+   - (NSArray *)unsortedLogFileNames;
260
+   - (NSArray *)unsortedLogFileInfos;
261
+
262
+   - (NSArray *)sortedLogFilePaths;
263
+   - (NSArray *)sortedLogFileNames;
264
+   - (NSArray *)sortedLogFileInfos;
265
+
266
+ */
267
+
268
+@end
269
+
270
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
271
+#pragma mark -
272
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
273
+
274
+/**
275
+ * Most users will want file log messages to be prepended with the date and time.
276
+ * Rather than forcing the majority of users to write their own formatter,
277
+ * we will supply a logical default formatter.
278
+ * Users can easily replace this formatter with their own by invoking the `setLogFormatter:` method.
279
+ * It can also be removed by calling `setLogFormatter:`, and passing a nil parameter.
280
+ *
281
+ * In addition to the convenience of having a logical default formatter,
282
+ * it will also provide a template that makes it easy for developers to copy and change.
283
+ **/
284
+@interface OSSDDLogFileFormatterDefault : NSObject <OSSDDLogFormatter>
285
+
286
+/**
287
+ *  Default initializer
288
+ */
289
+- (instancetype)init;
290
+
291
+/**
292
+ *  Designated initializer, requires a date formatter
293
+ */
294
+- (instancetype)initWithDateFormatter:(NSDateFormatter *)dateFormatter NS_DESIGNATED_INITIALIZER;
295
+
296
+@end
297
+
298
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
299
+#pragma mark -
300
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
301
+
302
+/**
303
+ *  The standard implementation for a file logger
304
+ */
305
+@interface OSSDDFileLogger : OSSDDAbstractLogger <OSSDDLogger> {
306
+	OSSDDLogFileInfo *_currentLogFileInfo;
307
+}
308
+
309
+/**
310
+ *  Default initializer
311
+ */
312
+- (instancetype)init;
313
+
314
+/**
315
+ *  Designated initializer, requires a `DDLogFileManager` instance
316
+ */
317
+- (instancetype)initWithLogFileManager:(id <OSSDDLogFileManager>)logFileManager NS_DESIGNATED_INITIALIZER;
318
+
319
+/**
320
+ *  Called when the logger is about to write message. Call super before your implementation.
321
+ */
322
+- (void)willLogMessage NS_REQUIRES_SUPER;
323
+
324
+/**
325
+ *  Called when the logger wrote message. Call super after your implementation.
326
+ */
327
+- (void)didLogMessage NS_REQUIRES_SUPER;
328
+
329
+/**
330
+ *  Called when the logger checks archive or not current log file. 
331
+ *  Override this method to exdend standart behavior. By default returns NO.
332
+ */
333
+- (BOOL)shouldArchiveRecentLogFileInfo:(OSSDDLogFileInfo *)recentLogFileInfo;
334
+
335
+/**
336
+ * Log File Rolling:
337
+ *
338
+ * `maximumFileSize`:
339
+ *   The approximate maximum size (in bytes) to allow log files to grow.
340
+ *   If a log file is larger than this value after a log statement is appended,
341
+ *   then the log file is rolled.
342
+ *
343
+ * `rollingFrequency`
344
+ *   How often to roll the log file.
345
+ *   The frequency is given as an `NSTimeInterval`, which is a double that specifies the interval in seconds.
346
+ *   Once the log file gets to be this old, it is rolled.
347
+ *
348
+ * `doNotReuseLogFiles`
349
+ *   When set, will always create a new log file at application launch.
350
+ *
351
+ * Both the `maximumFileSize` and the `rollingFrequency` are used to manage rolling.
352
+ * Whichever occurs first will cause the log file to be rolled.
353
+ *
354
+ * For example:
355
+ * The `rollingFrequency` is 24 hours,
356
+ * but the log file surpasses the `maximumFileSize` after only 20 hours.
357
+ * The log file will be rolled at that 20 hour mark.
358
+ * A new log file will be created, and the 24 hour timer will be restarted.
359
+ *
360
+ * You may optionally disable rolling due to filesize by setting `maximumFileSize` to zero.
361
+ * If you do so, rolling is based solely on `rollingFrequency`.
362
+ *
363
+ * You may optionally disable rolling due to time by setting `rollingFrequency` to zero (or any non-positive number).
364
+ * If you do so, rolling is based solely on `maximumFileSize`.
365
+ *
366
+ * If you disable both `maximumFileSize` and `rollingFrequency`, then the log file won't ever be rolled.
367
+ * This is strongly discouraged.
368
+ **/
369
+@property (readwrite, assign) unsigned long long maximumFileSize;
370
+
371
+/**
372
+ *  See description for `maximumFileSize`
373
+ */
374
+@property (readwrite, assign) NSTimeInterval rollingFrequency;
375
+
376
+/**
377
+ *  See description for `maximumFileSize`
378
+ */
379
+@property (readwrite, assign, atomic) BOOL doNotReuseLogFiles;
380
+
381
+/**
382
+ * The DDLogFileManager instance can be used to retrieve the list of log files,
383
+ * and configure the maximum number of archived log files to keep.
384
+ *
385
+ * @see DDLogFileManager.maximumNumberOfLogFiles
386
+ **/
387
+@property (strong, nonatomic, readonly) id <OSSDDLogFileManager> logFileManager;
388
+
389
+/**
390
+ * When using a custom formatter you can set the `logMessage` method not to append
391
+ * `\n` character after each output. This allows for some greater flexibility with
392
+ * custom formatters. Default value is YES.
393
+ **/
394
+@property (nonatomic, readwrite, assign) BOOL automaticallyAppendNewlineForCustomFormatters;
395
+
396
+/**
397
+ *  You can optionally force the current log file to be rolled with this method.
398
+ *  CompletionBlock will be called on main queue.
399
+ */
400
+- (void)rollLogFileWithCompletionBlock:(void (^)(void))completionBlock NS_SWIFT_NAME(rollLogFile(withCompletion:));
401
+
402
+/**
403
+ *  Method is deprecated.
404
+ *  @deprecated Use `rollLogFileWithCompletionBlock:` method instead.
405
+ */
406
+- (void)rollLogFile __attribute((deprecated));
407
+
408
+// Inherited from DDAbstractLogger
409
+
410
+// - (id <DDLogFormatter>)logFormatter;
411
+// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
412
+
413
+/**
414
+ * Returns the log file that should be used.
415
+ * If there is an existing log file that is suitable,
416
+ * within the constraints of `maximumFileSize` and `rollingFrequency`, then it is returned.
417
+ *
418
+ * Otherwise a new file is created and returned.
419
+ **/
420
+@property (nonatomic, readonly, strong) OSSDDLogFileInfo *currentLogFileInfo;
421
+
422
+@end
423
+
424
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
425
+#pragma mark -
426
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
427
+
428
+/**
429
+ * `DDLogFileInfo` is a simple class that provides access to various file attributes.
430
+ * It provides good performance as it only fetches the information if requested,
431
+ * and it caches the information to prevent duplicate fetches.
432
+ *
433
+ * It was designed to provide quick snapshots of the current state of log files,
434
+ * and to help sort log files in an array.
435
+ *
436
+ * This class does not monitor the files, or update it's cached attribute values if the file changes on disk.
437
+ * This is not what the class was designed for.
438
+ *
439
+ * If you absolutely must get updated values,
440
+ * you can invoke the reset method which will clear the cache.
441
+ **/
442
+@interface OSSDDLogFileInfo : NSObject
443
+
444
+@property (strong, nonatomic, readonly) NSString *filePath;
445
+@property (strong, nonatomic, readonly) NSString *fileName;
446
+
447
+#if FOUNDATION_SWIFT_SDK_EPOCH_AT_LEAST(8)
448
+@property (strong, nonatomic, readonly) NSDictionary<NSFileAttributeKey, id> *fileAttributes;
449
+#else
450
+@property (strong, nonatomic, readonly) NSDictionary<NSString *, id> *fileAttributes;
451
+#endif
452
+
453
+@property (strong, nonatomic, readonly) NSDate *creationDate;
454
+@property (strong, nonatomic, readonly) NSDate *modificationDate;
455
+
456
+@property (nonatomic, readonly) unsigned long long fileSize;
457
+
458
+@property (nonatomic, readonly) NSTimeInterval age;
459
+
460
+@property (nonatomic, readwrite) BOOL isArchived;
461
+
462
++ (instancetype)logFileWithPath:(NSString *)filePath NS_SWIFT_UNAVAILABLE("Use init(filePath:)");
463
+
464
+- (instancetype)init NS_UNAVAILABLE;
465
+- (instancetype)initWithFilePath:(NSString *)filePath NS_DESIGNATED_INITIALIZER;
466
+
467
+- (void)reset;
468
+- (void)renameFile:(NSString *)newFileName NS_SWIFT_NAME(renameFile(to:));
469
+
470
+#if TARGET_IPHONE_SIMULATOR
471
+
472
+// So here's the situation.
473
+// Extended attributes are perfect for what we're trying to do here (marking files as archived).
474
+// This is exactly what extended attributes were designed for.
475
+//
476
+// But Apple screws us over on the simulator.
477
+// Everytime you build-and-go, they copy the application into a new folder on the hard drive,
478
+// and as part of the process they strip extended attributes from our log files.
479
+// Normally, a copy of a file preserves extended attributes.
480
+// So obviously Apple has gone to great lengths to piss us off.
481
+//
482
+// Thus we use a slightly different tactic for marking log files as archived in the simulator.
483
+// That way it "just works" and there's no confusion when testing.
484
+//
485
+// The difference in method names is indicative of the difference in functionality.
486
+// On the simulator we add an attribute by appending a filename extension.
487
+//
488
+// For example:
489
+// "mylog.txt" -> "mylog.archived.txt"
490
+// "mylog"     -> "mylog.archived"
491
+
492
+- (BOOL)hasExtensionAttributeWithName:(NSString *)attrName;
493
+
494
+- (void)addExtensionAttributeWithName:(NSString *)attrName;
495
+- (void)removeExtensionAttributeWithName:(NSString *)attrName;
496
+
497
+#else /* if TARGET_IPHONE_SIMULATOR */
498
+
499
+// Normal use of extended attributes used everywhere else,
500
+// such as on Macs and on iPhone devices.
501
+
502
+- (BOOL)hasExtendedAttributeWithName:(NSString *)attrName;
503
+
504
+- (void)addExtendedAttributeWithName:(NSString *)attrName;
505
+- (void)removeExtendedAttributeWithName:(NSString *)attrName;
506
+
507
+#endif /* if TARGET_IPHONE_SIMULATOR */
508
+
509
+@end

+ 26
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSGetObjectACLRequest.h View File

@@ -0,0 +1,26 @@
1
+//
2
+//  OSSGetObjectACLRequest.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import "OSSRequest.h"
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+@interface OSSGetObjectACLRequest : OSSRequest
13
+
14
+/**
15
+ the bucket's name which object stored
16
+ */
17
+@property (nonatomic, copy) NSString *bucketName;
18
+
19
+/**
20
+ the name of object
21
+ */
22
+@property (nonatomic, copy) NSString *objectName;
23
+
24
+
25
+@end
26
+NS_ASSUME_NONNULL_END

+ 19
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSGetObjectACLResult.h View File

@@ -0,0 +1,19 @@
1
+//
2
+//  OSSGetObjectACLResult.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import "OSSResult.h"
10
+
11
+@interface OSSGetObjectACLResult : OSSResult
12
+
13
+/**
14
+ the ACL of object,valid values: @"private",@"public-read",@"public-read-write".
15
+ if object's ACL inherit from bucket,it will return @"default".
16
+ */
17
+@property (nonatomic, copy) NSString *grant;
18
+
19
+@end

+ 39
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSHttpResponseParser.h View File

@@ -0,0 +1,39 @@
1
+//
2
+//  OSSHttpResponseParser.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+#import "OSSTask.h"
12
+
13
+NS_ASSUME_NONNULL_BEGIN
14
+
15
+/**
16
+ HTTP response parser
17
+ */
18
+@interface OSSHttpResponseParser : NSObject
19
+
20
+@property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveBlock;
21
+
22
+@property (nonatomic, strong) NSURL *downloadingFileURL;
23
+
24
+/**
25
+ *  A Boolean value that determines whether verfifying crc64.
26
+ When set to YES, it will verify crc64 when transmission is completed normally.
27
+ The default value of this property is NO.
28
+ */
29
+@property (nonatomic, assign) BOOL crc64Verifiable;
30
+
31
+- (instancetype)initForOperationType:(OSSOperationType)operationType;
32
+- (void)consumeHttpResponse:(NSHTTPURLResponse *)response;
33
+- (OSSTask *)consumeHttpResponseBody:(NSData *)data;
34
+- (nullable id)constructResultObject;
35
+- (void)reset;
36
+
37
+@end
38
+
39
+NS_ASSUME_NONNULL_END

+ 16
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSHttpdns.h View File

@@ -0,0 +1,16 @@
1
+//
2
+//  OSSHttpdns.h
3
+//  AliyunOSSiOS
4
+//
5
+//  Created by zhouzhuo on 5/1/16.
6
+//  Copyright © 2016 zhouzhuo. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@interface OSSHttpdns : NSObject
12
+
13
++ (instancetype)sharedInstance;
14
+
15
+- (NSString *)asynGetIpByHost:(NSString *)host;
16
+@end

+ 113
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSIPv6Adapter.h View File

@@ -0,0 +1,113 @@
1
+/*
2
+ * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
3
+ *
4
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. The rights granted to you under the License
10
+ * may not be used to create, or enable the creation or redistribution of,
11
+ * unlawful or unlicensed copies of an Apple operating system, or to
12
+ * circumvent, violate, or enable the circumvention or violation of, any
13
+ * terms of an Apple operating system software license agreement.
14
+ *
15
+ * Please obtain a copy of the License at
16
+ * https://www.opensource.apple.com/apsl/ and read it before using this file.
17
+ *
18
+ * The Original Code and all software distributed under the License are
19
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23
+ * Please see the License for the specific language governing rights and
24
+ * limitations under the License.
25
+ *
26
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
+ */
28
+/*
29
+ * Copyright (c) 1980, 1986, 1993
30
+ *	The Regents of the University of California.  All rights reserved.
31
+ *
32
+ * Redistribution and use in source and binary forms, with or without
33
+ * modification, are permitted provided that the following conditions
34
+ * are met:
35
+ * 1. Redistributions of source code must retain the above copyright
36
+ *    notice, this list of conditions and the following disclaimer.
37
+ * 2. Redistributions in binary form must reproduce the above copyright
38
+ *    notice, this list of conditions and the following disclaimer in the
39
+ *    documentation and/or other materials provided with the distribution.
40
+ * 3. All advertising materials mentioning features or use of this software
41
+ *    must display the following acknowledgement:
42
+ *	This product includes software developed by the University of
43
+ *	California, Berkeley and its contributors.
44
+ * 4. Neither the name of the University nor the names of its contributors
45
+ *    may be used to endorse or promote products derived from this software
46
+ *    without specific prior written permission.
47
+ *
48
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58
+ * SUCH DAMAGE.
59
+ *
60
+ *	@(#)route.h	8.3 (Berkeley) 4/19/94
61
+ * $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $
62
+ */
63
+
64
+
65
+#ifndef AlicloudIPv6Adapter_h
66
+#define AlicloudIPv6Adapter_h
67
+#import <Foundation/Foundation.h>
68
+
69
+@interface OSSIPv6Adapter : NSObject
70
+
71
++ (instancetype)getInstance;
72
+
73
+/**
74
+ *	@brief	Checks if it's a IPv6-only network. If it's true, it's IPv6-only.
75
+ *
76
+ *	@return return YES for IPv6-only network,otherWise return NO
77
+ */
78
+- (BOOL)isIPv6OnlyNetwork;
79
+
80
+/**
81
+ *	@brief	Refresh the IPV6-only check
82
+ *
83
+ *	@return return YES for IPv6-only network,otherWise return NO
84
+ */
85
+- (BOOL)reResolveIPv6OnlyStatus;
86
+
87
+/**
88
+ *	@brief	Adapts the IPv4 address into IPv6 format under IPv6-only network.
89
+ *          For example:
90
+                42.156.220.114 -> 64:ff9b::2a9c:dc72
91
+ *	@param 	addr
92
+ *
93
+ *	@return return an IPv6 address
94
+ */
95
+- (NSString *)handleIpv4Address:(NSString *)addr;
96
+
97
+/**
98
+ *	@brief	Checks if it's an IPv4 address.
99
+ *
100
+ *	@return return YES while addr is an IPv4 address,otherwise return NO
101
+ */
102
+- (BOOL)isIPv4Address:(NSString *)addr;
103
+
104
+/**
105
+ *	@brief	Checks if it's an IPv6 address
106
+ *
107
+ *	@return return YES while addr is an IPv6 address,otherwise return NO
108
+ */
109
+- (BOOL)isIPv6Address:(NSString *)addr;
110
+
111
+@end
112
+
113
+#endif /* OSSIPv6Adapter_h */

+ 23
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSIPv6PrefixResolver.h View File

@@ -0,0 +1,23 @@
1
+//
2
+//  OSSIPv6PrefixResolver.h
3
+//
4
+//  Created by lingkun on 16/5/16.
5
+//  Edit by zhouzhuo on 16/5/22
6
+//  Copyright © 2016 Ali. All rights reserved.
7
+//
8
+
9
+#ifndef AlicloudIPv6PrefixResolver_h
10
+#define AlicloudIPv6PrefixResolver_h
11
+#import <Foundation/Foundation.h>
12
+
13
+@interface OSSIPv6PrefixResolver : NSObject
14
+
15
++ (instancetype)getInstance;
16
+
17
+- (void)updateIPv6Prefix;
18
+
19
+- (NSString *)convertIPv4toIPv6:(NSString *)ipv4;
20
+
21
+@end
22
+
23
+#endif /* OSSIPv6PrefixResolver_h */

+ 16
- 2
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSLog.h View File

@@ -7,6 +7,8 @@
7 7
 //
8 8
 
9 9
 #import <Foundation/Foundation.h>
10
+#import "OSSCocoaLumberjack.h"
11
+static const OSSDDLogLevel ossLogLevel = OSSDDLogLevelAll;
10 12
 
11 13
 // colorful log configuration
12 14
 // see https://github.com/robbiehanson/XcodeColors
@@ -19,21 +21,33 @@
19 21
 
20 22
 #define OSSLogVerbose(frmt, ...)\
21 23
 if ([OSSLog isLogEnable]) {\
22
-NSLog(@"[Verbose]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
24
+OSSDDLogVerbose(@"[Verbose]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
23 25
 }
24 26
 
25 27
 #define OSSLogDebug(frmt, ...)\
26 28
 if ([OSSLog isLogEnable]) {\
29
+OSSDDLogDebug(@"[Debug]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
30
+}
31
+
32
+#define OSSLogDebugNoFile(frmt, ...)\
33
+if ([OSSLog isLogEnable]) {\
27 34
 NSLog(@"[Debug]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
28 35
 }
29 36
 
30 37
 #define OSSLogError(frmt, ...)\
31 38
 if ([OSSLog isLogEnable]) {\
32
-NSLog(@"[Error]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
39
+OSSDDLogError(@"[Error]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
40
+}
41
+
42
+#define OSSLogWarn(frmt, ...)\
43
+if ([OSSLog isLogEnable]) {\
44
+OSSDDLogWarn(@"[Warning]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
33 45
 }
46
+
34 47
 static BOOL isEnable;
35 48
 
36 49
 @interface OSSLog : NSObject
50
+
37 51
 + (void)enableLog;
38 52
 + (void)disableLog;
39 53
 + (BOOL)isLogEnable;

+ 82
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSLogMacros.h View File

@@ -0,0 +1,82 @@
1
+// Software License Agreement (BSD License)
2
+//
3
+// Copyright (c) 2010-2016, Deusty, LLC
4
+// All rights reserved.
5
+//
6
+// Redistribution and use of this software in source and binary forms,
7
+// with or without modification, are permitted provided that the following conditions are met:
8
+//
9
+// * Redistributions of source code must retain the above copyright notice,
10
+//   this list of conditions and the following disclaimer.
11
+//
12
+// * Neither the name of Deusty nor the names of its contributors may be used
13
+//   to endorse or promote products derived from this software without specific
14
+//   prior written permission of Deusty, LLC.
15
+
16
+// Disable legacy macros
17
+#ifndef OSSDD_LEGACY_MACROS
18
+    #define OSSDD_LEGACY_MACROS 0
19
+#endif
20
+
21
+#import "OSSDDLog.h"
22
+
23
+/**
24
+ * The constant/variable/method responsible for controlling the current log level.
25
+ **/
26
+#ifndef OSSLOG_LEVEL_DEF
27
+    #define OSSLOG_LEVEL_DEF ossLogLevel
28
+#endif
29
+
30
+/**
31
+ * Whether async should be used by log messages, excluding error messages that are always sent sync.
32
+ **/
33
+#ifndef OSSLOG_ASYNC_ENABLED
34
+    #define OSSLOG_ASYNC_ENABLED YES
35
+#endif
36
+
37
+/**
38
+ * These are the two macros that all other macros below compile into.
39
+ * These big multiline macros makes all the other macros easier to read.
40
+ **/
41
+#define OSSLOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \
42
+        [OSSDDLog log : isAsynchronous                                     \
43
+             level : lvl                                                \
44
+              flag : flg                                                \
45
+           context : ctx                                                \
46
+              file : __FILE__                                           \
47
+          function : fnct                                               \
48
+              line : __LINE__                                           \
49
+               tag : atag                                               \
50
+            format : (frmt), ## __VA_ARGS__]
51
+
52
+/**
53
+ * Define version of the macro that only execute if the log level is above the threshold.
54
+ * The compiled versions essentially look like this:
55
+ *
56
+ * if (logFlagForThisLogMsg & ddLogLevel) { execute log message }
57
+ *
58
+ * When LOG_LEVEL_DEF is defined as ddLogLevel.
59
+ *
60
+ * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels.
61
+ * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques.
62
+ *
63
+ * Note that when compiler optimizations are enabled (as they are for your release builds),
64
+ * the log messages above your logging threshold will automatically be compiled out.
65
+ *
66
+ * (If the compiler sees LOG_LEVEL_DEF/ddLogLevel declared as a constant, the compiler simply checks to see
67
+ *  if the 'if' statement would execute, and if not it strips it from the binary.)
68
+ *
69
+ * We also define shorthand versions for asynchronous and synchronous logging.
70
+ **/
71
+#define OSSLOG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, ...) \
72
+        do { if(lvl & flg) OSSLOG_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0)
73
+
74
+/**
75
+ * Ready to use log macros with no context or tag.
76
+ **/
77
+#define OSSDDLogError(frmt, ...)   OSSLOG_MAYBE(NO,                OSSLOG_LEVEL_DEF, OSSDDLogFlagError,   0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
78
+#define OSSDDLogWarn(frmt, ...)    OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
79
+#define OSSDDLogInfo(frmt, ...)    OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagInfo,    0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
80
+#define OSSDDLogDebug(frmt, ...)   OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagDebug,   0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
81
+#define OSSDDLogVerbose(frmt, ...) OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
82
+

+ 666
- 476
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSModel.h
File diff suppressed because it is too large
View File


+ 14
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSNSLogger.h View File

@@ -0,0 +1,14 @@
1
+//
2
+//  OSSNSLogger.h
3
+//  AliyunOSSiOS
4
+//
5
+//  Created by jingdan on 2017/10/24.
6
+//  Copyright © 2017年 zhouzhuo. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSDDLog.h"
11
+
12
+@interface OSSNSLogger : OSSDDAbstractLogger <OSSDDLogger>
13
+@property (class, readonly, strong) OSSNSLogger *sharedInstance;
14
+@end

+ 3
- 100
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSNetworking.h View File

@@ -13,36 +13,10 @@
13 13
 @class OSSNetworkingRequestDelegate;
14 14
 @class OSSExecutor;
15 15
 
16
-/**
17
- 定义重试类型
18
- */
19
-typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) {
20
-    OSSNetworkingRetryTypeUnknown,
21
-    OSSNetworkingRetryTypeShouldRetry,
22
-    OSSNetworkingRetryTypeShouldNotRetry,
23
-    OSSNetworkingRetryTypeShouldRefreshCredentialsAndRetry,
24
-    OSSNetworkingRetryTypeShouldCorrectClockSkewAndRetry
25
-};
26
-
27
-/**
28
- 重试处理器
29
- */
30
-@interface OSSURLRequestRetryHandler : NSObject
31
-@property (nonatomic, assign) uint32_t maxRetryCount;
32 16
 
33
-- (OSSNetworkingRetryType)shouldRetry:(uint32_t)currentRetryCount
34
-                      requestDelegate:(OSSNetworkingRequestDelegate *)delegate
35
-                             response:(NSHTTPURLResponse *)response
36
-                                error:(NSError *)error;
37
-
38
-- (NSTimeInterval)timeIntervalForRetry:(uint32_t)currentRetryCount
39
-                             retryType:(OSSNetworkingRetryType)retryType;
40
-
41
-+ (instancetype)defaultRetryHandler;
42
-@end
43 17
 
44 18
 /**
45
- 网络参数设置
19
+ Network parameters
46 20
  */
47 21
 @interface OSSNetworkingConfiguration : NSObject
48 22
 @property (nonatomic, assign) uint32_t maxRetryCount;
@@ -55,82 +29,11 @@ typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) {
55 29
 @property (nonatomic, strong) NSNumber * proxyPort;
56 30
 @end
57 31
 
58
-/**
59
- 对操作发起的每一次请求构造一个信息代理
60
- */
61
-@interface OSSNetworkingRequestDelegate : NSObject
62
-
63
-@property (nonatomic, strong) NSMutableArray * interceptors;
64
-@property (nonatomic, strong) OSSAllRequestNeededMessage * allNeededMessage;
65
-@property (nonatomic, strong) NSMutableURLRequest * internalRequest;
66
-@property (nonatomic, assign) OSSOperationType operType;
67
-@property (nonatomic, assign) BOOL isAccessViaProxy;
68
-
69
-@property (nonatomic, assign) BOOL isRequestCancelled;
70
-
71
-@property (nonatomic, strong) OSSHttpResponseParser * responseParser;
72
-
73
-@property (nonatomic, strong) NSData * uploadingData;
74
-@property (nonatomic, strong) NSURL * uploadingFileURL;
75
-
76
-@property (nonatomic, assign) int64_t payloadTotalBytesWritten;
77
-
78
-@property (nonatomic, assign) BOOL isBackgroundUploadFileTask;
79
-@property (nonatomic, assign) BOOL isHttpdnsEnable;
80
-
81
-@property (nonatomic, strong) OSSURLRequestRetryHandler * retryHandler;
82
-@property (nonatomic, assign) uint32_t currentRetryCount;
83
-@property (nonatomic, strong) NSError * error;
84
-@property (nonatomic, assign) BOOL isHttpRequestNotSuccessResponse;
85
-@property (nonatomic, strong) NSMutableData * httpRequestNotSuccessResponseBody;
86
-
87
-@property (atomic, strong) NSURLSessionDataTask * currentSessionTask;
88
-
89
-@property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
90
-@property (nonatomic, copy) OSSNetworkingDownloadProgressBlock downloadProgress;
91
-@property (nonatomic, copy) OSSNetworkingCompletionHandlerBlock completionHandler;
92
-@property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveData;
93
-
94
-- (OSSTask *)buildInternalHttpRequest;
95
-- (void)reset;
96
-- (void)cancel;
97
-@end
98
-
99
-/**
100
- 包含一次网络请求所需的所有信息
101
- */
102
-@interface OSSAllRequestNeededMessage : NSObject
103
-@property (nonatomic, strong) NSString * endpoint;
104
-@property (nonatomic, strong) NSString * httpMethod;
105
-@property (nonatomic, strong) NSString * bucketName;
106
-@property (nonatomic, strong) NSString * objectKey;
107
-@property (nonatomic, strong) NSString * contentType;
108
-@property (nonatomic, strong) NSString * contentMd5;
109
-@property (nonatomic, strong) NSString * range;
110
-@property (nonatomic, strong) NSString * date;
111
-@property (nonatomic, strong) NSMutableDictionary * headerParams;
112
-@property (nonatomic, strong) NSMutableDictionary * querys;
113
-
114
-@property (nonatomic, assign) BOOL isHostInCnameExcludeList;
115
-
116
-- (instancetype)initWithEndpoint:(NSString *)endpoint
117
-                      httpMethod:(NSString *)httpMethod
118
-                      bucketName:(NSString *)bucketName
119
-                       objectKey:(NSString *)objectKey
120
-                            type:(NSString *)contentType
121
-                             md5:(NSString *)contentMd5
122
-                           range:(NSString *)range
123
-                            date:(NSString *)date
124
-                    headerParams:(NSMutableDictionary *)headerParams
125
-                          querys:(NSMutableDictionary *)querys;
126
-
127
-- (OSSTask *)validateRequestParamsInOperationType:(OSSOperationType)operType;
128
-@end
129 32
 
130 33
 /**
131
- 每个OSSClient持有一个OSSNetworking用以收发网络请求
34
+ The network interface which OSSClient uses for network read and write operations.
132 35
  */
133
-@interface OSSNetworking : NSObject <NSURLSessionDelegate>
36
+@interface OSSNetworking : NSObject <NSURLSessionDelegate, NSURLSessionDataDelegate>
134 37
 @property (nonatomic, strong) NSURLSession * dataSession;
135 38
 @property (nonatomic, strong) NSURLSession * uploadFileSession;
136 39
 @property (nonatomic, assign) BOOL isUsingBackgroundSession;

+ 76
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSNetworkingRequestDelegate.h View File

@@ -0,0 +1,76 @@
1
+//
2
+//  OSSNetworkingRequestDelegate.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+#import "OSSTask.h"
12
+
13
+@class OSSAllRequestNeededMessage;
14
+@class OSSURLRequestRetryHandler;
15
+@class OSSHttpResponseParser;
16
+
17
+/**
18
+ The proxy object class for each OSS request.
19
+ */
20
+@interface OSSNetworkingRequestDelegate : NSObject
21
+
22
+@property (nonatomic, strong) NSMutableArray * interceptors;
23
+
24
+@property (nonatomic, strong) NSMutableURLRequest *internalRequest;
25
+@property (nonatomic, assign) OSSOperationType operType;
26
+@property (nonatomic, assign) BOOL isAccessViaProxy;
27
+
28
+@property (nonatomic, assign) BOOL isRequestCancelled;
29
+
30
+@property (nonatomic, strong) OSSAllRequestNeededMessage *allNeededMessage;
31
+@property (nonatomic, strong) OSSURLRequestRetryHandler *retryHandler;
32
+@property (nonatomic, strong) OSSHttpResponseParser *responseParser;
33
+
34
+@property (nonatomic, strong) NSData * uploadingData;
35
+@property (nonatomic, strong) NSURL * uploadingFileURL;
36
+
37
+@property (nonatomic, assign) int64_t payloadTotalBytesWritten;
38
+
39
+@property (nonatomic, assign) BOOL isBackgroundUploadFileTask;
40
+@property (nonatomic, assign) BOOL isHttpdnsEnable;
41
+
42
+
43
+@property (nonatomic, assign) uint32_t currentRetryCount;
44
+@property (nonatomic, strong) NSError * error;
45
+@property (nonatomic, assign) BOOL isHttpRequestNotSuccessResponse;
46
+@property (nonatomic, strong) NSMutableData *httpRequestNotSuccessResponseBody;
47
+
48
+@property (atomic, strong) NSURLSessionDataTask *currentSessionTask;
49
+
50
+@property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
51
+@property (nonatomic, copy) OSSNetworkingDownloadProgressBlock downloadProgress;
52
+@property (nonatomic, copy) OSSNetworkingRetryBlock retryCallback;
53
+@property (nonatomic, copy) OSSNetworkingCompletionHandlerBlock completionHandler;
54
+@property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveData;
55
+
56
+/**
57
+ * when put object to server,client caculate crc64 code and assigns it to
58
+ * this property.
59
+ */
60
+@property (nonatomic, copy) NSString *contentCRC;
61
+
62
+/** last crc64 code */
63
+@property (nonatomic, copy) NSString *lastCRC;
64
+
65
+/**
66
+ * determine whether to verify crc64 code
67
+ */
68
+@property (nonatomic, assign) BOOL crc64Verifiable;
69
+
70
+
71
+
72
+- (OSSTask *)buildInternalHttpRequest;
73
+- (void)reset;
74
+- (void)cancel;
75
+
76
+@end

+ 64
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSReachability.h View File

@@ -0,0 +1,64 @@
1
+/*
2
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
3
+ See LICENSE.txt for this sample’s licensing information
4
+ 
5
+ Abstract:
6
+ Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
7
+ */
8
+
9
+#import <Foundation/Foundation.h>
10
+#import <SystemConfiguration/SystemConfiguration.h>
11
+#import <netinet/in.h>
12
+
13
+
14
+typedef enum : NSInteger {
15
+	OSSNotReachable = 0,
16
+	OSSReachableViaWiFi,
17
+	OSSReachableViaWWAN
18
+} OSSNetworkStatus;
19
+
20
+#pragma mark IPv6 Support
21
+//Reachability fully support IPv6.  For full details, see ReadMe.md.
22
+
23
+
24
+extern NSString *ossReachabilityChangedNotification;
25
+
26
+
27
+@interface OSSReachability : NSObject
28
+
29
+/*!
30
+ * Use to check the reachability of a given host name.
31
+ */
32
++ (instancetype)reachabilityWithHostName:(NSString *)hostName;
33
+
34
+/*!
35
+ * Use to check the reachability of a given IP address.
36
+ */
37
++ (instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress;
38
+
39
+/*!
40
+ * Checks whether the default route is available. Should be used by applications that do not connect to a particular host.
41
+ */
42
++ (instancetype)reachabilityForInternetConnection;
43
+
44
+
45
+#pragma mark reachabilityForLocalWiFi
46
+//reachabilityForLocalWiFi has been removed from the sample.  See ReadMe.md for more information.
47
+//+ (instancetype)reachabilityForLocalWiFi;
48
+
49
+/*!
50
+ * Start listening for reachability notifications on the current run loop.
51
+ */
52
+- (BOOL)startNotifier;
53
+- (void)stopNotifier;
54
+
55
+- (OSSNetworkStatus)currentReachabilityStatus;
56
+
57
+/*!
58
+ * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand.
59
+ */
60
+- (BOOL)connectionRequired;
61
+
62
+@end
63
+
64
+

+ 15
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSReachabilityManager.h View File

@@ -0,0 +1,15 @@
1
+//
2
+//  OSSReachabilityManager.h
3
+//
4
+//  Created by 亿刀 on 14-1-9.
5
+//  Edited by junmo on 15-5-16
6
+//  Copyright (c) 2014 Twitter. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@interface OSSReachabilityManager : NSObject
12
+
13
++ (OSSReachabilityManager *)shareInstance;
14
+
15
+@end

+ 36
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSRequest.h View File

@@ -0,0 +1,36 @@
1
+//
2
+//  OSSRequest.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+
12
+/**
13
+ The base class of request to OSS.
14
+ */
15
+@interface OSSRequest : NSObject
16
+/**
17
+ Flag of requiring authentication. It's per each request.
18
+ */
19
+@property (nonatomic, assign) BOOL isAuthenticationRequired;
20
+
21
+/**
22
+ the flag of request canceled.
23
+ */
24
+@property (nonatomic, assign) BOOL isCancelled;
25
+
26
+/**
27
+ the flag of verification about crc64
28
+ */
29
+@property (nonatomic, assign) OSSRequestCRCFlag crcFlag;
30
+
31
+/**
32
+ Cancels the request
33
+ */
34
+- (void)cancel;
35
+
36
+@end

+ 42
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSResult.h View File

@@ -0,0 +1,42 @@
1
+//
2
+//  OSSResult.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/26.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+/**
12
+ The base class of result from OSS.
13
+ */
14
+@interface OSSResult : NSObject
15
+
16
+/**
17
+ The http response code.
18
+ */
19
+@property (nonatomic, assign) NSInteger httpResponseCode;
20
+
21
+/**
22
+ The http headers, in the form of key value dictionary.
23
+ */
24
+@property (nonatomic, strong) NSDictionary * httpResponseHeaderFields;
25
+
26
+/**
27
+ The request Id. It's the value of header x-oss-request-id, which is created from OSS server.
28
+ It's a unique Id represents this request. This is used for troubleshooting when you contact OSS support.
29
+ */
30
+@property (nonatomic, strong) NSString * requestId;
31
+
32
+/**
33
+ It's the value of header x-oss-hash-crc64ecma, which is created from OSS server.
34
+ */
35
+@property (nonatomic, copy) NSString *remoteCRC64ecma;
36
+
37
+/**
38
+ It's the value of local Data.
39
+ */
40
+@property (nonatomic, copy) NSString *localCRC64ecma;
41
+
42
+@end

+ 12
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSService.h View File

@@ -11,7 +11,19 @@
11 11
 #define OSS_IOS_SDK_VERSION OSSSDKVersion
12 12
 
13 13
 #import "OSSDefine.h"
14
+#import "OSSConstants.h"
15
+
14 16
 #import "OSSNetworking.h"
17
+#import "OSSNetworkingRequestDelegate.h"
18
+#import "OSSAllRequestNeededMessage.h"
19
+#import "OSSURLRequestRetryHandler.h"
20
+#import "OSSHttpResponseParser.h"
21
+#import "OSSRequest.h"
22
+#import "OSSGetObjectACLRequest.h"
23
+#import "OSSGetObjectACLResult.h"
24
+#import "OSSDeleteMultipleObjectsRequest.h"
25
+#import "OSSDeleteMultipleObjectsResult.h"
26
+
15 27
 #import "OSSClient.h"
16 28
 #import "OSSModel.h"
17 29
 #import "OSSUtil.h"

+ 2
- 2
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSTask.h View File

@@ -60,7 +60,7 @@ typedef __nullable id(^OSSContinuationBlock)(OSSTask<ResultType> *task);
60 60
  Creates a task that is already completed with the given result.
61 61
  @param result The result for the task.
62 62
  */
63
-+ (instancetype)taskWithResult:(nullable ResultType)result;
63
++ (instancetype)taskWithResult:(_Nullable ResultType)result;
64 64
 
65 65
 /*!
66 66
  Creates a task that is already completed with the given error.
@@ -127,7 +127,7 @@ typedef __nullable id(^OSSContinuationBlock)(OSSTask<ResultType> *task);
127 127
  If block returns a OSSTask, then the task returned from
128 128
  this method will not be completed until that task is completed.
129 129
  */
130
-+ (instancetype)taskFromExecutor:(OSSExecutor *)executor withBlock:(nullable id (^)())block;
130
++ (instancetype)taskFromExecutor:(OSSExecutor *)executor withBlock:(nullable id (^)(void))block;
131 131
 
132 132
 // Properties that will be set on the task once it is completed.
133 133
 

+ 36
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSURLRequestRetryHandler.h View File

@@ -0,0 +1,36 @@
1
+//
2
+//  OSSURLRequestRetryHandler.h
3
+//  AliyunOSSSDK
4
+//
5
+//  Created by huaixu on 2018/1/22.
6
+//  Copyright © 2018年 aliyun. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import "OSSConstants.h"
11
+
12
+@class OSSNetworkingRequestDelegate;
13
+
14
+
15
+NS_ASSUME_NONNULL_BEGIN
16
+
17
+/**
18
+ The retry handler interface
19
+ */
20
+@interface OSSURLRequestRetryHandler : NSObject
21
+
22
+@property (nonatomic, assign) uint32_t maxRetryCount;
23
+
24
+
25
++ (instancetype)defaultRetryHandler;
26
+
27
+- (OSSNetworkingRetryType)shouldRetry:(uint32_t)currentRetryCount
28
+                      requestDelegate:(OSSNetworkingRequestDelegate *)delegate
29
+                             response:(NSHTTPURLResponse *)response
30
+                                error:(NSError *)error;
31
+
32
+- (NSTimeInterval)timeIntervalForRetry:(uint32_t)currentRetryCount
33
+                             retryType:(OSSNetworkingRetryType)retryType;
34
+@end
35
+
36
+NS_ASSUME_NONNULL_END

+ 36
- 2
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSUtil.h View File

@@ -7,6 +7,7 @@
7 7
 //
8 8
 
9 9
 #import <Foundation/Foundation.h>
10
+#import "OSSFileLogger.h"
10 11
 
11 12
 @class OSSFederationToken;
12 13
 
@@ -16,22 +17,55 @@
16 17
 + (NSString *)calBase64WithData:(uint8_t *)data;
17 18
 + (NSString *)encodeURL:(NSString *)url;
18 19
 + (NSData *)constructHttpBodyFromPartInfos:(NSArray *)partInfos;
19
-+ (NSData *)constructHttpBodyForCreateBucketWithLocation:(NSString *)location;
20
++ (NSData *)constructHttpBodyForDeleteMultipleObjects:(NSArray<NSString *> *)keys quiet:(BOOL)quiet;
21
++ (NSData *)constructHttpBodyForCreateBucketWithLocation:(NSString *)location __attribute__((deprecated("deprecated!")));
20 22
 + (BOOL)validateBucketName:(NSString *)bucketName;
21 23
 + (BOOL)validateObjectKey:(NSString *)objectKey;
22 24
 + (BOOL)isOssOriginBucketHost:(NSString *)host;
23 25
 + (NSString *)getIpByHost:(NSString *)host;
24 26
 + (BOOL)isNetworkDelegateState;
27
+
28
++ (NSData *)fileMD5:(NSString *)path;
25 29
 + (NSString *)dataMD5String:(NSData *)data;
26 30
 + (NSString *)fileMD5String:(NSString *)path;
27
-+ (NSString*)base64ForData:(uint8_t *)input length:(int32_t)length;
28 31
 + (NSString *)base64Md5ForData:(NSData *)data;
29 32
 + (NSString *)base64Md5ForFilePath:(NSString *)filePath;
30 33
 + (NSString *)base64Md5ForFileURL:(NSURL *)fileURL;
34
++ (NSString *)base64ForData:(uint8_t *)input length:(int32_t)length;
35
+
31 36
 + (NSString *)populateSubresourceStringFromParameter:(NSDictionary *)parameters;
32 37
 + (NSString *)populateQueryStringFromParameter:(NSDictionary *)parameters;
33 38
 + (BOOL)isSubresource:(NSString *)param;
34 39
 + (NSString *)sign:(NSString *)content withToken:(OSSFederationToken *)token;
35 40
 + (NSString *)getRelativePath:(NSString *)fullPath;
36 41
 + (NSString *)detemineMimeTypeForFilePath:(NSString *)filePath uploadName:(NSString *)uploadName;
42
++ (BOOL)hasPhoneFreeSpace;
43
++ (NSString*)buildNetWorkConnectedMsg;
44
++ (NSString*)buildOperatorMsg;
45
+
46
++ (uint64_t)crc64ecma:(uint64_t)crc1 buffer:(void *)buffer length:(size_t)len;
47
+
48
+/**
49
+ * @brief: combine crc1 and crc2
50
+ */
51
+
52
++ (uint64_t)crc64ForCombineCRC1:(uint64_t)crc1 CRC2:(uint64_t)crc2 length:(size_t)len2;
53
+
54
++ (NSString *)sha1WithString:(NSString *)string;
55
++ (NSString *)sha1WithData:(NSData *)data;
56
++ (NSString *)sha1WithFilePath:(NSString *)filePath;
57
+
58
++ (NSData *)constructHttpBodyForTriggerCallback:(NSString *)callbackParams callbackVaribles:(NSString *)callbackVaribles;
59
+
60
++ (NSData *)constructHttpBodyForImagePersist:(NSString *)action toBucket:(NSString *)toBucket toObjectKey:(NSString *)toObjectKey;
61
+
62
+@end
63
+
64
+@interface NSString (OSS)
65
+
66
+- (NSString *)oss_trim;
67
+- (BOOL)oss_isNotEmpty;
68
+- (NSString *)oss_stringByAppendingPathComponentForURL:(NSString *)path;
69
++ (NSString *)oss_documentDirectory;
70
+
37 71
 @end

+ 88
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/Headers/OSSXMLDictionary.h View File

@@ -0,0 +1,88 @@
1
+//
2
+//  XMLDictionary.h
3
+//
4
+//  Version 1.4
5
+//
6
+//  Created by Nick Lockwood on 15/11/2010.
7
+//  Copyright 2010 Charcoal Design. All rights reserved.
8
+//
9
+//  Get the latest version of XMLDictionary from here:
10
+//
11
+//  https://github.com/nicklockwood/XMLDictionary
12
+//
13
+//  This software is provided 'as-is', without any express or implied
14
+//  warranty.  In no event will the authors be held liable for any damages
15
+//  arising from the use of this software.
16
+//
17
+//  Permission is granted to anyone to use this software for any purpose,
18
+//  including commercial applications, and to alter it and redistribute it
19
+//  freely, subject to the following restrictions:
20
+//
21
+//  1. The origin of this software must not be misrepresented; you must not
22
+//  claim that you wrote the original software. If you use this software
23
+//  in a product, an acknowledgment in the product documentation would be
24
+//  appreciated but is not required.
25
+//
26
+//  2. Altered source versions must be plainly marked as such, and must not be
27
+//  misrepresented as being the original software.
28
+//
29
+//  3. This notice may not be removed or altered from any source distribution.
30
+//
31
+
32
+#import <Foundation/Foundation.h>
33
+#import "OSSConstants.h"
34
+
35
+#pragma GCC diagnostic push
36
+#pragma GCC diagnostic ignored "-Wobjc-missing-property-synthesis"
37
+@interface OSSXMLDictionaryParser : NSObject <NSCopying>
38
+
39
++ (OSSXMLDictionaryParser *)sharedInstance;
40
+
41
+@property (nonatomic, assign) BOOL collapseTextNodes; // defaults to YES
42
+@property (nonatomic, assign) BOOL stripEmptyNodes;   // defaults to YES
43
+@property (nonatomic, assign) BOOL trimWhiteSpace;    // defaults to YES
44
+@property (nonatomic, assign) BOOL alwaysUseArrays;   // defaults to NO
45
+@property (nonatomic, assign) BOOL preserveComments;  // defaults to NO
46
+@property (nonatomic, assign) BOOL wrapRootNode;      // defaults to NO
47
+
48
+@property (nonatomic, assign) OSSXMLDictionaryAttributesMode attributesMode;
49
+@property (nonatomic, assign) OSSXMLDictionaryNodeNameMode nodeNameMode;
50
+
51
+- (NSDictionary *)dictionaryWithParser:(NSXMLParser *)parser;
52
+- (NSDictionary *)dictionaryWithData:(NSData *)data;
53
+- (NSDictionary *)dictionaryWithString:(NSString *)string;
54
+- (NSDictionary *)dictionaryWithFile:(NSString *)path;
55
+
56
+@end
57
+
58
+
59
+@interface NSDictionary (OSSXMLDictionary)
60
+
61
++ (NSDictionary *)oss_dictionaryWithXMLParser:(NSXMLParser *)parser;
62
++ (NSDictionary *)oss_dictionaryWithXMLData:(NSData *)data;
63
++ (NSDictionary *)oss_dictionaryWithXMLString:(NSString *)string;
64
++ (NSDictionary *)oss_dictionaryWithXMLFile:(NSString *)path;
65
+
66
+- (NSDictionary *)oss_attributes;
67
+- (NSDictionary *)oss_childNodes;
68
+- (NSArray *)oss_comments;
69
+- (NSString *)oss_nodeName;
70
+- (NSString *)oss_innerText;
71
+- (NSString *)oss_innerXML;
72
+- (NSString *)oss_XMLString;
73
+
74
+- (NSArray *)oss_arrayValueForKeyPath:(NSString *)keyPath;
75
+- (NSString *)oss_stringValueForKeyPath:(NSString *)keyPath;
76
+- (NSDictionary *)oss_dictionaryValueForKeyPath:(NSString *)keyPath;
77
+
78
+@end
79
+
80
+
81
+@interface NSString (OSSXMLDictionary)
82
+
83
+- (NSString *)oss_XMLEncodedString;
84
+
85
+@end
86
+
87
+
88
+#pragma GCC diagnostic pop

+ 11
- 0
ios/AliyunSDK/AliyunOSSiOS.framework/PrivateHeaders/aos_crc64.h View File

@@ -0,0 +1,11 @@
1
+#ifndef LIBAOS_CRC_H
2
+#define LIBAOS_CRC_H
3
+
4
+#include <_types/_uintmax_t.h>
5
+#include <_types/_uint64_t.h>
6
+#include <stddef.h>
7
+
8
+uint64_t aos_crc64(uint64_t crc, void *buf, size_t len);
9
+uint64_t aos_crc64_combine(uint64_t crc1, uint64_t crc2, uintmax_t len2);
10
+
11
+#endif

+ 1
- 1
package.json View File

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "aliyun-oss-react-native",
3
-  "version": "1.0.0-alpha.4",
3
+  "version": "1.0.0-alpha.5",
4 4
   "description": "React Native SDK for aliyun object storage service",
5 5
   "main": "index.js",
6 6
   "scripts": {