Kofax Mobile SDK API Reference
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
BundleCacheProvider Class Reference
Inheritance diagram for BundleCacheProvider:
IBundleCacheProvider

Public Member Functions

 BundleCacheProvider (Context context)
 
 BundleCacheProvider (File cache)
 
String getLatestModelDataBuildInfo (String projectName)
 
File getProject (String projectName, String version)
 
File cacheProject (String projectName, IBundle bundle, String version)
 
File getVariant (String projectName, String variant, String version)
 
File cacheVariant (String projectName, String variantName, IBundle bundle, String version)
 
String getLatestVersionForProject (final String projectName)
 
- Public Member Functions inherited from IBundleCacheProvider
String getLatestVersionForProject (String projectName)
 

Static Public Attributes

static final String ODE_CACHE = "_COM_KOFAX_MOBILE_SDK_EXTRACT_ID_ODE_CACHE_"
 

Protected Member Functions

void clearCache ()
 

Detailed Description

The BundleCacheProvider handles extracting/copying entries from a bundle into a cache folder. The provider is used to determine the cache location.
By default, the SDK uses the Context.getFilesDir() to save extracted bundle entries as /[app dir]/files/ODE_CACHE/[version]/{project,variant}/

Depending on where the cache is (Context.getCacheDir() or Context.getFilesDir()), the saved files may be stored temporarily, or permanently.

This implementation uses the version string, and will completely empty downloaded files if the given version string does not match what is already on disk.

Constructor & Destructor Documentation

BundleCacheProvider ( Context  context)

Create a cache provider which uses context.getFilesDir() as the cache location.

Parameters
contextThe context
BundleCacheProvider ( File  cache)

Create a cache provider specifying the cache location.

Parameters
cacheThe directory where this should cache files

Member Function Documentation

File cacheProject ( String  projectName,
IBundle  bundle,
String  version 
)

Extracts the project parts from the given bundle and caches them in the application's local storage.

Parameters
projectNameThe project to extract
bundleThe bundle from which the project will be extracted
versionThe version of this bundle
Returns
The directory containing the project parts

Implements IBundleCacheProvider.

File cacheVariant ( String  projectName,
String  variantName,
IBundle  bundle,
String  version 
)

Extracts the variant parts from the given bundle and caches them in the application's local storage.

Parameters
projectNameThe name of the project to which this variant belongs
variantNameThe variant to extract
bundleThe bundle from which the variant will be extracted
versionThe version of this bundle
Returns
The directory containing the variant parts

Implements IBundleCacheProvider.

void clearCache ( )
protected

Recursively deletes the cache folder, and its contents.

String getLatestModelDataBuildInfo ( String  projectName)

Get the project latest build model from cache

Parameters
projectNameThe name of the project to retrieve
Returns
The latest model data build info if available, otherwise a null string

Implements IBundleCacheProvider.

String getLatestVersionForProject ( final String  projectName)

Gets the version of the cached project file

Parameters
projectNameThe name of the project to get the version string for
Returns
The version string, or null if one is not cached
Exceptions
ProjectProviderExceptionIf more than one project cache exists
File getProject ( String  projectName,
String  version 
)

Get the project directory

Parameters
projectNameThe name of the project to retrieve
versionThe version of the project to retrieve
Returns
The directory containing the project files

Implements IBundleCacheProvider.

File getVariant ( String  projectName,
String  variant,
String  version 
)

Get the variant directory

Parameters
projectNameThe name of the project to which this variant belongs
variantThe variant to retrieve
versionThe version of the variant to retrieve
Returns
The directory containing the variant parts

Implements IBundleCacheProvider.

Member Data Documentation

final String ODE_CACHE = "_COM_KOFAX_MOBILE_SDK_EXTRACT_ID_ODE_CACHE_"
static

The documentation for this class was generated from the following file:
Untitled Document © 2018 Kofax, Inc. All rights reserved. Use is subject to license terms.