public class AstroCatConfig extends AbstractCatalogDirectory
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER
Constructor and Description |
---|
AstroCatConfig(String configFileOrURL)
Parse the given AstroCat XML file or URL.
|
AstroCatConfig(String name,
String configFileOrURL)
Parse the given AstroCat XML file or URL.
|
AstroCatConfig(String name,
URL url)
Parse the AstroCat XML catalog config file pointed to by the given URL.
|
AstroCatConfig(URL url,
HTMLQueryResultHandler handler)
Parse the AstroCat XML file from the already opened input stream.
|
Modifier and Type | Method and Description |
---|---|
void |
addCatalogDirectory(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
|
List |
getNameServers()
Return a list of name servers (Catalogs with serv_type
equal to "namesvr") to use to resolve astronomical object names.
|
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 list in the default location (~/.jsky/AstroCat.xml)
|
void |
save(String filename)
Save the catalog list to the given file (in the AstroCat XML format).
|
static void |
setConfigFile(URL url)
Set the URL to use for the default catalog config file.
|
addCatalog, addCatalog, addTreeModelListener, clone, getCatalog, getCatalog, getCatalogList, getCatalogs, getChild, getChildCount, getDescription, getDocURL, getHTMLQueryResultHandler, getId, getIndexOfChild, getName, getNumCatalogs, getNumParams, getParamDesc, getParamDesc, getParent, getPath, getPath, getRoot, getRootCatalogDirectory, getTitle, getType, getURL, indexOf, isImageServer, isLeaf, isLocal, moveCatalog, moveCatalogToEnd, query, removeCatalog, removeTreeModelListener, replaceCatalog, setCatalogs, setHTMLQueryResultHandler, setId, setName, setParent, setRegionArgs, setURL, toString, valueForPathChanged
public AstroCatConfig(String name, URL url)
name
- the display name for the config fileurl
- the URL of the config filepublic AstroCatConfig(String name, String configFileOrURL)
name
- the display name for the config fileconfigFileOrURL
- the file name or URL of the config filepublic AstroCatConfig(String configFileOrURL)
configFileOrURL
- the file name or URL of the config filepublic AstroCatConfig(URL url, HTMLQueryResultHandler handler)
url
- the URL of the config filehandler
- used to report HTML errors from the HTTP serverpublic 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(URL url)
RuntimeException
- if the catalog directory could not be createdpublic static void setConfigFile(URL url)
url
- points to the AstroCat XML catalog config filepublic void addCatalogDirectory(String urlStr)
urlStr
- the URL of a catalog config file.public List getNameServers()
getNameServers
in interface CatalogDirectory
getNameServers
in class AbstractCatalogDirectory
public void save()
public void save(String filename)
filename
- the file name in which to store the catalog informationpublic static void main(String[] args)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.