KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > filesrv > PrepareHook


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package filesrv;
16
17 import org.quickserver.net.server.*;
18 import org.quickserver.net.ServerHook;
19 import java.util.*;
20
21 /**
22  * PrepareHook
23  * @author Akshathkumar Shetty
24  */

25 public class PrepareHook implements ServerHook {
26     private QuickServer quickserver;
27
28     public String JavaDoc info() {
29         return "Prepare Hook";
30     }
31
32     public void initHook(QuickServer quickserver) {
33         this.quickserver = quickserver;
34     }
35
36     public boolean handleEvent(int event) {
37         if(event==ServerHook.PRE_STARTUP) {
38             HashMap appConfig =
39                 quickserver.getConfig().getApplicationConfiguration();
40             if(appConfig==null)
41                 return false;
42
43             String JavaDoc temp = (String JavaDoc)appConfig.get("HFTP_ROOT");
44             Data.setUserRootHome(temp);
45             return true;
46         }
47         return false;
48     }
49 }
50
Popular Tags