/* * [WhereGetZips.java] * * Summary: extended version of Via for sender. * * 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.replicatoruse; import java.io.Serializable; import static com.mindprod.replicatoruse.Phrase.INCLUDING; import static com.mindprod.replicatoruse.Phrase.IN_YOUR; import static com.mindprod.replicatoruse.Phrase.LINK_TO; import static com.mindprod.replicatoruse.Phrase.SENDER_ZIP_STAGING_DIR; /** * extended version of Via for sender. * * @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 2009 */ enum WhereGetZips implements Serializable { /** * from a website on the Internet */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) A_FROM_WEBSITE( "from a website on the Internet. This is most common case.", new StringBuilder( 100 ).append( LINK_TO ) .append( "replicator.jnlp " ) .append( "which is an alias for replicatorreceiverwebsite.jnlp." ).toString() ), /** * TEST, gets ZIP files from sender's staging directory loops back to same machine. */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) B_FROM_ORIGINALS( "I am the author. I prepare the content.", new StringBuilder( 200 ).append( "Prepare the orginal files with any tools you like, " ) .append( "e.g. word processors, text editors, Dreamweaver, " ) .append( "custom program, anything. " ) .append( "Run ReplicatorSender to prepare and automatically upload " ) .append( "the recently changed files, " ) .append( IN_YOUR ) .append( SENDER_ZIP_STAGING_DIR ) .append( INCLUDING ) .append( "to the Internet website." ).toString() ), /** * CD, gets ZIP files from CD. */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) C_FROM_CD( "from a CD ROM somebody sent me.", new StringBuilder( 200 ).append( "Insert the latest distribution CD into the CD drive. " ) .append( "It should autostart. " ) .append( "If it does not, " ) .append( "type, X:, then CD \\, then setup.exe, where X is the CD drive " + "letter. " ) .append( "For non-Windows platforms, " ) .append( LINK_TO ) .append( "replicatorreceivercdX.jnlp " ) .append( "where X is the letter of your CD drive." ).toString() ), /** * Gets ZIP files from DVD. */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) D_FROM_DVD( "from a DVD somebody sent me.", new StringBuilder( 200 ).append( "Insert the latest distribution DVD into the DVD reader drive. " ) .append( "It should autostart. " ) .append( "If it does not, " ) .append( "type, X:, then CD \\, then setup.exe where X is the DVD drive " + "letter. " ) .append( "For non-Windows platforms, " ) .append( LINK_TO ) .append( "replicatorreceivercdX.jnlp " ) .append( "where X is the letter of your DVD drive." ) .append( "replicatorreceivercdX.jnlp works for both CD and DVD." ) .toString() ), /** * gets ZIP files from a file on a LAN */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) E_FROM_LAN( "from shared files on a LAN.", new StringBuilder( 100 ).append( "After someone has relayed fresh files to your shared LAN directory, " ) .append( LINK_TO ) .append( "replicatorreceiverlan.jnlp" ) .append( "." ).toString() ), /** * gets ZIP files from an internal website. */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) F_FROM_INTERNAL_WEBSITE( "from a local or LAN-based internal HTTP website without Internet access.", new StringBuilder( 200 ).append( "After someone has relayed fresh files to your internal website, " ) .append( LINK_TO ) .append( "replicatorreceiverlan.jnlp" ) .append( "." ) .append( "The first time you use the Replicator " ) .append( "you will have to configure " ) .append( "LAN_ZIP_URL " ) .append( "to something like " ) .append( "http://internalhost:8080/replicator " ) .append( "to tell the Replicator where to fetch the " ) .append( "incoming zip files from." ).toString() ), /** * gets ZIP files from a local directory, put ther eby somebody else. */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) G_FROM_LOCAL_DISK( "from files in a directory on my local hard disk that somebody put there.", "" ), /** * Gets ZiP files from floppies */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) H_FROM_FLOPPIES( "from a stack of floppies somebody sent me.", "" ), /** * from some sort of URL */ @SuppressWarnings( { "EnumeratedConstantNamingConvention" } ) I_FROM_URL( "from some other place that can be described with an URL.", "" ); /** * Layout version number. */ private static final long serialVersionUID = 410L; /** * long description of this option. */ private final String description; /** * long instructions for this option. */ private final String instructions; /** * constructor * * @param description long description of what this option means. * @param instructions how to get zips */ WhereGetZips( String description, String instructions ) { this.description = description; this.instructions = instructions; } /** * wording of question to choose an option * * @return question wording */ @SuppressWarnings( { "SameReturnValue" } ) public static String getQuestion() { return "Where do you get your compressed zip files?"; } /** * get long description of what this option means. * * @return description */ public String getDescription() { return description; } /** * get long instructions for this option means. * * @return instructions */ public String instructions() { return instructions; } }