/* * [ConfigForReceiver.java] * * Summary: Configuration for Receiver. * * 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: * 9.2 2007-12-24 display range of times for retired. */ package com.mindprod.replicator; import com.mindprod.common18.Build; import com.mindprod.replicatorcommon.Config; import com.mindprod.replicatorcommon.ConfigForCompiler; /** * Configuration for Receiver. *

* Unfortunately this also has to be included with the sender because MiniFD and MiniZD. * reference it. These fields get their values from JNLP or from the end user of from persisted store in the registry. * * @author Roedy Green, Canadian Mind Products * @version 9.2 2007-12-24 display range of times for retired. * @since 2003-10-01 */ public class ConfigForReceiver extends Config { /** * where the receiver persists state. aAways in the receiver's staging directory i.e. E:\mpstaging. Lives only on * client. Not downloaded. */ static final String PERSIST_RECEIVER_SER = "receiver.ser"; /** * Log of what we did in human-readable form. */ static final String RECEIVER_LOG = "receiver.log"; // CASE_SENSITIVE and DEBUGGING are defined in Config /** * Directory without trailing \ where all the master files to be distributed are kept. Use local clockSetter names * e.g. E:\mindprod for Windows. This name is purely for the local master copy, not for the website or the clients. * Persistent, initially from SUGGESTED_RECEIVER_BASE_DIR. Also used by replicatorcommon.MiniFD. No trailing \. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) public static String RECEIVER_BASE_DIR; /** * Directory without trailing \ where all the incoming archive zip files to be distributed are kept. Use local * clockSetter names e.g. E:\mindprod for Windows. This name is purely for the local master copy, not for the * website or the clients. Persistent, initially from SUGGESTED_RECEIVER_ZIP_STAGING_DIR. Also used by * replicatorcommon.MiniZD No trailing \. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) public static String RECEIVER_ZIP_STAGING_DIR; /** * place on web, lan or local where we get our files. Also used by replicatorcommon.MiniZD */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) public static String RECEIVER_ZIP_URL; /** * Where on the website the archive files are stored. Also used by Replicatorcommon.MiniZD */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) public static String WEBSITE_ZIP_URL; /** * Do clients need a userid/passwords to access the files from the website? none means no user id or password needed * to access files on the website. basic means use a simple undigested userid/password to access files. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String AUTHENTICATION; /** * Should we keep the downloaded zips around for others to use after we are finished with them? */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static boolean KEEP_ZIPS; /** * Where on a LAN the archive files are stored, url e.g. file://... */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String LAN_ZIP_URL; /** * Userid to fetch zip files if they are protected. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String PASSWORD; /** * True if valid set of prefs are defined, possibly not persisted yet. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static boolean PREFS_EXIST; /** * Directory without trailing \ where all the master files to be distributed are kept. Use local clockSetter names * e.g. E:\mindprod for Windows. This name is purely for the local master copy, not for the website or the clients. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String PROJECT_NAME; /** * Suggestest place on a LAN the archive files are stored. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String SUGGESTED_LAN_ZIP_URL; /** * Suggested value for: Directory without trailing \ where all the master files to be distributed are kept. Use * local clockSetter names e.g. E:\mindprod for Windows. This name is purely for the local master copy, not for the * website or the clients. Set via JNLP. No trailing \. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String SUGGESTED_RECEIVER_BASE_DIR; /** * Suggested value for: Directory without trailing \ where all the incoming archive zip files to be distributed are * kept. Use local clockSetter names e.g. E:\mindprod for Windows. This name is purely for the local master copy, * not for the website or the clients. Set Via JNLP. No trailing \. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String SUGGESTED_RECEIVER_ZIP_STAGING_DIR; /** * Globally unique name, starting with website name in reverse e.g. com.mindprod. This name allows The Replicator to * keep several projects on the same machine from interfering with one another. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String UNIQUE_PROJECT_NAME; /** * Should we unpack the zips, normally yes, unless we are just relaying them to others. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static boolean UNPACK_ZIPS; /** * Userid to fetch zip files if they are protected. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String USERID; /** * HowToProcess is client deployed? as a string. */ @SuppressWarnings( { "NonConstantFieldWithUpperCaseName" } ) static String VIA; /** * Numeric how how client deployed. */ static ViaForReceiver viaCode; /** * Display Config information * * @return string representation of the entire Receiver configuration. */ static String dumpConfig() { final StringBuilder sb = new StringBuilder( 1000 ); sb.append( "C O N F I G U R A T I O N" ); sb.append( "\n" ); sb.append( "PREFS_EXIST: " ); sb.append( PREFS_EXIST ); sb.append( "\n" ); sb.append( "VERSION: " ); sb.append( VERSION ); sb.append( "\n" ); sb.append( "BUILD: " ); sb.append( Build.BUILD_NUMBER ); sb.append( "\n" ); sb.append( "VIA: " ); sb.append( VIA ); sb.append( "\n" ); sb.append( "PROJECT_NAME: " ); sb.append( PROJECT_NAME ); sb.append( "\n" ); sb.append( "UNIQUE_PROJECT_NAME: " ); sb.append( UNIQUE_PROJECT_NAME ); sb.append( "\n" ); sb.append( "USERID: " ); sb.append( USERID ); sb.append( "\n" ); sb.append( "PASSWORD: " ); sb.append( PASSWORD ); sb.append( "\n" ); sb.append( "PROGRAM_DIR: " ); sb.append( PROGRAM_DIR ); sb.append( "\n" ); sb.append( "SUGGESTED_RECEIVER_BASE_DIR: " ); sb.append( SUGGESTED_RECEIVER_BASE_DIR ); sb.append( "\n" ); sb.append( "RECEIVER_BASE_DIR: " ); sb.append( RECEIVER_BASE_DIR ); sb.append( "\n" ); sb.append( "SUGGESTED_RECEIVER_ZIP_STAGING_DIR: " ); sb.append( SUGGESTED_RECEIVER_ZIP_STAGING_DIR ); sb.append( "\n" ); sb.append( "RECEIVER_ZIP_STAGING_DIR: " ); sb.append( RECEIVER_ZIP_STAGING_DIR ); sb.append( "\n" ); sb.append( "SUGGESTED_LAN_ZIP_URL: " ); sb.append( SUGGESTED_LAN_ZIP_URL ); sb.append( "\n" ); sb.append( "LAN_ZIP_URL: " ); sb.append( LAN_ZIP_URL ); sb.append( "\n" ); sb.append( "RECEIVER_ZIP_URL: " ); sb.append( RECEIVER_ZIP_URL ); sb.append( "\n" ); sb.append( "KEEP_ZIPS: " ); sb.append( KEEP_ZIPS ); sb.append( "\n" ); sb.append( "UNPACK_ZIPS: " ); sb.append( UNPACK_ZIPS ); sb.append( "\n" ); sb.append( "AUTHENTICATION: " ); sb.append( AUTHENTICATION ); sb.append( "\n" ); sb.append( "CASE_SENSITIVE: " ); sb.append( CASE_SENSITIVE ); sb.append( "\n" ); sb.append( "COMPILER: " ); sb.append( ConfigForCompiler.COMPILER ); sb.append( "\n" ); sb.append( "RUNTIME: " ); sb.append( System.getProperty( "java.version", "unknown" ) ); sb.append( "\n" ); sb.append( "DEBUG: " ); sb.append( DEBUGGING ); sb.append( "\n" ); return sb.toString(); } }