WebContentUtils

Functions

Link copied to clipboard

Return the Braze html in-app message asset cache directory. This cache directory stores assets for html in-app messages that are not pre-fetched into the files directory.

Link copied to clipboard
fun getLocalHtmlUrlFromRemoteUrl(localDirectory: File, remoteZipUrl: String): String?

Takes a remote url pointing to zip file assets and then downloads them into a local directory.

Link copied to clipboard
fun replacePrefetchedUrlsWithLocalAssets(originalString: String, remoteToLocalAssetMap: Map<String, String>): String

In the original string, replaces all instances of the remote uri (Map.Entry.getKey with the local uri Map.Entry.getValue.

Link copied to clipboard
fun unpackZipIntoDirectory(unpackDirectory: String, zipFile: File): Boolean

Takes a zip file and unzips it into a destination directory. Creates the destination directory if not already present.

Link copied to clipboard
fun validateChildFileExistsUnderParent(intendedParentDirectory: String, childFilePath: String): String

Validates that the provided filename's canonical path exists under the intended directory. Throws IllegalStateException if not.

Properties

Link copied to clipboard