|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.catalog.AbstractCatalogDirectory
jsky.catalog.irsa.IRSAConfig
public class IRSAConfig
Reads an IRSA XML catalog description (Holdings) file and stores information about the catalogs defined there.
Field Summary |
---|
Fields inherited from interface jsky.catalog.Catalog |
---|
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER |
Constructor Summary | |
---|---|
IRSAConfig(String configFileOrURL)
Parse the given IRSA XML file or URL. |
|
IRSAConfig(String name,
String configFileOrURL)
Parse the given IRSA XML file or URL. |
|
IRSAConfig(String name,
URL url)
Parse the IRSA XML catalog config file pointed to by the given URL. |
|
IRSAConfig(URL url,
HTMLQueryResultHandler handler)
Parse the IRSA XML file from the already opened input stream. |
Method Summary | |
---|---|
void |
addCatalogDirectory(String urlStr)
Add a catalog directory to the catalog list. |
static IRSAConfig |
getConfigFile()
If the catalog config file has already been loaded, return an object describing the contents, otherwise search for an IRSA XML catalog config file, load the contents if found, and return the object for it. |
static CatalogDirectory |
getDirectory()
This method is called once at startup to load the top level catalog directory |
CatalogDirectory |
loadSubDir(URL url)
Attempt to read a catalog subdirectory from the given URL and return a CatalogDirectory object for it. |
static void |
main(String[] args)
Test cases |
CatalogDirectory |
reload()
Reload the catalog config file and return the new object for it. |
void |
save()
Save the catalog descriptions to a set of IRSA XML files under ~/.jsky/irsa/. |
void |
save(String dirName)
Save the catalog descriptions to a set of IRSA XML files under the given directory. |
static void |
setConfigFile(URL url)
Set the URL to use for the default catalog config file. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IRSAConfig(String name, URL url)
name
- the display name for the config fileurl
- the URL of the config filepublic IRSAConfig(String name, String configFileOrURL)
name
- the display name for the config fileconfigFileOrURL
- the file name or URL of the config filepublic IRSAConfig(String configFileOrURL)
configFileOrURL
- the file name or URL of the config filepublic IRSAConfig(URL url, HTMLQueryResultHandler handler)
url
- the URL of the config filehandler
- used to report HTML errors from the HTTP serverMethod Detail |
---|
public static CatalogDirectory getDirectory()
public static IRSAConfig getConfigFile()
First the jsky.catalog.irsa.config system property is checked. If set, it should be the URL string or file name of the config file.
Next, the file ~/.jsky/nph-catlist.xml is checked. This file is created automatically when the user makes any changes in the catalog configuration or plot symbol settings in the table display/configure window.
Finally, a default URL s used. It may be set by calling "setConfigFile" and defaults to a config file included in this package (as a resource file: jsky/catalog/irsa/conf/nph-catlist.xml).
public CatalogDirectory reload()
public CatalogDirectory loadSubDir(URL url)
RuntimeException
- if the catalog directory could not be createdpublic static void setConfigFile(URL url)
url
- points to the IRSA XML catalog config filepublic void addCatalogDirectory(String urlStr)
urlStr
- the URL of a catalog config file.public void save()
public void save(String dirName) throws IOException
dirName
- the directory name in which to store the XML files (must end with a file separator)
IOException
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |