SBBDataArchive Class Reference

Inherits from NSObject
Declared in SBBDataArchive.h
SBBDataArchive.m

– initWithReference:jsonValidationMapping:

Designated Initializer

- (instancetype)initWithReference:(NSString *)reference jsonValidationMapping:(nullable NSDictionary<NSString*,NSPredicate*> *)jsonValidationMapping

Parameters

reference

Reference for the archive used as a directory name in temp directory

Return Value

APCDataArchive An instance of APCDataArchive

Declared In

SBBDataArchive.h

– setArchiveInfoObject:forKey:

Add a json serializable object to the info dictionary

- (void)setArchiveInfoObject:(id)object forKey:(NSString *)key

Parameters

object

JSON serializable object, or object convertible to JSON by SBBObjectManager, to be added to the info dictionary

key

Key for the json object to be included

Declared In

SBBDataArchive.h

– insertDictionaryIntoArchive:filename:createdOn:

Converts a dictionary into json data and inserts into the archive.

- (void)insertDictionaryIntoArchive:(NSDictionary *)dictionary filename:(NSString *)filename createdOn:(NSDate *)createdOn

Parameters

dictionary

Dictionary to be inserted into the zip archive.

filename

Filename for the json data to be included without path extension

createdOn

File creation timestamp to use in info.json

Declared In

SBBDataArchive.h

– insertURLIntoArchive:fileName:

Inserts the data from the file at the url.

- (void)insertURLIntoArchive:(NSURL *)url fileName:(NSString *)filename

Parameters

url

URL where the file exists. The original file’s creation date will be used as the creation timestamp in info.json

filename

Filename for the json data to be included without path extension (path extension will be preserved from the url).

Declared In

SBBDataArchive.h

– insertDataIntoArchive:filename:createdOn:

Inserts the data with the filename and path extension

- (void)insertDataIntoArchive:(NSData *)data filename:(NSString *)filename createdOn:(NSDate *)createdOn

Parameters

data

Data to add to archive

filename

Filename for the data to be included (path extension assumed to be json if excluded)

createdOn

File creation timestamp to use in info.json

Declared In

SBBDataArchive.h

– isEmpty

Checks if the archive is empty (contains no files).

- (BOOL)isEmpty

Return Value

false if the archive contains one or more files, true if not.

Declared In

SBBDataArchive.h

– completeArchive:

Inserts an info.json file into the archive.

- (BOOL)completeArchive:(NSError *_Nullable *)error

Parameters

error

will be pointed at an actual NSError object if there was a problem completing the archive, or nil.

Return Value

YES if succeeds, NO if fails.

Declared In

SBBDataArchive.h

– encryptAndUploadArchive

Completes the archive, encrypts it, and uploads it to Bridge, then removes the archive.

- (void)encryptAndUploadArchive

Declared In

SBBDataArchive.h

+ encryptAndUploadArchives:

Completes each archive, encrypts it, and uploads it to Bridge, then removes the archive.

+ (void)encryptAndUploadArchives:(NSArray<SBBDataArchive*> *)archives

Parameters

archives

The data archives to be encrypted and sent

Declared In

SBBDataArchive.h

– removeArchive

Guarantees to delete the archive and its working directory container. Call this method when you are finished with the archive, for example after encrypting or uploading.

- (void)removeArchive

Declared In

SBBDataArchive.h