view src/kryshen/catalina/startup/HomesUserConfig.java @ 10:086a55aa2620

PasswdUserConfig. Error logging.
author Mikhail Kryshen <mikhail@kryshen.net>
date Mon, 02 Nov 2009 23:17:40 +0300
parents ff1e55a2171f
children 3a71cbe721f9
line source
1 /*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
6 package kryshen.catalina.startup;
8 import java.io.File;
9 import org.apache.juli.logging.LogFactory;
11 /**
12 *
13 * @author Mikhail Kryshen
14 */
15 public class HomesUserConfig extends UserConfig {
17 protected static org.apache.juli.logging.Log log =
18 org.apache.juli.logging.LogFactory.getLog(HomesUserConfig.class);
20 /**
21 * The base directory containing user home directories.
22 */
23 private String homeBase = null;
26 public HomesUserConfig() {
27 log = LogFactory.getLog(HomesUserConfig.class);
28 }
30 /**
31 * Return the base directory containing user home directories.
32 */
33 public String getHomeBase() {
34 return homeBase;
35 }
37 /**
38 * Set the base directory containing user home directories.
39 *
40 * @param homeBase The new base directory
41 */
42 public void setHomeBase(String homeBase) {
43 this.homeBase = homeBase;
44 }
46 @Override
47 protected void deployUserApps() {
48 File homeBaseFile = new File(homeBase);
50 if (!homeBaseFile.exists() || !homeBaseFile.isDirectory()) {
51 log.error("Invalid home base.");
52 return;
53 }
55 String[] homes = homeBaseFile.list();
57 for (String name : homes) {
58 File home = new File(homeBaseFile, name);
60 if (!home.isDirectory() /* || !home.canExecute() */) {
61 continue;
62 }
64 deployUserApps(name, home);
65 }
66 }
67 }