sensitivity.io for iOS & macOS  1.1.4
Instance Methods | Class Methods | List of all members
HttpRetriever Class Reference

#import <HttpRetriever.h>

Inheritance diagram for HttpRetriever:
ApplicationIdRetriever LicenseRetriever SettingsRetriever ClassifierSettingsRetriever ScannerSettingsRetriever

Instance Methods

(NSString *_Nullable) - destinationFileWithError:
 
(BOOL) - setDestinationFile:withError:
 
(NSString *_Nullable) - urlStringWithError:
 
(BOOL) - retrieveToFileWithError:
 
(NSString *_Nullable) - retrieveToStringWithError:
 

Class Methods

(BOOL) + setHostName:withError:
 
(NSString *_Nullable) + hostNameWithError:
 
(BOOL) + setApiVersion:withError:
 
(NSString *_Nullable) + apiVersionWithError:
 
(BOOL) + setAccountId:withError:
 
(NSString *_Nullable) + accountIdWithError:
 
(BOOL) + setProjectId:withError:
 
(NSString *_Nullable) + projectIdWithError:
 
(BOOL) + setAuthenticationKey:withError:
 
(NSString *_Nullable) + authenticationKeyWithError:
 
(BOOL) + setApplicationId:withError:
 
(NSString *_Nullable) + applicationIdWithError:
 

Detailed Description

HttpRetriever class provides the means to download your resources. Before trying to download any resources, your retrievers need to be configured by setting your account ID, project ID, authentication key and application ID.

Note
Do not initialize this class directly, it will crash at runtime. Use the specific retriver subclasses instead.

Method Documentation

◆ accountIdWithError:()

+ (NSString * _Nullable) accountIdWithError: (NSError *_Nullable *_Nullable)  error

Returns the account ID defined for all retrievers.

Parameters
errorThe error representing the reason for the failure
Returns
The account ID

◆ apiVersionWithError:()

+ (NSString * _Nullable) apiVersionWithError: (NSError *_Nullable *_Nullable)  error

Returns the API version defined for all retrievers.

Parameters
errorThe error representing the reason for the failure
Returns
The API version

◆ applicationIdWithError:()

+ (NSString * _Nullable) applicationIdWithError: (NSError *_Nullable *_Nullable)  error

Returns the application ID defined for all retrievers.

Parameters
errorThe error representing the reason for the failure
Returns
The application ID

◆ authenticationKeyWithError:()

+ (NSString * _Nullable) authenticationKeyWithError: (NSError *_Nullable *_Nullable)  error

Returns the authentication key defined for all retrievers.

Parameters
errorThe error representing the reason for the failure
Returns
The authentication key

◆ destinationFileWithError:()

- (NSString * _Nullable) destinationFileWithError: (NSError *_Nullable *_Nullable)  error

Returns the file path where the retriever downloads the required resource if retrieveToFileWithError: is used.

Parameters
errorThe error representing the reason for the failure
Returns
The file path where the retriever downloads the required resource

◆ hostNameWithError:()

+ (NSString * _Nullable) hostNameWithError: (NSError *_Nullable *_Nullable)  error

Returns the host name defined for all retrievers.

Parameters
errorThe error representing the reason for the failure
Returns
The host name

◆ projectIdWithError:()

+ (NSString * _Nullable) projectIdWithError: (NSError *_Nullable *_Nullable)  error

Returns the project ID defined for all retrievers.

Parameters
errorThe error representing the reason for the failure
Returns
The project ID

◆ retrieveToFileWithError:()

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

Retrieves the required resource to file.

Precondition
account ID, project ID, authentication key and destination file are set.
Remarks
Relevant errors: ENETUNREACH, EPROTO, EIO
Parameters
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ retrieveToStringWithError:()

- (NSString * _Nullable) retrieveToStringWithError: (NSError *_Nullable *_Nullable)  error

Retrieves the required resource and returns it as a string.

Precondition
account ID, project ID and authentication key are set.
Remarks
Relevant errors: ENETUNREACH, EPROTO
Parameters
errorThe error representing the reason for the failure
Returns
The resource as a string on success, nil in case an error occured

◆ setAccountId:withError:()

+ (BOOL) setAccountId: (NSString *_Nonnull)  accountId
withError: (NSError *_Nullable *_Nullable)  error 

Sets the account ID of all retrievers.

Parameters
accountIdThe new account ID
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ setApiVersion:withError:()

+ (BOOL) setApiVersion: (NSString *_Nonnull)  apiVersion
withError: (NSError *_Nullable *_Nullable)  error 

Sets the API version of all retrievers.

Remarks
If not set, default is v1
Parameters
apiVersionThe new API version
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ setApplicationId:withError:()

+ (BOOL) setApplicationId: (NSString *_Nonnull)  applicationId
withError: (NSError *_Nullable *_Nullable)  error 

Sets the application ID of all retrievers.

Parameters
applicationIdThe new application ID
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ setAuthenticationKey:withError:()

+ (BOOL) setAuthenticationKey: (NSString *_Nonnull)  authenticationKey
withError: (NSError *_Nullable *_Nullable)  error 

Sets the authentication key of all retrievers.

Parameters
authenticationKeyThe new authentication key
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ setDestinationFile:withError:()

- (BOOL) setDestinationFile: (NSString *_Nonnull)  destinationFile
withError: (NSError *_Nullable *_Nullable)  error 

Sets the file path where the retriever downloads the required resource if retrieveToFileWithError: is used.

Parameters
destinationFileThe file path where the resource is downloaded
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ setHostName:withError:()

+ (BOOL) setHostName: (NSString *_Nonnull)  hostName
withError: (NSError *_Nullable *_Nullable)  error 

Sets the host name of all retrievers.

Remarks
If not set, default is api.sensitivity.io
Parameters
hostNameThe new host name
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ setProjectId:withError:()

+ (BOOL) setProjectId: (NSString *_Nonnull)  projectId
withError: (NSError *_Nullable *_Nullable)  error 

Sets the project ID of all retrievers.

Parameters
projectIdThe new project ID
errorThe error representing the reason for the failure
Returns
True on success, false in case an error occured

◆ urlStringWithError:()

- (NSString * _Nullable) urlStringWithError: (NSError *_Nullable *_Nullable)  error

Returns the URL string of the retriever.

Parameters
errorThe error representing the reason for the failure
Returns
The URL string of the retriever

The documentation for this class was generated from the following file: