/** * Returns the product home directory if the locator file is present or returns null. If null => * first time install * * @return the product home directory * @throws InstallException */ protected String getProductHome(IStateAccess stateAccess) throws InstallException { String serverHomeDir = getServerHomeDir(stateAccess); setProductLocatorFile(serverHomeDir + FILE_SEP + STR_LOCATOR_FILE_NAME); String productHome = null; File file = new File(getProductLocatorFile()); if (file.exists() && file.canRead()) { // Found old install productHome = readProductHome(); validateProductHome(productHome, getProductLocatorFile()); if (!productHome.equals(ConfigUtil.getHomePath())) { Debug.log( "MigrateServerLocatorHandler.validateProductHome() : " + "old Product home: " + productHome + ", New Product Home: " + ConfigUtil.getHomePath()); } else { Debug.log("MigrateServerLocatorHandler - Error:" + "This agent has been already migrated!"); throw new InstallException(LocalizedMessage.get(LOC_DR_ERR_PRODUCT_ALREADY_MIGRATED)); } } return productHome; }