Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Sysepub - PrintMessages.java

PrintMessages.java

Caricato da: Teutoburgo
Scarica il programma completo

  1. /*
  2.     Sysepub 0.9.0 - A Symmetric Semi-Public key cipher
  3.     Copyright (C) 2002 Pierre Blanc
  4.     Pierre Blanc: blanc_teutoburgo@yahoo.it
  5.     http://teutoburgo.cjb.net
  6.     http://it.geocities.com/teutoburgo
  7.  
  8.     This program is free software; you can redistribute it and/or modify
  9.     it under the terms of the GNU General Public License as published by
  10.     the Free Software Foundation; either version 2 of the License, or
  11.     (at your option) any later version.
  12.  
  13.     This program is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.     GNU General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU General Public License
  19.     along with this program; if not, write to the Free Software
  20.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  21.     or go to      http://www.gnu.org/copyleft/gpl.html
  22. */
  23. /**
  24.  * Sysepub 0.9 - Class PrintMessages (used to print the help, warranty, etc. messages)
  25.  * Creation date: (30/08/2002 16.50.29)
  26.  * @author: Pierre Blanc
  27.  */
  28. public class PrintMessages
  29. {
  30.         boolean isGUI=false;
  31.         private String stringLog="";
  32.  
  33.         public PrintMessages(){
  34.         }
  35.         public PrintMessages(boolean isGUI){
  36.                 this.isGUI=isGUI;
  37.         }
  38.  
  39.         public void sPrintLog(String s){
  40.       if (isGUI) stringLog=stringLog+s+"\n";
  41.       else System.out.println(s);
  42.     }
  43.         /**
  44.         * Returns to the GUI application the String of the log messages.
  45.         */
  46.     public String flushLog(){
  47.           String output=stringLog+"\n";
  48.           stringLog="";
  49.       return output;
  50.     }
  51.         public void printCopyright(){
  52.         sPrintLog("Sysepub 0.9.0 Copyright (C) Pierre Blanc 2002"+
  53.           "   http://teutoburgo.cjb.net");
  54.         sPrintLog("This software is under"+
  55.           " the GNU GPL license v.2");
  56.     }
  57.     public void printNoWarranty(){
  58.       sPrintLog("\n   BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n"+
  59. "FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\n"+
  60. "OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n"+
  61. "PROVIDE THE PROGRAM 'AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n"+
  62. "OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"+
  63. "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\n"+
  64. "TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\n"+
  65. "PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n"+
  66. "REPAIR OR CORRECTION.\n\n"+
  67.  
  68.   " IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"+
  69. "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n"+
  70. "REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n"+
  71. "INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n"+
  72. "OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n"+
  73. "TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n"+
  74. "YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n"+
  75. "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n"+
  76. "POSSIBILITY OF SUCH DAMAGES.");
  77.     }
  78.         public void printHelpGUI(){
  79.         sPrintLog("Use the Encipher/Decipher buttons to operate on the selected file");
  80.         sPrintLog("Use relative names if your files are in the Sysepub/plaintexts or ciphertexts directories");
  81.         sPrintLog("Either you can choose every file from the File->Open menu");
  82.         sPrintLog("You can use multiple configuration files:");
  83.         sPrintLog("to select another, type its name (it has to be in the Sysepub/config direcory)");
  84.         sPrintLog("and press 'Change'");
  85.         sPrintLog("If your public key isn't large enough, simply press 'Generate'");
  86.         sPrintLog("You can change its size either from the textfield or from the config file.");
  87.         sPrintLog("For more detailed help refer to the Sysepub manual in the Sysepub/doc directory.");
  88.         }
  89.         public void printLicenseGUI(){
  90.         sPrintLog("Sysepub comes with ABSOLUTELY NO WARRANTY; for details: Help->Warranty");
  91.         sPrintLog("This is free software, and you are welcome to redistribute it"+
  92.         " under certain\nconditions; for details see the gpl.txt file in the Sysepub/doc directory.");
  93.         }
  94.  
  95.     public void printHelp() {
  96.         sPrintLog("Sysepub comes with ABSOLUTELY NO WARRANTY; for details: java Sysepub w");
  97.         sPrintLog("This is free software, and you are welcome to redistribute it"+
  98.         " under certain\nconditions; for details see the gpl.txt file.");
  99.         sPrintLog("Usage:\n");
  100.         sPrintLog("java Sysepub option [parameter]");
  101.         sPrintLog("");
  102.         sPrintLog("Options:");
  103.         sPrintLog("e : performs encryption (parameter: the filename to write)");
  104.         sPrintLog("d : performs decryption (parameter: the filename to write)");
  105.         sPrintLog("g : generates a random file as public key (parameter: the file length in KB)");
  106.         sPrintLog("If no filename is specified the default file is used.");
  107.         sPrintLog("If you type only the filename Sysepub will search the file in plain/ciphertexts");
  108.         sPrintLog("");
  109.         sPrintLog("Examples: java Sysepub e supersecret.txt");
  110.         sPrintLog("Encrypts the file specified and writes it in the ciphertexts directory");
  111.         sPrintLog("          java Sysepub d supersecret.txt");
  112.         sPrintLog("Decrypts the file specified and writes it in the plaintexts directory");
  113.         sPrintLog("\nSee the readme.txt , doc/manual.html , doc/help.html "+
  114.                           ", doc/gpl.txt for more\ninformations.");
  115. //        sPrintLog("There is a configuration file: config/ssp.cfg");
  116.     }
  117.  
  118.  
  119. }