/**
* Creates an AppDescriptor from the properties.
* @param name the application name
*/
AppDescriptor(String name) {
ResourceProperties conf = props.getSubProperties(name + '.');
appName = name;
mountpoint = getMountpoint(conf.getProperty("mountpoint", appName));
pathPattern = getPathPattern(mountpoint);
staticDir = conf.getProperty("static");
staticMountpoint = getPathPattern(conf.getProperty("staticMountpoint",
joinMountpoint(mountpoint, "static")));
staticIndex = "true".equalsIgnoreCase(conf.getProperty("staticIndex"));
String home = conf.getProperty("staticHome");
if (home == null) {
staticHome = new String[] {"index.html", "index.htm"};
} else {
staticHome = StringUtils.split(home, ",");
}
protectedStaticDir = conf.getProperty("protectedStatic");
cookieDomain = conf.getProperty("cookieDomain");
sessionCookieName = conf.getProperty("sessionCookieName");
protectedSessionCookie = conf.getProperty("protectedSessionCookie");
uploadLimit = conf.getProperty("uploadLimit");
uploadSoftfail = conf.getProperty("uploadSoftfail");
debug = conf.getProperty("debug");
String appDirName = conf.getProperty("appdir");
appDir = (appDirName == null) ? null : getAbsoluteFile(appDirName);
String dbDirName = conf.getProperty("dbdir");
dbDir = (dbDirName == null) ? null : getAbsoluteFile(dbDirName);
servletClassName = conf.getProperty("servletClass");
// got ignore dirs
ignoreDirs = conf.getProperty("ignore");
// read and configure app repositories
ArrayList repositoryList = new ArrayList();
Class[] parameters = { String.class };
for (int i = 0; true; i++) {
String repositoryArgs = conf.getProperty("repository." + i);
if (repositoryArgs != null) {
// lookup repository implementation
String repositoryImpl = conf.getProperty("repository." + i +
".implementation");
if (repositoryImpl == null) {
// implementation not set manually, have to guess it
if (repositoryArgs.endsWith(".zip")) {
repositoryArgs = findResource(repositoryArgs);