public class RemoteProductProvider extends BaseProductProvider
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REMOTE_REPO_CACHE_PATH |
_cache, _context
Constructor and Description |
---|
RemoteProductProvider(android.app.Activity context,
android.content.SharedPreferences prefs) |
Modifier and Type | Method and Description |
---|---|
static void |
cleanup(java.io.File infz,
java.io.File dest)
Dumb cache clear for now
|
static boolean |
extract(java.io.File infz)
Extract the repo cache into apk/support/remote
|
static boolean |
extract(java.io.File infz,
java.io.File dest)
Extract the repo cache into the specified destination directory
|
java.io.File |
getAPK(ProductInformation product)
Runs on UI thread, must be quick (i.e.
|
void |
install(ProductInformation product)
Leverage HTTPRequestService to download APK
|
boolean |
isRemote()
Check if the repo is hosted remotely (not on this device)
|
protected ProductRepository |
load()
Load cached index
|
ProductRepository |
parseRepo(java.lang.String repoType,
java.io.File repoIndex)
Override to convert to use java.io.FileReader outside of IO Abstraction
|
ProductRepository |
rebuild(ProductProviderManager.ProgressDialogListener l)
Only execute from non-UI thread
|
contains, dispose, get, installed, toString, uninstall, uninstalled
public RemoteProductProvider(android.app.Activity context, android.content.SharedPreferences prefs)
protected ProductRepository load()
BaseProductProvider
load
in class BaseProductProvider
public ProductRepository rebuild(ProductProviderManager.ProgressDialogListener l)
l
- public static boolean extract(java.io.File infz)
infz
- public static void cleanup(java.io.File infz, java.io.File dest)
public static boolean extract(java.io.File infz, java.io.File dest)
infz
- dest
- public java.io.File getAPK(ProductInformation product)
BaseProductProvider
getAPK
in class BaseProductProvider
product
- the product informationpublic void install(ProductInformation product)
install
in interface ProductProviderManager.Provider
install
in class BaseProductProvider
product
- public boolean isRemote()
ProductProviderManager.Provider
isRemote
in interface ProductProviderManager.Provider
isRemote
in class BaseProductProvider
public ProductRepository parseRepo(java.lang.String repoType, java.io.File repoIndex)
parseRepo
in class BaseProductProvider
repoType
- The type of repo; such as remote in this caserepoIndex
- The file for the repo index