at.tuwien.ifs.somtoolbox.apps.viewer.controls.psomserver.httphandler
Class MapInformationProvider

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.apps.viewer.controls.psomserver.httphandler.MapInformationProvider
All Implemented Interfaces:
com.sun.net.httpserver.HttpHandler

public class MapInformationProvider
extends Object
implements com.sun.net.httpserver.HttpHandler

Provides useful information about the current map.

Author:
Jakob Frank

Field Summary
private  String configContext
           
private  String contentContext
           
private static String HTML_TEMPLATE_INDEX
           
private static String HTML_TEMPLATE_MAP
           
private  Logger log
           
private static String LOG_SEP
           
private static String NL
           
private  CommonSOMViewerStateData state
           
private  String templatePath
           
 
Constructor Summary
MapInformationProvider(CommonSOMViewerStateData state, String mapContentContext, String configurationContext)
           
 
Method Summary
private  String basename(String path)
           
private  void downloadFile(com.sun.net.httpserver.HttpExchange t)
           
 void handle(com.sun.net.httpserver.HttpExchange t)
           
private  String parseFile(com.sun.net.httpserver.HttpExchange t, File f)
           
private  String parseString(com.sun.net.httpserver.HttpExchange t, String string)
           
private  void sendFile(com.sun.net.httpserver.HttpExchange t, File f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_SEP

private static final String LOG_SEP
See Also:
Constant Field Values

state

private final CommonSOMViewerStateData state

contentContext

private final String contentContext

configContext

private final String configContext

templatePath

private final String templatePath

NL

private static final String NL
See Also:
Constant Field Values

log

private Logger log

HTML_TEMPLATE_INDEX

private static final String HTML_TEMPLATE_INDEX
See Also:
Constant Field Values

HTML_TEMPLATE_MAP

private static final String HTML_TEMPLATE_MAP
See Also:
Constant Field Values
Constructor Detail

MapInformationProvider

public MapInformationProvider(CommonSOMViewerStateData state,
                              String mapContentContext,
                              String configurationContext)
Method Detail

handle

public void handle(com.sun.net.httpserver.HttpExchange t)
            throws IOException
Specified by:
handle in interface com.sun.net.httpserver.HttpHandler
Throws:
IOException

downloadFile

private void downloadFile(com.sun.net.httpserver.HttpExchange t)
                   throws IOException
Throws:
IOException

sendFile

private void sendFile(com.sun.net.httpserver.HttpExchange t,
                      File f)
               throws IOException
Throws:
IOException

parseFile

private String parseFile(com.sun.net.httpserver.HttpExchange t,
                         File f)
                  throws IOException
Throws:
IOException

parseString

private String parseString(com.sun.net.httpserver.HttpExchange t,
                           String string)

basename

private String basename(String path)