You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
4.3 KiB

//
// JCStorage.h
// JCSDKOC
//
// Created by maikireton on 2017/8/11.
// Copyright © 2017年 juphoon. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JCStorageItem.h"
#import "JCStorageCallback.h"
/**
* @defgroup
* @{
*
*/
extern const int JCStorageFileExpire;
/**
*
*
*
*
*
*/
@interface JCStorage : NSObject
/**
* JCStorage
*
* JCStorage 线
*
* @note
* - JCStorage {@link destroy} JCStorage
* - JCClient @ref JCClient#state "state" @ref JCClientStateNotInit
*
* @param client JCClient
* @param callback JCStorageCallback
* @return JCStorage
* @exception "JCClient、JCStorageCallback 任意一个参数传空就会出现调用异常"
*/
+(JCStorage*)create:(JCClient*)client callback:(id<JCStorageCallback>)callback;
/**
* JCStorage
*
* JCStorage 使 JCStorage <br>
* **** JCSDK JCStorage <br>
* JCStorage @ref destroy
*/
+(void)destroy;
/**
*
*
* @param path **/Documents/JuphoonCloud/audio.wmv**
* @param cookie
* @param expiredSeconds -1
* @return
* - JCStorageItem
* - JCStorageItem @ref JCStorageItemStateTransfering {@link JCStorageCallback#onFileUpdate: onFileUpdate}
* - JCStorageItem @ref JCStorageItemStateFail {@link JCStorageCallback.onFileResult: onFileResult}
* - null
*/
-(JCStorageItem*)uploadFileByExpireTime:(NSString*)path expiredSeconds:(int)expiredSeconds cookie:(id)cookie;
/**
*
*
* @param uri
* @param savePath **/Documents/JuphoonCloud/audio.wmv**
* @param cookie
* - JCStorageItem
* - JCStorageItem @ref JCStorageItemStateTransfering {@link JCStorageCallback#onFileUpdate: onFileUpdate}
* - JCStorageItem @ref JCStorageItemStateFail {@link JCStorageCallback.onFileResult: onFileResult}
* - null
*/
-(JCStorageItem*)downloadFile:(NSString*)uri savePath:(NSString*)savePath cookie:(id)cookie;
/**
*
*
* @param item JCStorageItem {@link uploadFileByExpireTime:expiredSeconds:cookie: uploadFileByExpireTime} {@link downloadFile:savePath:cookie: downloadFile}
* @return
* - true: {@link JCStorageCallback#onFileResult: onFileResult}
* - false:
*/
-(bool)cancelFile:(JCStorageItem*)item;
/**
* cookie取消正在进行的文件上传下载
*
* cookie JCStorageItem
* - {@link cancelFile: cancelFile}
* - false
*
* @param cookie cookie
* @return
* - true:
* - false:
*/
-(bool)cancelFileByCookie:(id)cookie;
@end
/**
* @}
*/