/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.nplusc.izc.iZpl;

import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import java.io.IOException;
import java.io.OutputStream;

/**
 *
 * @author LH
 */
public class ReloadMgrT implements HttpHandler
{
    PlProcessor pp;
    public ReloadMgrT(PlProcessor p)
    {
     pp=p;   
    }
    
    @Override
    public void handle(HttpExchange t) throws IOException
    {
        
       pp.reloadLists(true);
       String response = "Reloaded....";
       t.sendResponseHeaders(200, response.length());
        Headers responseHeaders = t.getResponseHeaders();
        responseHeaders.set("Content-Type", "text/plain");

        OutputStream os = t.getResponseBody();
        os.write(response.getBytes());
        os.close();
    }
    
}
