private static File getFileUnderAsRoot(File jbossHomeDir, Properties props, String propName, String relativeLocation, boolean mustExist) { String prop = props.getProperty(propName, null); if (prop == null) { prop = props.getProperty(HostControllerEnvironment.DOMAIN_BASE_DIR, null); if (prop == null) { File dir = new File(jbossHomeDir, "domain" + File.separator + relativeLocation); if (mustExist && (!dir.exists() || !dir.isDirectory())) { throw ServerLogger.ROOT_LOGGER.embeddedServerDirectoryNotFound("domain" + File.separator + relativeLocation, jbossHomeDir.getAbsolutePath()); } return dir; } else { File server = new File(prop); validateDirectory(HostControllerEnvironment.DOMAIN_BASE_DIR, server); return new File(server, relativeLocation); } } else { File dir = new File(prop); validateDirectory(HostControllerEnvironment.DOMAIN_BASE_DIR, dir); return dir; } }
private static File getFileUnderAsRoot(File jbossHomeDir, Properties props, String propName, String relativeLocation, boolean mustExist) { String prop = props.getProperty(propName, null); if (prop == null) { prop = props.getProperty(HostControllerEnvironment.DOMAIN_BASE_DIR, null); if (prop == null) { File dir = new File(jbossHomeDir, "domain" + File.separator + relativeLocation); if (mustExist && (!dir.exists() || !dir.isDirectory())) { throw ServerLogger.ROOT_LOGGER.embeddedServerDirectoryNotFound("domain" + File.separator + relativeLocation, jbossHomeDir.getAbsolutePath()); } return dir; } else { File server = new File(prop); validateDirectory(HostControllerEnvironment.DOMAIN_BASE_DIR, server); return new File(server, relativeLocation); } } else { File dir = new File(prop); validateDirectory(HostControllerEnvironment.DOMAIN_BASE_DIR, dir); return dir; } }