package de.uhilger.filecms.web;
|
|
import java.util.logging.Logger;
|
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContextEvent;
|
import javax.servlet.ServletContextListener;
|
|
/**
|
*
|
*/
|
public class InitialiserHome implements ServletContextListener {
|
|
public static final String FILE_BASE = "filebase";
|
|
private static final Logger logger = Logger.getLogger(Initialiser.class.getName());
|
|
@Override
|
public void contextInitialized(ServletContextEvent sce) {
|
ServletContext ctx = sce.getServletContext();
|
StringBuilder sb = new StringBuilder();
|
sb.append(System.getProperty("user.home"));
|
sb.append("/file-cms");
|
System.out.println(" FILE_BASE: " + sb.toString());
|
ctx.setAttribute(FILE_BASE, sb.toString());
|
}
|
|
@Override
|
public void contextDestroyed(ServletContextEvent sce) {
|
ServletContext ctx = sce.getServletContext();
|
ctx.removeAttribute(FILE_BASE);
|
}
|
|
}
|