A reference implementation of IProjectProvider that uses a project zip input stream, or reads the project zip from assets.
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, named according to the project name. E.g. IdRegion#getRegionName().zip ("USIDs.zip").
- Parameters
-
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.
- Note
- It is the callers responsibility to close the input stream object.
- Parameters
-
ctx | This context |
projectZipStream | An input stream to the project zip file |
cacheProvider | The cache provider used to store files |
void finalize |
( |
| ) |
throws Throwable |
|
protected |
Deletes the temporary working file if one exists.
- Exceptions
-
String getBundleVersion |
( |
String |
projectName | ) |
|
|
protected |
Retrieves the project bundle's version string.
- Parameters
-
projectName | The name of the project to get the version for |
- Returns
- The version string
void getHighestVersion |
( |
final String |
projectName, |
|
|
final String |
sdkVersion, |
|
|
final ICompletionListener< String > |
listener |
|
) |
| |
Get the highest version string for the given project 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
-
projectName | The name of the project |
sdkVersion | The version of the SDK that must be compatible |
listener | A completion listener. If this is null, no work will be done. |
Implements IProjectProvider.
String getLatestCachedModelDataBuildInfo |
( |
String |
projectName | ) |
|
Get the project latest model data build information from cached project
- Parameters
-
projectName | The name of the project to retrieve |
- Returns
- The latest model data build info if available, otherwise a null string
Implements IProjectProvider.
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
-
projectName | The name of the project |
version | The version of the project |
listener | A completion listener. If this is null, no work will be done. |
Implements IProjectProvider.
Task<File> getProjectAsync |
( |
final String |
projectName, |
|
|
final String |
version |
|
) |
| |
|
protected |
void getVariant |
( |
final String |
projectName, |
|
|
final String |
variantName, |
|
|
final String |
version, |
|
|
final ICompletionListener< File > |
listener |
|
) |
| |
Get a variant for the given version for the given project
Note: The listener's object parameter will be a ZIP containing the variant-specific files
- Parameters
-
projectName | The name of the project |
variantName | The name of the variant |
version | The version of the variant (this should match the same version string retrieved from getHighestVersion(String, String, ICompletionListener) |
listener | A completion listener. If this is null, no work will be done. |
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
-
versionTable | The version table |
- Returns
- The compatible version.
String readVersion |
( |
String |
jsonContent | ) |
|
|
protected |
The documentation for this class was generated from the following file: