home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / Notes.jar / lotus / notes / internal / InfoPane.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-15  |  3.8 KB  |  116 lines

  1. package lotus.notes.internal;
  2.  
  3. import java.io.EOFException;
  4. import java.io.FileInputStream;
  5. import java.io.FileNotFoundException;
  6. import java.io.IOException;
  7. import java.io.InputStream;
  8. import java.io.ObjectInputStream;
  9. import java.util.StringTokenizer;
  10. import java.util.zip.ZipEntry;
  11. import java.util.zip.ZipFile;
  12. import lotus.notes.JavaString;
  13.  
  14. public class InfoPane {
  15.    private static InfoPaneRootItem rootItem;
  16.    static final String indexFilePath = "lotus/notes/internal/INFOPANE";
  17.    // $FF: synthetic field
  18.    static Class class$lotus$notes$internal$InfoPaneTopItem;
  19.  
  20.    InfoPane() {
  21.       rootItem = null;
  22.    }
  23.  
  24.    public static void main(String[] var0) {
  25.       new JavaString("lotus.notes.AgentResources");
  26.       GetRootItem();
  27.       if (var0.length > 0) {
  28.          rootItem.Print("", true);
  29.       } else {
  30.          rootItem.Print("", false);
  31.       }
  32.  
  33.       System.exit(0);
  34.    }
  35.  
  36.    static InfoPaneRootItem GetRootItem() {
  37.       if (rootItem == null) {
  38.          Initialize();
  39.       }
  40.  
  41.       return rootItem;
  42.    }
  43.  
  44.    static void Initialize() {
  45.       try {
  46.          rootItem = new InfoPaneRootItem();
  47.          String var0 = System.getProperty("java.class.path");
  48.          String var1 = System.getProperty("path.separator", ";");
  49.          StringTokenizer var2 = new StringTokenizer(var0, var1);
  50.  
  51.          while(var2.hasMoreTokens()) {
  52.             String var3 = var2.nextToken();
  53.             if (!var3.endsWith(".jar") && !var3.endsWith(".zip")) {
  54.                try {
  55.                   FileInputStream var9 = new FileInputStream(var3 + "/" + "lotus/notes/internal/INFOPANE");
  56.                   ReadIndexFile(var9);
  57.                } catch (FileNotFoundException var6) {
  58.                }
  59.             } else {
  60.                try {
  61.                   ZipFile var4 = new ZipFile(var3);
  62.                   ZipEntry var5 = var4.getEntry("lotus/notes/internal/INFOPANE");
  63.                   if (var5 != null) {
  64.                      ReadIndexFile(var4.getInputStream(var5));
  65.                   }
  66.                } catch (IOException var7) {
  67.                }
  68.             }
  69.          }
  70.  
  71.       } catch (Exception var8) {
  72.          System.out.println("InfoPane.Initialize exception: " + var8);
  73.          ((Throwable)var8).printStackTrace();
  74.       }
  75.    }
  76.  
  77.    static void ReadIndexFile(InputStream var0) {
  78.       try {
  79.          ObjectInputStream var1 = new ObjectInputStream(var0);
  80.  
  81.          Object var2;
  82.          try {
  83.             while((var2 = var1.readObject()) != null) {
  84.                AssertClass(var2, class$lotus$notes$internal$InfoPaneTopItem != null ? class$lotus$notes$internal$InfoPaneTopItem : (class$lotus$notes$internal$InfoPaneTopItem = class$("lotus.notes.internal.InfoPaneTopItem")));
  85.                InfoPaneTopItem var3 = (InfoPaneTopItem)var2;
  86.                InfoPaneTopItem var4 = rootItem.FindItem(var3.name);
  87.                if (var4 == null) {
  88.                   rootItem.AddItem(var3);
  89.                }
  90.             }
  91.          } catch (EOFException var5) {
  92.          }
  93.  
  94.          var0.close();
  95.       } catch (Exception var6) {
  96.          System.out.println("InfoPane.ReadIndexFile exception: " + var6);
  97.          ((Throwable)var6).printStackTrace();
  98.       }
  99.    }
  100.  
  101.    static void AssertClass(Object var0, Class var1) throws InfoPaneException {
  102.       if (var0.getClass() != var1) {
  103.          throw new InfoPaneException("\nClass mismatch: Expected " + var1 + ",\n\t\tactual " + var0.getClass());
  104.       }
  105.    }
  106.  
  107.    // $FF: synthetic method
  108.    static Class class$(String var0) {
  109.       try {
  110.          return Class.forName(var0);
  111.       } catch (ClassNotFoundException var2) {
  112.          throw new NoClassDefFoundError(((Throwable)var2).getMessage());
  113.       }
  114.    }
  115. }
  116.