aliyun-oss-react-native

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // OSSUtil.h
  3. // oss_ios_sdk
  4. //
  5. // Created by zhouzhuo on 8/16/15.
  6. // Copyright (c) 2015 aliyun.com. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class OSSFederationToken;
  10. @interface OSSUtil : NSObject
  11. + (NSString *)calBase64Sha1WithData:(NSString *)data withSecret:(NSString *)key;
  12. + (NSString *)calBase64WithData:(uint8_t *)data;
  13. + (NSString *)encodeURL:(NSString *)url;
  14. + (NSData *)constructHttpBodyFromPartInfos:(NSArray *)partInfos;
  15. + (NSData *)constructHttpBodyForCreateBucketWithLocation:(NSString *)location;
  16. + (BOOL)validateBucketName:(NSString *)bucketName;
  17. + (BOOL)validateObjectKey:(NSString *)objectKey;
  18. + (BOOL)isOssOriginBucketHost:(NSString *)host;
  19. + (NSString *)getIpByHost:(NSString *)host;
  20. + (BOOL)isNetworkDelegateState;
  21. + (NSString *)dataMD5String:(NSData *)data;
  22. + (NSString *)fileMD5String:(NSString *)path;
  23. + (NSString*)base64ForData:(uint8_t *)input length:(int32_t)length;
  24. + (NSString *)base64Md5ForData:(NSData *)data;
  25. + (NSString *)base64Md5ForFilePath:(NSString *)filePath;
  26. + (NSString *)base64Md5ForFileURL:(NSURL *)fileURL;
  27. + (NSString *)populateSubresourceStringFromParameter:(NSDictionary *)parameters;
  28. + (NSString *)populateQueryStringFromParameter:(NSDictionary *)parameters;
  29. + (BOOL)isSubresource:(NSString *)param;
  30. + (NSString *)sign:(NSString *)content withToken:(OSSFederationToken *)token;
  31. + (NSString *)getRelativePath:(NSString *)fullPath;
  32. + (NSString *)detemineMimeTypeForFilePath:(NSString *)filePath uploadName:(NSString *)uploadName;
  33. @end