public class IRSAConfig extends AbstractCatalogDirectory
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addCatalog, addCatalog, addTreeModelListener, clone, getCatalog, getCatalog, getCatalogList, getCatalogs, getChild, getChildCount, getDescription, getDocURL, getHTMLQueryResultHandler, getId, getIndexOfChild, getName, getNameServers, 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 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 serverpublic 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)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.