Source:
protected void installFromFile() throws Exception { File installMarker = new File(installDirectory, ".installed"); if (!refresh) { if (!installMarker.exists()) { refresh = true; } else if (assemblyArchive.lastModified() > installMarker.lastModified()) { log.debug(MessageFormat.format(messages.getString("debug.detect.assembly.archive"), "")); refresh = true; } else if(!assemblyArchive.getCanonicalPath().equals(FileUtils.fileRead(installMarker))) { refresh = true; } } else { log.debug(MessageFormat.format(messages.getString("debug.request.refresh"), "")); } if (refresh && installDirectory.exists() && installDirectory.isDirectory()) { log.info(MessageFormat.format(messages.getString("info.uninstalling.server.home"), installDirectory)); for(File f : installDirectory.listFiles()) { if(f.isDirectory() && f.getCanonicalPath().equals(userDirectory.getCanonicalPath())) else { FileUtils.forceDelete(f); } } } if (!installMarker.exists()) { log.info("Installing assembly..."); FileUtils.forceMkdir(installDirectory); Expand unzip = (Expand) ant.createTask("unzip"); unzip.setSrc(assemblyArchive); unzip.setDest(assemblyInstallDirectory.getCanonicalFile()); unzip.execute(); Chmod chmod = (Chmod) ant.createTask("chmod"); chmod.setPerm("ugo+rx"); chmod.setDir(installDirectory); chmod.setIncludes("bin/*"); chmod.setExcludes("bin/*.bat"); chmod.execute(); installMarker.delete(); installMarker.createNewFile(); FileUtils.fileWrite(installMarker, assemblyArchive.getCanonicalPath()); } else { log.info(MessageFormat.format(messages.getString("info.reuse.installed.assembly"), "")); } }

Target:
protected void installFromFile() throws Exception { File installMarker = new File(installDirectory, ".installed"); if (!refresh) { if (!installMarker.exists()) { refresh = true; } else if (assemblyArchive.lastModified() > installMarker.lastModified()) { log.debug(MessageFormat.format(messages.getString("debug.detect.assembly.archive"), "")); refresh = true; } else if(!assemblyArchive.getCanonicalPath().equals(FileUtils.fileRead(installMarker))) { refresh = true; } } else { log.debug(MessageFormat.format(messages.getString("debug.request.refresh"), "")); } String userDirectoryPath = userDirectory.getCanonicalPath(); if (refresh && installDirectory.exists() && installDirectory.isDirectory()) { log.info(MessageFormat.format(messages.getString("info.uninstalling.server.home"), installDirectory)); for(File f : installDirectory.listFiles()) { if(!(f.isDirectory() && f.getCanonicalPath().equals(userDirectoryPath))) { FileUtils.forceDelete(f); } } } if (!installMarker.exists()) { log.info("Installing assembly..."); FileUtils.forceMkdir(installDirectory); Expand unzip = (Expand) ant.createTask("unzip"); unzip.setSrc(assemblyArchive); unzip.setDest(assemblyInstallDirectory.getCanonicalFile()); unzip.execute(); Chmod chmod = (Chmod) ant.createTask("chmod"); chmod.setPerm("ugo+rx"); chmod.setDir(installDirectory); chmod.setIncludes("bin/*"); chmod.setExcludes("bin/*.bat"); chmod.execute(); installMarker.delete(); installMarker.createNewFile(); FileUtils.fileWrite(installMarker, assemblyArchive.getCanonicalPath()); } else { log.info(MessageFormat.format(messages.getString("info.reuse.installed.assembly"), "")); } }