|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.catalog.AbstractCatalogDirectory
jsky.catalog.astrocat.AstroCatConfig
public class AstroCatConfig
Reads an AstroCat XML catalog description file and stores information about the catalogs defined there. Since catalog config files may point to other catalog config files to form a hierarchy, this class also implements the CatalogDirectory interface.
Field Summary |
---|
Fields inherited from interface jsky.catalog.Catalog |
---|
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER |
Constructor Summary | |
---|---|
AstroCatConfig(java.lang.String configFileOrURL)
Parse the given AstroCat XML file or URL. |
|
AstroCatConfig(java.lang.String name,
java.lang.String configFileOrURL)
Parse the given AstroCat XML file or URL. |
|
AstroCatConfig(java.lang.String name,
java.net.URL url)
Parse the AstroCat XML catalog config file pointed to by the given URL. |
|
AstroCatConfig(java.net.URL url,
HTMLQueryResultHandler handler)
Parse the AstroCat XML file from the already opened input stream. |
Method Summary | |
---|---|
void |
addCatalogDirectory(java.lang.String urlStr)
Add a catalog directory to the catalog list. |
static AstroCatConfig |
getConfigFile()
If the catalog config file has already been loaded, return an object describing the contents, otherwise search for an AstroCat 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 |
java.util.List |
getNameServers()
Return a list of name servers (Catalogs with serv_type equal to "namesvr") to use to resolve astronomical object names. |
CatalogDirectory |
loadSubDir(java.net.URL url)
Attempt to read a catalog subdirectory from the given URL and return a CatalogDirectory object for it. |
static void |
main(java.lang.String[] args)
Test cases |
CatalogDirectory |
reload()
Reload the catalog config file and return the new object for it. |
void |
save()
Save the catalog list in the default location (~/.jsky/AstroCat.xml) |
void |
save(java.lang.String filename)
Save the catalog list to the given file (in the AstroCat XML format). |
static void |
setConfigFile(java.net.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 AstroCatConfig(java.lang.String name, java.net.URL url)
name
- the display name for the config fileurl
- the URL of the config filepublic AstroCatConfig(java.lang.String name, java.lang.String configFileOrURL)
name
- the display name for the config fileconfigFileOrURL
- the file name or URL of the config filepublic AstroCatConfig(java.lang.String configFileOrURL)
configFileOrURL
- the file name or URL of the config filepublic AstroCatConfig(java.net.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 AstroCatConfig getConfigFile()
First the jsky.catalog.astrocat.config system property is checked. If set, it should be the URL string or file name of the config file.
Next, the file ~/.jsky/AstroCat.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/astrocat/conf/AstroCat.xml).
public CatalogDirectory reload()
public CatalogDirectory loadSubDir(java.net.URL url)
java.lang.RuntimeException
- if the catalog directory could not be createdpublic static void setConfigFile(java.net.URL url)
url
- points to the AstroCat XML catalog config filepublic void addCatalogDirectory(java.lang.String urlStr)
urlStr
- the URL of a catalog config file.public java.util.List getNameServers()
getNameServers
in interface CatalogDirectory
getNameServers
in class AbstractCatalogDirectory
public void save()
public void save(java.lang.String filename)
filename
- the file name in which to store the catalog informationpublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |