aliyun-oss-react-native

OSSCompat.h 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // OSSCompat.h
  3. // oss_ios_sdk_new
  4. //
  5. // Created by zhouzhuo on 9/10/15.
  6. // Copyright (c) 2015 aliyun.com. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "OSSService.h"
  10. @class OSSCancellationTokenSource;
  11. typedef OSSCancellationTokenSource OSSTaskHandler;
  12. NS_ASSUME_NONNULL_BEGIN
  13. @interface OSSClient (Compat)
  14. /**
  15. The old version's upload API.
  16. Please use putObject instead.
  17. */
  18. - (OSSTaskHandler *)uploadData:(NSData *)data
  19. withContentType:(NSString *)contentType
  20. withObjectMeta:(NSDictionary *)meta
  21. toBucketName:(NSString *)bucketName
  22. toObjectKey:(NSString *)objectKey
  23. onCompleted:(void(^)(BOOL, NSError *))onCompleted
  24. onProgress:(void(^)(float progress))onProgress;
  25. /**
  26. The old version's download API.
  27. Please use getObject instead.
  28. */
  29. - (OSSTaskHandler *)downloadToDataFromBucket:(NSString *)bucketName
  30. objectKey:(NSString *)objectKey
  31. onCompleted:(void(^)(NSData *, NSError *))onCompleted
  32. onProgress:(void(^)(float progress))onProgress;
  33. /**
  34. The old version's upload API.
  35. Please use putObject instead.
  36. */
  37. - (OSSTaskHandler *)uploadFile:(NSString *)filePath
  38. withContentType:(NSString *)contentType
  39. withObjectMeta:(NSDictionary *)meta
  40. toBucketName:(NSString *)bucketName
  41. toObjectKey:(NSString *)objectKey
  42. onCompleted:(void(^)(BOOL, NSError *))onCompleted
  43. onProgress:(void(^)(float progress))onProgress;
  44. /**
  45. The old version's download API.
  46. Please use getObject instead.
  47. */
  48. - (OSSTaskHandler *)downloadToFileFromBucket:(NSString *)bucketName
  49. objectKey:(NSString *)objectKey
  50. toFile:(NSString *)filePath
  51. onCompleted:(void(^)(BOOL, NSError *))onCompleted
  52. onProgress:(void(^)(float progress))onProgress;
  53. /**
  54. The old version's upload API with resumable upload support.
  55. Please use resumableUpload instead.
  56. */
  57. - (OSSTaskHandler *)resumableUploadFile:(NSString *)filePath
  58. withContentType:(NSString *)contentType
  59. withObjectMeta:(NSDictionary *)meta
  60. toBucketName:(NSString *)bucketName
  61. toObjectKey:(NSString *)objectKey
  62. onCompleted:(void(^)(BOOL, NSError *))onCompleted
  63. onProgress:(void(^)(float progress))onProgress;
  64. /**
  65. The old version's delete API.
  66. Please use deleteObject instead.
  67. */
  68. - (void)deleteObjectInBucket:(NSString *)bucketName
  69. objectKey:(NSString *)objectKey
  70. onCompleted:(void(^)(BOOL, NSError *))onCompleted;
  71. @end
  72. NS_ASSUME_NONNULL_END