tn5250j/src/org/tn5250j GlobalConfigure.java,1.15,1.16

"Kenneth J. Pouncey" <[email protected]> Sat, 26 Jun 2004 05:33:10 +0000
Newsgroups gmane.comp.java.tn5250j.cvs
Message-ID <[email protected]>
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11763

Modified Files:
	GlobalConfigure.java 
Log Message:
Fixex from Luc - LDC, fix to call getInstance()

Index: GlobalConfigure.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/GlobalConfigure.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** GlobalConfigure.java	14 Apr 2004 12:15:52 -0000	1.15
--- GlobalConfigure.java	26 Jun 2004 05:33:07 -0000	1.16
***************
*** 55,66 ****
     static private Hashtable headers = new Hashtable();  //LUC GORRENS
  
!    static final public String SESSIONS = "sessions";
     static final public File ses = new File(SESSIONS);
!    static final public String MACROS = "macros";
!    static final public String KEYMAP = "keymap";
  
     static final private String settingsFile = "tn5250jstartup.cfg";
     private Logger log = Logger.getLogger(this.getClass());
!    
     /**
      * The constructor is made protected to allow overriding.
--- 55,66 ----
     static private Hashtable headers = new Hashtable();  //LUC GORRENS
  
! //   static final public String SESSIONS = "sessions";
     static final public File ses = new File(SESSIONS);
! //   static final public String MACROS = "macros";
! //   static final public String KEYMAP = "keymap";
  
     static final private String settingsFile = "tn5250jstartup.cfg";
     private Logger log = Logger.getLogger(this.getClass());
! 
     /**
      * The constructor is made protected to allow overriding.
***************
*** 158,167 ****
             catch (FileNotFoundException fnfe) {
                 try {
!                    again = new FileInputStream(settingsDirectory() + settingsFile); 
!                    settings.load(again); 
                 }
                 catch (FileNotFoundException fnfea) {
!                    log.info(" Information Message: " 
!                    + fnfea.getMessage() + ".  The file " + settingsFile 
                     + " will be created for first time use.");
                     checkLegacy();
--- 158,167 ----
             catch (FileNotFoundException fnfe) {
                 try {
!                    again = new FileInputStream(settingsDirectory() + settingsFile);
!                    settings.load(again);
                 }
                 catch (FileNotFoundException fnfea) {
!                    log.info(" Information Message: "
!                    + fnfea.getMessage() + ".  The file " + settingsFile
                     + " will be created for first time use.");
                     checkLegacy();
***************
*** 169,178 ****
                 }
                 catch (IOException ioea) {
!                    log.warn("IO Exception accessing File " 
                     + settingsFile + " for the following reason : "
                     + ioea.getMessage());
                 }
                 catch (SecurityException sea) {
!                    log.warn("Security Exception for file " 
                     + settingsFile + "  This file can not be "
                     + "accessed because : " + sea.getMessage());
--- 169,178 ----
                 }
                 catch (IOException ioea) {
!                    log.warn("IO Exception accessing File "
                     + settingsFile + " for the following reason : "
                     + ioea.getMessage());
                 }
                 catch (SecurityException sea) {
!                    log.warn("Security Exception for file "
                     + settingsFile + "  This file can not be "
                     + "accessed because : " + sea.getMessage());
***************
*** 180,189 ****
             }
             catch (IOException ioe) {
!                log.warn("IO Exception accessing File " 
                 + settingsFile + " for the following reason : "
                 + ioe.getMessage());
             }
             catch (SecurityException se) {
!                log.warn("Security Exception for file " 
                 + settingsFile + "  This file can not be "
                 + "accessed because : " + se.getMessage());
--- 180,189 ----
             }
             catch (IOException ioe) {
!                log.warn("IO Exception accessing File "
                 + settingsFile + " for the following reason : "
                 + ioe.getMessage());
             }
             catch (SecurityException se) {
!                log.warn("Security Exception for file "
                 + settingsFile + "  This file can not be "
                 + "accessed because : " + se.getMessage());
***************
*** 198,202 ****
           sd.mkdirs();
     }
!    
     private void checkLegacy() {
        // we check if the sessions file already exists in the directory
--- 198,202 ----
           sd.mkdirs();
     }
! 
     private void checkLegacy() {
        // we check if the sessions file already exists in the directory
***************
*** 206,210 ****
        if(ses.exists()) {
            int cfc;
!           cfc = JOptionPane.showConfirmDialog(null, 
            "Dear User,\n\n" +
            "Seems you are using an old version of tn5250j.\n" +
--- 206,210 ----
        if(ses.exists()) {
            int cfc;
!           cfc = JOptionPane.showConfirmDialog(null,
            "Dear User,\n\n" +
            "Seems you are using an old version of tn5250j.\n" +
***************
*** 226,230 ****
            }
            else {
!               JOptionPane.showMessageDialog(null, 
                "Dear User,\n\n" +
                "You choosed not to copy the file.\n" +
--- 226,230 ----
            }
            else {
!               JOptionPane.showMessageDialog(null,
                "Dear User,\n\n" +
                "You choosed not to copy the file.\n" +
***************
*** 238,246 ****
        }
     }
!    
     private void copyConfigs(String sesFile) {
         /** Copy the config-files to the user's home-dir */
         String srcFile = System.getProperty("user.dir") + File.separator + sesFile;
!        String dest = System.getProperty("user.home") + 
         File.separator + ".tn5250j" + File.separator + sesFile;
         File rmvFile = new File(sesFile);
--- 238,246 ----
        }
     }
! 
     private void copyConfigs(String sesFile) {
         /** Copy the config-files to the user's home-dir */
         String srcFile = System.getProperty("user.dir") + File.separator + sesFile;
!        String dest = System.getProperty("user.home") +
         File.separator + ".tn5250j" + File.separator + sesFile;
         File rmvFile = new File(sesFile);
***************
*** 248,252 ****
             FileReader r = new FileReader(srcFile);
             BufferedReader b = new BufferedReader(r);
!            
             FileWriter w = new FileWriter(dest);
             PrintWriter p = new PrintWriter(w);
--- 248,252 ----
             FileReader r = new FileReader(srcFile);
             BufferedReader b = new BufferedReader(r);
! 
             FileWriter w = new FileWriter(dest);
             PrintWriter p = new PrintWriter(w);
***************
*** 269,273 ****
             }
         }
!        
     /**
      * Save the settings for the global configuration
--- 269,273 ----
             }
         }
! 
     /**
      * Save the settings for the global configuration



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com