Kofax Mobile SDK API Reference
Classes | Public Member Functions | Protected Member Functions | List of all members
LocalProjectProvider Class Reference
Inheritance diagram for LocalProjectProvider:
IProjectProvider

Classes

class  VersionTable
 

Public Member Functions

 LocalProjectProvider (Context ctx)
 
 LocalProjectProvider (Context ctx, InputStream projectZipStream, IBundleCacheProvider cacheProvider)
 
void getProject (String version, ICompletionListener< File > listener)
 
void getVariant (String variantName, String version, ICompletionListener< File > listener)
 
void getHighestVersion (String sdkVersion, ICompletionListener< String > listener)
 
String getLatestCachedModelDataBuildInfo ()
 
void getProject (final String projectName, final String version, final ICompletionListener< File > listener)
 
void getVariant (final String projectName, final String variantName, final String version, final ICompletionListener< File > listener)
 
void getHighestVersion (final String projectName, final String sdkVersion, final ICompletionListener< String > listener)
 
String getLatestCachedModelDataBuildInfo (String projectName)
 
- Public Member Functions inherited from IProjectProvider
void getHighestVersion (final String sdkVersion, final ICompletionListener< String > listener)
 
void getProject (final String version, final ICompletionListener< File > listener)
 
void getVariant (final String variantName, final String version, final ICompletionListener< File > listener)
 

Protected Member Functions

String getBundleVersion (String projectName)
 
String readVersion (File versionTable)
 
String readVersion (String jsonContent)
 
String sdkVersion ()
 
Task< File > getProjectAsync (final String projectName, final String version)
 
Task< File > getVariantAsync (final String projectName, final String variantName, final String version)
 
void finalize () throws Throwable
 

Detailed Description

A reference implementation of IProjectProvider that uses a project zip input stream, or reads the project zip from assets.

Constructor & Destructor Documentation

LocalProjectProvider ( Context  ctx)

This constructor will create an instance using the default IBundleCacheProvider. This implementation will assume a project zip exists in the root of the project's assets. E.g.IdRegion#getRegionName().zip ("CombinedIDs.zip").

Parameters
ctxThis context
LocalProjectProvider ( Context  ctx,
InputStream  projectZipStream,
IBundleCacheProvider  cacheProvider 
)

This constructor allows specification of the project input stream and a IBundleCacheProvider. It's possible when using this constructor to place the project bundle anywhere on, or off the device, by providing its stream here.

Parameters
ctxThis context
projectZipStreamAn input stream to the project zip file
cacheProviderThe cache provider used to store files
Note
It is the callers responsibility to close the input stream object.

Member Function Documentation

void finalize ( ) throws Throwable
protected

Deletes the temporary working file if one exists.

Exceptions
Throwable
String getBundleVersion ( String  projectName)
protected

Retrieves the project bundle's version string.

Parameters
projectNameThe name of the project to get the version for
Returns
The version string
void getHighestVersion ( String  sdkVersion,
ICompletionListener< String >  listener 
)
void getHighestVersion ( final String  projectName,
final String  sdkVersion,
final ICompletionListener< String >  listener 
)

Get the highest version string that is compatible with the given SDK version

Note: The listener's object parameter will be null, or a string representing the highest compatible version

Parameters
projectNameThe name of the project. This parameter is no longer used and will be ignored.
sdkVersionThe version of the SDK that must be compatible
listenerA completion listener. If this is null, no work will be done.
Deprecated:
Deprecated in SDK 3.5. Replaced by IProjectProvider#getHighestVersion(String, ICompletionListener<String>).

Implements IProjectProvider.

String getLatestCachedModelDataBuildInfo ( )

Get the latest model data build information from cached project

Returns
The latest model data build info if available, otherwise a null string

Implements IProjectProvider.

String getLatestCachedModelDataBuildInfo ( String  projectName)

Get the latest model data build information from cached project

Parameters
projectNameThe name of the project. This parameter is no longer used and will be ignored.
Returns
The latest model data build info if available, otherwise a null string
Deprecated:
Deprecated in SDK 3.5. Replaced by IProjectProvider#getLatestCachedModelDataBuildInfo().

Implements IProjectProvider.

void getProject ( String  version,
ICompletionListener< File >  listener 
)
void getProject ( final String  projectName,
final String  version,
final ICompletionListener< File >  listener 
)

Get the project bundle for the given version

Note: The listener's object parameter will be a ZIP containing the top-level project files, including the fields.xml, classifier configurations, and cities.zip, and a file listing the available variants

Parameters
projectNameThe name of the project. This parameter is no longer used and will be ignored.
versionThe version of the project
listenerA completion listener. If this is null, no work will be done.
Deprecated:
Deprecated in SDK 3.5. Replaced by IProjectProvider#getProject(String, ICompletionListener<File>).

Implements IProjectProvider.

Task<File> getProjectAsync ( final String  projectName,
final String  version 
)
protected
void getVariant ( String  variantName,
String  version,
ICompletionListener< File >  listener 
)
void getVariant ( final String  projectName,
final String  variantName,
final String  version,
final ICompletionListener< File >  listener 
)

Get a variant for the given version

Note: The listener's object parameter will be a ZIP containing the variant-specific files

Parameters
projectNameThe name of the project. This parameter is no longer used and will be ignored.
variantNameThe name of the variant
versionThe version of the variant (this should match the same version string retrieved from getHighestVersion(String, String, ICompletionListener)
listenerA completion listener. If this is null, no work will be done.
Deprecated:
Deprecated in SDK 3.5. Replaced by IProjectProvider#getVariant(String, String, CompletionListener<File>).

Implements IProjectProvider.

Task<File> getVariantAsync ( final String  projectName,
final String  variantName,
final String  version 
)
protected
String readVersion ( File  versionTable)
protected

Given the file of the version table, parses the table, and retrieves the version compatible with this SDK version.

Normally, a project bundle will only include a single version. This implementation simply ensures the bundle is formatted properly.

Parameters
versionTableThe version table
Returns
The compatible version.
String readVersion ( String  jsonContent)
protected
String sdkVersion ( )
protected

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.