public boolean accept(File f) { return GFLauncherUtils.safeIsDirectory(f); } });
private void setupDomainDirs() throws GFLauncherException { // if they set domainrootdir -- it takes precedence if (domainRootDir != null) { domainParentDir = domainRootDir.getParentFile(); domainName = domainRootDir.getName(); return; } // if they set domainParentDir -- use it. o/w use the default dir if (domainParentDir == null) { domainParentDir = new File(installDir, DEFAULT_DOMAIN_PARENT_DIR); } // if they specified domain name -- use it. o/w use the one and only dir // in the domain parent dir if (domainName == null) { domainName = getTheOneAndOnlyDomain(); } domainRootDir = new File(domainParentDir, domainName); if (!GFLauncherUtils.safeIsDirectory(domainRootDir)) { throw new GFLauncherException("noDomainRootDir", domainRootDir); } configDir = new File(domainRootDir, CONFIG_DIR); } private void setupInstanceDirs() throws GFLauncherException {
private void finalSetup() throws GFLauncherException { if(installDir == null) installDir = GFLauncherUtils.getInstallDir(); if (!GFLauncherUtils.safeIsDirectory(installDir)) { throw new GFLauncherException("noInstallDir", installDir); } // check user-supplied args if (domainParentDir != null) { // if the arg was given -- then it MUST point to a real dir if (!GFLauncherUtils.safeIsDirectory(domainParentDir)) { throw new GFLauncherException("noDomainParentDir", domainParentDir); } } setupServerDirs(); if (!GFLauncherUtils.safeIsDirectory(configDir)) { throw new GFLauncherException("noConfigDir", configDir); } configFile = new File(configDir, CONFIG_FILENAME); if (!GFLauncherUtils.safeExists(configFile)) { throw new GFLauncherException("noConfigFile", configFile); } if (instanceName == null) { instanceName = "server"; } // if we made it here -- we're in pretty good shape! valid = true; }