/* * [Config.java] * * Summary: Config information common to both sender and receiver. * * Copyright: (c) 2009-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.replicatorcommon; import com.mindprod.common18.Build; import java.text.SimpleDateFormat; import java.util.concurrent.TimeUnit; /** * Config information common to both sender and receiver. * * @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. * @see com.mindprod.replicator.ConfigForReceiver * @see com.mindprod.replicatorsender.ConfigForSender * @since 2009 */ public class Config { /** * true if files that differ in case are different files. false for Windows. Hard to make configurable since needs * to be seen at low level by both client and master. Hard coded in. */ public static final boolean CASE_SENSITIVE = false; /** * how much error to tolerate in timestamp of distributed file vs what it should be, in milliseconds. If timestamps * are this close we consider them equal. */ public static final long ALLOWED_SLOP = TimeUnit.SECONDS.toMillis( 2 ); /** * oldest file we consider. Even 0 should be old enough -- 1970. */ public static final long CUTOFF_TIMESTAMP = Long.MIN_VALUE / 2; /** * marker value to indicate an empty time stamp . We don't use Long.MIN_VALUE since we don't have a Long.compare * method. */ public static final long NULL_TIMESTAMP = -2 * ( Long.MAX_VALUE / 3 ); /** * name of code signing certificate alias. Add .cer for file. */ public static final String CODE_SIGNING_CERT = Build.MINDPRODCERT; /** * File created in replicator staging directory, downloaded to client staging directory that lists the state of all * the auxilliary files. */ public static final String FRESHNESS_SER = "freshness.ser"; /** * Version String for both Sender and Receiver side, e.g. 10.0 */ public static final String VERSION = ReplicatorCommon.VERSION_STRING; /** * Where sender saves a copy of all files in distribution so client can verify it has everything. Named it so it * will naturally be uploaded after all z999.zip files. */ public static final String ZIPDETAILEDMANIFEST_SER = "zipdetailedmanifest.ser"; /** * File created in replicator staging directory, downloaded to client staging directory that lists the state of the * latest zips. Named it so it will naturally be uploaded after all z999.zip files. */ public static final String ZIPMANIFEST_SER = "zipmanifest.ser"; /** * display timestamp in form 2007-12-31+23:59+59.999 yyyy-mm-dd+hh:mm+ss.sss * must stick to ISO-8859-1 chars since that is the encoding of the logs. */ public static final SimpleDateFormat TIMESTAMP_MILLISECOND_FORMAT = new SimpleDateFormat( "yyyy-MM-dd'+'HH':'mm'+'ss'.'SSSzzz" ); /** * display timestamp in form 2007-12-31 23:59 PDT */ public static final SimpleDateFormat TIMESTAMP_SECOND_FORMAT = new SimpleDateFormat( "yyyy-MM-dd' 'HH':'mm':'ss' 'zzz" ); /** * Where the jar/exe files are. */ protected static final String PROGRAM_DIR = IO.getCurrentDir(); /** * true if additional debugging information should be dumped out, e.g. configuration information. Can't be final, * CONTROLLED BY CONFIG FILE! Do not set a value. */ public static boolean DEBUGGING /* value from config */; }