• BlackBerry Spark
  • Security library for Android applications
  • 0.6.0.1366-beta
ContentChecker Class Referenceabstract

Class to detect security threats within content and protect your app users, especially where user generated content is handled. More...

Description

Check if URLs, IP addresses or messages called or used within your application are safe. Implement checks which help protect your app users from malicious websites, phishing attempts, malware, adware, and other web sources that pose a threat to your data.

If your application calls IP address or URLs which are not destined for your application server, use ContentChecker.checkIP or ContentChecker.checkURL to determine if the resource server is safe before making a request to that address or URL.

If your application processes user generated content, scan the messages using ContentChecker.checkMessage to detect phishing attempts or unsafe links embedded in content. This enables you to catch potential threats before displaying or sending user generated content. You could choose to block the message or highlight the content may contain unsafe links.

Classes

enum  MsgType
 The type or source of message being checked. More...
 
enum  Result
 Indicate whether a result is safe or unsafe. More...
 

Public Member Functions

final long checkIP (String ip)
 Check whether an IP address is safe to make a socket or HTTP request. More...
 
final long checkURL (String url)
 Check whether a url is safe to make an HTTP request. More...
 
final long checkMessage (String body, String sender, MsgType type)
 Check whether a message is safe to send or display to a user. More...
 
abstract void resultOfScanning (long requestID, Result result)
 Callback with the result of a check. More...
 

Member Function Documentation

◆ checkIP()

final long checkIP ( String  ip)

This function checks whether or not the IP address is safe to make a socket or HTTP request.

Parameters
ipstring A string containing the IP address.
Returns
long containing the requestID to reference the request in the callback.
Exceptions
ContentChecker.INVALID_VALUEif IP object is not valid or null.

◆ checkURL()

final long checkURL ( String  url)

This function checks whether or not the url is safe to make an HTTP request.

Parameters
urlstring A string containing the URL
Returns
long containing the requestID to reference the request in the callback.
Exceptions
ContentChecker.INVALID_VALUEif URL object is not valid or null.

◆ checkMessage()

final long checkMessage ( String  body,
String  sender,
MsgType  type 
)

Check whether a user generated message is free from malicious websites links or phishing attempts and is safe to send or show to a user.

Parameters
bodystring containing the body of the message.
senderstring containing the number, email address or other identifier for the sender.
typeMsgType enum indicating the type of message being checked.
Returns
long containing the requestID to reference the request in the callback.
Exceptions
ContentChecker.INVALID_VALUEif message object is not valid or null.

◆ resultOfScanning()

abstract void resultOfScanning ( long  requestID,
Result  result 
)
abstract
Parameters
requestIDlong returned when calling a check function.
resultResult enum indicating the outcome of the check.