/** Removes all temporary files */ @Override public void cleanUp() { for (VersionedFile appPackageFile : mAppPackageFiles) { appPackageFile.getFile().delete(); } mAppPackageFiles.clear(); }
/** {@inheritDoc} */ @Override public IBuildInfo clone() { AppBuildInfo copy = new AppBuildInfo(getBuildId(), getTestTag(), getBuildTargetName()); copy.addAllBuildAttributes(this); try { for (VersionedFile origVerFile : mAppPackageFiles) { // Only using createTempFile to create a unique dest filename File origFile = origVerFile.getFile(); File copyFile = FileUtil.createTempFile( FileUtil.getBaseName(origFile.getName()), FileUtil.getExtension(origFile.getName())); copyFile.delete(); FileUtil.hardlinkFile(origFile, copyFile); copy.addAppPackageFile(copyFile, origVerFile.getVersion()); } } catch (IOException e) { throw new RuntimeException(e); } copy.setBuildBranch(getBuildBranch()); copy.setBuildFlavor(getBuildFlavor()); return copy; }