1 package com.dotmarketing.threads; 2 3 import java.io.File ; 4 5 6 public class ConfigUpdateThread extends Thread { 7 private int WAIT_TIME = 5000; private String webXmlPath = null; 9 10 public ConfigUpdateThread(String name, String webXmlPath) { 11 super(name); 12 this.webXmlPath = webXmlPath; 13 } 14 15 public void run() { 16 System.out.println("Restarting the web app"); 17 18 64 try { 65 sleep(WAIT_TIME); 66 67 System.out.println("Touching the web.xml file to force the resource file reload"); 68 String webConfigFilePath = webXmlPath; 69 File webConfigFile = new File (webConfigFilePath); 70 long curr_time = System.currentTimeMillis(); 71 webConfigFile.setLastModified(curr_time); 72 } catch (InterruptedException e) { 73 e.printStackTrace(); 74 } 75 76 } 77 78 79 82 public void destroy() { 83 } 85 } 86 | Popular Tags |