AWSS3TransferManager

Deprecated

Use AWSS3TransferUtility for upload and download operations.


@interface AWSS3TransferManager

High level utility for managing transfers to Amazon S3. S3TransferManager provides a simple API for uploading and downloading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability.

Warning

The AWSS3TransferManager is deprecated. Please use AWSS3TransferUtility for Amazon S3 upload and download operations. @deprecated Please use AWSS3TransferUtility for upload and download operations.
  • Returns the singleton service client. If the singleton object does not exist, the SDK instantiates the default service client with defaultServiceConfiguration from [AWSServiceManager defaultServiceManager]. The reference to this object is maintained by the SDK, and you do not need to retain it manually.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
        let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialProvider)
        AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration
    
        return true
    }
    

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
         AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                         identityPoolId:@"YourIdentityPoolId"];
         AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1
                                                                              credentialsProvider:credentialsProvider];
         [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;
    
         return YES;
     }
    

    Then call the following to get the default service client:

    Swift

    let S3TransferManager = AWSS3TransferManager.defaultS3TransferManager()
    

    Objective-C

    AWSS3TransferManager *S3TransferManager = [AWSS3TransferManager defaultS3TransferManager];
    

    Declaration

    Objective-C

    + (nonnull instancetype)defaultS3TransferManager;

    Swift

    class func `default`() -> Self

    Return Value

    The default service client.

  • Creates a service client with the given service configuration and registers it for the key.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
        let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
        AWSS3TransferManager.registerS3TransferManagerWithConfiguration(configuration, forKey: "USWest2S3TransferManager")
    
        return true
    }
    

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                        identityPoolId:@"YourIdentityPoolId"];
        AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                             credentialsProvider:credentialsProvider];
    
        [AWSS3TransferManager registerS3TransferManagerWithConfiguration:configuration forKey:@"USWest2S3TransferManager"];
    
        return YES;
    }
    

    Then call the following to get the service client:

    Swift

    let S3TransferManager = AWSS3TransferManager(forKey: "USWest2S3TransferManager")
    

    Objective-C

    AWSS3TransferManager *S3TransferManager = [AWSS3TransferManager S3TransferManagerForKey:@"USWest2S3TransferManager"];
    

    Warning

    After calling this method, do not modify the configuration object. It may cause unspecified behaviors.

    Declaration

    Objective-C

    + (void)registerS3TransferManagerWithConfiguration:(id)configuration
                                                forKey:(nonnull NSString *)key;

    Swift

    class func register(withConfiguration configuration: Any!, forKey key: String)

    Parameters

    configuration

    A service configuration object.

    key

    A string to identify the service client.

  • Retrieves the service client associated with the key. You need to call + registerS3TransferManagerWithConfiguration:forKey: before invoking this method.

    For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

    Swift

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
        let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
        AWSS3TransferManager.registerS3TransferManagerWithConfiguration(configuration, forKey: "USWest2S3TransferManager")
    
        return true
    }
    

    Objective-C

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                        identityPoolId:@"YourIdentityPoolId"];
        AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                             credentialsProvider:credentialsProvider];
    
        [AWSS3TransferManager registerS3TransferManagerWithConfiguration:configuration forKey:@"USWest2S3TransferManager"];
    
        return YES;
    }
    

    Then call the following to get the service client:

    Swift

    let S3TransferManager = AWSS3TransferManager(forKey: "USWest2S3TransferManager")
    

    Objective-C

    AWSS3TransferManager *S3TransferManager = [AWSS3TransferManager S3TransferManagerForKey:@"USWest2S3TransferManager"];
    

    Declaration

    Objective-C

    + (nonnull instancetype)S3TransferManagerForKey:(nonnull NSString *)key;

    Swift

    class func s3TransferManager(forKey key: String) -> Self

    Parameters

    key

    A string to identify the service client.

    Return Value

    An instance of the service client.

  • Removes the service client associated with the key and release it.

    Warning

    Before calling this method, make sure no method is running on this client.

    Declaration

    Objective-C

    + (void)removeS3TransferManagerForKey:(nonnull NSString *)key;

    Swift

    class func remove(forKey key: String)

    Parameters

    key

    A string to identify the service client.

  • Schedules a new transfer to upload data to Amazon S3.

    Declaration

    Objective-C

    - (id)upload:(nonnull AWSS3TransferManagerUploadRequest *)uploadRequest;

    Swift

    func upload(_ uploadRequest: AWSS3TransferManagerUploadRequest) -> Any!

    Parameters

    uploadRequest

    The upload request.

    Return Value

    AWSTask.

  • Schedules a new transfer to download data from Amazon S3 and save it to the specified file.

    Declaration

    Objective-C

    - (id)download:(nonnull AWSS3TransferManagerDownloadRequest *)downloadRequest;

    Swift

    func download(_ downloadRequest: AWSS3TransferManagerDownloadRequest) -> Any!

    Parameters

    downloadRequest

    The download request.

    Return Value

    AWSTask.

  • Cancels all of the upload and download requests.

    Declaration

    Objective-C

    - (id)cancelAll;

    Swift

    func cancelAll() -> Any!

    Return Value

    AWSTask.

  • Pauses all of the upload and download requests.

    Declaration

    Objective-C

    - (id)pauseAll;

    Swift

    func pauseAll() -> Any!

    Return Value

    AWSTask.

  • Resumes all of the upload and download requests.

    Declaration

    Objective-C

    - (id)resumeAll:(nonnull AWSS3TransferManagerResumeAllBlock)block;

    Swift

    func resumeAll(_ block: @escaping AWSS3TransferManagerResumeAllBlock) -> Any!

    Parameters

    block

    The block to optionally re-set the progress blocks to the requests.

    Return Value

    AWSTask.

  • Clears the local cache.

    Declaration

    Objective-C

    - (id)clearCache;

    Swift

    func clearCache() -> Any!

    Return Value

    AWSTask.