|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.repository.Repository
public class Repository
The Repository class provides access to the contents of an Inca reporter repository--the catalog of Reporter packages and the packages themselves.
Field Summary | |
---|---|
protected java.net.URL |
baseUrl
|
protected java.util.Properties[] |
catalog
|
static java.lang.String |
CATALOG_NAME
|
Constructor Summary | |
---|---|
Repository(java.net.URL baseURL)
Instantiates a repository accessed via a base URL. |
|
Repository(java.net.URL baseURL,
java.util.Properties[] catalog)
Instantiates a repository with a catalog generated elsewhere. |
Method Summary | |
---|---|
boolean |
equals(java.lang.String repositoryUrl)
Returns true if the given repository url matches this repository url. |
boolean |
exists(java.lang.String propertyName,
java.lang.String value)
Return whether a package exists in the repository with a given property name and value. |
java.util.Properties[] |
getCatalog()
Returns information about the contents of the repository. |
java.lang.String |
getLatestVersionOfPackage(java.lang.String packageName)
Return the latest version of the specified package that exists in this repository or null if it doesn't exist. |
java.util.Properties |
getProperties(java.lang.String name,
java.lang.String version)
Retrieve the repository properties for the specified package and version. |
java.util.Properties[] |
getPropertiesByLookup(java.lang.String property,
java.lang.String value)
Returns properties for all packages that match the given property name and value. |
static java.lang.String[] |
getPropertyValues(java.lang.String s)
Splits a property value from a catalog reporter entry into a set of values. |
byte[] |
getReporter(java.lang.String path)
Returns the contents of a file located via a specified path in the repository. |
ReporterPackage |
getReporterPackage(java.lang.String path)
Returns a binary package located via a specified path in the repository. |
java.net.URL |
getURL()
Returns the base URL through which this Repository is accessed. |
static void |
main(java.lang.String[] args)
The main for this class is a test program that lists the contents of one or more repositories listed on the command line. |
void |
refresh()
Refresh the catalog contents by downloading the Packages.gz file and replacing the current contents. |
void |
setCatalog(java.util.Properties[] catalog)
Force the repository catalog to be a specified set of reporters. |
java.lang.String |
toString()
Override of the default toString method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CATALOG_NAME
protected java.net.URL baseUrl
protected java.util.Properties[] catalog
Constructor Detail |
---|
public Repository(java.net.URL baseURL) throws java.io.IOException
baseURL
- the URL for the repository
java.io.IOException
- if the repository does not exist or has no catalogpublic Repository(java.net.URL baseURL, java.util.Properties[] catalog)
baseURL
- the URL for the repositorycatalog
- an array of Properties, each element of which describes one
reporter/package in the repositoryMethod Detail |
---|
public boolean equals(java.lang.String repositoryUrl)
repositoryUrl
- A url that we are comparing to this repository.
public boolean exists(java.lang.String propertyName, java.lang.String value)
propertyName
- Name of the reporter package property.value
- Value we expect the property to equal
public java.util.Properties[] getCatalog()
public java.lang.String getLatestVersionOfPackage(java.lang.String packageName)
packageName
- The name of the package we are looking for.
public java.util.Properties getProperties(java.lang.String name, java.lang.String version)
name
- The name of the package to retrieve properties on.version
- The version of the package to retrieve properties on.
public java.util.Properties[] getPropertiesByLookup(java.lang.String property, java.lang.String value)
property
- Name of the reporter package property.value
- Value we expect the property to equal.
public byte[] getReporter(java.lang.String path) throws java.io.IOException
path
- the relative path to the file
java.io.IOException
public ReporterPackage getReporterPackage(java.lang.String path) throws java.io.IOException
path
- the relative path to the package file
java.io.IOException
public java.net.URL getURL()
public void refresh() throws java.io.IOException
java.io.IOException
- if the repository does not exist or has no catalogpublic void setCatalog(java.util.Properties[] catalog)
catalog
- an array of Properties, each element of which describes one
reporter/package in the repositorypublic java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String[] getPropertyValues(java.lang.String s)
s
- A property value from a catalog reporter entry
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |