Package skyview.survey
Class XMLSurveyFinder
- java.lang.Object
-
- skyview.survey.XMLSurveyFinder
-
- All Implemented Interfaces:
SurveyFinder
public class XMLSurveyFinder extends Object implements SurveyFinder
This class provides functionality to translate survey names into associated survey description files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXMLSurveyFinder.SurveyLink
-
Constructor Summary
Constructors Constructor Description XMLSurveyFinder()Set up the SurveyFinder and populate the map.XMLSurveyFinder(boolean dump)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump()Create a cached translation between survey names and files.Surveyfind(String shortName)Do we have this survey?StringfindFile(String shortName)Find the survey file given the short nameString[]getSurveys()What surveys do we know about?protected voidgetSurveysFromMainifest()Get surveys from a user manifest.protected voidgetSurveysFromManifest(boolean dump)protected voidgetSurveysFromRoot()Get the surveys in the document root areaprotected voidgetSurveysFromUser()Get user specified surveysprotected booleanloadSurveyCacheFromFile(String hashFile)protected booleanloadSurveyCacheFromUrl(String url)protected StringlocalCacheName()Get path to the local cache using the path to the jar file being executed.static voidmain(String[] args)Main class.protected StringmanifestName()protected voidmanifestToHash()Read XML files to populate survey hash in memory.voidread(String file)protected StringremoteCacheName()
-
-
-
Method Detail
-
dump
public void dump()
Create a cached translation between survey names and files. This can be used to save a little time when running SkyView. Note that the hash that is written was already created in the XMLSurveyFinder constructor above.
-
read
public void read(String file)
-
getSurveysFromRoot
protected void getSurveysFromRoot()
Get the surveys in the document root area
-
getSurveysFromUser
protected void getSurveysFromUser()
Get user specified surveys
-
getSurveysFromMainifest
protected void getSurveysFromMainifest()
Get surveys from a user manifest. This is how SkyView-in-a-Jar gets its surveys. Result is that the XMLSurveyFinder's hash object is filled. Overloaded for case of dump
-
getSurveysFromManifest
protected void getSurveysFromManifest(boolean dump)
-
localCacheName
protected String localCacheName()
Get path to the local cache using the path to the jar file being executed.
-
remoteCacheName
protected String remoteCacheName()
-
manifestName
protected String manifestName()
-
manifestToHash
protected void manifestToHash()
Read XML files to populate survey hash in memory.
-
loadSurveyCacheFromUrl
protected boolean loadSurveyCacheFromUrl(String url)
-
loadSurveyCacheFromFile
protected boolean loadSurveyCacheFromFile(String hashFile)
-
find
public Survey find(String shortName)
Do we have this survey?- Specified by:
findin interfaceSurveyFinder
-
getSurveys
public String[] getSurveys()
What surveys do we know about?- Specified by:
getSurveysin interfaceSurveyFinder
-
main
public static void main(String[] args)
Main class.
With no arguments simply list all of the survey names.
With the single argument "dump": Create a cached names file that can be used to speed up the initialization.
With any other single argument: show the metadata for the selected survey
With multiple arguments survey metakey1 [metakey2...] show the requested metadata for the requested survey
-
-