home *** CD-ROM | disk | FTP | other *** search
- package com.ms.applet;
-
- import java.net.URL;
- import java.util.Hashtable;
-
- class CabClassLoader extends AppletBaseClassLoader {
- Hashtable CabSubFilesTable = new Hashtable();
- Hashtable DefinedClasses = new Hashtable();
- String CabFileURL;
- int InternalHandle;
-
- synchronized byte[] getDataItem(String var1) {
- String var2 = var1.replace('/', '\\');
- return !this.CabSubFilesTable.containsKey(var2) ? null : this.getBytes((CabSubFile)this.CabSubFilesTable.get(var2));
- }
-
- private void load() {
- synchronized(this.getClass()){}
-
- try {
- this.load0();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void finalize() {
- this.cleanup();
- }
-
- private native byte[] getBytes(CabSubFile var1);
-
- private native void cleanup();
-
- boolean isDataStore() {
- return true;
- }
-
- private native void load0();
-
- protected Class loadClass(String var1) throws ClassNotFoundException {
- return this.loadClass(var1, true);
- }
-
- protected synchronized Class loadClass(String var1, boolean var2) throws ClassNotFoundException {
- if (this.DefinedClasses.containsKey(var1)) {
- return (Class)this.DefinedClasses.get(var1);
- } else {
- SecurityManager var4 = System.getSecurityManager();
- if (var4 != null) {
- int var5 = var1.lastIndexOf(46);
- if (var5 >= 0) {
- var4.checkPackageAccess(var1.substring(0, var5));
- }
- }
-
- try {
- return ((ClassLoader)this).findSystemClass(var1);
- } catch (Throwable var8) {
- if (var4 != null) {
- int var12 = var1.lastIndexOf(46);
- if (var12 >= 0 && !((AppletBaseClassLoader)this).getSecureState()) {
- var4.checkPackageDefinition(var1.substring(0, var12));
- }
- }
-
- String var10 = var1.replace('.', '\\');
- var10 = var10 + ".class";
- if (this.CabSubFilesTable.containsKey(var10)) {
- CabSubFile var13 = (CabSubFile)this.CabSubFilesTable.get(var10);
- Class var3 = ((ClassLoader)this).defineClass(this.getBytes(var13), 0, var13.FileLength);
- if (!var1.equals(var3.getName())) {
- Class var6 = var3;
- Object var9 = null;
- throw new ClassFormatError(var1 + " != " + var6.getName());
- } else {
- this.DefinedClasses.put(var1, var3);
- if (var2) {
- ((ClassLoader)this).resolveClass(var3);
- }
-
- return var3;
- }
- } else {
- throw new ClassNotFoundException(var1);
- }
- }
- }
- }
-
- CabClassLoader(URL var1, URL var2) {
- super.base = var2;
- this.CabFileURL = var1.toExternalForm();
- BrowserAppletFrame var3 = ((AppletBaseClassLoader)this).currentAppletFrame();
-
- try {
- ((AppletBaseClassLoader)this).showDownloadUI(var3, 261, var1);
- this.load();
- } finally {
- ((AppletBaseClassLoader)this).hideDownloadUI(var3);
- }
-
- }
- }
-