/* * [StatsForReceiver.java] * * Summary: Track statistics. * * Copyright: (c) 2003-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 10.2 2009-04-03 tidy up code to check presence of necessary files to make it more WORA. */ package com.mindprod.replicator; import static java.lang.System.*; /** * Track statistics. * * @author Roedy Green, Canadian Mind Products * @version 10.2 2009-04-03 tidy up code to check presence of necessary files to make it more WORA. * @since 2003-11-04 */ final class StatsForReceiver { /** * HowToProcess many files deleted since the last distribution. */ public static int deletedFilesCount; /** * HowToProcess many files were updated or new since the last distribution. */ public static int receivedFilesCount; /** * Display stats on console. */ public static void displayStats() { final String stats = getStats(); Log.divider(); Log.println( stats ); Log.divider(); out.println( stats ); } /** * Gets stats on files received * * @return statistic about files received. */ public static String getStats() { return "\nS T A T I S T I C S" + "\n" + receivedFilesCount + " files received for the distribution" + "\n" + deletedFilesCount + " files deleted from the distribution" + "\n"; } }