public class ProductRepository
extends java.lang.Object
Constructor and Description |
---|
ProductRepository(java.lang.String indexCacheFile,
java.lang.String repoType,
java.util.List<ProductInformation> products) |
Modifier and Type | Method and Description |
---|---|
boolean |
addProduct(ProductInformation product)
Add the product
|
boolean |
equals(java.lang.Object o) |
boolean |
equals(ProductRepository c)
Note this only checks package name, not that the othr details match
|
java.lang.String |
getIndexCacheFilePath() |
java.util.List<ProductInformation> |
getPlugins()
Get all plugin products
|
ProductInformation |
getProduct(java.lang.String pkg) |
java.util.List<ProductInformation> |
getProducts()
Get all products
|
java.lang.String |
getRepoType() |
int |
getSize() |
java.util.List<ProductInformation> |
getStale(android.content.Context context)
Get all products which are installed but not current
|
int |
hashCode() |
boolean |
hasProduct(java.lang.String pkg) |
boolean |
hasProducts() |
boolean |
installed(android.content.Context context,
java.lang.String pkg)
See if this repo has the product, and update internal state
|
boolean |
isRepoType(java.lang.String repoType) |
boolean |
isStale(android.content.Context context,
java.lang.String pkg)
Check if product is installed but not current
|
boolean |
isValid() |
static ProductRepository |
parseRepo(android.content.Context context,
java.lang.String repoType,
java.io.File in)
Parse the repo index from file
|
static ProductRepository |
parseRepo(android.content.Context context,
java.lang.String repoIndexUrl,
java.lang.String repoType,
java.io.BufferedReader in)
Parse the repo index from input stream
|
boolean |
removeProduct(java.lang.String pkg)
Remove the product
|
boolean |
save(java.io.File index)
Save the repo to the specified file location
|
static boolean |
save(java.io.File index,
java.util.List<ProductInformation> products) |
void |
setProducts(java.util.List<ProductInformation> products) |
java.lang.String |
toString() |
boolean |
uninstalled(android.content.Context context,
java.lang.String pkg)
See if this repo has the product, and update internal state
|
public ProductRepository(java.lang.String indexCacheFile, java.lang.String repoType, java.util.List<ProductInformation> products)
public boolean isValid()
public boolean isRepoType(java.lang.String repoType)
public java.lang.String getRepoType()
public java.lang.String getIndexCacheFilePath()
public boolean hasProducts()
public java.util.List<ProductInformation> getProducts()
public ProductInformation getProduct(java.lang.String pkg)
public boolean hasProduct(java.lang.String pkg)
public void setProducts(java.util.List<ProductInformation> products)
public java.util.List<ProductInformation> getPlugins()
public int getSize()
public java.util.List<ProductInformation> getStale(android.content.Context context)
public boolean isStale(android.content.Context context, java.lang.String pkg)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equals(ProductRepository c)
c
- public boolean installed(android.content.Context context, java.lang.String pkg)
context
- pkg
- public boolean uninstalled(android.content.Context context, java.lang.String pkg)
context
- pkg
- public boolean removeProduct(java.lang.String pkg)
pkg
- public boolean addProduct(ProductInformation product)
product
- public static ProductRepository parseRepo(android.content.Context context, java.lang.String repoIndexUrl, java.lang.String repoType, java.io.BufferedReader in)
repoIndexUrl
- in
- public static ProductRepository parseRepo(android.content.Context context, java.lang.String repoType, java.io.File in)
context
- in
- public boolean save(java.io.File index)
index
- public static boolean save(java.io.File index, java.util.List<ProductInformation> products)
public int hashCode()
hashCode
in class java.lang.Object