Class TopcatServer
java.lang.Object
uk.ac.starlink.topcat.interop.TopcatServer
Provides HTTP server functionality for TOPCAT.
This includes a web server for dynamically generated content and an
XML-RPC server for use with SAMP.
This class is a singleton.
- Since:
- 29 Aug 2008
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionaddResource(String name, org.astrogrid.samp.httpd.ServerResource resource) Makes a resource available for retrieving from this internal HTTP server.static TopcatServerReturns the sole instance of this class.org.astrogrid.samp.client.ClientProfileReturns a SAMP client profile.getRelativeUrl(String subPath) Returns the URL for a resource available at a path served by this server.Returns the URL corresponding to the classpath for the package uk.ac.starlink.topcat.booleanIndicates whether this server can serve the resource with a given URL.voidremoveResource(URL url) Removes a resource from this server.
-
Method Details
-
getProfile
public org.astrogrid.samp.client.ClientProfile getProfile()Returns a SAMP client profile.- Returns:
- profile
-
addResource
Makes a resource available for retrieving from this internal HTTP server. Anamemay be supplied which will appear at the end of the URL, but this is just for cosmetic purposes. The URL at which the resource is available will provided as the return value.- Parameters:
name- filename identifying the resourceresource- resource to make available- Returns:
- URL at which
resourcecan be found
-
removeResource
Removes a resource from this server.- Parameters:
url- URL returned by a previous addResource call
-
getTopcatPackageUrl
Returns the URL corresponding to the classpath for the package uk.ac.starlink.topcat.- Returns:
- documentation URL
-
getRelativeUrl
-
isFound
Indicates whether this server can serve the resource with a given URL.- Parameters:
url- URL to enquire about- Returns:
- true if a request for
urlwill complete with non-error status
-
getInstance
Returns the sole instance of this class.- Returns:
- instance
- Throws:
IOException
-