public class SkycatConfigFile extends AbstractCatalogDirectory
See the Skycat web page for more information about the format of Skycat catalog config files.
Modifier and Type | Field and Description |
---|---|
static String |
BACKUP1 |
static String |
BACKUP2 |
static String |
DEC_COL |
static String |
EQUINOX |
static String |
HELP |
static String |
ID_COL |
static String |
LONG_NAME |
static String |
RA_COL |
static String |
SEARCH_COLS |
static String |
SERV_TYPE
Constants for some config file strings
|
static String |
SHORT_NAME |
static String |
SYMBOL |
static String |
URL |
static String |
X_COL |
static String |
Y_COL |
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER
Constructor and Description |
---|
SkycatConfigFile(String configFileOrURL)
Parse the given skycat style config file or URL.
|
SkycatConfigFile(String name,
String configFileOrURL)
Parse the given skycat style config file or URL.
|
SkycatConfigFile(String name,
URL url)
Parse the skycat style catalog config file pointed to by the given URL.
|
SkycatConfigFile(URL url,
HTMLQueryResultHandler handler)
Parse the skycat style config 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 SkycatConfigFile |
getConfigFile()
If the catalog config file has already been loaded, return an
object describing the contents, otherwise search for a skycat
style 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 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 config file to a file under the user's home directory
(~/.jsky/skycat.cfg) to make it permanent.
|
void |
save(OutputStream stream)
Save the contents of this object in skycat catalog
config file format to the given stream.
|
void |
save(String filename)
Save the contents of this object as a new skycat style catalog
config file using the given file name.
|
static void |
setConfigFile(URL url)
Set the URL to use for the default catalog config file.
|
void |
setParent(CatalogDirectory dir)
Set the parent catalog directory
|
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, setRegionArgs, setURL, toString, valueForPathChanged
public static final String SERV_TYPE
public static final String LONG_NAME
public static final String SHORT_NAME
public static final String URL
public static final String BACKUP1
public static final String BACKUP2
public static final String EQUINOX
public static final String SYMBOL
public static final String ID_COL
public static final String RA_COL
public static final String DEC_COL
public static final String X_COL
public static final String Y_COL
public static final String SEARCH_COLS
public static final String HELP
public SkycatConfigFile(String name, URL url)
name
- the display name for the config fileurl
- the URL of the config filepublic SkycatConfigFile(String name, String configFileOrURL)
name
- the display name for the config fileconfigFileOrURL
- the file name or URL of the config filepublic SkycatConfigFile(String configFileOrURL)
configFileOrURL
- the file name or URL of the config filepublic SkycatConfigFile(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 SkycatConfigFile getConfigFile()
First the jsky.catalog.skycat.config system property is checked. If set, it should be the URL string or file name of the config file.
Next, the file ~/.jsky/skycat.cfg is checked. This file is created when the user makes changes in the 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/skycat/skycat.cfg).
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 skycat style 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) throws IOException
IOException
public void save(OutputStream stream)
public void setParent(CatalogDirectory dir)
Catalog
setParent
in interface Catalog
setParent
in class AbstractCatalogDirectory
public static void main(String[] args)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.