|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.catalog.AbstractCatalogDirectory
jsky.catalog.skycat.SkycatConfigFile
public class SkycatConfigFile
Reads a Skycat style catalog config 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.
See the Skycat web page for more information about the format of Skycat catalog config files.
Field Summary | |
---|---|
static java.lang.String |
BACKUP1
|
static java.lang.String |
BACKUP2
|
static java.lang.String |
DEC_COL
|
static java.lang.String |
EQUINOX
|
static java.lang.String |
HELP
|
static java.lang.String |
ID_COL
|
static java.lang.String |
LONG_NAME
|
static java.lang.String |
RA_COL
|
static java.lang.String |
SEARCH_COLS
|
static java.lang.String |
SERV_TYPE
Constants for some config file strings |
static java.lang.String |
SHORT_NAME
|
static java.lang.String |
SYMBOL
|
static java.lang.String |
URL
|
static java.lang.String |
X_COL
|
static java.lang.String |
Y_COL
|
Fields inherited from interface jsky.catalog.Catalog |
---|
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER |
Constructor Summary | |
---|---|
SkycatConfigFile(java.lang.String configFileOrURL)
Parse the given skycat style config file or URL. |
|
SkycatConfigFile(java.lang.String name,
java.lang.String configFileOrURL)
Parse the given skycat style config file or URL. |
|
SkycatConfigFile(java.lang.String name,
java.net.URL url)
Parse the skycat style catalog config file pointed to by the given URL. |
|
SkycatConfigFile(java.net.URL url,
HTMLQueryResultHandler handler)
Parse the skycat style config file from the already opened input stream. |
Method Summary | |
---|---|
void |
addCatalogDirectory(java.lang.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 |
java.util.List |
getNameServers()
Return a list of name servers (Catalogs with 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 config file to a file under the user's home directory (~/.jsky/skycat.cfg) to make it permanent. |
void |
save(java.io.OutputStream stream)
Save the contents of this object in skycat catalog config file format to the given stream. |
void |
save(java.lang.String filename)
Save the contents of this object as a new skycat style catalog config file using the given file name. |
static void |
setConfigFile(java.net.URL url)
Set the URL to use for the default catalog config file. |
void |
setParent(CatalogDirectory dir)
Set the parent catalog directory |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SERV_TYPE
public static final java.lang.String LONG_NAME
public static final java.lang.String SHORT_NAME
public static final java.lang.String URL
public static final java.lang.String BACKUP1
public static final java.lang.String BACKUP2
public static final java.lang.String EQUINOX
public static final java.lang.String SYMBOL
public static final java.lang.String ID_COL
public static final java.lang.String RA_COL
public static final java.lang.String DEC_COL
public static final java.lang.String X_COL
public static final java.lang.String Y_COL
public static final java.lang.String SEARCH_COLS
public static final java.lang.String HELP
Constructor Detail |
---|
public SkycatConfigFile(java.lang.String name, java.net.URL url)
name
- the display name for the config fileurl
- the URL of the config filepublic SkycatConfigFile(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 SkycatConfigFile(java.lang.String configFileOrURL)
configFileOrURL
- the file name or URL of the config filepublic SkycatConfigFile(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 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(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 skycat style 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) throws java.io.IOException
java.io.IOException
public void save(java.io.OutputStream stream)
public void setParent(CatalogDirectory dir)
Catalog
setParent
in interface Catalog
setParent
in class AbstractCatalogDirectory
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |