changeset 2357:464f7b987fb6

Remove NetX and the IcedTea plugin, now developed in IcedTea-Web. 2010-12-09 Andrew John Hughes <ahughes@redhat.com> Remove NetX and the IcedTea plugin; now developed in IcedTea-Web. * NEWS: Updated. * extra/net/sourceforge/jnlp/about/HTMLPanel.java, * extra/net/sourceforge/jnlp/about/Main.java, * extra/net/sourceforge/jnlp/about/resources/about.html, * extra/net/sourceforge/jnlp/about/resources/applications.html, * extra/net/sourceforge/jnlp/about/resources/notes.html, * netx/javax/jnlp/BasicService.java, * netx/javax/jnlp/ClipboardService.java, * netx/javax/jnlp/DownloadService.java, * netx/javax/jnlp/DownloadServiceListener.java, * netx/javax/jnlp/ExtendedService.java, * netx/javax/jnlp/ExtensionInstallerService.java, * netx/javax/jnlp/FileContents.java, * netx/javax/jnlp/FileOpenService.java, * netx/javax/jnlp/FileSaveService.java, * netx/javax/jnlp/JNLPRandomAccessFile.java, * netx/javax/jnlp/PersistenceService.java, * netx/javax/jnlp/PrintService.java, * netx/javax/jnlp/ServiceManager.java, * netx/javax/jnlp/ServiceManagerStub.java, * netx/javax/jnlp/SingleInstanceListener.java, * netx/javax/jnlp/SingleInstanceService.java, * netx/javax/jnlp/UnavailableServiceException.java, * netx/net/sourceforge/jnlp/AppletDesc.java, * netx/net/sourceforge/jnlp/ApplicationDesc.java, * netx/net/sourceforge/jnlp/AssociationDesc.java, * netx/net/sourceforge/jnlp/ComponentDesc.java, * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java, * netx/net/sourceforge/jnlp/ExtensionDesc.java, * netx/net/sourceforge/jnlp/IconDesc.java, * netx/net/sourceforge/jnlp/InformationDesc.java, * netx/net/sourceforge/jnlp/InstallerDesc.java, * netx/net/sourceforge/jnlp/JARDesc.java, * netx/net/sourceforge/jnlp/JNLPFile.java, * netx/net/sourceforge/jnlp/JNLPSplashScreen.java, * netx/net/sourceforge/jnlp/JREDesc.java, * netx/net/sourceforge/jnlp/LaunchException.java, * netx/net/sourceforge/jnlp/LaunchHandler.java, * netx/net/sourceforge/jnlp/Launcher.java, * netx/net/sourceforge/jnlp/MenuDesc.java, * netx/net/sourceforge/jnlp/NetxPanel.java, * netx/net/sourceforge/jnlp/Node.java, * netx/net/sourceforge/jnlp/PackageDesc.java, * netx/net/sourceforge/jnlp/ParseException.java, * netx/net/sourceforge/jnlp/Parser.java, * netx/net/sourceforge/jnlp/PluginBridge.java, * netx/net/sourceforge/jnlp/PropertyDesc.java, * netx/net/sourceforge/jnlp/RelatedContentDesc.java, * netx/net/sourceforge/jnlp/ResourcesDesc.java, * netx/net/sourceforge/jnlp/SecurityDesc.java, * netx/net/sourceforge/jnlp/ShortcutDesc.java, * netx/net/sourceforge/jnlp/StreamEater.java, * netx/net/sourceforge/jnlp/Version.java, * netx/net/sourceforge/jnlp/cache/CacheEntry.java, * netx/net/sourceforge/jnlp/cache/CacheUtil.java, * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java, * netx/net/sourceforge/jnlp/cache/DownloadIndicator.java, * netx/net/sourceforge/jnlp/cache/Resource.java, * netx/net/sourceforge/jnlp/cache/ResourceTracker.java, * netx/net/sourceforge/jnlp/cache/UpdatePolicy.java, * netx/net/sourceforge/jnlp/cache/package.html, * netx/net/sourceforge/jnlp/event/ApplicationEvent.java, * netx/net/sourceforge/jnlp/event/ApplicationListener.java, * netx/net/sourceforge/jnlp/event/DownloadEvent.java, * netx/net/sourceforge/jnlp/event/DownloadListener.java, * netx/net/sourceforge/jnlp/event/package.html, * netx/net/sourceforge/jnlp/package.html, * netx/net/sourceforge/jnlp/resources/Manifest.mf, * netx/net/sourceforge/jnlp/resources/Messages.properties, * netx/net/sourceforge/jnlp/resources/about.jnlp, * netx/net/sourceforge/jnlp/resources/default.jnlp, * netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java, * netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java, * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java, * netx/net/sourceforge/jnlp/runtime/AppletInstance.java, * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java, * netx/net/sourceforge/jnlp/runtime/Boot.java, * netx/net/sourceforge/jnlp/runtime/Boot13.java, * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java, * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java, * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java, * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java, * netx/net/sourceforge/jnlp/runtime/package.html, * netx/net/sourceforge/jnlp/security/AccessWarningPane.java, * netx/net/sourceforge/jnlp/security/AppletWarningPane.java, * netx/net/sourceforge/jnlp/security/CertVerifier.java, * netx/net/sourceforge/jnlp/security/CertWarningPane.java, * netx/net/sourceforge/jnlp/security/CertsInfoPane.java, * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java, * netx/net/sourceforge/jnlp/security/MoreInfoPane.java, * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java, * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java, * netx/net/sourceforge/jnlp/security/SecurityUtil.java, * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java, * netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java, * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java, * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java, * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java, * netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java, * netx/net/sourceforge/jnlp/services/InstanceExistsException.java, * netx/net/sourceforge/jnlp/services/ServiceUtil.java, * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java, * netx/net/sourceforge/jnlp/services/XBasicService.java, * netx/net/sourceforge/jnlp/services/XClipboardService.java, * netx/net/sourceforge/jnlp/services/XDownloadService.java, * netx/net/sourceforge/jnlp/services/XExtendedService.java, * netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java, * netx/net/sourceforge/jnlp/services/XFileContents.java, * netx/net/sourceforge/jnlp/services/XFileOpenService.java, * netx/net/sourceforge/jnlp/services/XFileSaveService.java, * netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java, * netx/net/sourceforge/jnlp/services/XPersistenceService.java, * netx/net/sourceforge/jnlp/services/XPrintService.java, * netx/net/sourceforge/jnlp/services/XServiceManagerStub.java, * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java, * netx/net/sourceforge/jnlp/services/package.html, * netx/net/sourceforge/jnlp/tools/CharacterEncoder.java, * netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java, * netx/net/sourceforge/jnlp/tools/JarRunner.java, * netx/net/sourceforge/jnlp/tools/JarSigner.java, * netx/net/sourceforge/jnlp/tools/JarSignerResources.java, * netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java, * netx/net/sourceforge/jnlp/tools/KeyTool.java, * netx/net/sourceforge/jnlp/util/FileUtils.java, * netx/net/sourceforge/jnlp/util/PropertiesFile.java, * netx/net/sourceforge/jnlp/util/Reflect.java, * netx/net/sourceforge/jnlp/util/WeakList.java, * netx/net/sourceforge/jnlp/util/XDesktopEntry.java, * netx/net/sourceforge/nanoxml/XMLElement.java, * netx/net/sourceforge/nanoxml/XMLParseException.java, * patches/extensions/liveconnect-dist.patch, * patches/extensions/liveconnect.patch, * patches/extensions/netx-dist.patch, * patches/extensions/netx-umask.patch, * patches/extensions/netx.patch, * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc, * plugin/icedteanp/IcedTeaJavaRequestProcessor.h, * plugin/icedteanp/IcedTeaNPPlugin.cc, * plugin/icedteanp/IcedTeaNPPlugin.h, * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc, * plugin/icedteanp/IcedTeaPluginRequestProcessor.h, * plugin/icedteanp/IcedTeaPluginUtils.cc, * plugin/icedteanp/IcedTeaPluginUtils.h, * plugin/icedteanp/IcedTeaRunnable.cc, * plugin/icedteanp/IcedTeaRunnable.h, * plugin/icedteanp/IcedTeaScriptablePluginObject.cc, * plugin/icedteanp/IcedTeaScriptablePluginObject.h, * plugin/icedteanp/java/netscape/javascript/JSException.java, * plugin/icedteanp/java/netscape/javascript/JSObject.java, * plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java, * plugin/icedteanp/java/netscape/javascript/JSProxy.java, * plugin/icedteanp/java/netscape/javascript/JSRunnable.java, * plugin/icedteanp/java/netscape/javascript/JSUtil.java, * plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java, * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java, * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java, * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java, * plugin/icedteanp/java/sun/applet/JavaConsole.java, * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java, * plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java, * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java, * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java, * plugin/icedteanp/java/sun/applet/PluginCallRequest.java, * plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java, * plugin/icedteanp/java/sun/applet/PluginClassLoader.java, * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java, * plugin/icedteanp/java/sun/applet/PluginCookieManager.java, * plugin/icedteanp/java/sun/applet/PluginDebug.java, * plugin/icedteanp/java/sun/applet/PluginException.java, * plugin/icedteanp/java/sun/applet/PluginMain.java, * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java, * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java, * plugin/icedteanp/java/sun/applet/PluginObjectStore.java, * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java, * plugin/icedteanp/java/sun/applet/PluginProxySelector.java, * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java, * plugin/icedteanp/java/sun/applet/RequestQueue.java, * plugin/icedteanp/java/sun/applet/TestEnv.java, * plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java, * plugin/tests/LiveConnect/DummyObject.java, * plugin/tests/LiveConnect/OverloadTestHelper1.java, * plugin/tests/LiveConnect/OverloadTestHelper2.java, * plugin/tests/LiveConnect/OverloadTestHelper3.java, * plugin/tests/LiveConnect/PluginTest.java, * plugin/tests/LiveConnect/build, * plugin/tests/LiveConnect/common.js, * plugin/tests/LiveConnect/index.html, * plugin/tests/LiveConnect/jjs_eval_test.js, * plugin/tests/LiveConnect/jjs_func_parameters_tests.js, * plugin/tests/LiveConnect/jjs_func_rettype_tests.js, * plugin/tests/LiveConnect/jjs_get_tests.js, * plugin/tests/LiveConnect/jjs_set_tests.js, * plugin/tests/LiveConnect/jsj_func_overload_tests.js, * plugin/tests/LiveConnect/jsj_func_parameters_tests.js, * plugin/tests/LiveConnect/jsj_func_rettype_tests.js, * plugin/tests/LiveConnect/jsj_get_tests.js, * plugin/tests/LiveConnect/jsj_set_tests.js, * plugin/tests/LiveConnect/jsj_type_casting_tests.js, * plugin/tests/LiveConnect/jsj_type_conversion_tests.js: Remove plugin and NetX. * Makefile.am: Remove NetX and plugin variables, targets and aliases. (JDK_CHANGESET): Update to pick up applet hole patch. (JDK_SHA256SUM): Likewise. (NETX_CLASSES): Removed. (NETX_JAR): Likewise. (NETX_SRC): Likewise. (NETX_SRCDIR): Likewise. (NETX_RESOURCE_DIR): Likewise. (NETX_EXTRA_DIR): Likewise. (PLUGIN_SRCDIR): Likewise. (PLUGIN_BUILD_DIR): Likewise. (LIVECONNECT_DIR): Likewise. (LIVECONNECT_SRCS): Likewise. (LIVECONNECT_CLASSES): Likewise. (LIVECONNECT_JAR): Likewise. (LIVECONNECT_SRC): Likewise. (NETX_BOOTSTRAP_CLASSES): Likewise. (ICEDTEA_BOOTSTRAP_CLASSES): Remove NETX_BOOTSTRAP_CLASSES. (ICEDTEAPLUGIN_TARGET): Removed. (JNLP_ABOUT_TARGET): Likewise. (PLUGIN_TEST_SRCS): Likewise. (ICEDTEA_PATCHES): Drop netx.patch, netx-dist.patch, netx-umask.patch, liveconnect.patch, liveconnect-dist.patch. (PLUGIN_VERSION): Removed. (ICEDTEA_ENV): Don't pass ALT_NETX_DIST or ALT_LIVECONNECT_DIST. (EXTRA_DIST): Drop extensions patch directory, extra, netx and plugin source directories. (clean-local): Remove dropped targets. (.PHONY): Likewise. (icedtea): Drop dependencies on plugin and liveconnect. Remove copying of plugin and javaws data. (icedtea-debug): Likewise. (icedtea-boot): Remove dead dependencies. (PLUGIN_SRC): Removed. (PLUGIN_OBJECTS): Likewise. ($(PLUGIN_BUILD_DIR)/%.o): Dropped target. ($(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so): Likewise. (liveconnect-source-files): Likewise. (liveconnect): Likewise. (liveconnect-dist): Likewise. (icedtea-npplugin): Likewise. (clean-IcedTeaPlugin): Likewise. (clean-liveconnect): Likewise. (netx-source-files): Likewise. (netx): Likewise. (netx-dist): Likewise. (clean-netx): Likewise. (extra-source-files): Likewise. (extra-class-files): Likewise. (clean-extra): Likewise. (extra-lib/about.jar): Likewise. (plugin-tests): Likewise.
author Andrew John Hughes <ahughes@redhat.com>
date Thu, 09 Dec 2010 17:41:47 +0000
parents 313adf325208
children 93ac4fddecf3
files ChangeLog Makefile.am extra/net/sourceforge/jnlp/about/HTMLPanel.java extra/net/sourceforge/jnlp/about/Main.java extra/net/sourceforge/jnlp/about/resources/about.html extra/net/sourceforge/jnlp/about/resources/applications.html extra/net/sourceforge/jnlp/about/resources/jamIcon.jpg extra/net/sourceforge/jnlp/about/resources/notes.html netx/javax/jnlp/BasicService.java netx/javax/jnlp/ClipboardService.java netx/javax/jnlp/DownloadService.java netx/javax/jnlp/DownloadServiceListener.java netx/javax/jnlp/ExtendedService.java netx/javax/jnlp/ExtensionInstallerService.java netx/javax/jnlp/FileContents.java netx/javax/jnlp/FileOpenService.java netx/javax/jnlp/FileSaveService.java netx/javax/jnlp/JNLPRandomAccessFile.java netx/javax/jnlp/PersistenceService.java netx/javax/jnlp/PrintService.java netx/javax/jnlp/ServiceManager.java netx/javax/jnlp/ServiceManagerStub.java netx/javax/jnlp/SingleInstanceListener.java netx/javax/jnlp/SingleInstanceService.java netx/javax/jnlp/UnavailableServiceException.java netx/net/sourceforge/jnlp/AppletDesc.java netx/net/sourceforge/jnlp/ApplicationDesc.java netx/net/sourceforge/jnlp/AssociationDesc.java netx/net/sourceforge/jnlp/ComponentDesc.java netx/net/sourceforge/jnlp/DefaultLaunchHandler.java netx/net/sourceforge/jnlp/ExtensionDesc.java netx/net/sourceforge/jnlp/IconDesc.java netx/net/sourceforge/jnlp/InformationDesc.java netx/net/sourceforge/jnlp/InstallerDesc.java netx/net/sourceforge/jnlp/JARDesc.java netx/net/sourceforge/jnlp/JNLPFile.java netx/net/sourceforge/jnlp/JNLPSplashScreen.java netx/net/sourceforge/jnlp/JREDesc.java netx/net/sourceforge/jnlp/LaunchException.java netx/net/sourceforge/jnlp/LaunchHandler.java netx/net/sourceforge/jnlp/Launcher.java netx/net/sourceforge/jnlp/MenuDesc.java netx/net/sourceforge/jnlp/NetxPanel.java netx/net/sourceforge/jnlp/Node.java netx/net/sourceforge/jnlp/PackageDesc.java netx/net/sourceforge/jnlp/ParseException.java netx/net/sourceforge/jnlp/Parser.java netx/net/sourceforge/jnlp/PluginBridge.java netx/net/sourceforge/jnlp/PropertyDesc.java netx/net/sourceforge/jnlp/RelatedContentDesc.java netx/net/sourceforge/jnlp/ResourcesDesc.java netx/net/sourceforge/jnlp/SecurityDesc.java netx/net/sourceforge/jnlp/ShortcutDesc.java netx/net/sourceforge/jnlp/StreamEater.java netx/net/sourceforge/jnlp/Version.java netx/net/sourceforge/jnlp/cache/CacheEntry.java netx/net/sourceforge/jnlp/cache/CacheUtil.java netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java netx/net/sourceforge/jnlp/cache/DownloadIndicator.java netx/net/sourceforge/jnlp/cache/Resource.java netx/net/sourceforge/jnlp/cache/ResourceTracker.java netx/net/sourceforge/jnlp/cache/UpdatePolicy.java netx/net/sourceforge/jnlp/cache/package.html netx/net/sourceforge/jnlp/event/ApplicationEvent.java netx/net/sourceforge/jnlp/event/ApplicationListener.java netx/net/sourceforge/jnlp/event/DownloadEvent.java netx/net/sourceforge/jnlp/event/DownloadListener.java netx/net/sourceforge/jnlp/event/package.html netx/net/sourceforge/jnlp/package.html netx/net/sourceforge/jnlp/resources/Manifest.mf netx/net/sourceforge/jnlp/resources/Messages.properties netx/net/sourceforge/jnlp/resources/about.jnlp netx/net/sourceforge/jnlp/resources/default.jnlp netx/net/sourceforge/jnlp/resources/info-small.png netx/net/sourceforge/jnlp/resources/install.png netx/net/sourceforge/jnlp/resources/netx-icon.png netx/net/sourceforge/jnlp/resources/warning-small.png netx/net/sourceforge/jnlp/resources/warning.png netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java netx/net/sourceforge/jnlp/runtime/AppletInstance.java netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java netx/net/sourceforge/jnlp/runtime/Boot.java netx/net/sourceforge/jnlp/runtime/Boot13.java netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java netx/net/sourceforge/jnlp/runtime/package.html netx/net/sourceforge/jnlp/security/AccessWarningPane.java netx/net/sourceforge/jnlp/security/AppletWarningPane.java netx/net/sourceforge/jnlp/security/CertVerifier.java netx/net/sourceforge/jnlp/security/CertWarningPane.java netx/net/sourceforge/jnlp/security/CertsInfoPane.java netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java netx/net/sourceforge/jnlp/security/MoreInfoPane.java netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java netx/net/sourceforge/jnlp/security/SecurityUtil.java netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java netx/net/sourceforge/jnlp/services/InstanceExistsException.java netx/net/sourceforge/jnlp/services/ServiceUtil.java netx/net/sourceforge/jnlp/services/SingleInstanceLock.java netx/net/sourceforge/jnlp/services/XBasicService.java netx/net/sourceforge/jnlp/services/XClipboardService.java netx/net/sourceforge/jnlp/services/XDownloadService.java netx/net/sourceforge/jnlp/services/XExtendedService.java netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java netx/net/sourceforge/jnlp/services/XFileContents.java netx/net/sourceforge/jnlp/services/XFileOpenService.java netx/net/sourceforge/jnlp/services/XFileSaveService.java netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java netx/net/sourceforge/jnlp/services/XPersistenceService.java netx/net/sourceforge/jnlp/services/XPrintService.java netx/net/sourceforge/jnlp/services/XServiceManagerStub.java netx/net/sourceforge/jnlp/services/XSingleInstanceService.java netx/net/sourceforge/jnlp/services/package.html netx/net/sourceforge/jnlp/tools/CharacterEncoder.java netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java netx/net/sourceforge/jnlp/tools/JarRunner.java netx/net/sourceforge/jnlp/tools/JarSigner.java netx/net/sourceforge/jnlp/tools/JarSignerResources.java netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java netx/net/sourceforge/jnlp/tools/KeyTool.java netx/net/sourceforge/jnlp/util/FileUtils.java netx/net/sourceforge/jnlp/util/PropertiesFile.java netx/net/sourceforge/jnlp/util/Reflect.java netx/net/sourceforge/jnlp/util/WeakList.java netx/net/sourceforge/jnlp/util/XDesktopEntry.java netx/net/sourceforge/nanoxml/XMLElement.java netx/net/sourceforge/nanoxml/XMLParseException.java patches/extensions/liveconnect-dist.patch patches/extensions/liveconnect.patch patches/extensions/netx-dist.patch patches/extensions/netx-umask.patch patches/extensions/netx.patch plugin/icedteanp/IcedTeaJavaRequestProcessor.cc plugin/icedteanp/IcedTeaJavaRequestProcessor.h plugin/icedteanp/IcedTeaNPPlugin.cc plugin/icedteanp/IcedTeaNPPlugin.h plugin/icedteanp/IcedTeaPluginRequestProcessor.cc plugin/icedteanp/IcedTeaPluginRequestProcessor.h plugin/icedteanp/IcedTeaPluginUtils.cc plugin/icedteanp/IcedTeaPluginUtils.h plugin/icedteanp/IcedTeaRunnable.cc plugin/icedteanp/IcedTeaRunnable.h plugin/icedteanp/IcedTeaScriptablePluginObject.cc plugin/icedteanp/IcedTeaScriptablePluginObject.h plugin/icedteanp/java/netscape/javascript/JSException.java plugin/icedteanp/java/netscape/javascript/JSObject.java plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java plugin/icedteanp/java/netscape/javascript/JSProxy.java plugin/icedteanp/java/netscape/javascript/JSRunnable.java plugin/icedteanp/java/netscape/javascript/JSUtil.java plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java plugin/icedteanp/java/sun/applet/JavaConsole.java plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java plugin/icedteanp/java/sun/applet/PluginAppletViewer.java plugin/icedteanp/java/sun/applet/PluginCallRequest.java plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java plugin/icedteanp/java/sun/applet/PluginClassLoader.java plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java plugin/icedteanp/java/sun/applet/PluginCookieManager.java plugin/icedteanp/java/sun/applet/PluginDebug.java plugin/icedteanp/java/sun/applet/PluginException.java plugin/icedteanp/java/sun/applet/PluginMain.java plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java plugin/icedteanp/java/sun/applet/PluginObjectStore.java plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java plugin/icedteanp/java/sun/applet/PluginProxySelector.java plugin/icedteanp/java/sun/applet/PluginStreamHandler.java plugin/icedteanp/java/sun/applet/RequestQueue.java plugin/icedteanp/java/sun/applet/TestEnv.java plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java plugin/tests/LiveConnect/DummyObject.java plugin/tests/LiveConnect/OverloadTestHelper1.java plugin/tests/LiveConnect/OverloadTestHelper2.java plugin/tests/LiveConnect/OverloadTestHelper3.java plugin/tests/LiveConnect/PluginTest.java plugin/tests/LiveConnect/build plugin/tests/LiveConnect/common.js plugin/tests/LiveConnect/index.html plugin/tests/LiveConnect/jjs_eval_test.js plugin/tests/LiveConnect/jjs_func_parameters_tests.js plugin/tests/LiveConnect/jjs_func_rettype_tests.js plugin/tests/LiveConnect/jjs_get_tests.js plugin/tests/LiveConnect/jjs_set_tests.js plugin/tests/LiveConnect/jsj_func_overload_tests.js plugin/tests/LiveConnect/jsj_func_parameters_tests.js plugin/tests/LiveConnect/jsj_func_rettype_tests.js plugin/tests/LiveConnect/jsj_get_tests.js plugin/tests/LiveConnect/jsj_set_tests.js plugin/tests/LiveConnect/jsj_type_casting_tests.js plugin/tests/LiveConnect/jsj_type_conversion_tests.js
diffstat 206 files changed, 272 insertions(+), 45076 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Dec 08 20:59:00 2010 +0000
+++ b/ChangeLog	Thu Dec 09 17:41:47 2010 +0000
@@ -1,3 +1,261 @@
+2010-12-09  Andrew John Hughes  <ahughes@redhat.com>
+
+	Remove NetX and the IcedTea plugin; now developed
+	in IcedTea-Web.
+	* NEWS: Updated.
+	* extra/net/sourceforge/jnlp/about/HTMLPanel.java,
+	* extra/net/sourceforge/jnlp/about/Main.java,
+	* extra/net/sourceforge/jnlp/about/resources/about.html,
+	* extra/net/sourceforge/jnlp/about/resources/applications.html,
+	* extra/net/sourceforge/jnlp/about/resources/notes.html,
+	* netx/javax/jnlp/BasicService.java,
+	* netx/javax/jnlp/ClipboardService.java,
+	* netx/javax/jnlp/DownloadService.java,
+	* netx/javax/jnlp/DownloadServiceListener.java,
+	* netx/javax/jnlp/ExtendedService.java,
+	* netx/javax/jnlp/ExtensionInstallerService.java,
+	* netx/javax/jnlp/FileContents.java,
+	* netx/javax/jnlp/FileOpenService.java,
+	* netx/javax/jnlp/FileSaveService.java,
+	* netx/javax/jnlp/JNLPRandomAccessFile.java,
+	* netx/javax/jnlp/PersistenceService.java,
+	* netx/javax/jnlp/PrintService.java,
+	* netx/javax/jnlp/ServiceManager.java,
+	* netx/javax/jnlp/ServiceManagerStub.java,
+	* netx/javax/jnlp/SingleInstanceListener.java,
+	* netx/javax/jnlp/SingleInstanceService.java,
+	* netx/javax/jnlp/UnavailableServiceException.java,
+	* netx/net/sourceforge/jnlp/AppletDesc.java,
+	* netx/net/sourceforge/jnlp/ApplicationDesc.java,
+	* netx/net/sourceforge/jnlp/AssociationDesc.java,
+	* netx/net/sourceforge/jnlp/ComponentDesc.java,
+	* netx/net/sourceforge/jnlp/DefaultLaunchHandler.java,
+	* netx/net/sourceforge/jnlp/ExtensionDesc.java,
+	* netx/net/sourceforge/jnlp/IconDesc.java,
+	* netx/net/sourceforge/jnlp/InformationDesc.java,
+	* netx/net/sourceforge/jnlp/InstallerDesc.java,
+	* netx/net/sourceforge/jnlp/JARDesc.java,
+	* netx/net/sourceforge/jnlp/JNLPFile.java,
+	* netx/net/sourceforge/jnlp/JNLPSplashScreen.java,
+	* netx/net/sourceforge/jnlp/JREDesc.java,
+	* netx/net/sourceforge/jnlp/LaunchException.java,
+	* netx/net/sourceforge/jnlp/LaunchHandler.java,
+	* netx/net/sourceforge/jnlp/Launcher.java,
+	* netx/net/sourceforge/jnlp/MenuDesc.java,
+	* netx/net/sourceforge/jnlp/NetxPanel.java,
+	* netx/net/sourceforge/jnlp/Node.java,
+	* netx/net/sourceforge/jnlp/PackageDesc.java,
+	* netx/net/sourceforge/jnlp/ParseException.java,
+	* netx/net/sourceforge/jnlp/Parser.java,
+	* netx/net/sourceforge/jnlp/PluginBridge.java,
+	* netx/net/sourceforge/jnlp/PropertyDesc.java,
+	* netx/net/sourceforge/jnlp/RelatedContentDesc.java,
+	* netx/net/sourceforge/jnlp/ResourcesDesc.java,
+	* netx/net/sourceforge/jnlp/SecurityDesc.java,
+	* netx/net/sourceforge/jnlp/ShortcutDesc.java,
+	* netx/net/sourceforge/jnlp/StreamEater.java,
+	* netx/net/sourceforge/jnlp/Version.java,
+	* netx/net/sourceforge/jnlp/cache/CacheEntry.java,
+	* netx/net/sourceforge/jnlp/cache/CacheUtil.java,
+	* netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java,
+	* netx/net/sourceforge/jnlp/cache/DownloadIndicator.java,
+	* netx/net/sourceforge/jnlp/cache/Resource.java,
+	* netx/net/sourceforge/jnlp/cache/ResourceTracker.java,
+	* netx/net/sourceforge/jnlp/cache/UpdatePolicy.java,
+	* netx/net/sourceforge/jnlp/cache/package.html,
+	* netx/net/sourceforge/jnlp/event/ApplicationEvent.java,
+	* netx/net/sourceforge/jnlp/event/ApplicationListener.java,
+	* netx/net/sourceforge/jnlp/event/DownloadEvent.java,
+	* netx/net/sourceforge/jnlp/event/DownloadListener.java,
+	* netx/net/sourceforge/jnlp/event/package.html,
+	* netx/net/sourceforge/jnlp/package.html,
+	* netx/net/sourceforge/jnlp/resources/Manifest.mf,
+	* netx/net/sourceforge/jnlp/resources/Messages.properties,
+	* netx/net/sourceforge/jnlp/resources/about.jnlp,
+	* netx/net/sourceforge/jnlp/resources/default.jnlp,
+	* netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java,
+	* netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java,
+	* netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java,
+	* netx/net/sourceforge/jnlp/runtime/AppletInstance.java,
+	* netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java,
+	* netx/net/sourceforge/jnlp/runtime/Boot.java,
+	* netx/net/sourceforge/jnlp/runtime/Boot13.java,
+	* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java,
+	* netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java,
+	* netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java,
+	* netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java,
+	* netx/net/sourceforge/jnlp/runtime/package.html,
+	* netx/net/sourceforge/jnlp/security/AccessWarningPane.java,
+	* netx/net/sourceforge/jnlp/security/AppletWarningPane.java,
+	* netx/net/sourceforge/jnlp/security/CertVerifier.java,
+	* netx/net/sourceforge/jnlp/security/CertWarningPane.java,
+	* netx/net/sourceforge/jnlp/security/CertsInfoPane.java,
+	* netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java,
+	* netx/net/sourceforge/jnlp/security/MoreInfoPane.java,
+	* netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java,
+	* netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java,
+	* netx/net/sourceforge/jnlp/security/SecurityUtil.java,
+	* netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java,
+	* netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java,
+	* netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java,
+	* netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java,
+	* netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java,
+	* netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java,
+	* netx/net/sourceforge/jnlp/services/InstanceExistsException.java,
+	* netx/net/sourceforge/jnlp/services/ServiceUtil.java,
+	* netx/net/sourceforge/jnlp/services/SingleInstanceLock.java,
+	* netx/net/sourceforge/jnlp/services/XBasicService.java,
+	* netx/net/sourceforge/jnlp/services/XClipboardService.java,
+	* netx/net/sourceforge/jnlp/services/XDownloadService.java,
+	* netx/net/sourceforge/jnlp/services/XExtendedService.java,
+	* netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java,
+	* netx/net/sourceforge/jnlp/services/XFileContents.java,
+	* netx/net/sourceforge/jnlp/services/XFileOpenService.java,
+	* netx/net/sourceforge/jnlp/services/XFileSaveService.java,
+	* netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java,
+	* netx/net/sourceforge/jnlp/services/XPersistenceService.java,
+	* netx/net/sourceforge/jnlp/services/XPrintService.java,
+	* netx/net/sourceforge/jnlp/services/XServiceManagerStub.java,
+	* netx/net/sourceforge/jnlp/services/XSingleInstanceService.java,
+	* netx/net/sourceforge/jnlp/services/package.html,
+	* netx/net/sourceforge/jnlp/tools/CharacterEncoder.java,
+	* netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java,
+	* netx/net/sourceforge/jnlp/tools/JarRunner.java,
+	* netx/net/sourceforge/jnlp/tools/JarSigner.java,
+	* netx/net/sourceforge/jnlp/tools/JarSignerResources.java,
+	* netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java,
+	* netx/net/sourceforge/jnlp/tools/KeyTool.java,
+	* netx/net/sourceforge/jnlp/util/FileUtils.java,
+	* netx/net/sourceforge/jnlp/util/PropertiesFile.java,
+	* netx/net/sourceforge/jnlp/util/Reflect.java,
+	* netx/net/sourceforge/jnlp/util/WeakList.java,
+	* netx/net/sourceforge/jnlp/util/XDesktopEntry.java,
+	* netx/net/sourceforge/nanoxml/XMLElement.java,
+	* netx/net/sourceforge/nanoxml/XMLParseException.java,
+	* patches/extensions/liveconnect-dist.patch,
+	* patches/extensions/liveconnect.patch,
+	* patches/extensions/netx-dist.patch,
+	* patches/extensions/netx-umask.patch,
+	* patches/extensions/netx.patch,
+	* plugin/icedteanp/IcedTeaJavaRequestProcessor.cc,
+	* plugin/icedteanp/IcedTeaJavaRequestProcessor.h,
+	* plugin/icedteanp/IcedTeaNPPlugin.cc,
+	* plugin/icedteanp/IcedTeaNPPlugin.h,
+	* plugin/icedteanp/IcedTeaPluginRequestProcessor.cc,
+	* plugin/icedteanp/IcedTeaPluginRequestProcessor.h,
+	* plugin/icedteanp/IcedTeaPluginUtils.cc,
+	* plugin/icedteanp/IcedTeaPluginUtils.h,
+	* plugin/icedteanp/IcedTeaRunnable.cc,
+	* plugin/icedteanp/IcedTeaRunnable.h,
+	* plugin/icedteanp/IcedTeaScriptablePluginObject.cc,
+	* plugin/icedteanp/IcedTeaScriptablePluginObject.h,
+	* plugin/icedteanp/java/netscape/javascript/JSException.java,
+	* plugin/icedteanp/java/netscape/javascript/JSObject.java,
+	* plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java,
+	* plugin/icedteanp/java/netscape/javascript/JSProxy.java,
+	* plugin/icedteanp/java/netscape/javascript/JSRunnable.java,
+	* plugin/icedteanp/java/netscape/javascript/JSUtil.java,
+	* plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java,
+	* plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java,
+	* plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java,
+	* plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java,
+	* plugin/icedteanp/java/sun/applet/JavaConsole.java,
+	* plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java,
+	* plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java,
+	* plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java,
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java,
+	* plugin/icedteanp/java/sun/applet/PluginCallRequest.java,
+	* plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java,
+	* plugin/icedteanp/java/sun/applet/PluginClassLoader.java,
+	* plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java,
+	* plugin/icedteanp/java/sun/applet/PluginCookieManager.java,
+	* plugin/icedteanp/java/sun/applet/PluginDebug.java,
+	* plugin/icedteanp/java/sun/applet/PluginException.java,
+	* plugin/icedteanp/java/sun/applet/PluginMain.java,
+	* plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java,
+	* plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java,
+	* plugin/icedteanp/java/sun/applet/PluginObjectStore.java,
+	* plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java,
+	* plugin/icedteanp/java/sun/applet/PluginProxySelector.java,
+	* plugin/icedteanp/java/sun/applet/PluginStreamHandler.java,
+	* plugin/icedteanp/java/sun/applet/RequestQueue.java,
+	* plugin/icedteanp/java/sun/applet/TestEnv.java,
+	* plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java,
+	* plugin/tests/LiveConnect/DummyObject.java,
+	* plugin/tests/LiveConnect/OverloadTestHelper1.java,
+	* plugin/tests/LiveConnect/OverloadTestHelper2.java,
+	* plugin/tests/LiveConnect/OverloadTestHelper3.java,
+	* plugin/tests/LiveConnect/PluginTest.java,
+	* plugin/tests/LiveConnect/build,
+	* plugin/tests/LiveConnect/common.js,
+	* plugin/tests/LiveConnect/index.html,
+	* plugin/tests/LiveConnect/jjs_eval_test.js,
+	* plugin/tests/LiveConnect/jjs_func_parameters_tests.js,
+	* plugin/tests/LiveConnect/jjs_func_rettype_tests.js,
+	* plugin/tests/LiveConnect/jjs_get_tests.js,
+	* plugin/tests/LiveConnect/jjs_set_tests.js,
+	* plugin/tests/LiveConnect/jsj_func_overload_tests.js,
+	* plugin/tests/LiveConnect/jsj_func_parameters_tests.js,
+	* plugin/tests/LiveConnect/jsj_func_rettype_tests.js,
+	* plugin/tests/LiveConnect/jsj_get_tests.js,
+	* plugin/tests/LiveConnect/jsj_set_tests.js,
+	* plugin/tests/LiveConnect/jsj_type_casting_tests.js,
+	* plugin/tests/LiveConnect/jsj_type_conversion_tests.js:
+	Remove plugin and NetX.
+	* Makefile.am:
+	Remove NetX and plugin variables, targets and aliases.
+	(JDK_CHANGESET): Update to pick up applet hole patch.
+	(JDK_SHA256SUM): Likewise.
+	(NETX_CLASSES): Removed.
+	(NETX_JAR): Likewise.
+	(NETX_SRC): Likewise.
+	(NETX_SRCDIR): Likewise.
+	(NETX_RESOURCE_DIR): Likewise.
+	(NETX_EXTRA_DIR): Likewise.
+	(PLUGIN_SRCDIR): Likewise.
+	(PLUGIN_BUILD_DIR): Likewise.
+	(LIVECONNECT_DIR): Likewise.
+	(LIVECONNECT_SRCS): Likewise.
+	(LIVECONNECT_CLASSES): Likewise.
+	(LIVECONNECT_JAR): Likewise.
+	(LIVECONNECT_SRC): Likewise.
+	(NETX_BOOTSTRAP_CLASSES): Likewise.
+	(ICEDTEA_BOOTSTRAP_CLASSES): Remove NETX_BOOTSTRAP_CLASSES.
+	(ICEDTEAPLUGIN_TARGET): Removed.
+	(JNLP_ABOUT_TARGET): Likewise.
+	(PLUGIN_TEST_SRCS): Likewise.
+	(ICEDTEA_PATCHES): Drop netx.patch, netx-dist.patch,
+	netx-umask.patch, liveconnect.patch, liveconnect-dist.patch.
+	(PLUGIN_VERSION): Removed.
+	(ICEDTEA_ENV): Don't pass ALT_NETX_DIST or ALT_LIVECONNECT_DIST.
+	(EXTRA_DIST): Drop extensions patch directory, extra, netx and
+	plugin source directories.
+	(clean-local): Remove dropped targets.
+	(.PHONY): Likewise.
+	(icedtea): Drop dependencies on plugin and liveconnect.  Remove
+	copying of plugin and javaws data.
+	(icedtea-debug): Likewise.
+	(icedtea-boot): Remove dead dependencies.
+	(PLUGIN_SRC): Removed.
+	(PLUGIN_OBJECTS): Likewise.
+	($(PLUGIN_BUILD_DIR)/%.o): Dropped target.
+	($(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so): Likewise.
+	(liveconnect-source-files): Likewise.
+	(liveconnect): Likewise.
+	(liveconnect-dist): Likewise.
+	(icedtea-npplugin): Likewise.
+	(clean-IcedTeaPlugin): Likewise.
+	(clean-liveconnect): Likewise.
+	(netx-source-files): Likewise.
+	(netx): Likewise.
+	(netx-dist): Likewise.
+	(clean-netx): Likewise.
+	(extra-source-files): Likewise.
+	(extra-class-files): Likewise.
+	(clean-extra): Likewise.
+	(extra-lib/about.jar): Likewise.
+	(plugin-tests): Likewise.
+
 2010-12-08  Andrew John Hughes  <ahughes@redhat.com>
 
 	* javac.in: Add missing semicolon.
--- a/Makefile.am	Wed Dec 08 20:59:00 2010 +0000
+++ b/Makefile.am	Thu Dec 09 17:41:47 2010 +0000
@@ -6,7 +6,7 @@
 HOTSPOT_CHANGESET = 81685aa89446
 JAXP_CHANGESET  = 43658f98c582
 JAXWS_CHANGESET = f3444af18aff
-JDK_CHANGESET = c981a387cd86
+JDK_CHANGESET = e7fc51780596
 LANGTOOLS_CHANGESET = fdf1b74d3437
 OPENJDK_CHANGESET = c94d1673451e
 
@@ -14,7 +14,7 @@
 HOTSPOT_SHA256SUM = 7ca6831eb7505c21b8607c7cf8d12cb182fca21c3a40c4696db737d56d80e54b
 JAXP_SHA256SUM = e0aa77b166b30d4d4052110956da831c59c43e22f8d6feeac62a06775bb083b6
 JAXWS_SHA256SUM = ff4124f3765ac5ebac5ecfd0391cb2a54857d80ac7f967f60630ce0879cfd1f4
-JDK_SHA256SUM = d211d0f1ec2baae5560e076eb60e313421c087e85ead4592256c2885a99d8b85
+JDK_SHA256SUM = 0a01f5c43c8ef895addbc6c75adf4046d200c7a0d95d8056fa4f127a1b87feec
 LANGTOOLS_SHA256SUM = d200c9bcf1c1805e0800a8cd8017e99ff6d12db14a1fcca8e9b67c59dc5ed448
 OPENJDK_SHA256SUM = d7a3a531f0e064898e511f08f1127447b9171adce21ae4cecb3bca84b3f7b531
 
@@ -58,9 +58,6 @@
 BOOT_BUILD_OUTPUT_DIR = $(BUILD_OUTPUT_DIR)-boot
 BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0
 RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar
-NETX_CLASSES = $(abs_top_builddir)/netx.build
-NETX_JAR = $(NETX_CLASSES)/lib/classes.jar
-NETX_SRC = $(NETX_CLASSES)/lib/src.zip
 ENDORSED_DIR = $(BOOT_DIR)/lib/endorsed
 CLS_DIR_BOOT = $(BOOT_BUILD_OUTPUT_DIR)/classes
 SERVER_DIR = hotspot/import/jre/lib/$(INSTALL_ARCH_DIR)/server
@@ -78,18 +75,6 @@
 CORBA = openjdk-boot/corba/src/share/classes
 JAXWS = $(BUILD_OUTPUT_DIR)/jaxws/drop/jaxws_src/src
 
-NETX_SRCDIR = netx
-NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources
-NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/jnlp/about/resources
-
-PLUGIN_SRCDIR=$(abs_top_srcdir)/plugin/icedteanp
-PLUGIN_BUILD_DIR=$(abs_top_builddir)/plugin.build/icedteanp
-LIVECONNECT_DIR = netscape sun/applet
-LIVECONNECT_SRCS = $(PLUGIN_SRCDIR)/java
-LIVECONNECT_CLASSES = $(abs_top_builddir)/liveconnect
-LIVECONNECT_JAR = $(LIVECONNECT_CLASSES)/lib/classes.jar
-LIVECONNECT_SRC = $(LIVECONNECT_CLASSES)/lib/src.zip
-
 PULSE_JAVA_DIR = $(abs_top_srcdir)/pulseaudio
 PULSE_JAVA_NATIVE_SRCDIR = $(PULSE_JAVA_DIR)/src/native
 PULSE_JAVA_NATIVE_SRCS = $(wildcard $(PULSE_JAVA_NATIVE_SRCDIR)/*.c)
@@ -139,23 +124,13 @@
 ICEDTEA_BOOTSTRAP_RESOURCES = \
 	$(LANGTOOLS)/com/sun/tools/javac/resources
 
-# PR43578 - java.security.CodeSource.getCodeSigners() missing
-# PR43582 - Missing javax.swing.JTable.setFillsViewportHeight
-# PR43585 - java.security.KeyStore.TrustedCertificateEntry class missing
-NETX_BOOTSTRAP_CLASSES = \
-	$(SHARE)/java/security/CodeSource.java \
-	$(SHARE)/javax/swing/JTable.java \
-	$(SHARE)/java/security/KeyStore.java
-
 # PR42003 - javax.swing.plaf.basic.BasicDirectoryModel
 # PR43389 - javax.management.StandardMBean
 ICEDTEA_BOOTSTRAP_CLASSES = \
 	$(SHARE)/javax/swing/plaf/basic/BasicDirectoryModel.java \
 	$(SHARE)/javax/management/StandardMBean.java \
 	$(SHARE)/java/nio/file/SimpleFileVisitor.java \
-	$(SHARE)/javax/management/modelmbean/ModelMBeanInfo.java \
-	$(NETX_BOOTSTRAP_CLASSES)
-
+	$(SHARE)/javax/management/modelmbean/ModelMBeanInfo.java
 endif
 
 # Settings for javac
@@ -198,11 +173,6 @@
   HS_URL = $(HOTSPOT_URL)
 endif
 
-if ENABLE_PLUGIN
-ICEDTEAPLUGIN_TARGET = stamps/icedtea-npplugin.stamp
-JNLP_ABOUT_TARGET = extra-lib/about.jar
-endif
-
 if ENABLE_PULSE_JAVA
 PULSE_JAVA_TARGET = stamps/pulse-java.stamp
 endif
@@ -279,8 +249,6 @@
 
 # Sources list
 
-PLUGIN_TEST_SRCS = $(abs_top_srcdir)/plugin/tests/LiveConnect/*.java
-
 REWRITER_SRCS = $(top_srcdir)/rewriter/com/redhat/rewriter/ClassRewriter.java
 
 # Patch list
@@ -335,9 +303,6 @@
 	patches/no-precompiled.patch \
 	patches/parisc.patch \
 	patches/sh4-support.patch \
-	patches/extensions/netx.patch \
-	patches/extensions/netx-dist.patch \
-	patches/extensions/netx-umask.patch \
 	patches/jtreg-httpTest.patch
 
 # Conditional patches
@@ -378,11 +343,6 @@
 	patches/systemtap-alloc-size-workaround.patch
 endif
 
-if ENABLE_PLUGIN
-ICEDTEA_PATCHES += patches/extensions/liveconnect.patch \
-	patches/extensions/liveconnect-dist.patch
-endif
-
 if ENABLE_NSS
 ICEDTEA_PATCHES += patches/icedtea-nss-config.patch
 else
@@ -478,8 +438,6 @@
 ICEDTEA_PKG = $(EMPTY) (${PKGVERSION})
 endif
 
-PLUGIN_VERSION = $(ICEDTEA_NAME) $(PACKAGE_VERSION)$(ICEDTEA_REV)$(ICEDTEA_PKG)
-
 ICEDTEA_ENV = \
 	ALT_JDK_IMPORT_PATH="$(BOOT_DIR)" \
 	ANT="$(ANT)" \
@@ -520,7 +478,6 @@
 	DISTRIBUTION_ID="$(DIST_ID)" \
 	DERIVATIVE_ID="$(ICEDTEA_NAME) $(PACKAGE_VERSION)$(ICEDTEA_REV)" \
 	ALT_JIBX_LIBS_PATH="$(JIBX_DEPS_DIR)" \
-	ALT_NETX_DIST="$(NETX_CLASSES)" \
 	DEBUG_CLASSFILES="true" \
 	DEBUG_BINARIES="true" \
 	DISABLE_INTREE_EC="true" \
@@ -559,11 +516,6 @@
 	RHINO_JAR="$(abs_top_builddir)/rhino/rhino.jar"
 endif
 
-if ENABLE_PLUGIN
-ICEDTEA_ENV += \
-	ALT_LIVECONNECT_DIST="$(LIVECONNECT_CLASSES)"
-endif
-
 # OpenJDK boot build environment.
 ICEDTEA_ENV_BOOT = $(ICEDTEA_ENV) \
 	BOOTCLASSPATH_CLS_RT="-bootclasspath $(CLS_DIR_BOOT):$(RUNTIME)" \
@@ -739,14 +691,12 @@
 	$(top_srcdir)/patches/boot/*.patch \
 	$(top_srcdir)/patches/cacao/*.patch \
 	$(top_srcdir)/patches/debian/*.patch \
-	$(top_srcdir)/patches/extensions/*.patch \
 	$(top_srcdir)/patches/security/*.patch \
-	tools-copy contrib extra overlays \
+	tools-copy contrib overlays \
 	javaws.png javaws.desktop \
 	jconsole.desktop policytool.desktop \
 	$(JTREG_SRCS) \
 	HACKING $(PULSEAUDIO_SRCS) fsg.sh \
-	$(top_srcdir)/plugin $(top_srcdir)/$(NETX_SRCDIR) \
 	hotspot.map autogen.sh \
 	tapset/hotspot.stp.in \
 	tapset/hotspot_jni.stp.in \
@@ -765,12 +715,11 @@
 
 clean-local: clean-jtreg clean-jtreg-reports clean-pulse-java \
  clean-icedtea clean-icedtea-boot clean-clone clean-clone-boot \
- clean-extra clean-netx clean-bootstrap-directory-stage1 clean-bootstrap-directory-stage2 \
+ clean-bootstrap-directory-stage1 clean-bootstrap-directory-stage2 \
  clean-bootstrap-directory-symlink-stage1 clean-bootstrap-directory-symlink-stage2 \
- clean-extract clean-generated clean-IcedTeaPlugin clean-liveconnect clean-native-ecj \
- clean-hgforest clean-icedtea-stage2 clean-icedtea-debug-stage2 clean-icedtea-stage1 \
- clean-add-zero clean-add-zero-debug clean-add-cacao clean-add-cacao-debug clean-rt \
- clean-rewrite-rhino clean-rewriter
+ clean-extract clean-generated clean-native-ecj clean-hgforest clean-icedtea-stage2 \
+ clean-icedtea-debug-stage2 clean-icedtea-stage1 clean-add-zero clean-add-zero-debug \
+ clean-add-cacao clean-add-cacao-debug clean-rt clean-rewrite-rhino clean-rewriter
 	if [ -e bootstrap ]; then \
 	  rmdir bootstrap ; \
 	fi
@@ -796,8 +745,8 @@
 	clean-bootstrap-directory-symlink-stage2 clean-bootstrap-directory-stage1 \
 	clean-bootstrap-directory-symlink-stage1 icedtea icedtea-debug \
 	clean-icedtea icedtea-stage2 clean-icedtea-boot \
-	clean-rt clean-IcedTeaPlugin hotspot hotspot-helper clean-extra clean-jtreg \
-	clean-jtreg-reports clean-netx clean-drops jtregcheck
+	clean-rt hotspot hotspot-helper clean-jtreg clean-jtreg-reports \
+	clean-drops jtregcheck
 
 env:
 	@echo 'unset JAVA_HOME'
@@ -1729,8 +1678,7 @@
 # you change it in the icedtea-debug target as well.
 stamps/icedtea.stamp: stamps/bootstrap-directory-symlink-stage2.stamp \
  stamps/download.stamp stamps/extract.stamp $(OPENJDK_TREE) \
- $(ICEDTEAPLUGIN_TARGET) $(JNLP_ABOUT_TARGET) stamps/cacao.stamp \
- stamps/netx-dist.stamp $(PULSE_JAVA_TARGET) stamps/rewrite-rhino.stamp
+ stamps/cacao.stamp $(PULSE_JAVA_TARGET) stamps/rewrite-rhino.stamp
 	$(ARCH_PREFIX) $(MAKE) \
 	  $(ICEDTEA_ENV) \
 	  -C openjdk/ \
@@ -1739,16 +1687,6 @@
 	mkdir -p $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)
 	mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext
 	mkdir -p $(BUILD_OUTPUT_DIR)/j2re-image/lib/ext 
-if ENABLE_PLUGIN
-	cp -pPRf $(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so \
-	  $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
-	cp -pPRf $(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so \
-	  $(BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)
-	cp $(top_srcdir)/$(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \
-	  $(BUILD_OUTPUT_DIR)/j2re-image/lib
-	cp $(top_srcdir)/$(NETX_RESOURCE_DIR)/about.jnlp extra-lib/about.jar \
-	  $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib
-endif
 if ENABLE_PULSE_JAVA
 	cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
@@ -1801,8 +1739,7 @@
 
 stamps/icedtea-debug.stamp: stamps/bootstrap-directory-symlink-stage2.stamp \
  stamps/download.stamp stamps/extract.stamp $(OPENJDK_TREE) \
- $(ICEDTEAPLUGIN_TARGET) $(JNLP_ABOUT_TARGET) stamps/cacao.stamp \
- stamps/netx-dist.stamp $(PULSE_JAVA_TARGET) stamps/rewrite-rhino.stamp
+ stamps/cacao.stamp $(PULSE_JAVA_TARGET) stamps/rewrite-rhino.stamp
 	$(ARCH_PREFIX) $(MAKE) \
 	  $(ICEDTEA_ENV) \
 	  -C openjdk/ \
@@ -1811,16 +1748,6 @@
 	mkdir -p $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)
 	mkdir -p $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/ext
 	mkdir -p $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/ext 
-if ENABLE_PLUGIN
-	cp -pPRf $(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so \
-	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
-	cp -pPRf $(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so \
-	  $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib/$(INSTALL_ARCH_DIR)
-	cp $(top_srcdir)/$(NETX_RESOURCE_DIR)/default.jnlp extra-lib/about.jar \
-	  $(DEBUG_BUILD_OUTPUT_DIR)/j2re-image/lib
-	cp $(top_srcdir)/$(NETX_RESOURCE_DIR)/default.jnlp extra-lib/about.jar \
-	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib
-endif
 if ENABLE_PULSE_JAVA
 	cp -pPRf $(PULSE_JAVA_NATIVE_BUILDDIR)/libpulse-java.so \
 	  $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
@@ -1896,8 +1823,8 @@
 # ===================
 
 stamps/icedtea-boot.stamp: stamps/bootstrap-directory-symlink-stage1.stamp \
- stamps/download.stamp $(OPENJDK_BOOT_TREE) stamps/netx-dist.stamp \
- $(ICEDTEAPLUGIN_TARGET) stamps/cacao.stamp stamps/rewrite-rhino.stamp
+ stamps/download.stamp $(OPENJDK_BOOT_TREE) stamps/cacao.stamp \
+ stamps/rewrite-rhino.stamp
 	$(ARCH_PREFIX) $(MAKE) \
 	  $(ICEDTEA_ENV_BOOT) \
 	  -C openjdk-boot \
@@ -1954,150 +1881,6 @@
 clean-icedtea-stage1:
 	rm -f stamps/icedtea-stage1.stamp
 
-# Plugin
-
-if ENABLE_PLUGIN
-# IcedTeaNPPlugin.so.
-# Separate compile and link invocations to ensure intermediate object
-# is listed before -l options.  See:
-# http://developer.mozilla.org/en/docs/XPCOM_Glue
-PLUGIN_SRC=IcedTeaNPPlugin.cc IcedTeaScriptablePluginObject.cc \
-	IcedTeaJavaRequestProcessor.cc IcedTeaPluginRequestProcessor.cc \
-	IcedTeaPluginUtils.cc
-
-PLUGIN_OBJECTS=IcedTeaNPPlugin.o IcedTeaScriptablePluginObject.o \
-	IcedTeaJavaRequestProcessor.o IcedTeaPluginRequestProcessor.o \
-	IcedTeaPluginUtils.o
-
-$(PLUGIN_BUILD_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc
-	mkdir -p $(PLUGIN_BUILD_DIR) && \
-	$(CXX) $(CXXFLAGS) \
-	  -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
-	  -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \
-	  -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \
-	  $(GLIB_CFLAGS) \
-	  $(GTK_CFLAGS) \
-	  $(MOZILLA_CFLAGS) \
-	  -fPIC -o $@ -c $<
-
-$(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so: $(addprefix $(PLUGIN_BUILD_DIR)/,$(PLUGIN_OBJECTS))
-	$(CXX) $(CXXFLAGS) \
-	  $(addprefix $(PLUGIN_BUILD_DIR)/,$(PLUGIN_OBJECTS)) \
-	  $(GLIB_LIBS) \
-	  $(GTK_LIBS) \
-	  $(MOZILLA_LIBS)\
-	  -shared -o $@
-
-liveconnect-source-files.txt:
-	find $(LIVECONNECT_SRCS) -name '*.java' | sort > $@
-	touch $@
-
-stamps/liveconnect.stamp: liveconnect-source-files.txt stamps/netx.stamp
-	mkdir -p $(LIVECONNECT_CLASSES)
-	$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-	  -d $(LIVECONNECT_CLASSES) \
-	  -classpath $(RUNTIME):$(NETX_CLASSES) \
-	  -sourcepath $(SOURCEPATH_DIRS) \
-	  -bootclasspath \'\' \
-	  @liveconnect-source-files.txt
-	mkdir -p stamps
-	touch $@
-
-stamps/liveconnect-dist.stamp: stamps/liveconnect.stamp
-	(cd $(LIVECONNECT_CLASSES) ; \
-	 mkdir -p lib ; \
-	 $(BOOT_DIR)/bin/jar cf $(LIVECONNECT_JAR) $(LIVECONNECT_DIR) ; \
-	 cp -pPR $(SRC_DIR_LINK) $(LIVECONNECT_SRCS) src; \
-	 find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \
-	 cd src ; \
-	 $(ZIP) -qr $(LIVECONNECT_SRC) ${LIVECONNECT_DIR} \
-        )
-	mkdir -p stamps
-	touch $@
-
-stamps/icedtea-npplugin.stamp: $(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so \
- stamps/liveconnect-dist.stamp
-	touch stamps/icedtea-npplugin.stamp
-endif
-
-clean-IcedTeaPlugin:
-	rm -f $(addprefix $(PLUGIN_BUILD_DIR)/,$(PLUGIN_OBJECTS))
-	rm -f $(PLUGIN_BUILD_DIR)/IcedTeaNPPlugin.so
-	if [ -e $(PLUGIN_BUILD_DIR) ] ; then \
-		rmdir $(PLUGIN_BUILD_DIR) ; \
-	fi
-	if [ -e plugin.build ] ; then \
-		rmdir plugin.build ; \
-	fi
-	rm -f stamps/icedtea-npplugin.stamp
-
-clean-liveconnect:
-	rm -rf $(LIVECONNECT_CLASSES)
-	rm -f stamps/liveconnect-dist.stamp
-	rm -f liveconnect-source-files.txt
-	rm -f stamps/liveconnect.stamp
-
-# NetX
-# requires availability of OpenJDK source code including
-# a patch applied to sun.plugin.AppletViewerPanel and generated sources
-
-netx-source-files.txt:
-	find $(top_srcdir)/$(NETX_SRCDIR) -name '*.java' | sort > $@
-
-stamps/netx.stamp: netx-source-files.txt stamps/rt.stamp
-	mkdir -p $(NETX_CLASSES)
-	$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-	    -d $(NETX_CLASSES) \
-	    -classpath $(RUNTIME) \
-	    -sourcepath $(top_srcdir)/$(NETX_SRCDIR):$(SOURCEPATH_DIRS) \
-	    -bootclasspath \'\' \
-	    @netx-source-files.txt ;
-	cp -r $(top_srcdir)/$(NETX_RESOURCE_DIR) $(NETX_CLASSES)/net/sourceforge/jnlp
-	chmod -R u+w $(NETX_CLASSES)/net/sourceforge/jnlp
-	mkdir -p stamps
-	touch $@
-
-stamps/netx-dist.stamp: stamps/netx.stamp
-	(cd $(NETX_CLASSES) ; \
-	 mkdir -p lib ; \
-	 $(BOOT_DIR)/bin/jar cf $(NETX_JAR) javax/jnlp net ; \
-	 cp -pPR $(SRC_DIR_LINK) $(abs_top_srcdir)/$(NETX_SRCDIR) src; \
-	 find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \
-	 cd src ; \
-	 $(BOOT_DIR)/bin/jar uf $(NETX_JAR) \
-	  `find . -type f -not -name '*.java'` ; \
-	 $(ZIP) -qr $(NETX_SRC) javax net )
-	mkdir -p stamps
-	touch $@
-
-clean-netx:
-	rm -rf $(NETX_CLASSES)
-	rm -f stamps/netx-dist.stamp
-	rm -f netx-source-files.txt
-	rm -f stamps/netx.stamp
-
-extra-source-files.txt:
-	find $(abs_top_srcdir)/extra -name '*.java' | sort > $@
-
-stamps/extra-class-files.stamp: extra-source-files.txt stamps/netx-dist.stamp
-	mkdir -p extra-lib
-	$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) -d extra-lib \
-	  -sourcepath $(abs_top_srcdir)/extra \
-	  -bootclasspath $(NETX_JAR):$(RUNTIME) @extra-source-files.txt
-	cp -r $(NETX_EXTRA_DIR) extra-lib/net/sourceforge/jnlp/about	
-	find extra-lib/net/sourceforge/jnlp/about -type f -exec chmod 640 '{}' ';' \
-	  -o -type d -exec chmod 750 '{}' ';'
-	mkdir -p stamps
-	touch $@
-
-clean-extra:
-	rm -rf extra-lib
-	rm -f stamps/extra-class-files.stamp
-	rm -f extra-source-files.txt
-
-extra-lib/about.jar: stamps/extra-class-files.stamp
-	$(BOOT_DIR)/bin/jar cf $@ -C extra-lib net
-
 # PulseAudio based mixer
 # (pulse-java)
 if ENABLE_PULSE_JAVA
@@ -2386,23 +2169,6 @@
 
 # end additional VMs
 
-# plugin tests
-
-if ENABLE_PLUGIN
-stamps/plugin-tests.stamp: $(PLUGIN_TEST_SRCS) $(ICEDTEAPLUGIN_TARGET)
-	mkdir -p plugin/tests/LiveConnect
-	$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
-	 -d plugin/tests/LiveConnect \
-	 -classpath $(LIVECONNECT_JAR) $(PLUGIN_TEST_SRCS) ;
-	$(BOOT_DIR)/bin/jar cf plugin/tests/LiveConnect/PluginTest.jar \
-	  plugin/tests/LiveConnect/*.class 
-	cp -pPR $(SRC_DIR_LINK) $(abs_top_srcdir)/plugin/tests/LiveConnect/*.{js,html} \
-	  plugin/tests/LiveConnect
-	echo "Done. Now load \"file://$(abs_top_builddir)/index.html\" in your browser" ; \
-	mkdir -p stamps
-	touch stamps/plugin-tests.stamp
-endif
-
 # jtreg
 
 stamps/jtreg.stamp: stamps/icedtea-stage2.stamp
@@ -2601,18 +2367,8 @@
 
 jtreg: stamps/jtreg.stamp
 
-liveconnect: stamps/liveconnect.stamp
-
-liveconnect-dist: stamps/liveconnect-dist.stamp
-
 native-ecj: stamps/native-ecj.stamp
 
-nbplatform: stamps/nbplatform.stamp
-
-netx: stamps/netx.stamp
-
-netx-dist: stamps/netx-dist.stamp
-
 overlay: stamps/overlay.stamp
 
 patch: stamps/patch.stamp
@@ -2623,10 +2379,6 @@
 
 patch-jaxws: stamps/patch-jaxws.stamp
 
-plugin: stamps/icedtea-npplugin.stamp
-
-plugin-tests: stamps/plugin-tests.stamp
-
 pulse-java: $(PULSE_JAVA_TARGET)
 
 rewriter: stamps/rewriter.stamp
--- a/extra/net/sourceforge/jnlp/about/HTMLPanel.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/* HTMLPanel.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.about;
-
-import java.awt.BorderLayout;
-import java.io.IOException;
-import java.net.URL;
-
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JEditorPane;
-
-public class HTMLPanel extends JPanel {
-
-	JEditorPane pane;
-	
-	public HTMLPanel(URL url) throws IOException {
-		super(new BorderLayout());
-		pane = new JEditorPane(url);
-		pane.setEditable(false);
-		JScrollPane scroller = new JScrollPane(pane);
-		add(scroller, BorderLayout.CENTER);
-	}
-}
--- a/extra/net/sourceforge/jnlp/about/Main.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/* Main.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.about;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.io.IOException;
-import java.net.URL;
-
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JTabbedPane;
-import javax.swing.UIManager;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-
-import net.sourceforge.jnlp.Launcher;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-public class Main extends JPanel implements HyperlinkListener {
-
-	private final String notes = "/net/sourceforge/jnlp/about/resources/notes.html";
-	private final String apps = "/net/sourceforge/jnlp/about/resources/applications.html";
-	private final String about = "/net/sourceforge/jnlp/about/resources/about.html";
-	JTabbedPane tabbedPane;
-
-	public Main() throws IOException {
-		super(new BorderLayout());
-		
-		HTMLPanel notesPanel = new HTMLPanel(getClass().getResource(notes));
-		HTMLPanel appsPanel = new HTMLPanel(getClass().getResource(apps));
-		HTMLPanel aboutPanel = new HTMLPanel(getClass().getResource(about));
-		
-		appsPanel.pane.addHyperlinkListener(this);
-		
-		tabbedPane = new JTabbedPane();
-
-		tabbedPane.add("About NetX", aboutPanel);
-		tabbedPane.add("Applications", appsPanel);
-		tabbedPane.add("Notes", notesPanel);
-		
-		tabbedPane.setPreferredSize(new Dimension(550,410));
-		add(tabbedPane, BorderLayout.CENTER);
-	}
-
-	private static void createAndShowGUI() {
-		JNLPRuntime.setExitClass(Main.class);
-		
-		try {
-			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-		} catch (Exception e) {	
-		}
-		
-		JFrame frame = new JFrame("About NetX");
-		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
-		Main demo = null;
-		try {
-			demo = new Main();
-		} catch (Exception e) {
-			e.printStackTrace();
-			System.exit(1);
-		}
-		demo.setOpaque(true);
-		frame.setContentPane(demo);
-		frame.pack();
-		centerDialog(frame);
-		frame.setVisible(true);
-	}
-	
-    private static void centerDialog(JFrame frame) {
-        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
-        Dimension dialogSize = frame.getSize();
-
-        frame.setLocation((screen.width - dialogSize.width)/2,
-            (screen.height - dialogSize.height)/2);
-    }
-
-	public static void main(String[] args) {
-		javax.swing.SwingUtilities.invokeLater(new Runnable() {
-			public void run() {
-				createAndShowGUI();
-			}
-		});
-	}
-
-	public void hyperlinkUpdate(HyperlinkEvent e) {
-		if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
-			URL url = e.getURL();
-
-			Launcher launcher = new Launcher(
-					JNLPRuntime.getDefaultLaunchHandler());
-			try {
-				launcher.launchBackground(url);
-			} catch (Exception ex) {
-				ex.printStackTrace();
-			}
-		}
-	}
-}
--- a/extra/net/sourceforge/jnlp/about/resources/about.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-    <head>
-        <title>
-        </title>
-    </head>
-    <body>
-        <b>NetX</b> is a high-quality JNLP client that executes
-        network-based applications.  
-        <br>NetX downloads code over the
-        network, caches it, and runs it in a secure sandbox
-        environment (unless signed).
-        <br><br><big><b>
-                Features of NetX:
-        </b></big>
-        <ul>
-            <li><b>Modular: </b>Easily add JNLP capabilities to an application.</li>
-            <li><b>Small Size: </b>Loads from a ~130K JAR file.</li>
-            <li><b>Saves Memory: </b>Launch programs in a shared JVM.</li>
-            <li><b>Fast startup:</b> Runs applications from a cache for fast starting. </li>
-            <li><b>Security:</b> Run any application in a sandbox or log its activities.</li>
-            <li><b>Auto-Update:</b> Applications can auto-update without special code.</li>
-            <li><b>Network Deployment:</b> Deploy to the internet, not with installers. </li>
-            <li><b>Open Source:</b> GNU Lesser General Public License.</li>
-        </ul>
-    </body>
-</html>
-
--- a/extra/net/sourceforge/jnlp/about/resources/applications.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>Applications</title>
-</head>
-<body>
-
-<big><b>Sample Applications:</b></big><br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://www.jGoodies.com/download/jdiskreport/jdiskreport.jnlp">jDiskReport</a> -</b> http://www.jGoodies.com/download/jdiskreport/jdiskreport.jnlp<br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://www.jgoodies.com/download/jpathreport/jpathreport.jnlp">jPathReport</a> -</b> http://www.jgoodies.com/download/jpathreport/jpathreport.jnlp<br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://www.L2FProd.com/software/skinlf/jnlp/demo.php">Skin L2F Demo</a> -</b> http://www.L2FProd.com/software/skinlf/jnlp/demo.php<br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://www.glub.com/products/secureftp/secureftp.jnlp">Secure FTP</a> -</b> http://www.glub.com/products/secureftp/secureftp.jnlp<br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://www.jext.org/apps/jext.jnlp">Jext</a> -</b> http://www.jext.org/apps/jext.jnlp<br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://www.javazoom.net/jlgui/jws/jlgui.jnlp">Java Music Player</a> -</b> http://www.javazoom.net/jlgui/jws/jlgui.jnlp<br>
-<br>
-<big><b>Apps using netx:</b></big><br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://jnlp.sourceforge.net/netx/start/start.jnlp">Java Start Button</a> -</b> http://jnlp.sourceforge.net/netx/start/start.jnlp<br>
-<br>
-<big><b>Sun Demos:</b></big><br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://java.sun.com/products/javawebstart/apps/swingset2.jnlp">SwingSet2</a> -</b> http://java.sun.com/products/javawebstart/apps/swingset2.jnlp<br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://java.sun.com/products/javawebstart/apps/notepad.jnlp">Notepad</a> -</b> http://java.sun.com/products/javawebstart/apps/notepad.jnlp<br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://java.sun.com/products/javawebstart/apps/draw.jnlp">Draw</a> -</b> http://java.sun.com/products/javawebstart/apps/draw.jnlp<br>
-<b>&nbsp;&nbsp;&nbsp;<a href="http://java.sun.com/products/javawebstart/apps/mg.jnlp">Military Game</a> -</b> http://java.sun.com/products/javawebstart/apps/mg.jnlp<br>
-<br>
-<big><b>Tests:</b></big><br>
-&nbsp;&nbsp;&nbsp;<a href="http://www.acm.vt.edu/~jmaxwell/security/SecurityTest.jnlp">Security Test</a><br>
-&nbsp;&nbsp;&nbsp;<a href="http://www.acm.vt.edu/~jmaxwell/security/SecurityTestSigned.jnlp">Security Test (signed)</a><br>
-&nbsp;&nbsp;&nbsp;<a href="http://www.acm.vt.edu/~jmaxwell/security/StrictTest.jnlp">Security Test (signed; fail strict JNLP)</a><br>
-&nbsp;&nbsp;&nbsp;<a href="http://www.acm.vt.edu/~jmaxwell/security/PermissionList.jnlp">Permission Test</a><br>
-&nbsp;&nbsp;&nbsp;<a href="http://www.acm.vt.edu/~jmaxwell/security/PermissionListSigned.jnlp">Permission Test (signed)</a>
-<table cellpadding="0" cellspacing="0" border="0">
-		<tbody><tr><td valign="Top" nowrap="true" bgcolor="#ffffff" width="500"><br>
-		</td></tr></tbody>
-</table>
-</body>
-</html>
Binary file extra/net/sourceforge/jnlp/about/resources/jamIcon.jpg has changed
--- a/extra/net/sourceforge/jnlp/about/resources/notes.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-	<head>
-		<title>Release Notes</title>
-	</head>
-	<body>
-	<br>
-	<table cellpadding="2" cellspacing="2" border="0" width="100%">
-		<tbody>
-		<tr>
-			<td valign="Top" width="15"></td>
-			<td valign="Top" width="100%">
-				<table cellpadding="0" cellspacing="0" border="0" align="Center">
-					<tbody>
-						<tr>
-							<td valign="Middle" align="Center" nowrap="true"><div align="Center">
-								<img src="jamIcon.jpg" alt="Jam Icon" width="87" height="84" align="Center">
-								</div>
-							</td>
-						</tr>
-						<tr>
-							<td valign="Middle" nowrap="true" align="Justify">
-								<div align="Center">
-								<big><b>Jon A. Maxwell</b></big><br>
-								developer<br>
-								<big><b>Joshua Sumali</b></big><br>
-								developer
-								</div>
-							</td>
-						</tr>
-					</tbody>
-				</table>
-			</td>
-		</tr>
-		</tbody>
-	</table>
-<br>
-<big><b>Release Notes</b></big>
-<br>
-<table cellpadding="0" cellspacing="0" border="0">
-	<tbody>
-		<tr>
-			<td valign="Top" width="15"><br></td>
-			
-
-			<td valign="Top"> 
-			NetX on IcedTea: Security Support
-			<ul>
-				<li> Full signed application support </li>
-				<li> User trusted certificates support </li>
-				<li> Some JNLP API Services implemented </li>
-				<li> Improved unsigned application sandboxing with JNLP API </li>
-			</ul>
-			</td>
-		</tr>
-		<tr>
-			<td valign="Top" width="15"><br></td>
-			<td valign="Top"> 
-			Version 0.5: Refines multi-app capabilities + native code support
-			<ul>
-				<li> Released under LGPL. </li> 
-				<li> Separate event queue, look and feel, etc for each application. </li> 
-				<li> Native code support. </li> 
-				<li> Supports headless mode. </li> 
-				<li> Internationalized messages. </li> 
-				<li> Uses NanoXML parser. </li> 
-				<li> Minor changes listed on project web site... </li> 
-			</ul>
-
-			</td>
-		</tr>
-	</tbody>
-</table>
-<b>Please visit the SourceForge site
-	<a href="http://jnlp.sourceforge.net/netx/index.html">
-		http://jnlp.sourceforge.net/netx/index.html
-	</a>
-	and the IcedTea site
-	<a href="http://iced-tea.org">http://iced-tea.org</a>
-	 for more information.</b><br>
-</body>
-</html>
--- a/netx/javax/jnlp/BasicService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface BasicService {
-
-  public java.net.URL getCodeBase();
-  public boolean isOffline();
-  public boolean showDocument(java.net.URL url);
-  public boolean isWebBrowserSupported();
-
-}
--- a/netx/javax/jnlp/ClipboardService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface ClipboardService {
-
-  public java.awt.datatransfer.Transferable getContents();
-  public void setContents(java.awt.datatransfer.Transferable contents);
-
-}
--- a/netx/javax/jnlp/DownloadService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface DownloadService {
-
-  public boolean isResourceCached(java.net.URL ref, java.lang.String version);
-  public boolean isPartCached(java.lang.String part);
-  public boolean isPartCached(java.lang.String[] parts);
-  public boolean isExtensionPartCached(java.net.URL ref, java.lang.String version, java.lang.String part);
-  public boolean isExtensionPartCached(java.net.URL ref, java.lang.String version, java.lang.String[] parts);
-  public void loadResource(java.net.URL ref, java.lang.String version, DownloadServiceListener progress) throws java.io.IOException;
-  public void loadPart(java.lang.String part, DownloadServiceListener progress) throws java.io.IOException;
-  public void loadPart(java.lang.String[] parts, DownloadServiceListener progress) throws java.io.IOException;
-  public void loadExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String part, DownloadServiceListener progress) throws java.io.IOException;
-  public void loadExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String[] parts, DownloadServiceListener progress) throws java.io.IOException;
-  public void removeResource(java.net.URL ref, java.lang.String version) throws java.io.IOException;
-  public void removePart(java.lang.String part) throws java.io.IOException;
-  public void removePart(java.lang.String[] parts) throws java.io.IOException;
-  public void removeExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String part) throws java.io.IOException;
-  public void removeExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String[] parts) throws java.io.IOException;
-  public DownloadServiceListener getDefaultProgressWindow();
-
-}
--- a/netx/javax/jnlp/DownloadServiceListener.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface DownloadServiceListener {
-
-  public void progress(java.net.URL url, java.lang.String version, long readSoFar, long total, int overallPercent);
-  public void validating(java.net.URL url, java.lang.String version, long entry, long total, int overallPercent);
-  public void upgradingArchive(java.net.URL url, java.lang.String version, int patchPercent, int overallPercent);
-  public void downloadFailed(java.net.URL url, java.lang.String version);
-
-}
--- a/netx/javax/jnlp/ExtendedService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package javax.jnlp;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * This interface provides a way for the JNLP application to open specific files
- * in the client's system. It asks permission from the user before opening any
- * files.
- *
- * @author <a href="mailto:omajid@redhat.com">Omair Majid</a>
- *
- */
-public interface ExtendedService {
-
-    /**
-     * Open a file on the client' system and return its contents. The user must
-     * grant permission to the application for this to work.
-     *
-     * @param file the file to open
-     * @return the opened file as a {@link FileContents} object
-     * @throws IOException on any io problems
-     */
-    FileContents openFile(File file) throws IOException;
-
-    /**
-     * Opens multiple files on the user's sytem and returns their contents as a
-     * {@link FileContents} array
-     *
-     * @param files the files to open
-     * @return an array of FileContents objects
-     * @throws IOException on any io problems
-     */
-    FileContents[] openFiles(File[] files) throws IOException;
-}
--- a/netx/javax/jnlp/ExtensionInstallerService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface ExtensionInstallerService {
-
-  public java.lang.String getInstallPath();
-  public java.lang.String getExtensionVersion();
-  public java.net.URL getExtensionLocation();
-  public void hideProgressBar();
-  public void hideStatusWindow();
-  public void setHeading(java.lang.String heading);
-  public void setStatus(java.lang.String status);
-  public void updateProgress(int value);
-  public void installSucceeded(boolean needsReboot);
-  public void installFailed();
-  public void setJREInfo(java.lang.String platformVersion, java.lang.String jrePath);
-  public void setNativeLibraryInfo(java.lang.String path);
-  public java.lang.String getInstalledJRE(java.net.URL url, java.lang.String version);
-
-}
--- a/netx/javax/jnlp/FileContents.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface FileContents {
-
-  public java.lang.String getName() throws java.io.IOException;
-  public java.io.InputStream getInputStream() throws java.io.IOException;
-  public java.io.OutputStream getOutputStream(boolean overwrite) throws java.io.IOException;
-  public long getLength() throws java.io.IOException;
-  public boolean canRead() throws java.io.IOException;
-  public boolean canWrite() throws java.io.IOException;
-  public JNLPRandomAccessFile getRandomAccessFile(java.lang.String mode) throws java.io.IOException;
-  public long getMaxLength() throws java.io.IOException;
-  public long setMaxLength(long maxlength) throws java.io.IOException;
-
-}
--- a/netx/javax/jnlp/FileOpenService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface FileOpenService {
-
-  public FileContents openFileDialog(java.lang.String pathHint, java.lang.String[] extensions) throws java.io.IOException;
-  public FileContents[] openMultiFileDialog(java.lang.String pathHint, java.lang.String[] extensions) throws java.io.IOException;
-
-}
--- a/netx/javax/jnlp/FileSaveService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface FileSaveService {
-
-  public FileContents saveFileDialog(java.lang.String pathHint, java.lang.String[] extensions, java.io.InputStream stream, java.lang.String name) throws java.io.IOException;
-  public FileContents saveAsFileDialog(java.lang.String pathHint, java.lang.String[] extensions, FileContents contents) throws java.io.IOException;
-
-}
--- a/netx/javax/jnlp/JNLPRandomAccessFile.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface JNLPRandomAccessFile {
-
-  public void close() throws java.io.IOException;
-  public long length() throws java.io.IOException;
-  public long getFilePointer() throws java.io.IOException;
-  public int read() throws java.io.IOException;
-  public int read(byte[] b, int off, int len) throws java.io.IOException;
-  public int read(byte[] b) throws java.io.IOException;
-  public void readFully(byte[] b) throws java.io.IOException;
-  public void readFully(byte[] b, int off, int len) throws java.io.IOException;
-  public int skipBytes(int n) throws java.io.IOException;
-  public boolean readBoolean() throws java.io.IOException;
-  public byte readByte() throws java.io.IOException;
-  public int readUnsignedByte() throws java.io.IOException;
-  public short readShort() throws java.io.IOException;
-  public int readUnsignedShort() throws java.io.IOException;
-  public char readChar() throws java.io.IOException;
-  public int readInt() throws java.io.IOException;
-  public long readLong() throws java.io.IOException;
-  public float readFloat() throws java.io.IOException;
-  public double readDouble() throws java.io.IOException;
-  public java.lang.String readLine() throws java.io.IOException;
-  public java.lang.String readUTF() throws java.io.IOException;
-  public void seek(long pos) throws java.io.IOException;
-  public void setLength(long newLength) throws java.io.IOException;
-  public void write(int b) throws java.io.IOException;
-  public void write(byte[] b) throws java.io.IOException;
-  public void write(byte[] b, int off, int len) throws java.io.IOException;
-  public void writeBoolean(boolean v) throws java.io.IOException;
-  public void writeByte(int v) throws java.io.IOException;
-  public void writeShort(int v) throws java.io.IOException;
-  public void writeChar(int v) throws java.io.IOException;
-  public void writeInt(int v) throws java.io.IOException;
-  public void writeLong(long v) throws java.io.IOException;
-  public void writeFloat(float v) throws java.io.IOException;
-  public void writeDouble(double v) throws java.io.IOException;
-  public void writeBytes(java.lang.String s) throws java.io.IOException;
-  public void writeChars(java.lang.String s) throws java.io.IOException;
-  public void writeUTF(java.lang.String str) throws java.io.IOException;
-
-}
--- a/netx/javax/jnlp/PersistenceService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-
-package javax.jnlp;
-
-public interface PersistenceService {
-
-  public static final int CACHED = 0;
-  public static final int TEMPORARY = 1;
-  public static final int DIRTY = 2;
-
-  public long create(java.net.URL url, long maxsize) throws java.net.MalformedURLException, java.io.IOException;
-  public FileContents get(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException, java.io.FileNotFoundException;
-  public void delete(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException;
-  public java.lang.String[] getNames(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException;
-  public int getTag(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException;
-  public void setTag(java.net.URL url, int tag) throws java.net.MalformedURLException, java.io.IOException;
-
-}
--- a/netx/javax/jnlp/PrintService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface PrintService {
-
-  public java.awt.print.PageFormat getDefaultPage();
-  public java.awt.print.PageFormat showPageFormatDialog(java.awt.print.PageFormat page);
-  public boolean print(java.awt.print.Pageable document);
-  public boolean print(java.awt.print.Printable painter);
-
-}
--- a/netx/javax/jnlp/ServiceManager.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-
-
-
-package javax.jnlp;
-
-import java.util.*;
-
-
-public final class ServiceManager {
-
-  private static ServiceManagerStub stub = null;
-
-  private static Map lookupTable = new HashMap(); // ensure lookup is idempotent
-
-  private ServiceManager() {
-    // says it can't be instantiated
-  }
-
-
-  public static java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException {
-    if (stub == null)
-      throw new UnavailableServiceException("service stub not set.");
-
-    synchronized(lookupTable) {
-      Object result = lookupTable.get(name);
-
-      if (result == null) {
-        result = stub.lookup(name);
-        if (result != null)
-          lookupTable.put(name, result);
-      }
-
-      if (result == null)
-        throw new UnavailableServiceException("service not available (stub returned null).");
-
-      return result;
-    }
-  }
-
-  public static java.lang.String[] getServiceNames() {
-    // should this return the required ones even though no stub??
-    if (stub == null)
-      return new String[0];
-
-    return stub.getServiceNames();
-  }
-
-  public static void setServiceManagerStub(ServiceManagerStub stub) {
-    if (ServiceManager.stub == null)
-      ServiceManager.stub = stub;
-  }
-
-}
--- a/netx/javax/jnlp/ServiceManagerStub.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-package javax.jnlp;
-
-public interface ServiceManagerStub {
-
-  public java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException;
-  public java.lang.String[] getServiceNames();
-
-}
--- a/netx/javax/jnlp/SingleInstanceListener.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package javax.jnlp;
-
-/**
- * This interface specifies a listener which is notified whenever a new instance
- * of the web start application is launched.
- *
- */
-public interface SingleInstanceListener {
-
-    /**
-     * This method is called when a new instance of the application is launched.
-     * The arguments passed to the new instance are passed into this method.
-     *
-     * @param arguments the arguments passed to the new instance of the
-     *        application
-     */
-    void newActivation(String[] arguments);
-
-}
--- a/netx/javax/jnlp/SingleInstanceService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package javax.jnlp;
-
-/**
- * The SingleInstanceService provides a way to ensure that only one instance of
- * the application is ever running - singleton behavior at the application
- * level.
- *
- */
-public interface SingleInstanceService {
-
-    /**
-     * Adds the specified SingleInstanceListener to the notification list. This
-     * listener is notified when a new instance of the application is started.
-     *
-     *
-     * @param listener the single instance listener to be added. No action is
-     *        performed if it is null.
-     */
-    void addSingleInstanceListener(SingleInstanceListener listener);
-
-    /**
-     * Removes the specified SingleInstanceListener from the notification list.
-     * This listener will not be notified if a new instance of the application
-     * is started.
-     *
-     * @param listener the single instance listener to be removed. No action is
-     *        performed if it is null or not in the notification list.
-     */
-    void removeSingleInstanceListener(SingleInstanceListener listener);
-}
--- a/netx/javax/jnlp/UnavailableServiceException.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-
-
-package javax.jnlp;
-
-public class UnavailableServiceException extends Exception {
-
-  public UnavailableServiceException() {
-    super();
-  }
-
-  public UnavailableServiceException(java.lang.String message) {
-    super(message);
-  }
-
-}
--- a/netx/net/sourceforge/jnlp/AppletDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * The applet-desc element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.8 $
- */
-public class AppletDesc {
-
-    /** the applet name */
-    private String name;
-
-    /** the main class name and package */
-    private String mainClass;
-
-    /** the document base */
-    private URL documentBase;
-
-    /** the width */
-    private int width;
-
-    /** the height */
-    private int height;
-
-    /** the parameters */
-    private Map parameters;
-
-
-    /**
-     * Create an Applet descriptor.
-     *
-     * @param name the applet name
-     * @param mainClass the main class name and package
-     * @param documentBase the document base
-     * @param width the width
-     * @param height the height
-     * @param parameters the parameters
-     */
-    public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, Map parameters) {
-        this.name = name;
-        this.mainClass = mainClass;
-        this.documentBase = documentBase;
-        this.width = width;
-        this.height = height;
-        this.parameters = new HashMap(parameters);
-    }
-
-    /**
-     * Returns the applet name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Returns the main class name
-     */
-    public String getMainClass() {
-        return mainClass;
-    }
-
-    /**
-     * Returns the document base
-     */
-    public URL getDocumentBase() {
-        return documentBase;
-    }
-
-    /**
-     * Returns the width
-     */
-    public int getWidth() {
-        return width;
-    }
-
-    /**
-     * Returns the height
-     */
-    public int getHeight() {
-        return height;
-    }
-
-    /**
-     * Returns the applet parameters
-     */
-    public Map getParameters() {
-        return new HashMap(parameters);
-    }
-
-    /**
-     * Adds a parameter to the applet.  If the parameter already
-     * exists then it is overwritten with the new value.  Adding a
-     * parameter will have no effect on already-running applets
-     * launched from this JNLP file.
-     */
-    public void addParameter(String name, String value) {
-        parameters.put(name, value);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/ApplicationDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * The application-desc element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.7 $
- */
-public class ApplicationDesc {
-
-    /** the main class name and package */
-    private String mainClass;
-
-    /** the arguments */
-    private String arguments[];
-
-
-    /**
-     * Create an Application descriptor.
-     *
-     * @param mainClass the main class name and package
-     * @param arguments the arguments
-     */
-    public ApplicationDesc(String mainClass, String arguments[]) {
-        this.mainClass = mainClass;
-        this.arguments = arguments;
-    }
-
-    /**
-     * Returns the main class name
-     */
-    public String getMainClass() {
-        return mainClass;
-    }
-
-    /**
-     * Returns the arguments
-     */
-    public String[] getArguments() {
-        return (String[]) arguments.clone();
-    }
-
-    /**
-     * Add an argument to the end of the arguments.
-     */
-    public void addArgument(String arg) {
-        ArrayList l = new ArrayList(Arrays.asList(arguments));
-        l.add(arg);
-
-        arguments = (String[]) l.toArray(arguments);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/AssociationDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp;
-
-public final class AssociationDesc {
-
-    /** the extensions this application wants to register with */
-    private String[] extensions;
-
-    /** the mime type for the association */
-    private String mimeType;
-
-    public AssociationDesc(String mimeType, String[] extensions) throws ParseException {
-        checkMimeType(mimeType);
-        this.mimeType = mimeType;
-        this.extensions = extensions;
-    }
-
-    /**
-     * Return the extensions for this association
-     */
-    public String[] getExtensions() {
-        return extensions;
-    }
-
-    /**
-     * Return the mimetype for this association
-     */
-    public String getMimeType() {
-        return mimeType;
-    }
-
-    /**
-     * Check for valid mimeType
-     * @param mimeType a mime type
-     * @throws ParseException if mimeType is an invalid MIME type
-     */
-    private void checkMimeType(String mimeType) throws ParseException {
-        // TODO check that mime type is valid
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/ComponentDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * The component-desc element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.6 $
- */
-public class ComponentDesc {
-
-    // this is for completeness and in case of changes to spec for components.
-
-    /**
-     * Create a component descriptor.
-     */
-    public ComponentDesc() {
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/DefaultLaunchHandler.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp;
-
-import net.sourceforge.jnlp.runtime.*;
-import net.sourceforge.jnlp.util.*;
-
-import java.awt.*;
-import java.util.*;
-import javax.swing.*;
-
-
-/**
- * This default implementation shows prints the exception to
- * stdout and if not in headless mode displays the exception in a
- * dialog.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.1 $
- */
-public class DefaultLaunchHandler implements LaunchHandler {
-
-    /**
-     * Called when the application could not be launched due to a
-     * fatal error, such as the inability to find the main class
-     * or non-parseable XML.
-     */
-    public void launchError(LaunchException exception) {
-        printMessage(exception);
-    }
-
-    /**
-     * Called when launching the application can not be launched
-     * due to an error that is not fatal.  For example a JNLP file
-     * that is not strictly correct yet does not necessarily
-     * prohibit the system from attempting to launch the
-     * application.
-     *
-     * @return true if the launch should continue, false to abort
-     */
-    public boolean launchWarning(LaunchException warning) {
-        printMessage(warning);
-        return true;
-    }
-
-    /**
-     * Called when a security validation error occurs while
-     * launching the application.
-     *
-     * @return true to allow the application to continue, false to stop it.
-     */
-    public boolean validationError(LaunchException security) {
-        printMessage(security);
-        return true;
-    }
-
-    /**
-     * Called when an application, applet, or installer has been
-     * launched successfully (the main method or applet start method
-     * returned normally).
-     *
-     * @param application the launched application instance
-     */
-    public void launchCompleted(ApplicationInstance application) {
-        //
-    }
-
-    /**
-     * Print a message to stdout.
-     */
-    protected void printMessage(LaunchException ex) {
-        StringBuffer result = new StringBuffer();
-        result.append("netx: ");
-        result.append(ex.getCategory());
-        if (ex.getSummary() != null) {
-            result.append(": ");
-            result.append(ex.getSummary());
-        }
-
-        if (JNLPRuntime.isDebug()) {
-            if (ex.getCause() != null)
-                ex.getCause().printStackTrace();
-            else
-                ex.printStackTrace();
-        }
-
-        Throwable causes[] = ex.getCauses();
-
-        for (int i=0; i < causes.length; i++) {
-            result.append(" (");
-            result.append(causes[i].getClass().getName());
-            result.append(" ");
-            result.append(causes[i].getMessage());
-            result.append(")");
-        }
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/ExtensionDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-
-/**
- * The extension element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.8 $
- */
-public class ExtensionDesc {
-
-    /** the extension name */
-    private String name;
-
-    /** the required extension version */
-    private Version version;
-
-    /** the location of the extension JNLP file */
-    private URL location;
-
-    /** the JNLPFile the extension refers to */
-    private JNLPFile file;
-
-    /** map from ext-part to local part */
-    private Map extToPart = new HashMap();
-
-    /** eager ext parts */
-    private List eagerExtParts = new ArrayList();
-
-
-    /**
-     * Create an extention descriptor.
-     *
-     * @param name the extension name
-     * @param version the required version of the extention JNLPFile
-     * @param location the location of the extention JNLP file
-     */
-    public ExtensionDesc(String name, Version version, URL location) {
-        this.name = name;
-        this.version = version;
-        this.location = location;
-    }
-
-    /**
-     * Adds an extension part to be downloaded when the specified
-     * part of the main JNLP file is loaded.  The extension part
-     * will be downloaded before the application is launched if the
-     * lazy value is false or the part is empty or null.
-     *
-     * @param extPart the part name in the extension file
-     * @param part the part name in the main file
-     * @param lazy whether to load the part before launching
-     */
-    protected void addPart(String extPart, String part, boolean lazy) {
-        extToPart.put(extPart, part);
-
-        if (!lazy || part == null || part.length() == 0)
-            eagerExtParts.add(extPart);
-    }
-
-    /**
-     * Returns the parts in the extension JNLP file mapped to the
-     * part of the main file.
-     */
-    public String[] getExtensionParts(String thisPart) {
-
-        return null;
-    }
-
-    /**
-     * Returns the name of the extension.
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Returns the required version of the extension JNLP file.
-     */
-    public Version getVersion() {
-        return version;
-    }
-
-    /**
-     * Returns the location of the extension JNLP file.
-     */
-    public URL getLocation() {
-        return location;
-    }
-
-    /**
-     * Resolves the extension by creating a JNLPFile from the file
-     * specified by the extension's location property.
-     *
-     * @throws IOException if the extension JNLPFile could not be resolved.
-     * @throws ParseException if the extension JNLPFile could not be
-     * parsed or was not a component or installer descriptor.
-     */
-    public void resolve() throws ParseException, IOException {
-        if (file == null) {
-            file = new JNLPFile(location);
-
-            if (JNLPRuntime.isDebug())
-                System.out.println("Resolve: "+file.getInformation().getTitle());
-
-            // check for it being an extension descriptor
-            if (!file.isComponent() && !file.isInstaller())
-                throw new ParseException(JNLPRuntime.getMessage("JInvalidExtensionDescriptor", new Object[] {name, location} ));
-        }
-
-    }
-
-    /**
-     * Returns a JNLPFile for the extension, or null if the JNLP
-     * file has not been resolved.
-     */
-    public JNLPFile getJNLPFile() {
-        return file;
-    }
-}
--- a/netx/net/sourceforge/jnlp/IconDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * The icon element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.8 $
- */
-public class IconDesc {
-
-    /** default icon */
-    public static final Object DEFAULT = "default";
-
-    /** selected icon */
-    public static final Object SELECTED = "selected";
-
-    /** disabled icon */
-    public static final Object DISABLED = "disabled";
-
-    /** rollover icon */
-    public static final Object ROLLOVER = "rollover";
-
-    /** splash icon */
-    public static final Object SPLASH = "splash";
-
-    /** destop shortcut icon */
-    public static final Object SHORTCUT = "shortcut";
-
-
-    /** the location of the icon */
-    private URL location;
-
-    /** the type of icon*/
-    private Object kind;
-
-    /** the width, or -1 if unknown*/
-    private int width;
-
-    /** the height, or -1 if unknown*/
-    private int height;
-
-    /** the depth, or -1 if unknown*/
-    private int depth;
-
-    /** the size, or -1 if unknown*/
-    private int size;
-
-
-    /**
-     * Creates an icon descriptor with the specified information.
-     *
-     * @param location the location of the icon
-     * @param kind the type of icon
-     * @param width the width, or -1 if unknown
-     * @param height the height, or -1 if unknown
-     * @param depth the depth, or -1 if unknown
-     * @param size the size, or -1 if unknown
-     */
-    IconDesc(URL location, Object kind, int width, int height, int depth, int size) {
-        this.location = location;
-        this.kind = kind;
-        this.width = width;
-        this.height = height;
-        this.depth = depth;
-        this.size = size;
-    }
-
-    /**
-     * Returns the location of the icon.
-     */
-    public URL getLocation() {
-        return location;
-    }
-
-    /**
-     * Returns the icon type.
-     */
-    public Object getKind() {
-        return kind;
-    }
-
-    /**
-     * Returns the icon width or -1 if not specified in the
-     * JNLPFile.
-     */
-    public int getWidth() {
-        return width;
-    }
-
-    /**
-     * Returns the icon height or -1 if not specified in the
-     * JNLPFile.
-     */
-    public int getHeight() {
-        return height;
-    }
-
-    /**
-     * Returns the icon size or -1 if not specified in the JNLPFile.
-     */
-    public int getSize() {
-        return size;
-    }
-
-    /**
-     * Returns the icon depth or -1 if not specified in the
-     * JNLPFile.
-     */
-    public int getDepth() {
-        return depth;
-    }
-
-
-}
--- a/netx/net/sourceforge/jnlp/InformationDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.awt.Dimension;
-import java.net.*;
-import java.util.*;
-
-/**
- * The information element.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.9 $
- */
-public class InformationDesc {
-
-    // There is an understanding between this class and the parser
-    // that description and icon types are keyed by "icon-"+kind and
-    // "description-"+kind, and that other types are keyed by their
-    // specification name.
-
-    /** one-line description */
-    public static final Object ONE_LINE= "oneline";
-
-    /** short description */
-    public static final Object SHORT= "short";
-
-    /** tooltip description */
-    public static final Object TOOLTIP= "tooltip";
-
-    /** default description */
-    public static final Object DEFAULT = "default";
-
-    /** the locales for the information */
-    private Locale locales[];
-
-    /** the data as list of key,value pairs */
-    private List info;
-
-    /** the JNLPFile this information is for */
-    private JNLPFile jnlpFile;
-
-
-    /**
-     * Create an information element object.
-     *
-     * @param jnlpFile file that the information is for
-     * @param locale the the information is for
-     */
-    public InformationDesc(JNLPFile jnlpFile, Locale locales[]) {
-        this.jnlpFile = jnlpFile;
-        this.locales = locales;
-    }
-
-    /**
-     * Returns the application's title.
-     */
-    public String getTitle() {
-        return (String) getItem("title");
-    }
-
-    /**
-     * Returns the application's vendor.
-     */
-    public String getVendor() {
-        return (String) getItem("vendor");
-    }
-
-    /**
-     * Returns the application's homepage.
-     */
-    public URL getHomepage() {
-        return (URL)getItem("homepage");
-    }
-
-    /**
-     * Returns the default description for the application.
-     */
-    public String getDescription() {
-        String result = getDescription(DEFAULT);
-
-        // try to find any description if default is null
-        if (result == null)
-            result = getDescription(ONE_LINE);
-        if (result == null)
-            result = getDescription(SHORT);
-        if (result == null)
-            result = getDescription(TOOLTIP);
-
-        return result;
-    }
-
-    /**
-     * Returns the application's description of the specified type.
-     *
-     * @param kind one of Information.SHORT, Information.ONE_LINE,
-     * Information.TOOLTIP, Information.DEFAULT
-     */
-    public String getDescription(Object kind) {
-        String result = (String) getItem("description-"+kind);
-        if (result == null)
-            return (String) getItem("description-"+DEFAULT);
-        else
-            return result;
-    }
-
-    /**
-     * Returns the icons specified by the JNLP file.
-     *
-     * @param kind one of IconDesc.SELECTED, IconDesc.DISABLED,
-     * IconDesc.ROLLOVER, IconDesc.SPLASH, IconDesc.DEFAULT
-     * @return an array of zero of more IconDescs of the specified icon type
-     */
-    public IconDesc[] getIcons(Object kind) {
-        List icons = getItems("icon-"+kind);
-
-        return (IconDesc[]) icons.toArray(new IconDesc[icons.size()]);
-    };
-
-    /**
-     * Returns the URL of the icon closest to the specified size and
-     * kind.  This method will not return an icon smaller than the
-     * specified width and height unless there are no other icons
-     * available.
-     *
-     * @param kind the kind of icon to get
-     * @param width desired width of icon
-     * @param height desired height of icon
-     * @return the closest icon by size or null if no icons declared
-     */
-    public URL getIconLocation(Object kind, int width, int height) {
-        IconDesc icons[] = getIcons(kind);
-        if (icons.length == 0)
-            return null;
-
-        IconDesc best = null;
-        for (int i=0; i < icons.length; i++) {
-            if (icons[i].getWidth() >= width &&
-                icons[i].getHeight() >= height) {
-                if (best == null)
-                    best = icons[i];
-
-                if (icons[i].getWidth() <= best.getWidth() && // Use <= so last specified of
-                    icons[i].getHeight() <= best.getHeight()) // equivalent icons is chosen.
-                    best = icons[i];
-            }
-        }
-
-        if (best == null)
-            best = icons[0];
-
-        return best.getLocation();
-    }
-
-    /**
-     * Returns the locales for the information.
-     */
-    public Locale[] getLocales() {
-        return locales;
-    }
-
-    /**
-     * Returns the JNLPFile the information is for.
-     */
-    public JNLPFile getJNLPFile() {
-        return jnlpFile;
-    }
-
-    /**
-     * Returns whether offline execution allowed.
-     */
-    public boolean isOfflineAllowed() {
-        return null != getItem("offline-allowed");
-    }
-
-    /**
-     * Returns whether the resources specified in the JNLP file may
-     * be shared by more than one instance in the same JVM
-     * (JNLP extension).  This is an extension to the JNLP spec and
-     * will always return false for standard JNLP files.
-     */
-    public boolean isSharingAllowed() {
-        return null != getItem("sharing-allowed");
-    }
-
-    /**
-     * Returns the associations specified in the JNLP file
-     */
-    public AssociationDesc[] getAssociations() {
-        List associations = getItems("association");
-
-        return (AssociationDesc[]) associations.toArray(new AssociationDesc[associations.size()]);
-    }
-
-    /**
-     * Returns the shortcut specified by this JNLP file
-     */
-    public ShortcutDesc getShortcut() {
-        return (ShortcutDesc) getItem("shortcut");
-    }
-
-    /**
-     * Returns the related-contents specified by this JNLP file
-     */
-    public RelatedContentDesc[] getRelatedContents() {
-        List relatedContents = getItems("related-content");
-
-        return (RelatedContentDesc[]) relatedContents.toArray(
-                new RelatedContentDesc[relatedContents.size()]);
-    }
-
-    /**
-     * Returns the last item matching the specified key.
-     */
-    protected Object getItem(Object key) {
-        List items = getItems(key);
-        if (items.size() == 0)
-            return null;
-        else
-            return items.get( items.size()-1 );
-    }
-
-    /**
-     * Returns all items matching the specified key.
-     */
-    protected List getItems(Object key) {
-        if (info == null)
-            return Collections.EMPTY_LIST;
-
-        List result = new ArrayList();
-        for (int i=0; i < info.size(); i+=2)
-            if (info.get(i).equals(key))
-                result.add( info.get(i+1) );
-
-        return result;
-    }
-
-    /**
-     * Add an information item (description, icon, etc) under a
-     * specified key name.
-     */
-    protected void addItem(String key, Object value) {
-        if (info == null)
-            info = new ArrayList();
-
-        info.add(key);
-        info.add(value);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/InstallerDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * The installer-desc element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.6 $
- */
-public class InstallerDesc {
-
-    /** the main class name and package. */
-    private String mainClass;
-
-
-    /**
-     * Creates a installer descriptor.
-     *
-     * @param mainClass main class name and package
-     */
-    public InstallerDesc(String mainClass) {
-        this.mainClass = mainClass;
-    }
-
-    /**
-     * Returns the main class name and package.
-     */
-    public String getMainClass() {
-        return mainClass;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/JARDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * The JAR element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.6 $
- */
-public class JARDesc {
-
-    /** the location of the JAR file */
-    private URL location;
-
-    /** the required JAR versions, or null */
-    private Version version;
-
-    /** the part name */
-    private String part;
-
-    /** whether to load the JAR on demand */
-    private boolean lazy;
-
-    /** whether the JAR contains the main class */
-    private boolean main;
-
-    /** whether the JAR contains native libraries */
-    private boolean nativeJar;
-
-    /** whether the JAR can be cached */
-    private boolean cacheable;
-
-    /**
-     * Create a JAR descriptor.
-     *
-     * @param location the location of the JAR file
-     * @param version the required JAR versions, or null
-     * @param part the part name, or null
-     * @param lazy whether to load the JAR on demand
-     * @param main whether the JAR contains the main class
-     * @param nativeJam whether the JAR contains native libraries
-     */
-    public JARDesc(URL location, Version version, String part, boolean lazy, boolean main, boolean nativeJar, boolean cacheable) {
-        this.location = location;
-        this.version = version;
-        this.part = part;
-        this.lazy = lazy;
-        this.main = main;
-        this.nativeJar = nativeJar;
-        this.cacheable = cacheable;
-    }
-
-    /**
-     * Returns the URL of the JAR file.
-     */
-    public URL getLocation() {
-        return location;
-    }
-
-    /**
-     * Returns the required version of the JAR file.
-     */
-    public Version getVersion() {
-        return version;
-    }
-
-    /**
-     * Returns the part name, or null if not specified in the JNLP
-     * file.
-     */
-    public String getPart() {
-        return part;
-    }
-
-    /**
-     * Returns true if the JAR file contains native code
-     * libraries.
-     */
-    public boolean isNative() {
-        return nativeJar;
-    }
-
-    // these both are included in case the spec adds a new value,
-    // where !lazy would no longer imply eager.
-
-    /**
-     * Returns true if the JAR file should be downloaded before
-     * starting the application.
-     */
-    public boolean isEager() {
-        return !lazy;
-    }
-
-    /**
-     * Returns true if the JAR file should be downloaded on demand.
-     */
-    public boolean isLazy() {
-        return lazy;
-    }
-
-    /**
-     * Returns true if the JNLP file defined this JAR as containing
-     * the main class.  If no JARs were defined as the main JAR then
-     * the first JAR should be used to locate the main class.
-     *
-     * @see ResourcesDesc#getMainJAR
-     */
-    public boolean isMain() {
-        return main;
-    }
-
-    /**
-     * Returns if this jar is cacheable
-     *
-     * @return Whether or not this jar is cacheable
-     */
-    public boolean isCacheable() {
-        return cacheable;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/JNLPFile.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,623 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-
-import net.sourceforge.jnlp.cache.ResourceTracker;
-import net.sourceforge.jnlp.cache.UpdatePolicy;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-/**
- * Provides methods to access the information in a Java Network
- * Launching Protocol (JNLP) file.  The Java Network Launching
- * Protocol specifies in an XML file the information needed to
- * load, cache, and run Java code over the network and in a secure
- * environment.<p>
- *
- * This class represents the overall information about a JNLP file
- * from the jnlp element.  Other information is accessed through
- * objects that represent the elements of a JNLP file
- * (information, resources, application-desc, etc).  References to
- * these objects are obtained by calling the getInformation,
- * getResources, getSecurity, etc methods.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.21 $
- */
-public class JNLPFile {
-
-    // todo: save the update policy, then if file was not updated
-    // then do not check resources for being updated.
-    //
-    // todo: make getLaunchInfo return a superclass that all the
-    // launch types implement (can get codebase from it).
-    //
-    // todo: currently does not filter resources by jvm version.
-    //
-
-    private static String R(String key) { return JNLPRuntime.getMessage(key); }
-
-    /** the location this JNLP file was created from */
-    protected URL sourceLocation = null;
-
-    /** the network location of this JNLP file */
-    protected URL fileLocation;
-
-    /** A key that uniquely identifies connected instances (main jnlp+ext) */
-    protected String uniqueKey = null;
-
-    /** the URL used to resolve relative URLs in the file */
-    protected URL codeBase;
-
-    /** file version */
-    protected Version fileVersion;
-
-    /** spec version */
-    protected Version specVersion;
-
-    /** information */
-    protected List info;
-
-    /** resources */
-    protected List resources;
-
-    /** additional resources not in JNLP file (from command line) */
-    protected ResourcesDesc sharedResources = new ResourcesDesc(this, null, null, null);
-
-    /** the application description */
-    protected Object launchType;
-
-    /** the security descriptor */
-    protected SecurityDesc security;
-
-    /** the default OS */
-    protected Locale defaultLocale = null;
-
-    /** the default arch */
-    protected String defaultOS = null;
-
-    /** the default jvm */
-    protected String defaultArch = null;
-
-    { // initialize defaults if security allows
-        try {
-            defaultLocale = Locale.getDefault();
-            defaultOS = System.getProperty("os.name");
-            defaultArch = System.getProperty("os.arch");
-        }
-        catch (SecurityException ex) {
-            // null values will still work, and app can set defaults later
-        }
-    }
-
-    /**
-     * Empty stub, allowing child classes to override the constructor
-     */
-    protected JNLPFile() {
-    }
-
-    /**
-     * Create a JNLPFile from a URL.
-     *
-     * @param location the location of the JNLP file
-     * @throws IOException if an IO exception occurred
-     * @throws ParseException if the JNLP file was invalid
-     */
-    public JNLPFile(URL location) throws IOException, ParseException {
-        this(location, false); // not strict
-    }
-
-    /**
-     * Create a JNLPFile from a URL checking for updates using the
-     * default policy.
-     *
-     * @param location the location of the JNLP file
-     * @param strict whether to enforce the spec when
-     * @throws IOException if an IO exception occurred
-     * @throws ParseException if the JNLP file was invalid
-     */
-    public JNLPFile(URL location, boolean strict) throws IOException, ParseException {
-        this(location, (Version) null, strict);
-    }
-
-    /**
-     * Create a JNLPFile from a URL and a Version checking for updates using
-     * the default policy.
-     *
-     * @param location the location of the JNLP file
-     * @param version the version of the JNLP file
-     * @param strict whether to enforce the spec when
-     * @throws IOException if an IO exception occurred
-     * @throws ParseException if the JNLP file was invalid
-     */
-    public JNLPFile(URL location, Version version, boolean strict) throws IOException, ParseException {
-        this(location, version, strict, JNLPRuntime.getDefaultUpdatePolicy());
-    }
-
-    /**
-     * Create a JNLPFile from a URL and a version, checking for updates
-     * using the specified policy.
-     *
-     * @param location the location of the JNLP file
-     * @param version the version of the JNLP file
-     * @param strict whether to enforce the spec when
-     * @param policy the update policy
-     * @throws IOException if an IO exception occurred
-     * @throws ParseException if the JNLP file was invalid
-     */
-    public JNLPFile(URL location, Version version, boolean strict, UpdatePolicy policy) throws IOException, ParseException {
-        Node root = Parser.getRootNode(openURL(location, version, policy));
-        parse(root, strict, location);
-
-        //Downloads the original jnlp file into the cache if possible
-        //(i.e. If the jnlp file being launched exist locally, but it
-        //originated from a website, then download the one from the website
-        //into the cache).
-        if (sourceLocation != null && location.getProtocol() == "file") {
-            openURL(sourceLocation, version, policy);
-        }
-
-        this.fileLocation = location;
-
-        this.uniqueKey = Calendar.getInstance().getTimeInMillis() + "-" +
-                         Math.abs(((new java.util.Random()).nextInt())) + "-" +
-                         location;
-
-        if (JNLPRuntime.isDebug())
-            System.err.println("UNIQUEKEY=" + this.uniqueKey);
-    }
-
-    /**
-     * Create a JNLPFile from a URL, parent URLm a version and checking for
-     * updates using the specified policy.
-     *
-     * @param location the location of the JNLP file
-     * @param uniqueKey A string that uniquely identifies connected instances
-     * @param version the version of the JNLP file
-     * @param strict whether to enforce the spec when
-     * @param policy the update policy
-     * @throws IOException if an IO exception occurred
-     * @throws ParseException if the JNLP file was invalid
-     */
-    public JNLPFile(URL location, String uniqueKey, Version version, boolean strict, UpdatePolicy policy) throws IOException, ParseException {
-        this(location, version, strict, policy);
-        this.uniqueKey = uniqueKey;
-
-        if (JNLPRuntime.isDebug())
-            System.err.println("UNIQUEKEY (override) =" + this.uniqueKey);
-    }
-
-    /**
-     * Create a JNLPFile from an input stream.
-     *
-     * @throws IOException if an IO exception occurred
-     * @throws ParseException if the JNLP file was invalid
-     */
-    public JNLPFile(InputStream input, boolean strict) throws ParseException {
-        parse(Parser.getRootNode(input), strict, null);
-    }
-
-    /**
-     * Create a JNLPFile from a character stream.
-     *
-     * @param input the stream
-     * @param strict whether to enforce the spec when
-     * @throws IOException if an IO exception occurred
-     * @throws ParseException if the JNLP file was invalid
-     */
-    private JNLPFile(Reader input, boolean strict) throws ParseException {
-        // todo: now that we are using NanoXML we can use a Reader
-        //parse(Parser.getRootNode(input), strict, null);
-    }
-
-
-    /**
-     * Open the jnlp file URL from the cache if there, otherwise
-     * download to the cache.  Called from constructor.
-     */
-    private static InputStream openURL(URL location, Version version, UpdatePolicy policy) throws IOException {
-        if (location == null || policy == null)
-            throw new IllegalArgumentException(R("NullParameter"));
-
-        try {
-            ResourceTracker tracker = new ResourceTracker(false); // no prefetch
-            tracker.addResource(location, version , policy);
-
-            return tracker.getInputStream(location);
-        }
-        catch (Exception ex) {
-            throw new IOException(ex.getMessage());
-        }
-    }
-
-    /**
-     * Returns the JNLP specification versions supported.
-     */
-    public static Version getSupportedVersions() {
-        return Parser.getSupportedVersions();
-    }
-
-    /**
-     * Returns the JNLP file's title.  This method returns the same
-     * value as InformationDesc.getTitle().
-     */
-    public String getTitle() {
-        return getInformation().getTitle();
-    }
-
-    /**
-     * Returns the JNLP file's network location as specified in the
-     * JNLP file.
-     */
-    public URL getSourceLocation() {
-        return sourceLocation;
-    }
-
-    /**
-     * Returns the location of the file parsed to create the JNLP
-     * file, or null if it was not created from a URL.
-     */
-    public URL getFileLocation() {
-        return fileLocation;
-    }
-
-    /**
-     * Returns the location of the parent file if it exists, null otherwise
-     */
-    public String getUniqueKey() {
-        return uniqueKey;
-    }
-
-    /**
-     * Returns the JNLP file's version.
-     */
-    public Version getFileVersion() {
-        return fileVersion;
-    }
-
-    /**
-     * Returns the specification version required by the file.
-     */
-    public Version getSpecVersion() {
-        return specVersion;
-    }
-
-    /**
-     * Returns the codebase URL for the JNLP file.
-     */
-    public URL getCodeBase() {
-        return codeBase;
-    }
-
-    /**
-     * Returns the information section of the JNLP file as viewed
-     * through the default locale.
-     */
-    public InformationDesc getInformation() {
-        return getInformation(defaultLocale);
-    }
-
-    /**
-     * Returns the information section of the JNLP file as viewed
-     * through the specified locale.
-     */
-    public InformationDesc getInformation(final Locale locale) {
-        return new InformationDesc(this, new Locale[] {locale}) {
-            protected List getItems(Object key) {
-                List result = new ArrayList();
-
-                for (int i=0; i < info.size(); i++) {
-                    InformationDesc infoDesc = (InformationDesc) info.get(i);
-
-                    if (localMatches(locale, infoDesc.getLocales()))
-                        if (localMatches(locale, infoDesc.getLocales()))
-                            result.addAll(infoDesc.getItems(key) );
-                }
-
-                return result;
-            }
-        };
-    }
-
-    /**
-     * Returns the security section of the JNLP file.
-     */
-    public SecurityDesc getSecurity() {
-        return security;
-    }
-
-    /**
-     * Returns the resources section of the JNLP file as viewed
-     * through the default locale and the os.name and os.arch
-     * properties.
-     */
-    public ResourcesDesc getResources() {
-        return getResources(defaultLocale, defaultOS, defaultArch);
-    }
-
-    /**
-     * Returns the information section of the JNLP file for the
-     * specified locale, os, and arch.
-     */
-    public ResourcesDesc getResources(final Locale locale, final String os, final String arch) {
-        return new ResourcesDesc(this, new Locale[] {locale}, new String[] {os}, new String[] {arch}) {
-            public List getResources(Class launchType) {
-                List result = new ArrayList();
-
-                for (int i=0; i < resources.size(); i++) {
-                    ResourcesDesc rescDesc = (ResourcesDesc) resources.get(i);
-
-                    if (localMatches(locale, rescDesc.getLocales())
-                        && stringMatches(os, rescDesc.getOS())
-                        && stringMatches(arch, rescDesc.getArch()))
-                        result.addAll(rescDesc.getResources(launchType) );
-                }
-
-                result.addAll(sharedResources.getResources(launchType));
-
-                return result;
-            }
-
-            public void addResource(Object resource) {
-                // todo: honor the current locale, os, arch values
-                sharedResources.addResource(resource);
-            }
-        };
-    }
-
-    /**
-     * Returns an object of one of the following types: AppletDesc,
-     * ApplicationDesc, InstallerDesc, and ComponentDesc.
-     */
-    public Object getLaunchInfo() {
-        return launchType;
-    }
-
-    /**
-     * Returns the launch information for an applet.
-     *
-     * @throws UnsupportedOperationException if there is no applet information
-     */
-    public AppletDesc getApplet() {
-        if (!isApplet())
-            throw new UnsupportedOperationException(R("JNotApplet"));
-
-        return (AppletDesc) launchType;
-    }
-
-    /**
-     * Returns the launch information for an application.
-     *
-     * @throws UnsupportedOperationException if there is no application information
-     */
-    public ApplicationDesc getApplication() {
-        if (!isApplication())
-            throw new UnsupportedOperationException(R("JNotApplication"));
-
-        return (ApplicationDesc) launchType;
-    }
-
-    /**
-     * Returns the launch information for a component.
-     *
-     * @throws UnsupportedOperationException if there is no component information
-     */
-    public ComponentDesc getComponent() {
-        if (!isComponent())
-            throw new UnsupportedOperationException(R("JNotComponent"));
-
-        return (ComponentDesc) launchType;
-    }
-
-    /**
-     * Returns the launch information for an installer.
-     *
-     * @throws UnsupportedOperationException if there is no installer information
-     */
-    public InstallerDesc getInstaller() {
-        if (!isInstaller())
-            throw new UnsupportedOperationException(R("NotInstaller"));
-
-        return (InstallerDesc) launchType;
-    }
-
-    /**
-     * Returns whether the lauch descriptor describes an Applet.
-     */
-    public boolean isApplet() {
-        return launchType instanceof AppletDesc;
-    }
-
-    /**
-     * Returns whether the lauch descriptor describes an Application.
-     */
-    public boolean isApplication() {
-        return launchType instanceof ApplicationDesc;
-    }
-
-    /**
-     * Returns whether the lauch descriptor describes a Component.
-     */
-    public boolean isComponent() {
-        return launchType instanceof ComponentDesc;
-    }
-
-    /**
-     * Returns whether the lauch descriptor describes an Installer.
-     */
-    public boolean isInstaller() {
-        return launchType instanceof InstallerDesc;
-    }
-
-    /**
-     * Sets the default view of the JNLP file returned by
-     * getInformation, getResources, etc.  If unset, the defaults
-     * are the properties os.name, os.arch, and the locale returned
-     * by Locale.getDefault().
-     */
-    public void setDefaults(String os, String arch, Locale locale) {
-        defaultOS = os;
-        defaultArch = arch;
-        defaultLocale = locale;
-    }
-
-
-    /**
-     * Returns whether a locale is matched by one of more other
-     * locales.  Only the non-empty language, country, and variant
-     * codes are compared; for example, a requested locale of
-     * Locale("","","") would always return true.
-     *
-     * @param requested the local
-     * @param available the available locales
-     * @return true if requested matches any of available, or if
-     * available is empty or null.
-     */
-    private boolean localMatches(Locale requested, Locale available[]) {
-        if (available == null || available.length == 0)
-            return true;
-
-        for (int i=0; i < available.length; i++) {
-            String language = requested.getLanguage(); // "" but never null
-            String country = requested.getCountry();
-            String variant = requested.getVariant();
-
-            if (!"".equals(language) && !language.equalsIgnoreCase(available[i].getLanguage()))
-                continue;
-            if (!"".equals(country) && !country.equalsIgnoreCase(available[i].getCountry()))
-                continue;
-            if (!"".equals(variant) && !variant.equalsIgnoreCase(available[i].getVariant()))
-                continue;
-
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns whether the string is a prefix for any of the strings
-     * in the specified array.
-     *
-     * @param prefixStr the prefix string
-     * @param available the strings to test
-     * @return true if prefixStr is a prefix of any strings in
-     * available, or if available is empty or null.
-     */
-    private boolean stringMatches(String prefixStr, String available[]) {
-        if (available == null || available.length == 0)
-            return true;
-
-        for (int i=0; i < available.length; i++)
-            if (available[i] != null && available[i].startsWith(prefixStr))
-                return true;
-
-        return false;
-    }
-
-    /**
-     * Initialize the JNLPFile fields. Private because it's called
-     * from the constructor.
-     *
-     * @param root the root node
-     * @param strict whether to enforce the spec when
-     * @param location the file location or null
-     */
-    private void parse(Node root, boolean strict, URL location) throws ParseException {
-        try {
-            //if (location != null)
-            //  location = new URL(location, "."); // remove filename
-
-            Parser parser = new Parser(this, location, root, strict, true); // true == allow extensions
-
-            // JNLP tag information
-            specVersion = parser.getSpecVersion();
-            fileVersion = parser.getFileVersion();
-            codeBase = parser.getCodeBase();
-            sourceLocation = parser.getFileLocation() != null ? parser.getFileLocation() : location;
-            info = parser.getInfo(root);
-            resources = parser.getResources(root, false); // false == not a j2se/java resources section
-            launchType = parser.getLauncher(root);
-            security = parser.getSecurity(root);
-        }
-        catch (ParseException ex) {
-            throw ex;
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            throw new RuntimeException(ex.toString());
-        }
-    }
-
-    /**
-     *
-     * @return true if the JNLP file specifies things that can only be
-     * applied on a new vm (eg: different max heap memory)
-     */
-    public boolean needsNewVM() {
-
-        if (getNewVMArgs().size() == 0) {
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-    /**
-     *  @return a list of args to pass to the new
-     *  JVM based on this JNLP file
-     */
-    public List<String> getNewVMArgs() {
-
-        List<String> newVMArgs = new LinkedList<String>();
-
-        JREDesc[] jres = getResources().getJREs();
-        for (int jreIndex = 0; jreIndex < jres.length; jreIndex++) {
-            String initialHeapSize = jres[jreIndex].getInitialHeapSize();
-            if (initialHeapSize != null) {
-                newVMArgs.add("-Xms" + initialHeapSize);
-            }
-
-            String maxHeapSize = jres[jreIndex].getMaximumHeapSize();
-            if (maxHeapSize != null) {
-                newVMArgs.add("-Xmx" + maxHeapSize);
-            }
-
-            String vmArgsFromJre = jres[jreIndex].getVMArgs();
-            if (vmArgsFromJre != null) {
-                String[] args = vmArgsFromJre.split(" ");
-                newVMArgs.addAll(Arrays.asList(args));
-            }
-        }
-
-        return newVMArgs;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/JNLPSplashScreen.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-package net.sourceforge.jnlp;
-
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.Insets;
-import java.awt.Toolkit;
-import java.io.IOException;
-import java.net.URL;
-
-import javax.imageio.ImageIO;
-import javax.swing.JFrame;
-
-import net.sourceforge.jnlp.cache.ResourceTracker;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-public class JNLPSplashScreen extends JFrame {
-
-    String applicationTitle;
-    String applicationVendor;
-
-    ResourceTracker resourceTracker;
-
-    URL splashImageUrl;
-    Image splashImage;
-
-    public JNLPSplashScreen(ResourceTracker resourceTracker,
-            String applicationTitle, String applicationVendor) {
-
-        // If the JNLP file does not contain any icon images, the splash image
-        // will consist of the application's title and vendor, as taken from the
-        // JNLP file.
-
-        this.resourceTracker = resourceTracker;
-        this.applicationTitle = applicationTitle;
-        this.applicationVendor = applicationVendor;
-
-    }
-
-    public void setSplashImageURL(URL url) {
-        splashImageUrl = url;
-        splashImage = null;
-        try {
-            splashImage = ImageIO.read(resourceTracker
-                    .getCacheFile(splashImageUrl));
-        } catch (IOException e) {
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("Error loading splash image: " + url);
-            }
-            splashImage = null;
-            return;
-        } catch (IllegalArgumentException argumentException) {
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("Error loading splash image: " + url);
-            }
-            splashImage = null;
-            return;
-        }
-
-        correctSize();
-    }
-
-    public boolean isSplashScreenValid() {
-        return (splashImage != null);
-    }
-
-    private void correctSize() {
-
-        Insets insets = getInsets();
-        int minimumWidth = splashImage.getWidth(null) + insets.left
-                + insets.right;
-        int minimumHeight = splashImage.getHeight(null) + insets.top
-                + insets.bottom;
-        setMinimumSize(new Dimension(minimumWidth, minimumHeight));
-
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        setLocation((screenSize.width - minimumWidth) / 2,
-                (screenSize.height - minimumHeight) / 2);
-    }
-
-    @Override
-    public void paint(Graphics g) {
-        if (splashImage == null) {
-            return;
-        }
-
-        correctSize();
-        Graphics2D g2 = (Graphics2D) g;
-        g2.drawImage(splashImage, getInsets().left, getInsets().top, null);
-
-    }
-}
--- a/netx/net/sourceforge/jnlp/JREDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-/**
- * The J2SE/Java element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.5 $
- */
-public class JREDesc {
-
-    /** the platform version or the product version if location is not null */
-    private Version version;
-
-    /** the location of a JRE product or null */
-    private URL location;
-
-    /** inital heap size */
-    private String initialHeapSize;
-
-    /** maximum head size */
-    private String maximumHeapSize;
-
-    /** args to pass to the vm */
-    private String vmArgs;
-
-    /** list of ResourceDesc objects */
-    private List resources;
-
-
-    /**
-     * Create a JRE descriptor.
-     *
-     * @param version the platform version or the product version
-     * if location is not null
-     * @param location the location of a JRE product or null
-     * @param initialHeapSize inital heap size
-     * @param maximumHeadSize maximum head size
-     * @param resources list of ResourceDesc objects
-     */
-    public JREDesc(Version version, URL location,
-            String vmArgs, String initialHeapSize,
-            String maximumHeapSize, List resources) throws ParseException {
-        this.version = version;
-        this.location = location;
-        this.vmArgs = vmArgs;
-        checkHeapSize(initialHeapSize);
-        this.initialHeapSize = initialHeapSize;
-        checkHeapSize(maximumHeapSize);
-        this.maximumHeapSize = maximumHeapSize;
-        this.resources = resources;
-    }
-
-    /**
-     * Returns the JRE version.  Use isPlatformVersion to
-     * determine if this version corresponds to a platform or
-     * product version.
-     */
-    public Version getVersion() {
-        return version;
-    }
-
-    /**
-     * Returns true if the JRE version is a Java platform version
-     * (java.specification.version property) or false if it is a
-     * product version (java.version property).
-     */
-    public boolean isPlatformVersion() {
-        return getLocation() == null;
-    }
-
-    /**
-     * Returns the JRE version string.
-     */
-    public URL getLocation() {
-        return location;
-    }
-
-    /**
-     * Returns the maximum heap size in bytes.
-     */
-    public String getMaximumHeapSize() {
-        return maximumHeapSize;
-    }
-
-    /**
-     * Returns the initial heap size in bytes.
-     */
-    public String getInitialHeapSize() {
-        return initialHeapSize;
-    }
-
-    /**
-     * Returns the resources defined for this JRE.
-     */
-    public List getResourcesDesc() {
-        return resources;
-    }
-
-    /**
-     * Returns the additional arguments to pass to the Java VM
-     * Can be null
-     */
-    public String getVMArgs() {
-        return vmArgs;
-    }
-
-    /**
-     * Check for valid heap size string
-     * @throws ParseException if heapSize is invalid
-     */
-    static private void checkHeapSize(String heapSize) throws ParseException {
-        // need to implement for completeness even though not used in netx
-        if (heapSize == null) {
-            return;
-        }
-
-        boolean lastCharacterIsDigit = true;
-        // the last character must be 0-9 or k/K/m/M
-        char lastChar = Character.toLowerCase(heapSize.charAt(heapSize.length()-1));
-        if ((lastChar < '0' || lastChar > '9')) {
-            lastCharacterIsDigit = false;
-            if (lastChar != 'k' && lastChar!= 'm' ) {
-                throw new ParseException(JNLPRuntime.getMessage("PBadHeapSize",new Object[] {heapSize}));
-            }
-        }
-
-        int indexOfLastDigit = heapSize.length() - 1;
-        if (!lastCharacterIsDigit) {
-            indexOfLastDigit = indexOfLastDigit - 1;
-        }
-
-        String size = heapSize.substring(0,indexOfLastDigit);
-        try {
-            // check that the number is a number!
-            Integer.valueOf(size);
-        } catch (NumberFormatException numberFormat) {
-            throw new ParseException(JNLPRuntime.getMessage("PBadHeapSize", new Object[] {heapSize}), numberFormat);
-        }
-
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/LaunchException.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.util.*;
-
-import net.sourceforge.jnlp.util.*;
-
-/**
- * Thrown when a JNLP application, applet, or installer could not
- * be created.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.9 $
- */
-public class LaunchException extends Exception {
-
-    /** the original exception */
-    private Throwable cause = null;
-
-    /** the file being launched */
-    private JNLPFile file;
-
-    /** the category of the exception */
-    private String category;
-
-    /** summary */
-    private String summary;
-
-    /** description of the action that was taking place */
-    private String description;
-
-    /** severity of the warning/error */
-    private String severity;
-
-
-    /**
-     * Creates a LaunchException without detail message.
-     */
-    public LaunchException(JNLPFile file, Exception cause, String severity, String category, String summary, String description) {
-        super(severity + ": " + category  + ": "+ summary);
-
-        this.file = file;
-        this.category = category;
-        this.summary = summary;
-        this.description = description;
-        this.severity = severity;
-
-        // replace with setCause when no longer 1.3 compatible
-        this.cause = cause;
-    }
-
-    /**
-     * Creates a LaunchException with a cause.
-     */
-    public LaunchException(Throwable cause) {
-        this(cause.getMessage());
-
-        // replace with setCause when no longer 1.3 compatible
-        this.cause = cause;
-    }
-
-    /**
-     * Creates a LaunchException with a cause and detail message
-     */
-    public LaunchException(String message, Throwable cause) {
-        this(message+": "+cause.getMessage());
-
-        // replace with setCause when no longer 1.3 compatible
-        this.cause = cause;
-    }
-
-    /**
-     * Constructs a LaunchException with the specified detail
-     * message.
-     *
-     * @param message the detail message
-     */
-    public LaunchException(String message) {
-        super(message);
-    }
-
-    /**
-     * Returns the JNLPFile being launched.
-     */
-    public JNLPFile getFile() {
-        return file;
-    }
-
-    /**
-     * Returns the category string, a short description of the
-     * exception suitable for displaying in a window title.
-     */
-    public String getCategory() {
-        return category;
-    }
-
-    /**
-     * Returns a one-sentence summary of the problem.
-     */
-    public String getSummary() {
-        return summary;
-    }
-
-    /**
-     * Return a description of the exception and the action being
-     * performed when the exception occurred.
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Returns a short description of the severity of the problem.
-     */
-    public String getSeverity() {
-        return severity;
-    }
-
-    /**
-     * Return the cause of the launch exception or null if there
-     * is no cause exception.
-     */
-    public Throwable getCause() {
-        return cause;
-    }
-
-    /**
-     * Returns the causes for this exception.  This method is
-     * useful on JRE 1.3 since getCause is not a standard method,
-     * and will be removed once netx no longer supports 1.3.
-     */
-    public Throwable[] getCauses() {
-        ArrayList result = new ArrayList();
-
-        Reflect r = new Reflect();
-        Throwable cause = this.cause;
-
-        while (cause != null) {
-            result.add(cause);
-            cause = (Throwable) r.invoke(cause, "getCause");
-        }
-
-        return (Throwable[]) result.toArray(new Throwable[0]);
-    }
-
-    /**
-     * Print the stack trace and the cause exception (1.3
-     * compatible)
-     */
-    public void printStackTrace(PrintStream stream) {
-        super.printStackTrace(stream);
-
-        if (cause != null) {
-            stream.println("Caused by: ");
-            cause.printStackTrace(stream);
-        }
-    }
-
-    /**
-     * Print the stack trace and the cause exception (1.3
-     * compatible)
-     */
-    public void printStackTrace(PrintWriter stream) {
-        super.printStackTrace(stream);
-
-        if (cause != null) {
-            stream.println("Caused by: ");
-            cause.printStackTrace(stream);
-        }
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/LaunchHandler.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp;
-
-import net.sourceforge.jnlp.runtime.*;
-
-/**
- * This optional interface is used to handle conditions that occur
- * while launching JNLP applications, applets, and installers.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.9 $
- */
-public interface LaunchHandler {
-
-    /**
-     * Called when the application could not be launched due to a
-     * fatal error, such as the inability to find the main class or
-     * non-parseable XML.
-     */
-    public void launchError(LaunchException exception);
-
-    /**
-     * Called when launching the application can not be launched due
-     * to an error that is not fatal.  For example a JNLP file that
-     * is not strictly correct yet does not necessarily prohibit the
-     * system from attempting to launch the application.
-     *
-     * @return true if the launch should continue, false to abort
-     */
-    public boolean launchWarning(LaunchException warning);
-
-    /**
-     * Called when a security validation error occurs while
-     * launching the application.
-     *
-     * @return true to allow the application to continue, false to stop it.
-     */
-    public boolean validationError(LaunchException security);
-    // this method will probably be replaced when real security
-    // controller is in place.
-
-    /**
-     * Called when an application, applet, or installer has been
-     * launched successfully (the main method or applet start method
-     * returned normally).
-     *
-     * @param application the launched application instance
-     */
-    public void launchCompleted(ApplicationInstance application);
-
-}
--- a/netx/net/sourceforge/jnlp/Launcher.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,784 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.applet.Applet;
-import java.awt.Container;
-import java.io.File;
-import java.lang.management.ManagementFactory;
-import java.lang.management.ThreadMXBean;
-import java.lang.reflect.Method;
-import java.net.InetAddress;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.jar.JarFile;
-
-import net.sourceforge.jnlp.cache.CacheUtil;
-import net.sourceforge.jnlp.cache.ResourceTracker;
-import net.sourceforge.jnlp.cache.UpdatePolicy;
-import net.sourceforge.jnlp.runtime.AppThreadGroup;
-import net.sourceforge.jnlp.runtime.AppletInstance;
-import net.sourceforge.jnlp.runtime.ApplicationInstance;
-import net.sourceforge.jnlp.runtime.JNLPClassLoader;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.services.InstanceExistsException;
-import net.sourceforge.jnlp.services.ServiceUtil;
-import net.sourceforge.jnlp.util.Reflect;
-
-/**
- * Launches JNLPFiles either in the foreground or background.<p>
- *
- * An optional LaunchHandler can be specified that is notified of
- * warning and error condition while launching and that indicates
- * whether a launch may proceed after a warning has occurred.  If
- * specified, the LaunchHandler is notified regardless of whether
- * the file is launched in the foreground or background.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.22 $
- */
-public class Launcher {
-
-    // defines class Launcher.BgRunner, Launcher.TgThread
-
-    /** shortcut for resources */
-    private static String R(String key) { return JNLPRuntime.getMessage(key); }
-
-    /** shared thread group */
-    private static final ThreadGroup mainGroup = new ThreadGroup(R("LAllThreadGroup"));
-
-    /** the handler */
-    private LaunchHandler handler = null;
-
-    /** the update policy */
-    private UpdatePolicy updatePolicy = JNLPRuntime.getDefaultUpdatePolicy();
-
-    /** whether to create an AppContext (if possible) */
-    private boolean context = true;
-
-    /** If the application should call System.exit on fatal errors */
-    private boolean exitOnFailure = true;
-
-    /**
-     * Create a launcher with the runtime's default update policy
-     * and launch handler.
-     */
-    public Launcher() {
-        this(null, null);
-
-        if (handler == null)
-            handler = JNLPRuntime.getDefaultLaunchHandler();
-    }
-
-    /**
-     * Create a launcher with the runtime's default update policy
-     * and launch handler.
-     *
-     * @param exitOnError Exit if there is an error (usually default, but false when being used from the plugin)
-     */
-    public Launcher(boolean exitOnFailure) {
-        this(null, null);
-
-        if (handler == null)
-            handler = JNLPRuntime.getDefaultLaunchHandler();
-
-        this.exitOnFailure = exitOnFailure;
-    }
-
-    /**
-     * Create a launcher with the specified handler and the
-     * runtime's default update policy.
-     *
-     * @param handler the handler to use or null for no handler.
-     */
-    public Launcher(LaunchHandler handler) {
-        this(handler, null);
-    }
-
-    /**
-     * Create a launcher with an optional handler using the
-     * specified update policy and launch handler.
-     *
-     * @param handler the handler to use or null for no handler.
-     * @param policy the update policy to use or null for default policy.
-     */
-    public Launcher(LaunchHandler handler, UpdatePolicy policy) {
-        if (policy == null)
-            policy = JNLPRuntime.getDefaultUpdatePolicy();
-
-        this.handler = handler;
-        this.updatePolicy = policy;
-    }
-
-    /**
-     * Sets the update policy used by launched applications.
-     */
-    public void setUpdatePolicy(UpdatePolicy policy) {
-        if (policy == null)
-            throw new IllegalArgumentException(R("LNullUpdatePolicy"));
-
-        this.updatePolicy = policy;
-    }
-
-    /**
-     * Returns the update policy used when launching applications.
-     */
-    public UpdatePolicy getUpdatePolicy() {
-        return updatePolicy;
-    }
-
-    /**
-     * Sets whether to launch the application in a new AppContext
-     * (a separate event queue, look and feel, etc).  If the
-     * sun.awt.SunToolkit class is not present then this method
-     * has no effect.  The default value is true.
-     */
-    public void setCreateAppContext(boolean context) {
-        this.context = context;
-    }
-
-    /**
-     * Returns whether applications are launched in their own
-     * AppContext.
-     */
-    public boolean isCreateAppContext() {
-        return this.context;
-    }
-
-    /**
-     * Launches a JNLP file by calling the launch method for the
-     * appropriate file type.  The application will be started in
-     * a new window.
-     *
-     * @param file the JNLP file to launch
-     * @return the application instance
-     * @throws LaunchException if an error occurred while launching (also sent to handler)
-     */
-    public ApplicationInstance launch(JNLPFile file) throws LaunchException {
-        return launch(file, null);
-    }
-
-    /**
-     * Launches a JNLP file inside the given container if it is an applet.  Specifying a
-     * container has no effect for Applcations and Installers.
-     *
-     * @param file the JNLP file to launch
-     * @param cont the container in which to place the application, if it is an applet
-     * @return the application instance
-     * @throws LaunchException if an error occurred while launching (also sent to handler)
-     */
-    public ApplicationInstance launch(JNLPFile file, Container cont) throws LaunchException {
-        TgThread tg;
-
-        //First checks whether offline-allowed tag is specified inside the jnlp
-        //file.
-        if (!file.getInformation().isOfflineAllowed()) {
-            try {
-                //Checks the offline/online status of the system.
-                //If system is offline do not launch.
-                InetAddress.getByName(file.getSourceLocation().getHost());
-
-            } catch (UnknownHostException ue) {
-                            System.err.println("File cannot be launched because offline-allowed tag not specified and system currently offline.");
-                return null;
-            } catch (Exception e) {
-                System.err.println(e);
-            }
-        }
-
-        if (file instanceof PluginBridge && cont != null)
-                tg = new TgThread(file, cont, true);
-        else if (cont == null)
-                tg = new TgThread(file);
-        else
-                tg = new TgThread(file, cont);
-
-        tg.start();
-
-        try {
-            tg.join();
-        }
-        catch (InterruptedException ex) {
-                        //By default, null is thrown here, and the message dialog is shown.
-            throw launchWarning(new LaunchException(file, ex, R("LSMinor"), R("LCSystem"), R("LThreadInterrupted"), R("LThreadInterruptedInfo")));
-        }
-
-        if (tg.getException() != null)
-            throw tg.getException(); // passed to handler when first created
-
-        if (handler != null)
-            handler.launchCompleted(tg.getApplication());
-
-        return tg.getApplication();
-    }
-
-    /**
-     * Launches a JNLP file by calling the launch method for the
-     * appropriate file type.
-     *
-     * @param location the URL of the JNLP file to launch
-     * @throws LaunchException if there was an exception
-     * @return the application instance
-     */
-    public ApplicationInstance launch(URL location) throws LaunchException {
-        return launch(toFile(location));
-    }
-
-    /**
-     * Launches a JNLP file by calling the launch method for the
-     * appropriate file type in a different thread.
-     *
-     * @param file the JNLP file to launch
-     */
-    public void launchBackground(JNLPFile file) {
-        BgRunner runner = new BgRunner(file, null);
-        new Thread(runner).start();
-    }
-
-    /**
-     * Launches the JNLP file at the specified location in the
-     * background by calling the launch method for its file type.
-     *
-     * @param location the location of the JNLP file
-     */
-    public void launchBackground(URL location) {
-        BgRunner runner = new BgRunner(null, location);
-        new Thread(runner).start();
-    }
-
-    /**
-     * Launches the JNLP file in a new JVM instance.  The launched
-     * application's output is sent to the system out and it's
-     * standard input channel is closed.
-     *
-     * @param vmArgs the arguments to pass to the new JVM. Can be empty but
-     *        must not be null.
-     * @param file the JNLP file to launch
-     * @param javawsArgs the arguments to pass to the javaws command. Can be
-     *        an empty list but must not be null.
-     * @throws LaunchException if there was an exception
-     */
-    public void launchExternal(List<String> vmArgs, JNLPFile file, List<String> javawsArgs) throws LaunchException {
-        List<String> updatedArgs = new LinkedList<String>(javawsArgs);
-
-        if (file.getFileLocation() != null)
-            updatedArgs.add(file.getFileLocation().toString());
-        else if (file.getSourceLocation() != null)
-            updatedArgs.add(file.getFileLocation().toString());
-        else
-            launchError(new LaunchException(file, null, R("LSFatal"), R("LCExternalLaunch"), R("LNullLocation"), R("LNullLocationInfo")));
-
-        launchExternal(vmArgs, updatedArgs);
-
-    }
-
-    /**
-     * Launches the JNLP file in a new JVM instance.  The launched
-     * application's output is sent to the system out and it's
-     * standard input channel is closed.
-     *
-     * @param url the URL of the JNLP file to launch
-     * @throws LaunchException if there was an exception
-     */
-    public void launchExternal(URL url) throws LaunchException {
-        List<String> javawsArgs = new LinkedList<String>();
-        javawsArgs.add(url.toString());
-        launchExternal(new LinkedList<String>(), javawsArgs);
-    }
-
-    /**
-     * Launches the JNLP file at the specified location in a new JVM
-     * instance.  The launched application's output is sent to the
-     * system out and it's standard input channel is closed.
-     * @param vmArgs the arguments to pass to the jvm
-     * @param javawsArgs the arguments to pass to javaws (aka Netx)
-     * @throws LaunchException if there was an exception
-     */
-    public void launchExternal(List<String> vmArgs, List<String> javawsArgs) throws LaunchException {
-        try {
-
-            List<String> commands = new LinkedList<String>();
-
-            String pathToWebstartBinary = System.getProperty("java.home") +
-                                      File.separatorChar +
-                                      "bin" +
-                                      File.separatorChar +
-                                      "javaws";
-            commands.add(pathToWebstartBinary);
-            // use -Jargument format to pass arguments to the JVM through the launcher
-            for (String arg: vmArgs) {
-                commands.add("-J" + arg);
-            }
-            commands.addAll(javawsArgs);
-
-            String[] command = commands.toArray(new String[] {});
-
-            Process p = Runtime.getRuntime().exec(command);
-            new StreamEater(p.getErrorStream()).start();
-            new StreamEater(p.getInputStream()).start();
-            p.getOutputStream().close();
-
-        }
-        catch (NullPointerException ex) {
-            throw launchError(new LaunchException(null, null, R("LSFatal"), R("LCExternalLaunch"), R("LNetxJarMissing"), R("LNetxJarMissingInfo")));
-        }
-        catch (Exception ex) {
-            throw launchError(new LaunchException(null, ex, R("LSFatal"), R("LCExternalLaunch"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")));
-        }
-    }
-
-    /**
-     * Returns the JNLPFile for the URL, with error handling.
-     */
-    private JNLPFile toFile(URL location) throws LaunchException {
-        try {
-            JNLPFile file = null;
-
-            try {
-                file = new JNLPFile(location, (Version) null, true, updatePolicy); // strict
-            }
-            catch (ParseException ex) {
-                file = new JNLPFile(location, (Version) null, false, updatePolicy);
-
-                // only here if strict failed but lax did not fail
-                LaunchException lex =
-                    launchWarning(new LaunchException(file, ex, R("LSMinor"), R("LCFileFormat"), R("LNotToSpec"), R("LNotToSpecInfo")));
-
-                if (lex != null)
-                    throw lex;
-            }
-
-            return file;
-        }
-        catch (Exception ex) {
-            if (ex instanceof LaunchException)
-                throw (LaunchException) ex; // already sent to handler when first thrown
-            else  // IO and Parse
-                throw launchError(new LaunchException(null, ex, R("LSFatal"), R("LCReadError"), R("LCantRead"), R("LCantReadInfo")));
-        }
-    }
-
-    /**
-     * Launches a JNLP application.  This method should be called
-     * from a thread in the application's thread group.
-     */
-    protected ApplicationInstance launchApplication(JNLPFile file) throws LaunchException {
-        if (!file.isApplication())
-            throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplication"), R("LNotApplicationInfo")));
-
-        try {
-
-            try {
-                ServiceUtil.checkExistingSingleInstance(file);
-            } catch (InstanceExistsException e) {
-                return null;
-            }
-
-            if (JNLPRuntime.getForksAllowed() && file.needsNewVM()) {
-                List<String> netxArguments = new LinkedList<String>();
-                netxArguments.add("-Xnofork");
-                netxArguments.addAll(JNLPRuntime.getInitialArguments());
-                launchExternal(file.getNewVMArgs(), netxArguments);
-                return null;
-            }
-
-            final int preferredWidth = 500;
-            final int preferredHeight = 400;
-            JNLPSplashScreen splashScreen = null;
-            URL splashImageURL = file.getInformation().getIconLocation(
-                    IconDesc.SPLASH, preferredWidth, preferredHeight);
-            if (splashImageURL != null) {
-                ResourceTracker resourceTracker = new ResourceTracker(true);
-                resourceTracker.addResource(splashImageURL, file.getFileVersion(), updatePolicy);
-                splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
-                splashScreen.setSplashImageURL(splashImageURL);
-                if (splashScreen.isSplashScreenValid()) {
-                    splashScreen.setVisible(true);
-                }
-            }
-
-
-            ApplicationInstance app = createApplication(file);
-            app.initialize();
-
-            String mainName = file.getApplication().getMainClass();
-
-            // When the application-desc field is empty, we should take a
-            // look at the main jar for the main class.
-            if (mainName == null) {
-                JARDesc mainJarDesc = file.getResources().getMainJAR();
-                File f = CacheUtil.getCacheFile(mainJarDesc.getLocation(), null);
-                if (f != null) {
-                        JarFile mainJar = new JarFile(f);
-                        mainName = mainJar.getManifest().
-                                getMainAttributes().getValue("Main-Class");
-                }
-            }
-
-            if (mainName == null)
-                throw launchError(new LaunchException(file, null,
-                        R("LSFatal"), R("LCClient"), R("LCantDetermineMainClass") ,
-                        R("LCantDetermineMainClassInfo")));
-
-            Class mainClass = app.getClassLoader().loadClass(mainName);
-
-            Method main = mainClass.getDeclaredMethod("main", new Class[] {String[].class} );
-            String args[] = file.getApplication().getArguments();
-
-            setContextClassLoaderForAllThreads(app.getThreadGroup(), app.getClassLoader());
-
-            if (splashScreen != null) {
-                if (splashScreen.isSplashScreenValid()) {
-                    splashScreen.setVisible(false);
-                }
-                splashScreen.dispose();
-            }
-
-            main.invoke(null, new Object[] { args } );
-
-            return app;
-        }
-        catch (LaunchException lex) {
-            throw launchError(lex);
-        }
-        catch (Exception ex) {
-            throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")));
-        }
-    }
-
-    /**
-     * Set the classloader as the context classloader for all threads in
-     * the given threadgroup. This is required to make some applications
-     * work. For example, an application that provides a custom Swing LnF
-     * may ask the swing thread to load resources from their JNLP, which
-     * would only work if the Swing thread knows about the JNLPClassLoader.
-     *
-     * @param tg The threadgroup for which the context classloader should be set
-     * @param classLoader the classloader to set as the context classloader
-     */
-    private void setContextClassLoaderForAllThreads(ThreadGroup tg, ClassLoader classLoader) {
-
-        /* be prepared for change in thread size */
-        int threadCountGuess = tg.activeCount();
-        Thread[] threads;
-        do {
-            threadCountGuess = threadCountGuess * 2;
-            threads = new Thread[threadCountGuess];
-            tg.enumerate(threads, true);
-        } while (threads[threadCountGuess-1] != null);
-
-
-        for (Thread thread: threads) {
-            if (thread != null) {
-                if (JNLPRuntime.isDebug()) {
-                    System.err.println("Setting " + classLoader + " as the classloader for thread " + thread.getName());
-                }
-                thread.setContextClassLoader(classLoader);
-            }
-        }
-
-    }
-
-    /**
-     * Launches a JNLP applet. This method should be called from a
-     * thread in the application's thread group.<p>
-     *
-     * The enableCodeBase parameter adds the applet's codebase to
-     * the locations searched for resources and classes.  This can
-     * slow down the applet loading but allows browser-style applets
-     * that don't use JAR files exclusively to be run from a applet
-     * JNLP file.  If the applet JNLP file does not specify any
-     * resources then the code base will be enabled regardless of
-     * the specified value.<p>
-     *
-     * @param file the JNLP file
-     * @param enableCodeBase whether to add the codebase URL to the classloader
-     */
-    protected ApplicationInstance launchApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException {
-        if (!file.isApplet())
-            throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplet"), R("LNotAppletInfo")));
-
-        try {
-            AppletInstance applet = createApplet(file, enableCodeBase, cont);
-            applet.initialize();
-
-            applet.getAppletEnvironment().startApplet(); // this should be a direct call to applet instance
-            return applet;
-        }
-        catch (LaunchException lex) {
-            throw launchError(lex);
-        }
-        catch (Exception ex) {
-            throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")));
-        }
-    }
-
-    /**
-     * Gets an ApplicationInstance, but does not launch the applet.
-     */
-    protected ApplicationInstance getApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException {
-        if (!file.isApplet())
-            throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplet"), R("LNotAppletInfo")));
-
-        try {
-            AppletInstance applet = createApplet(file, enableCodeBase, cont);
-            applet.initialize();
-            return applet;
-        }
-        catch (LaunchException lex) {
-            throw launchError(lex);
-        }
-        catch (Exception ex) {
-            throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")));
-        }
-    }
-
-    /**
-     * Launches a JNLP installer.  This method should be called from
-     * a thread in the application's thread group.
-     */
-    protected ApplicationInstance launchInstaller(JNLPFile file) throws LaunchException {
-        throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCNotSupported"), R("LNoInstallers"), R("LNoInstallersInfo")));
-    }
-
-    /**
-     * Create an AppletInstance.
-     *
-     * @param enableCodeBase whether to add the code base URL to the classloader
-     */
-    protected AppletInstance createApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException {
-        try {
-            JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy);
-
-            if (enableCodeBase || file.getResources().getJARs().length == 0)
-                loader.enableCodeBase();
-
-            AppThreadGroup group = (AppThreadGroup) Thread.currentThread().getThreadGroup();
-
-            String appletName = file.getApplet().getMainClass();
-
-                        //Classloader chokes if there's '/' in the path to the main class.
-                        //Must replace with '.' instead.
-                        appletName = appletName.replace('/', '.');
-            Class appletClass = loader.loadClass(appletName);
-            Applet applet = (Applet) appletClass.newInstance();
-
-            AppletInstance appletInstance;
-            if (cont == null)
-              appletInstance = new AppletInstance(file, group, loader, applet);
-            else
-              appletInstance = new AppletInstance(file, group, loader, applet, cont);
-
-            group.setApplication(appletInstance);
-            loader.setApplication(appletInstance);
-
-            setContextClassLoaderForAllThreads(appletInstance.getThreadGroup(), appletInstance.getClassLoader());
-
-            return appletInstance;
-        }
-        catch (Exception ex) {
-            throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplet"), R("LInitAppletInfo")));
-        }
-    }
-
-    /**
-     * Creates an Applet object from a JNLPFile. This is mainly to be used with
-     * gcjwebplugin.
-     * @param file the PluginBridge to be used.
-     * @param enableCodeBase whether to add the code base URL to the classloader.
-     */
-    protected Applet createAppletObject(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException {
-        try {
-            JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy);
-
-            if (enableCodeBase || file.getResources().getJARs().length == 0)
-                loader.enableCodeBase();
-
-            String appletName = file.getApplet().getMainClass();
-
-                        //Classloader chokes if there's '/' in the path to the main class.
-                        //Must replace with '.' instead.
-                        appletName = appletName.replace('/', '.');
-            Class appletClass = loader.loadClass(appletName);
-            Applet applet = (Applet) appletClass.newInstance();
-
-            return applet;
-        }
-        catch (Exception ex) {
-            throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplet"), R("LInitAppletInfo")));
-        }
-    }
-
-    /**
-     * Creates an Application.
-     */
-    protected ApplicationInstance createApplication(JNLPFile file) throws LaunchException {
-        try {
-            JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy);
-            AppThreadGroup group = (AppThreadGroup) Thread.currentThread().getThreadGroup();
-
-            ApplicationInstance app = new ApplicationInstance(file, group, loader);
-            group.setApplication(app);
-            loader.setApplication(app);
-
-            return app;
-        }
-        catch (Exception ex) {
-            throw new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplication"), R("LInitApplicationInfo"));
-        }
-    }
-
-    /**
-     * Create a thread group for the JNLP file.
-     */
-    protected AppThreadGroup createThreadGroup(JNLPFile file) {
-        return new AppThreadGroup(mainGroup, file.getTitle());
-    }
-
-    /**
-     * Send n launch error to the handler, if set, and also to the
-     * caller.
-     */
-    private LaunchException launchError(LaunchException ex) {
-        if (handler != null)
-            handler.launchError(ex);
-
-        return ex;
-    }
-
-    /**
-     * Send a launch error to the handler, if set, and to the
-     * caller only if the handler indicated that the launch should
-     * continue despite the warning.
-     *
-     * @return an exception to throw if the launch should be aborted, or null otherwise
-     */
-    private LaunchException launchWarning(LaunchException ex) {
-        if (handler != null)
-            if (!handler.launchWarning(ex))
-                // no need to destroy the app b/c it hasn't started
-                return ex; // chose to abort
-
-        return null; // chose to continue, or no handler
-    }
-
-
-
-    /**
-     * This runnable is used to call the appropriate launch method
-     * for the application, applet, or installer in its thread group.
-     */
-    private class TgThread extends Thread { // ThreadGroupThread
-        private JNLPFile file;
-        private ApplicationInstance application;
-        private LaunchException exception;
-        private Container cont;
-        private boolean isPlugin = false;
-
-        TgThread(JNLPFile file) {
-            this(file, null);
-        }
-
-        TgThread(JNLPFile file, Container cont) {
-            super(createThreadGroup(file), file.getTitle());
-
-            this.file = file;
-            this.cont = cont;
-        }
-
-        TgThread(JNLPFile file, Container cont, boolean isPlugin) {
-            super(createThreadGroup(file), file.getTitle());
-            this.file = file;
-            this.cont = cont;
-            this.isPlugin = isPlugin;
-        }
-
-        public void run() {
-            try {
-                // Do not create new AppContext if we're using NetX and gcjwebplugin.
-                if (context && !isPlugin)
-                        new Reflect().invokeStatic("sun.awt.SunToolkit", "createNewAppContext");
-
-                if (isPlugin) {
-                        // Do not display download indicators if we're using gcjwebplugin.
-                        JNLPRuntime.setDefaultDownloadIndicator(null);
-                        application = getApplet(file, true, cont);
-                } else {
-                        if (file.isApplication())
-                                application = launchApplication(file);
-                        else if (file.isApplet())
-                                application = launchApplet(file, true, cont); // enable applet code base
-                        else if (file.isInstaller())
-                                application = launchInstaller(file);
-                        else
-                                throw launchError(new LaunchException(file, null,
-                                                R("LSFatal"), R("LCClient"), R("LNotLaunchable"),
-                                                R("LNotLaunchableInfo")));
-                }
-            }
-            catch (LaunchException ex) {
-                ex.printStackTrace();
-                exception = ex;
-                // Exit if we can't launch the application.
-                if (exitOnFailure)
-                        System.exit(0);
-            }
-        }
-
-        public LaunchException getException() {
-            return exception;
-        }
-
-        public ApplicationInstance getApplication() {
-            return application;
-        }
-
-    };
-
-
-    /**
-     * This runnable is used by the <code>launchBackground</code>
-     * methods to launch a JNLP file from a separate thread.
-     */
-    private class BgRunner implements Runnable {
-        private JNLPFile file;
-        private URL location;
-
-        BgRunner(JNLPFile file, URL location) {
-            this.file = file;
-            this.location = location;
-        }
-
-        public void run() {
-            try {
-                if (file != null)
-                    launch(file);
-                if (location != null)
-                    launch(location);
-            }
-            catch (LaunchException ex) {
-                // launch method communicates error conditions to the
-                // handler if it exists, otherwise we don't care because
-                // there's nothing that can be done about the exception.
-            }
-        }
-    };
-
-}
--- a/netx/net/sourceforge/jnlp/MenuDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp;
-
-public class MenuDesc {
-
-    /** the submenu for this menu entry */
-    private String subMenu;
-
-    /**
-     * Create a new menu descriptor
-     */
-    public MenuDesc(String subMenu) {
-        this.subMenu = subMenu;
-    }
-
-    /**
-     * Returns the submenu for this menu entry.
-     */
-    public String getSubMenu() {
-        return subMenu;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/NetxPanel.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*
- * Copyright 2007 Red Hat, Inc.
- * This file is part of IcedTea, http://icedtea.classpath.org
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-package net.sourceforge.jnlp;
-
-import net.sourceforge.jnlp.runtime.AppletInstance;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-import java.net.URL;
-import java.util.Hashtable;
-
-import sun.applet.AppletViewerPanel;
-
-/**
- * This panel calls into netx to run an applet, and pipes the display
- * into a panel from gcjwebplugin.
- *
- * @author      Francis Kung <fkung@redhat.com>
- */
-public class NetxPanel extends AppletViewerPanel
-{
-    private PluginBridge bridge = null;
-    private boolean exitOnFailure = true;
-    private AppletInstance appInst = null;
-    private boolean appletAlive;
-
-    public NetxPanel(URL documentURL, Hashtable atts)
-    {
-        super(documentURL, atts);
-    }
-
-    // overloaded constructor, called when initialized via plugin
-    public NetxPanel(URL documentURL, Hashtable atts, boolean exitOnFailure)
-    {
-        this(documentURL, atts);
-        this.exitOnFailure = exitOnFailure;
-        this.appletAlive = true;
-    }
-
-    //Overriding to use Netx classloader. You might need to relax visibility
-    //in sun.applet.AppletPanel for runLoader().
-    protected void runLoader() {
-
-        try {
-                bridge = new PluginBridge(baseURL,
-                                getDocumentBase(),
-                                getJarFiles(),
-                                getCode(),
-                                getWidth(),
-                                getHeight(),
-                                atts);
-
-                synchronized(JNLPRuntime.initMutex) {
-                        //The custom NetX Policy and SecurityManager are set here.
-                        if (!JNLPRuntime.isInitialized()) {
-                            if (JNLPRuntime.isDebug())
-                                System.out.println("initializing JNLPRuntime...");
-
-                                JNLPRuntime.initialize(false);
-                        } else {
-                            if (JNLPRuntime.isDebug())
-                                System.out.println("JNLPRuntime already initialized");
-                        }
-                }
-
-                doInit = true;
-                dispatchAppletEvent(APPLET_LOADING, null);
-                status = APPLET_LOAD;
-
-                Launcher l = new Launcher(exitOnFailure);
-
-                try {
-                    appInst = (AppletInstance) l.launch(bridge, this);
-                } catch (LaunchException e) {
-                    // Assume user has indicated he does not trust the
-                    // applet.
-                        if (exitOnFailure)
-                                System.exit(0);
-                }
-                applet = appInst.getApplet();
-
-                //On the other hand, if you create an applet this way, it'll work
-                //fine. Note that you might to open visibility in sun.applet.AppletPanel
-                //for this to work (the loader field, and getClassLoader).
-                //loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey());
-                //applet = createApplet(loader);
-
-                // This shows that when using NetX's JNLPClassLoader, keyboard input
-                // won't make it to the applet, whereas using sun.applet.AppletClassLoader
-                // works just fine.
-
-                dispatchAppletEvent(APPLET_LOADING_COMPLETED, null);
-
-                if (applet != null)
-                {
-                        // Stick it in the frame
-                        applet.setStub(this);
-                        applet.setVisible(false);
-                        add("Center", applet);
-                        showAppletStatus("loaded");
-                        validate();
-                }
-        } catch (Exception e) {
-            this.appletAlive = false;
-                e.printStackTrace();
-        }
-    }
-
-    // Reminder: Relax visibility in sun.applet.AppletPanel
-    protected synchronized void createAppletThread() {
-        handler = new Thread(this);
-        handler.start();
-    }
-
-    public void updateSizeInAtts(int height, int width) {
-        this.atts.put("height", Integer.toString(height));
-        this.atts.put("width", Integer.toString(width));
-    }
-
-    public ClassLoader getAppletClassLoader() {
-        return appInst.getClassLoader();
-    }
-
-    public boolean isAlive() {
-        return handler != null && handler.isAlive() && this.appletAlive;
-    }
-}
--- a/netx/net/sourceforge/jnlp/Node.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-package net.sourceforge.jnlp;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import net.sourceforge.nanoxml.XMLElement;
-
-// this class makes assumptions on how parser calls methods (such
-// as getFirstChild->getNextChild only called by a single loop at
-// a time, so no need for an iterator).
-
-/**
- * This class converts the NanoXML's XMLElement nodes into the
- * regular XML Node interface (for the methods used by Parser).
- */
-/* NANO */
-class Node {
-    private XMLElement xml;
-    private Node next;
-    private Node children[];
-
-    Node(XMLElement xml) {
-        this.xml = xml;
-    }
-
-    Node getFirstChild() {
-        if (children == null)
-            getChildNodes();
-
-        if (children.length == 0)
-            return null;
-        else
-            return children[0];
-    }
-
-    Node getNextSibling() {
-        return next;
-    }
-
-    void normalize() {
-    }
-
-    String getNodeValue() {
-        return xml.getContent();
-    }
-
-    Node[] getChildNodes() {
-        if (children == null) {
-            List list = new ArrayList();
-
-            for (Enumeration e = xml.enumerateChildren(); e.hasMoreElements();)
-                list.add( new Node((XMLElement)e.nextElement()) );
-
-            children = (Node[]) list.toArray( new Node[list.size()] );
-
-            for (int i=0; i < children.length-1; i++)
-                children[i].next = children[i+1];
-        }
-
-        return children;
-    }
-
-    String getAttribute(String name) {
-        return (String)xml.getAttribute(name);
-    }
-
-    String getNodeName() {
-        if (xml.getName() == null)
-            return "";
-        else
-            return xml.getName();
-    }
-
-    public String toString() {
-        return getNodeName();
-    }
-}
-
-/**
- * This class converts the TinyXML's ParsedXML nodes into the
- * regular XML Node interface (for the methods used by Parser).
- */
-/* TINY
-class Node {
-    private ParsedXML tinyNode;
-    private Node next;
-    private Node children[];
-
-    Node(ParsedXML tinyNode) {
-        this.tinyNode = tinyNode;
-    }
-
-    Node getFirstChild() {
-        if (children == null)
-            getChildNodes();
-
-        if (children.length == 0)
-            return null;
-        else
-            return children[0];
-    }
-
-    Node getNextSibling() {
-        return next;
-    }
-
-    void normalize() {
-    }
-
-    String getNodeValue() {
-        return tinyNode.getContent();
-    }
-
-    Node[] getChildNodes() {
-        if (children == null) {
-            List list = new ArrayList();
-
-            for (Enumeration e = tinyNode.elements(); e.hasMoreElements();) {
-                list.add( new Node((ParsedXML)e.nextElement()) );
-            }
-            children = (Node[]) list.toArray( new Node[list.size()] );
-
-            for (int i=0; i < children.length-1; i++)
-                children[i].next = children[i+1];
-        }
-
-        return children;
-    }
-
-    String getAttribute(String name) {
-        return tinyNode.getAttribute(name);
-    }
-
-    String getNodeName() {
-        if (tinyNode.getName() == null)
-            return "";
-        else
-            return tinyNode.getName();
-    }
-
-    public String toString() {
-        return getNodeName();
-    }
-}
-*/
--- a/netx/net/sourceforge/jnlp/PackageDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * The package element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.6 $
- */
-public class PackageDesc {
-
-    /** the package name */
-    private String name;
-
-    /** the part required by the package */
-    private String part;
-
-    /** whether the package includes subpackages */
-    private boolean recursive;
-
-
-    /**
-     * Create a package descriptor.
-     *
-     * @param name the package name
-     * @param part the part required by the package
-     * @param recursive whether the package includes subpackages
-     */
-    public PackageDesc(String name, String part, boolean recursive) {
-        this.name = name;
-        this.part = part;
-        this.recursive = recursive;
-    }
-
-    /**
-     * Returns whether the specified class is part of this package.
-     *
-     * @param className the fully qualified class name
-     */
-    public boolean matches(String className) {
-        // form 1: exact class
-        if (name.equals(className))
-            return true;
-
-        // form 2: package.*
-        if (name.endsWith(".*")) {
-            String pkName = name.substring(0, name.length()-1);
-
-            if (className.startsWith(pkName)) {
-                String postfix = className.substring(pkName.length()+1);
-
-                if (recursive || -1 == postfix.indexOf("."))
-                    return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns the package name.
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Returns the part name.
-     */
-    public String getPart() {
-        return part;
-    }
-
-    /**
-     * Returns whether subpackages should be matched by this
-     * package.
-     */
-    public boolean isRecursive() {
-        return recursive;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/ParseException.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * Thrown to indicate that an error has occurred while parsing a
- * JNLP file.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.7 $
- */
-public class ParseException extends Exception {
-
-    // todo: add meaningful information, such as the invalid
-    // element, parse position, etc.
-
-    /** the original exception */
-    private Throwable cause = null;
-
-
-    /**
-     * Create a parse exception with the specified message.
-     */
-    public ParseException(String message) {
-        super(message);
-    }
-
-    /**
-     * Create a parse exception with the specified message and
-     * cause.
-     */
-    public ParseException(String message, Throwable cause) {
-        super(message);
-
-        // replace with setCause when no longer 1.3 compatible
-        this.cause = cause;
-    }
-
-    /**
-     * Return the cause of the launch exception or null if there
-     * is no cause exception.
-     */
-    public Throwable getCause() {
-        return cause;
-    }
-
-    /**
-     * Print the stack trace and the cause exception (1.3
-     * compatible)
-     */
-    public void printStackTrace(PrintStream stream) {
-        super.printStackTrace(stream);
-
-        if (cause != null) {
-            stream.println("Caused by: ");
-            cause.printStackTrace(stream);
-        }
-    }
-
-    /**
-     * Print the stack trace and the cause exception (1.3
-     * compatible)
-     */
-    public void printStackTrace(PrintWriter stream) {
-        super.printStackTrace(stream);
-
-        if (cause != null) {
-            stream.println("Caused by: ");
-            cause.printStackTrace(stream);
-        }
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/Parser.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1270 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-//import javax.xml.parsers.*; // commented to use right Node
-//import org.w3c.dom.*;       // class for using Tiny XML | NanoXML
-//import org.xml.sax.*;
-//import gd.xml.tiny.*;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.nanoxml.*;
-
-
-/**
- * Contains methods to parse an XML document into a JNLPFile.
- * Implements JNLP specification version 1.0.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.13 $
- */
-class Parser {
-
-    private static String R(String key) { return JNLPRuntime.getMessage(key); }
-    private static String R(String key, Object p1) { return R(key, p1, null); }
-    private static String R(String key, Object p1, Object p2) { return R(key, p1, p2, null); }
-    private static String R(String key, Object p1, Object p2, Object p3) { return JNLPRuntime.getMessage(key, new Object[] { p1, p2, p3 }); }
-
-
-    // defines netx.jnlp.Node class if using Tiny XML or Nano XML
-
-    // Currently uses the Nano XML parse.  Search for "SAX" or
-    // "TINY" or "NANO" and uncomment those blocks and comment the
-    // active ones (if any) to switch XML parsers.  Also
-    // (un)comment appropriate Node class at end of this file and
-    // do a clean build.
-
-    /**
-     * Ensure consistent error handling.
-     */
-    /* SAX
-    static ErrorHandler errorHandler = new ErrorHandler() {
-        public void error(SAXParseException exception) throws SAXParseException {
-            //throw exception;
-        }
-        public void fatalError(SAXParseException exception) throws SAXParseException {
-            //throw exception;
-        }
-        public void warning(SAXParseException exception) {
-            System.err.println("XML parse warning:");
-            exception.printStackTrace();
-        }
-    };
-    */
-
-
-    /** the supported JNLP file versions */
-    private static Version supportedVersions = new Version("1.0 1.5 6.0");
-
-    // fix: some descriptors need to use the jnlp file at a later
-    // date and having file ref lets us pass it to their
-    // constructors
-    //
-    /** the file reference */
-    private JNLPFile file; // do not use (uninitialized)
-
-    /** the root node */
-    private Node root;
-
-    /** the specification version */
-    private Version spec;
-
-    /** the base URL that all hrefs are relative to */
-    private URL base;
-
-    /** the codebase URL */
-    private URL codebase;
-
-    /** the file URL */
-    private URL fileLocation;
-
-    /** whether to throw errors on non-fatal errors. */
-    private boolean strict; // if strict==true parses a file with no error then strict==false should also
-
-    /** whether to allow extensions to the JNLP specification */
-    private boolean allowExtensions; // true if extensions to JNLP spec are ok
-
-
-    /**
-     * Create a parser for the JNLP file.  If the location
-     * parameters is not null it is used as the default codebase
-     * (does not override value of jnlp element's href
-     * attribute).<p>
-     *
-     * The root node may be normalized as a side effect of this
-     * constructor.
-     *
-     * @param file the (uninitialized) file reference
-     * @param base if codebase is not specified, a default base for relative URLs
-     * @param root the root node
-     * @param strict whether to enforce strict compliance with the JNLP spec
-     * @param allowExtensions whether to allow extensions to the JNLP spec
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public Parser(JNLPFile file, URL base, Node root, boolean strict, boolean allowExtensions) throws ParseException {
-        this.file = file;
-        this.root = root;
-        this.strict = strict;
-        this.allowExtensions = allowExtensions;
-
-        // ensure it's a JNLP node
-        if (root == null || !root.getNodeName().equals("jnlp"))
-            throw new ParseException(R("PInvalidRoot"));
-
-        // JNLP tag information
-        this.spec = getVersion(root, "spec", "1.0+");
-        this.codebase = addSlash(getURL(root, "codebase", base));
-        this.base = (codebase!=null) ? codebase : base; // if codebase not specified use default codebase
-        fileLocation = getURL(root, "href", this.base);
-
-        // ensure version is supported
-        if (!supportedVersions.matchesAny(spec))
-            throw new ParseException(R("PSpecUnsupported", supportedVersions));
-
-        // normalize the text nodes
-        root.normalize();
-    }
-
-    /**
-     * Return the JNLP specification versions supported.
-     */
-    public static Version getSupportedVersions() {
-        return supportedVersions;
-    }
-
-    /**
-     * Returns the file version.
-     */
-    public Version getFileVersion() {
-        return getVersion(root, "version", null);
-    }
-
-    /**
-     * Returns the file location.
-     */
-    public URL getFileLocation() {
-        return fileLocation;
-    }
-
-    /**
-     * Returns the codebase.
-     */
-    public URL getCodeBase() {
-        return codebase;
-    }
-
-    /**
-     * Returns the specification version.
-     */
-    public Version getSpecVersion() {
-        return spec;
-    }
-
-    //
-    // This section loads the resources elements
-    //
-
-    /**
-     * Returns all of the ResourcesDesc elements under the specified
-     * node (jnlp or j2se).
-     *
-     * @param parent the parent node (either jnlp or j2se)
-     * @param j2se true if the resources are located under a j2se or java node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public List getResources(Node parent, boolean j2se) throws ParseException {
-        List result = new ArrayList();
-        Node resources[] = getChildNodes(parent, "resources");
-
-        // ensure that there are at least one information section present
-        if (resources.length == 0 && !j2se)
-            throw new ParseException(R("PNoResources"));
-
-        // create objects from the resources sections
-        for (int i=0; i < resources.length; i++)
-            result.add(getResourcesDesc(resources[i], j2se));
-
-        return result;
-    }
-
-    /**
-     * Returns the ResourcesDesc element at the specified node.
-     *
-     * @param node the resources node
-     * @param j2se true if the resources are located under a j2se or java node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public ResourcesDesc getResourcesDesc(Node node, boolean j2se) throws ParseException {
-        boolean mainFlag = false; // if found a main tag
-
-        // create resources
-        ResourcesDesc resources =
-            new ResourcesDesc(file,
-                              getLocales(node),
-                              splitString(getAttribute(node, "os", null)),
-                              splitString(getAttribute(node, "arch", null)));
-
-        // step through the elements
-        Node child = node.getFirstChild();
-        while (child != null) {
-            String name = child.getNodeName();
-
-            // check for nativelib but no trusted environment
-            if ("nativelib".equals(name))
-                if (!isTrustedEnvironment())
-                    throw new ParseException(R("PUntrustedNative"));
-
-            if ("j2se".equals(name) || "java".equals(name)) {
-                if (getChildNode(root, "component-desc") != null)
-                    if (strict)
-                        throw new ParseException(R("PExtensionHasJ2SE"));
-                if (!j2se)
-                    resources.addResource( getJRE(child) );
-                else
-                    throw new ParseException(R("PInnerJ2SE"));
-            }
-
-            if ("jar".equals(name) || "nativelib".equals(name)) {
-                JARDesc jar = getJAR(child);
-
-                // check for duplicate main entries
-                if (jar.isMain()) {
-                    if (mainFlag == true)
-                        if (strict)
-                            throw new ParseException(R("PTwoMains"));
-                    mainFlag = true;
-                }
-
-                resources.addResource(jar);
-            }
-
-            if ("extension".equals(name))
-                resources.addResource( getExtension(child) );
-
-            if ("property".equals(name))
-                resources.addResource( getProperty(child) );
-
-            if ("package".equals(name))
-                resources.addResource( getPackage(child) );
-
-            child = child.getNextSibling();
-        }
-
-        return resources;
-    }
-
-    /**
-     * Returns the JRE element at the specified node.
-     *
-     * @param node the j2se/java node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public JREDesc getJRE(Node node) throws ParseException {
-        Version version = getVersion(node, "version", null);
-        URL location = getURL(node, "href", base);
-        String vmArgs = getAttribute(node, "java-vm-args",null);
-        try {
-            checkVMArgs(vmArgs);
-        } catch (IllegalArgumentException argumentException) {
-            vmArgs = null;
-        }
-        String initialHeap = getAttribute(node, "initial-heap-size", null);
-        String maxHeap = getAttribute(node, "max-heap-size", null);
-        List resources = getResources(node, true);
-
-        // require version attribute
-        getRequiredAttribute(node, "version", null);
-
-        return new JREDesc(version, location, vmArgs, initialHeap, maxHeap, resources);
-    }
-
-
-
-    /**
-     * Returns the JAR element at the specified node.
-     *
-     * @param node the jar or nativelib node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public JARDesc getJAR(Node node) throws ParseException {
-        boolean nativeJar = "nativelib".equals(node.getNodeName());
-        URL location = getRequiredURL(node, "href", base);
-        Version version = getVersion(node, "version", null);
-        String part = getAttribute(node, "part", null);
-        boolean main = "true".equals(getAttribute(node, "main", "false"));
-        boolean lazy = "lazy".equals(getAttribute(node, "download", "eager"));
-        int size = Integer.parseInt(getAttribute(node, "size", "0"));
-
-        if (nativeJar && main)
-            if (strict)
-                throw new ParseException(R("PNativeHasMain"));
-
-        return new JARDesc(location, version, part, lazy, main, nativeJar, true);
-
-    }
-
-    /**
-     * Returns the Extension element at the specified node.
-     *
-     * @param node the extension node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public ExtensionDesc getExtension(Node node) throws ParseException {
-        String name = getAttribute(node, "name", null);
-        Version version = getVersion(node, "version", null);
-        URL location = getRequiredURL(node, "href", base);
-
-        ExtensionDesc ext = new ExtensionDesc(name, version, location);
-
-        Node dload[] = getChildNodes(node, "ext-download");
-        for (int i=0; i < dload.length; i++) {
-            boolean lazy = "lazy".equals(getAttribute(dload[i], "download", "eager"));
-
-            ext.addPart(getRequiredAttribute(dload[i], "ext-part", null),
-                        getAttribute(dload[i], "part", null),
-                        lazy);
-        }
-
-        return ext;
-    }
-
-    /**
-     * Returns the Property element at the specified node.
-     *
-     * @param node the property node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public PropertyDesc getProperty(Node node) throws ParseException {
-        String name = getRequiredAttribute(node, "name", null);
-        String value = getRequiredAttribute(node, "value", "");
-
-        return new PropertyDesc(name, value);
-    }
-
-    /**
-     * Returns the Package element at the specified node.
-     *
-     * @param node the package node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public PackageDesc getPackage(Node node) throws ParseException {
-        String name = getRequiredAttribute(node, "name", null);
-        String part = getRequiredAttribute(node, "part", "");
-        boolean recursive = getAttribute(node, "recursive", "false").equals("true");
-
-        return new PackageDesc(name, part, recursive);
-    }
-
-    //
-    // This section loads the information elements
-    //
-
-    /**
-     * Returns all of the information elements under the specified
-     * node.
-     *
-     * @param parent the parent node (jnlp)
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public List getInfo(Node parent) throws ParseException {
-        List result = new ArrayList();
-        Node info[] = getChildNodes(parent, "information");
-
-        // ensure that there are at least one information section present
-        if (info.length == 0)
-            throw new ParseException(R("PNoInfoElement"));
-
-        // create objects from the info sections
-        for (int i=0; i < info.length; i++)
-            result.add(getInformationDesc(info[i]));
-
-        return result;
-    }
-
-    /**
-     * Returns the information element at the specified node.
-     *
-     * @param node the information node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public InformationDesc getInformationDesc(Node node) throws ParseException {
-        List descriptionsUsed = new ArrayList();
-
-        // locale
-        Locale locales[] = getLocales(node);
-
-        // create information
-        InformationDesc info = new InformationDesc(file, locales);
-
-        // step through the elements
-        Node child = node.getFirstChild();
-        while (child != null) {
-            String name = child.getNodeName();
-
-            if ("title".equals(name))
-                addInfo(info, child, null, getSpanText(child));
-            if ("vendor".equals(name))
-                addInfo(info, child, null, getSpanText(child));
-            if ("description".equals(name)) {
-                String kind = getAttribute(child, "kind", "default");
-                if (descriptionsUsed.contains(kind))
-                    if (strict)
-                        throw new ParseException(R("PTwoDescriptions", kind));
-
-                descriptionsUsed.add(kind);
-                addInfo(info, child, kind, getSpanText(child));
-            }
-            if ("homepage".equals(name))
-                addInfo(info, child, null, getRequiredURL(child, "href", base));
-            if ("icon".equals(name))
-                addInfo(info, child, getAttribute(child, "kind", "default"), getIcon(child));
-            if ("offline-allowed".equals(name))
-                addInfo(info, child, null, Boolean.TRUE);
-            if ("sharing-allowed".equals(name)) {
-                if (strict && !allowExtensions)
-                    throw new ParseException(R("PSharing"));
-                addInfo(info, child, null, Boolean.TRUE);
-            }
-            if ("association".equals(name)) {
-                addInfo(info, child, null, getAssociation(child));
-            }
-            if ("shortcut".equals(name)) {
-                addInfo(info, child, null, getShortcut(child));
-            }
-            if ("related-content".equals(name)) {
-                addInfo(info, child, null, getRelatedContent(child));
-            }
-
-            child = child.getNextSibling();
-        }
-
-        return info;
-    }
-
-    /**
-     * Adds a key,value pair to the information object.
-     *
-     * @param info the information object
-     * @param node node name to be used as the key
-     * @param mod key name appended with "-"+mod if not null
-     * @param value the info object to add (icon or string)
-     */
-    protected void addInfo(InformationDesc info, Node node, String mod, Object value) {
-        String modStr = (mod == null) ? "" : "-"+mod;
-
-        if (node == null)
-            return;
-
-        info.addItem(node.getNodeName()+modStr, value);
-    }
-
-    /**
-     * Returns the icon element at the specified node.
-     *
-     * @param node the icon node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public IconDesc getIcon(Node node) throws ParseException {
-        int width = Integer.parseInt(getAttribute(node, "width", "-1"));
-        int height = Integer.parseInt(getAttribute(node, "height", "-1"));
-        int size = Integer.parseInt(getAttribute(node, "size", "-1"));
-        int depth = Integer.parseInt(getAttribute(node, "depth", "-1"));
-        URL location = getRequiredURL(node, "href", base);
-        Object kind = getAttribute(node, "kind", "default");
-
-        return new IconDesc(location, kind, width, height, depth, size);
-    }
-
-    //
-    // This section loads the security descriptor element
-    //
-
-    /**
-     * Returns the security descriptor element.  If no security
-     * element was specified in the JNLP file then a SecurityDesc
-     * with applet permissions is returned.
-     *
-     * @param parent the parent node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public SecurityDesc getSecurity(Node parent) throws ParseException {
-        Node nodes[] = getChildNodes(parent, "security");
-
-        // test for too many security elements
-        if (nodes.length > 1)
-            if (strict)
-                throw new ParseException(R("PTwoSecurity"));
-
-        Object type = SecurityDesc.SANDBOX_PERMISSIONS;
-
-        if (nodes.length == 0)
-            type = SecurityDesc.SANDBOX_PERMISSIONS;
-        else if (null != getChildNode(nodes[0], "all-permissions"))
-            type = SecurityDesc.ALL_PERMISSIONS;
-        else if (null != getChildNode(nodes[0], "j2ee-application-client-permissions"))
-            type = SecurityDesc.J2EE_PERMISSIONS;
-        else if (strict)
-            throw new ParseException(R("PEmptySecurity"));
-
-        if (base != null)
-            return new SecurityDesc(file, type, base.getHost());
-        else
-            return new SecurityDesc(file, type, null);
-    }
-
-    /**
-     * Returns whether the JNLP file requests a trusted execution
-     * environment.
-     */
-    protected boolean isTrustedEnvironment() {
-        Node security = getChildNode(root, "security");
-
-        if (security != null)
-            if (getChildNode(security, "all-permissions") != null
-                || getChildNode(security, "j2ee-application-client-permissions") != null)
-                return true;
-
-        return false;
-    }
-
-    //
-    // This section loads the launch descriptor element
-    //
-
-    /**
-     * Returns the launch descriptor element, either AppletDesc,
-     * ApplicationDesc, ComponentDesc, or InstallerDesc.
-     *
-     * @param parent the parent node
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public Object getLauncher(Node parent) throws ParseException {
-        // check for other than one application type
-        if (1 != getChildNodes(parent, "applet-desc").length
-            + getChildNodes(parent, "application-desc").length
-            + getChildNodes(parent, "component-desc").length
-            + getChildNodes(parent, "installer-desc").length)
-            throw new ParseException(R("PTwoDescriptors"));
-
-        Node child = parent.getFirstChild();
-        while (child != null) {
-            String name = child.getNodeName();
-
-            if ("applet-desc".equals(name))
-                return getApplet(child);
-            if ("application-desc".equals(name))
-                return getApplication(child);
-            if ("component-desc".equals(name))
-                return getComponent(child);
-            if ("installer-desc".equals(name))
-                return getInstaller(child);
-
-            child = child.getNextSibling();
-        }
-
-        // not reached
-        return null;
-    }
-
-    /**
-     * Returns the applet descriptor.
-     *
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public AppletDesc getApplet(Node node) throws ParseException {
-        String name = getRequiredAttribute(node, "name", R("PUnknownApplet"));
-        String main = getRequiredAttribute(node, "main-class", null);
-        URL docbase = getURL(node, "documentbase", base);
-        Map paramMap = new HashMap();
-        int width = 0;
-        int height = 0;
-
-        try {
-            width = Integer.parseInt(getRequiredAttribute(node, "width", "100"));
-            height = Integer.parseInt(getRequiredAttribute(node, "height", "100"));
-        }
-        catch (NumberFormatException nfe) {
-            if (width <= 0)
-                throw new ParseException(R("PBadWidth"));
-            throw new ParseException(R("PBadWidth"));
-        }
-
-        // read params
-        Node params[] = getChildNodes(node, "param");
-        for (int i=0; i < params.length; i++) {
-            paramMap.put(getRequiredAttribute(params[i], "name", null),
-                         getRequiredAttribute(params[i], "value", ""));
-        }
-
-        return new AppletDesc(name, main, docbase, width, height, paramMap);
-    }
-
-    /**
-     * Returns the application descriptor.
-     *
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public ApplicationDesc getApplication(Node node) throws ParseException {
-        String main = getAttribute(node, "main-class", null);
-        List argsList = new ArrayList();
-
-        // if (main == null)
-        //   only ok if can be found in main jar file (can't check here but make a note)
-
-        // read parameters
-        Node args[] = getChildNodes(node, "argument");
-        for (int i=0; i < args.length; i++) {
-            //argsList.add( args[i].getNodeValue() );
-
-            //This approach was not finding the argument text
-            argsList.add( getSpanText(args[i]) );
-        }
-
-        String argStrings[] =
-            (String[]) argsList.toArray( new String[argsList.size()] );
-
-        return new ApplicationDesc(main, argStrings);
-    }
-
-    /**
-     * Returns the component descriptor.
-     */
-    public ComponentDesc getComponent(Node node) {
-        return new ComponentDesc();
-    }
-
-    /**
-     * Returns the installer descriptor.
-     */
-    public InstallerDesc getInstaller(Node node) {
-        String main = getAttribute(node, "main-class", null);
-
-        return new InstallerDesc(main);
-    }
-
-    /**
-     * Returns the association descriptor.
-     */
-    public AssociationDesc getAssociation(Node node) throws ParseException {
-        String[] extensions = getRequiredAttribute(node, "extensions", null).split(" ");
-        String mimeType = getRequiredAttribute(node, "mime-type", null);
-
-        return new AssociationDesc(mimeType, extensions);
-    }
-
-    /**
-     * Returns the shortcut descriptor.
-     */
-    public ShortcutDesc getShortcut(Node node) throws ParseException {
-
-        String online = getAttribute(node, "online", "true");
-        boolean shortcutIsOnline = Boolean.valueOf(online);
-
-        boolean showOnDesktop = false;
-        MenuDesc menu = null;
-
-        // step through the elements
-        Node child = node.getFirstChild();
-        while (child != null) {
-            String name = child.getNodeName();
-
-            if ("desktop".equals(name)) {
-                if (showOnDesktop && strict) {
-                    throw new ParseException(R("PTwoDesktops"));
-                }
-                showOnDesktop = true;
-            } else if ("menu".equals(name)){
-                if (menu != null && strict) {
-                    throw new ParseException(R("PTwoMenus"));
-                }
-                menu = getMenu(child);
-            }
-
-            child = child.getNextSibling();
-        }
-
-        ShortcutDesc shortcut = new ShortcutDesc(shortcutIsOnline, showOnDesktop);
-        if (menu != null) {
-            shortcut.addMenu(menu);
-        }
-        return shortcut;
-    }
-
-    /**
-     * Returns the menu descriptor.
-     */
-    public MenuDesc getMenu(Node node) {
-        String subMenu = getAttribute(node, "submenu", null);
-
-        return new MenuDesc(subMenu);
-    }
-
-
-    /**
-     * Returns the related-content descriptor.
-     */
-    public RelatedContentDesc getRelatedContent(Node node) throws ParseException {
-
-        getRequiredAttribute(node, "href", null);
-        URL location = getURL(node, "href", base);
-
-        String title = null;
-        String description = null;
-        IconDesc icon = null;
-
-        // step through the elements
-        Node child = node.getFirstChild();
-        while (child != null) {
-            String name = child.getNodeName();
-
-            if ("title".equals(name)) {
-                if (title != null && strict) {
-                    throw new ParseException(R("PTwoTitles"));
-                }
-                title = getSpanText(child);
-            } else if ("description".equals(name)) {
-                if (description != null && strict) {
-                    throw new ParseException(R("PTwoDescriptions"));
-                }
-                description = getSpanText(child);
-            } else if ("icon".equals(name)) {
-                if (icon != null && strict) {
-                    throw new ParseException(R("PTwoIcons"));
-                }
-                icon = getIcon(child);
-            }
-
-            child = child.getNextSibling();
-        }
-
-        RelatedContentDesc relatedContent = new RelatedContentDesc(location);
-        relatedContent.setDescription(description);
-        relatedContent.setIconDesc(icon);
-        relatedContent.setTitle(title);
-
-        return relatedContent;
-
-    }
-
-    // other methods
-
-    /**
-     * Returns an array of substrings seperated by spaces (spaces
-     * escaped with backslash do not separate strings).  This method
-     * splits strings as per the spec except that it does replace
-     * escaped other characters with their own value.
-     */
-    public String[] splitString(String source) {
-        if (source == null)
-            return new String[0];
-
-        List result = new ArrayList();
-        StringTokenizer st = new StringTokenizer(source, " ");
-        StringBuffer part = new StringBuffer();
-        while (st.hasMoreTokens()) {
-            part.setLength(0);
-
-            // tack together tokens joined by backslash
-            while (true) {
-                part.append(st.nextToken());
-
-                if (st.hasMoreTokens() && part.charAt(part.length()-1) == '\\')
-                    part.setCharAt(part.length()-1, ' '); // join with the space
-                else
-                    break; // bizarre while format gets \ at end of string right (no extra space added at end)
-            }
-
-            // delete \ quote chars
-            for (int i = part.length(); i-- > 0;) // sweet syntax for reverse loop
-                if (part.charAt(i) == '\\')
-                    part.deleteCharAt(i--); // and skip previous char so \\ becomes \
-
-            result.add( part.toString() );
-        }
-
-        return (String[]) result.toArray(new String[result.size()] );
-    }
-
-    /**
-     * Returns the Locale object(s) from a node's locale attribute.
-     *
-     * @param node the node with a locale attribute
-     */
-    public Locale[] getLocales(Node node) {
-        List locales = new ArrayList();
-        String localeParts[] =
-            splitString(getAttribute(node, "locale", ""));
-
-        for (int i=0; i < localeParts.length; i++) {
-            Locale l = getLocale( localeParts[i] );
-            if (l != null)
-                locales.add(l);
-        }
-
-        return (Locale[]) locales.toArray(new Locale[locales.size()] );
-    }
-
-    /**
-     * Returns a Locale from a single locale.
-     *
-     * @param locale the locale string
-     */
-    public Locale getLocale(String localeStr) {
-        if (localeStr.length() < 2)
-            return null;
-
-        String language = localeStr.substring(0, 2);
-        String country = (localeStr.length()<5) ? "" : localeStr.substring(3, 5);
-        String variant = (localeStr.length()<7) ? "" : localeStr.substring(6, 8);
-
-        // null is not allowed n locale but "" is
-        return new Locale(language, country, variant);
-    }
-
-
-
-    // XML junk
-
-    /**
-     * Returns the implied text under a node, for example "text" in
-     * "<description>text</description>".
-     *
-     * @param node the node with text under it
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public String getSpanText(Node node) throws ParseException {
-        if (node == null)
-            return null;
-
-        // NANO
-        return node.getNodeValue();
-
-        /* TINY
-        Node child = node.getFirstChild();
-
-        if (child == null) {
-            if (strict)
-                // not sure if this is an error or whether "" is proper
-                throw new ParseException("No text specified (node="+node.getNodeName()+")");
-            else
-                return "";
-        }
-
-        return child.getNodeValue();
-        */
-    }
-
-    /**
-     * Returns the first child node with the specified name.
-     */
-    public static Node getChildNode(Node node, String name) {
-        Node[] result = getChildNodes(node, name);
-        if (result.length == 0)
-            return null;
-        else
-            return result[0];
-    }
-
-    /**
-     * Returns all child nodes with the specified name.
-     */
-    public static Node[] getChildNodes(Node node, String name) {
-        List result = new ArrayList();
-
-        Node child = node.getFirstChild();
-        while (child != null) {
-            if (child.getNodeName().equals(name))
-                result.add(child);
-            child = child.getNextSibling();
-        }
-
-        return (Node[]) result.toArray( new Node[result.size()] );
-    }
-
-
-    /**
-     * Returns a URL with a trailing / appended to it if there is no
-     * trailing slash on the specifed URL.
-     */
-    private URL addSlash(URL source) {
-        if (source == null)
-            return null;
-
-        if (!source.toString().endsWith("/")) {
-            try {
-                source = new URL(source.toString()+"/");
-            }
-            catch (MalformedURLException ex) {
-            }
-        }
-
-        return source;
-    }
-
-
-    /**
-     * Returns the same result as getURL except that a
-     * ParseException is thrown if the attribute is null or empty.
-     *
-     * @param node the node
-     * @param name the attribute containing an href
-     * @param base the base URL
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public URL getRequiredURL(Node node, String name, URL base) throws ParseException {
-        // probably should change "" to null so that url is always
-        // required even if !strict
-        getRequiredAttribute(node, name, "");
-
-        return getURL(node, name, base);
-    }
-
-
-    /**
-     * Returns a URL object from a href string relative to the
-     * code base.  If the href denotes a relative URL, it must
-     * reference a location that is a subdirectory of the
-     * codebase.<p>
-     *
-     * @param node the node
-     * @param name the attribute containing an href
-     * @param base the base URL
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public URL getURL(Node node, String name, URL base) throws ParseException {
-        String href = getAttribute(node, name, null);
-        if (href == null)
-            return null; // so that code can throw an exception if attribute was required
-
-        try {
-            if (base == null)
-                return new URL(href);
-            else {
-                try {
-                    return new URL(href);
-                }
-                catch (MalformedURLException ex) {
-                    // is relative
-                }
-
-                URL result = new URL(base, href);
-
-                // check for going above the codebase
-                if (! result.toString().startsWith( base.toString()) )
-                    if (strict)
-                        throw new ParseException(R("PUrlNotInCodebase", node.getNodeName(), href, base));
-
-                return result;
-            }
-
-        }
-        catch (MalformedURLException ex) {
-            if (base == null)
-                throw new ParseException(R("PBadNonrelativeUrl", node.getNodeName(), href));
-            else
-                throw new ParseException(R("PBadRelativeUrl", node.getNodeName(), href, base));
-        }
-    }
-
-    /**
-     * Returns a Version from the specified attribute and default
-     * value.
-     *
-     * @param node the node
-     * @param name the attribute
-     * @param defaultValue default if no such attribute
-     * @return a Version, or null if no such attribute and default is null
-     */
-    public Version getVersion(Node node, String name, String defaultValue) {
-        String version = getAttribute(node, name, defaultValue);
-        if (version == null)
-            return null;
-        else
-            return new Version(version);
-    }
-
-    /**
-     * Check that the VM args are valid and safe
-     * @param vmArgs a string containing the args
-     * @throws ParseException if the VM arguments are invalid or dangerous
-     */
-    private void checkVMArgs(String vmArgs) throws IllegalArgumentException {
-        if (vmArgs == null) {
-            return;
-        }
-
-        List<String> validArguments = Arrays.asList(getValidVMArguments());
-        List<String> validStartingArguments = Arrays.asList(getValidStartingVMArguments());
-
-        String[] arguments = vmArgs.split(" ");
-        boolean argumentIsValid = false;
-        for (String argument: arguments) {
-            argumentIsValid = false;
-
-            if (validArguments.contains(argument)) {
-                argumentIsValid = true;
-            } else {
-                for (String validStartingArgument: validStartingArguments) {
-                    if (argument.startsWith(validStartingArgument)) {
-                        argumentIsValid = true;
-                        break;
-                    }
-                }
-            }
-
-            if (!argumentIsValid) {
-                throw new IllegalArgumentException(argument);
-            }
-        }
-
-    }
-
-    /**
-     * Returns an array of valid (ie safe and supported) arguments for the JVM
-     *
-     * Based on http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html
-     */
-    private String[] getValidVMArguments() {
-        return new String[] {
-        "-d32",                             /* use a 32-bit data model if available */
-        "-client",                          /* to select the client VM */
-        "-server",                          /* to select the server VM */
-        "-verbose",                         /* enable verbose output */
-        "-version",                         /* print product version and exit */
-        "-showversion",                     /* print product version and continue */
-        "-help",                            /* print this help message */
-        "-X",                               /* print help on non-standard options */
-        "-ea",                              /* enable assertions */
-        "-enableassertions",                /* enable assertions */
-        "-da",                              /* disable assertions */
-        "-disableassertions",               /* disable assertions */
-        "-esa",                             /* enable system assertions */
-        "-enablesystemassertions",          /* enable system assertions */
-        "-dsa",                             /* disable system assertione */
-        "-disablesystemassertions",         /* disable system assertione */
-        "-Xmixed",                          /* mixed mode execution (default) */
-        "-Xint",                            /* interpreted mode execution only */
-        "-Xnoclassgc",                      /* disable class garbage collection */
-        "-Xincgc",                          /* enable incremental garbage collection */
-        "-Xbatch",                          /* disable background compilation */
-        "-Xprof",                           /* output cpu profiling data */
-        "-Xdebug",                          /* enable remote debugging */
-        "-Xfuture",                         /* enable strictest checks, anticipating future default */
-        "-Xrs",                             /* reduce use of OS signals by Java/VM (see documentation) */
-        "-XX:+ForceTimeHighResolution",     /* use high resolution timer */
-        "-XX:-ForceTimeHighResolution",     /* use low resolution (default) */
-        };
-    }
-
-    /**
-     * Returns an array containing the starts of valid (ie safe and supported)
-     * arguments for the JVM
-     *
-     * Based on http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html
-     */
-    private String[] getValidStartingVMArguments() {
-        return new String[] {
-        "-ea",                          /* enable assertions for classes */
-        "-enableassertions",            /* enable assertions for classes */
-        "-da",                          /* disable assertions for classes */
-        "-disableassertions",           /* disable assertions for classes */
-        "-verbose",                     /* enable verbose output */
-        "-Xms",                         /* set initial Java heap size */
-        "-Xmx",                         /* set maximum Java heap size */
-        "-Xss",                         /* set java thread stack size */
-        "-XX:NewRatio",                 /* set Ratio of new/old gen sizes */
-        "-XX:NewSize",                  /* set initial size of new generation */
-        "-XX:MaxNewSize",               /* set max size of new generation */
-        "-XX:PermSize",                 /* set initial size of permanent gen */
-        "-XX:MaxPermSize",              /* set max size of permanent gen */
-        "-XX:MaxHeapFreeRatio",         /* heap free percentage (default 70) */
-        "-XX:MinHeapFreeRatio",         /* heap free percentage (default 40) */
-        "-XX:UseSerialGC",              /* use serial garbage collection */
-        "-XX:ThreadStackSize",          /* thread stack size (in KB) */
-        "-XX:MaxInlineSize",            /* set max num of bytecodes to inline */
-        "-XX:ReservedCodeCacheSize",    /* Reserved code cache size (bytes) */
-        "-XX:MaxDirectMemorySize",
-
-        };
-    }
-
-    /**
-     * Returns the same result as getAttribute except that if strict
-     * mode is enabled or the default value is null a parse
-     * exception is thrown instead of returning the default value.
-     *
-     * @param node the node
-     * @param name the attribute
-     * @param defaultValue default value
-     * @throws ParseException if the attribute does not exist or is empty
-     */
-    public String getRequiredAttribute(Node node, String name, String defaultValue) throws ParseException {
-        String result = getAttribute(node, name, null);
-
-        if (result == null || result.length() == 0)
-            if (strict || defaultValue == null)
-                throw new ParseException(R("PNeedsAttribute", node.getNodeName(), name));
-
-        if (result == null)
-            return defaultValue;
-        else
-            return result;
-    }
-
-    /**
-     * Retuns an attribute or the specified defaultValue if there is
-     * no such attribute.
-     *
-     * @param node the node
-     * @param name the attribute
-     * @param defaultValue default if no such attribute
-     */
-    public String getAttribute(Node node, String name, String defaultValue) {
-        // SAX
-        // String result = ((Element) node).getAttribute(name);
-        String result = node.getAttribute(name);
-
-        if (result == null || result.length()==0)
-            return defaultValue;
-
-        return result;
-    }
-
-    /**
-     * Return the root node from the XML document in the specified
-     * input stream.
-     *
-     * @throws ParseException if the JNLP file is invalid
-     */
-    public static Node getRootNode(InputStream input) throws ParseException {
-        try {
-            /* SAX
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setValidating(false);
-            factory.setNamespaceAware(true);
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            builder.setErrorHandler(errorHandler);
-
-            Document doc = builder.parse(input);
-            return doc.getDocumentElement();
-            */
-
-            /* TINY
-            Node document = new Node(TinyParser.parseXML(input));
-            Node jnlpNode = getChildNode(document, "jnlp"); // skip comments
-            */
-
-            //A BufferedInputStream is used to allow marking and reseting
-            //of a stream.
-            BufferedInputStream bs = new BufferedInputStream(input);
-
-            /* NANO */
-            final XMLElement xml = new XMLElement();
-            final PipedInputStream pin = new PipedInputStream();
-            final PipedOutputStream pout = new PipedOutputStream(pin);
-            final InputStreamReader isr = new InputStreamReader(bs, getEncoding(bs));
-            // Clean the jnlp xml file of all comments before passing
-            // it to the parser.
-            new Thread(
-                new Runnable(){
-                    public void run(){
-                        (new XMLElement()).sanitizeInput(isr, pout);
-                        try {
-                            pout.close();
-                        } catch (IOException ioe) {
-                            ioe.printStackTrace();
-                        }
-                    }
-                }
-            ).start();
-            xml.parseFromReader(new InputStreamReader(pin));
-            Node jnlpNode = new Node(xml);
-            return jnlpNode;
-        }
-        catch(Exception ex) {
-            throw new ParseException(R("PBadXML"), ex);
-        }
-    }
-
-    /**
-     * Returns the name of the encoding used in this InputStream.
-     *
-     * @param input the InputStream
-     * @return a String representation of encoding
-     */
-    private static String getEncoding(InputStream input) throws IOException{
-        //Fixme: This only recognizes UTF-8, UTF-16, and
-        //UTF-32, which is enough to parse the prolog portion of xml to
-        //find out the exact encoding (if it exists). The reason being
-        //there could be other encodings, such as ISO 8859 which is 8-bits
-        //but it supports latin characters.
-        //So what needs to be done is to parse the prolog and retrieve
-        //the exact encoding from it.
-
-        int[] s = new int[4];
-        String encoding = "UTF-8";
-
-        //Determine what the first four bytes are and store
-        //them into an int array.
-        input.mark(4);
-        for (int i = 0; i < 4; i++) {
-            s[i] = input.read();
-        }
-        input.reset();
-
-        //Set the encoding base on what the first four bytes of the
-        //inputstream turn out to be (following the information from
-        //www.w3.org/TR/REC-xml/#sec-guessing).
-        if (s[0] == 255) {
-            if (s[1] == 254) {
-                if (s[2] != 0 || s[3] != 0) {
-                    encoding = "UnicodeLittle";
-                } else {
-                    encoding = "X-UTF-32LE-BOM";
-                }
-            }
-        } else if (s[0] == 254 && s[1] == 255 && (s[2] != 0 ||
-          s[3] != 0)) {
-            encoding = "UTF-16";
-
-        } else if (s[0] == 0 && s[1] == 0 && s[2] == 254 &&
-          s[3] == 255) {
-            encoding = "X-UTF-32BE-BOM";
-
-        } else if (s[0] == 0 && s[1] == 0 && s[2] == 0 &&
-          s[3] == 60) {
-            encoding = "UTF-32BE";
-
-        } else if (s[0] == 60 && s[1] == 0 && s[2] == 0 &&
-          s[3] == 0) {
-            encoding = "UTF-32LE";
-
-        } else if (s[0] == 0 && s[1] == 60 && s[2] == 0 &&
-          s[3] == 63) {
-            encoding = "UTF-16BE";
-        } else if (s[0] == 60 && s[1] == 0 && s[2] == 63 &&
-          s[3] == 0) {
-            encoding = "UTF-16LE";
-        }
-
-        return encoding;
-    }
-}
--- a/netx/net/sourceforge/jnlp/PluginBridge.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
- * Copyright 2007 Red Hat, Inc.
- * This file is part of IcedTea, http://icedtea.classpath.org
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-package net.sourceforge.jnlp;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.Calendar;
-import java.util.Hashtable;
-import java.util.Locale;
-import java.util.List;
-import java.util.ArrayList;
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-
-public class PluginBridge extends JNLPFile
-{
-    Version specVersion = new Version("1.0");
-    Version fileVersion = new Version("1.1");
-
-    String name;
-    String[] jars = new String[0];
-    String[] cache_jars = new String[0];
-    String[] cache_ex_jars = new String[0];
-    Hashtable atts;
-
-    public PluginBridge(URL codebase, URL documentBase, String jar, String main,
-                        int width, int height, Hashtable atts)
-    throws Exception
-    {
-        this.codeBase = codebase;
-        this.sourceLocation = documentBase;
-
-        // also, see if cache_archive is specified
-        if (atts.get("cache_archive") != null && ((String) atts.get("cache_archive")).length() > 0) {
-
-            String[] versions = new String[0];
-
-            // are there accompanying versions?
-            if (atts.get("cache_version") != null) {
-                versions = ((String) atts.get("cache_version")).split(",");
-            }
-
-            String[] jars = ((String) atts.get("cache_archive")).split(",");
-            cache_jars = new String[jars.length];
-
-            for (int i=0; i < jars.length; i++) {
-
-                cache_jars[i] = jars[i].trim();
-
-                if (versions.length > 0) {
-                    cache_jars[i] += ";" + versions[i].trim();
-                }
-            }
-        }
-
-        if (atts.get("cache_archive_ex") != null && ((String) atts.get("cache_archive_ex")).length() > 0) {
-            cache_ex_jars = ((String) atts.get("cache_archive_ex")).split(",");
-        }
-
-        if (jar != null && jar.length() > 0) {
-            this.jars = jar.split(",");
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("Jar string: " + jar);
-                System.err.println("jars length: " + jars.length);
-            }
-        }
-        this.atts = atts;
-
-        name = (String) atts.get("name");
-        if (name == null)
-            name = "Applet";
-        else
-            name = name + " applet";
-
-        if (main.endsWith(".class"))
-            main = main.substring(0, main.length() - 6);
-
-        launchType = new AppletDesc(name, main, documentBase, width,
-                                    height, atts);
-
-        if (main.endsWith(".class")) //single class file only
-            security = new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS,
-                                        codebase.getHost());
-        else
-            security = null;
-
-        this.uniqueKey = Calendar.getInstance().getTimeInMillis() + "-" +
-                         Math.abs(((new java.util.Random()).nextInt())) + "-" +
-                         documentBase;
-    }
-
-    public String getTitle()
-    {
-        return name;
-    }
-
-    public InformationDesc getInformation(final Locale locale)
-    {
-        return new InformationDesc(this, new Locale[] {locale}) {
-            protected List getItems(Object key)
-            {
-                // Should we populate this list with applet attribute tags?
-                List result = new ArrayList();
-                return result;
-            }
-        };
-    }
-
-    public ResourcesDesc getResources(final Locale locale, final String os,
-                                      final String arch)
-    {
-        return new ResourcesDesc(this, new Locale[] {locale}, new String[] {os},
-        new String[] {arch}) {
-            public List getResources(Class launchType)
-            {
-                List result = new ArrayList();
-                result.addAll(sharedResources.getResources(launchType));
-
-                // Need to add the JAR manually...
-                //should this be done to sharedResources on init?
-                try
-                {
-                    if (launchType.equals(JARDesc.class))
-                    {
-                        for (int i = 0; i < jars.length; i++)
-                            if (jars[i].length() > 0)
-                                result.add(new JARDesc(new URL(codeBase, jars[i]),
-                                        null, null, false, true, false, true));
-
-                        boolean cacheable = true;
-
-                        if (atts.get("cache_option") != null &&
-                                ((String) atts.get("cache_option")).equalsIgnoreCase("no"))
-                            cacheable = false;
-
-                        for (int i = 0; i < cache_jars.length; i++) {
-
-                            String[] jar_and_ver = cache_jars[i].split(";");
-
-                            String jar = jar_and_ver[0];
-                            Version version = null;
-
-                            if (jar.length() == 0)
-                                continue;
-
-                            if (jar_and_ver.length > 1) {
-                                version = new Version(jar_and_ver[1]);
-                            }
-
-                            result.add(new JARDesc(new URL(codeBase, jar),
-                                    version, null, false, true, false, cacheable));
-                        }
-
-                        for (int i = 0; i < cache_ex_jars.length; i++) {
-
-                            if (cache_ex_jars[i].length() == 0)
-                                continue;
-
-                            String[] jar_info = cache_ex_jars[i].split(";");
-
-                            String jar = jar_info[0].trim();
-                            Version version = null;
-                            boolean lazy = true;
-
-                            if (jar_info.length > 1) {
-
-                                // format is name[[;preload];version]
-
-                                if (jar_info[1].equals("preload")) {
-                                    lazy = false;
-                                } else {
-                                    version = new Version(jar_info[1].trim());
-                                }
-
-                                if (jar_info.length > 2) {
-                                    lazy = false;
-                                    version = new Version(jar_info[2].trim());
-                                }
-                            }
-
-                            result.add(new JARDesc(new URL(codeBase, jar),
-                                    version, null, lazy, true, false, false));
-                        }
-                    }
-                }
-                catch (MalformedURLException ex)
-                    { }
-                return result;
-            }
-
-            public JARDesc[] getJARs() {
-                List resources = getResources(JARDesc.class);
-                ArrayList<JARDesc> jars = new ArrayList<JARDesc>();
-
-                //Only get the JARDescs
-                for (int i = 0; i < resources.size(); i++) {
-                    Object resource = resources.get(i);
-                    if (resource instanceof JARDesc)
-                        jars.add((JARDesc) resource);
-                }
-
-                Object[] objectArray = jars.toArray();
-                JARDesc[] jarArray = new JARDesc[objectArray.length];
-
-                for (int i = 0; i < objectArray.length; i++)
-                    jarArray[i] = (JARDesc) objectArray[i];
-
-                return jarArray;
-            }
-
-            public void addResource(Object resource)
-            {
-                // todo: honor the current locale, os, arch values
-                sharedResources.addResource(resource);
-            }
-
-        };
-    }
-
-    public boolean isApplet() {
-        return true;
-    }
-    public boolean isApplication() {
-        return false;
-    }
-    public boolean isComponent() {
-        return false;
-    }
-    public boolean isInstaller() {
-        return false;
-    }
-}
--- a/netx/net/sourceforge/jnlp/PropertyDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * The property element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.6 $
- */
-public class PropertyDesc {
-
-    /** the key name */
-    private String key;
-
-    /** the value */
-    private String value;
-
-
-    /**
-     * Creates a property descriptor.
-     *
-     * @param key the key name
-     * @param value the value
-     */
-    public PropertyDesc(String key, String value) {
-        this.key = key;
-        this.value = value;
-    }
-
-    /**
-     * Returns the property's key
-     */
-    public String getKey() {
-        return key;
-    }
-
-    /**
-     * Returns the property's value
-     */
-    public String getValue() {
-        return value;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/RelatedContentDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp;
-
-import java.net.URL;
-
-public class RelatedContentDesc {
-
-    /** title of the content */
-    private String title = null;;
-
-    /** the description of the content */
-    private String description = null;
-
-    /** the location of the content */
-    private URL location = null;
-
-    /** the icon for this related content */
-    private IconDesc icon = null;
-
-    /**
-     * Create a related-content descriptor
-     * @param href the url of the related content
-     */
-    public RelatedContentDesc(URL href) {
-        this.location = href;
-    }
-
-    /**
-     * Set the title of this content
-     * @param title the title of this content
-     */
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    /**
-     * Returns the title of this content..
-     */
-    public String getTitle() {
-        return title;
-    }
-
-    /**
-     * Set the description of this related content
-     */
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    /**
-     * Returns the description of the related content
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Returns the location of the related content. Not null
-     */
-    public URL getLocation() {
-        return location;
-    }
-
-    /**
-     * Set the icon for this related content
-     */
-    public void setIconDesc(IconDesc icon) {
-        this.icon = icon;
-    }
-
-    /**
-     * Returns the icon descriptor for the realted content
-     */
-    public IconDesc getIcon() {
-        return icon;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/ResourcesDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,230 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.awt.Dimension;
-import java.net.*;
-import java.util.*;
-
-/**
- * The resources element.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.7 $
- */
-public class ResourcesDesc {
-
-    /** the locales of these resources */
-    private Locale locales[];
-
-    /** the OS for these resources */
-    private String os[];
-
-    /** the arch for these resources */
-    private String arch[];
-
-    /** the JNLPFile this information is for */
-    private JNLPFile jnlpFile;
-
-    /** list of jars, packages, properties, and extensions */
-    private List resources = new ArrayList(); // mixed list makes easier for lookup code
-
-
-    /**
-     * Create a representation of one information section of the
-     * JNLP File.
-     *
-     * @param jnlpFile JNLP file the resources are for
-     * @param locales the locales of these resources
-     * @param os the os of these resources
-     * @param arch the arch of these resources
-     */
-    public ResourcesDesc(JNLPFile jnlpFile, Locale locales[], String os[], String arch[]) {
-        this.jnlpFile = jnlpFile;
-        this.locales = locales;
-        this.os = os;
-        this.arch = arch;
-    }
-
-    /**
-     * Returns the JVMs.
-     */
-    public JREDesc[] getJREs() {
-        List resources = getResources(JREDesc.class);
-        return (JREDesc[]) resources.toArray( new JREDesc[resources.size()] );
-    }
-
-    /**
-     * Returns the main JAR for these resources.  There first JAR
-     * is returned if no JARs are specified as the main JAR, and if
-     * there are no JARs defined then null is returned.
-     */
-    public JARDesc getMainJAR() {
-        JARDesc jars[] = getJARs();
-
-        for (int i=0; i < jars.length; i++)
-            if (jars[i].isMain())
-                return jars[i];
-
-        if (jars.length > 0)
-            return jars[0];
-        else
-            return null;
-    }
-
-    /**
-     * Returns all of the JARs.
-     */
-    public JARDesc[] getJARs() {
-        List resources = getResources(JARDesc.class);
-        return (JARDesc[]) resources.toArray( new JARDesc[resources.size()] );
-    }
-
-    /**
-     * Returns the JARs with the specified part name.
-     *
-     * @param partName the part name, null and "" equivalent
-     */
-    public JARDesc[] getJARs(String partName) {
-        List resources = getResources(JARDesc.class);
-
-        for (int i = resources.size(); i-- > 0;) {
-            JARDesc jar = (JARDesc) resources.get(i);
-
-            if (!(""+jar.getPart()).equals(""+partName))
-                resources.remove(i);
-        }
-
-        return (JARDesc[]) resources.toArray( new JARDesc[resources.size()] );
-    }
-
-    /**
-     * Returns the Extensions.
-     */
-    public ExtensionDesc[] getExtensions() {
-        List resources = getResources(ExtensionDesc.class);
-        return (ExtensionDesc[]) resources.toArray( new ExtensionDesc[resources.size()] );
-    }
-
-    /**
-     * Returns the Packages.
-     */
-    public PackageDesc[] getPackages() {
-        List resources = getResources(PackageDesc.class);
-        return (PackageDesc[]) resources.toArray( new PackageDesc[resources.size()] );
-    }
-
-    /**
-     * Returns the Packages that match the specified class name.
-     *
-     * @param className the fully qualified class name
-     * @return the PackageDesc objects matching the class name
-     */
-    public PackageDesc[] getPackages(String className) {
-        List resources = getResources(PackageDesc.class);
-
-        for (int i = resources.size(); i-- > 0;) {
-            PackageDesc pk = (PackageDesc) resources.get(i);
-
-            if (!pk.matches(className))
-                resources.remove(i);
-        }
-
-        return (PackageDesc[]) resources.toArray( new PackageDesc[resources.size()] );
-    }
-
-    /**
-     * Returns the Properties as a list.
-     */
-    public PropertyDesc[] getProperties() {
-        List resources = getResources(PropertyDesc.class);
-        return (PropertyDesc[]) resources.toArray( new PropertyDesc[resources.size()] );
-    }
-
-    /**
-     * Returns the properties as a map.
-     */
-    public Map getPropertiesMap() {
-        Properties properties = new Properties();
-        List resources = getResources(PropertyDesc.class);
-        for (int i=0; i < resources.size(); i++) {
-            PropertyDesc prop = (PropertyDesc) resources.get(i);
-            properties.put( prop.getKey(), prop.getValue() );
-        }
-
-        return properties;
-    }
-
-    /**
-     * Returns the os required by these resources, or null if no
-     * locale was specified in the JNLP file.
-     */
-    public String[] getOS() {
-        return os;
-    }
-
-    /**
-     * Returns the architecture required by these resources, or null
-     * if no locale was specified in the JNLP file.
-     */
-    public String[] getArch() {
-        return arch;
-    }
-
-    /**
-     * Returns the locale required by these resources, or null if no
-     * locale was specified in the JNLP file.
-     */
-    public Locale[] getLocales() {
-        return locales;
-    }
-
-    /**
-     * Returns the JNLPFile the resources are for.
-     */
-    public JNLPFile getJNLPFile() {
-        return jnlpFile;
-    }
-
-    /**
-     * Returns all resources of the specified type.
-     */
-    public List getResources(Class type) {
-        List result = new ArrayList();
-
-        for (int i=0; i < resources.size(); i++)
-            if ( type.isAssignableFrom(resources.get(i).getClass()) )
-                result.add(resources.get(i));
-
-        return result;
-    }
-
-    /**
-     * Add a resource.
-     */
-    public void addResource(Object resource) {
-        // if this is going to stay public it should probably take an
-        // interface instead of an Object
-        if (resource == null)
-            throw new IllegalArgumentException("null resource");
-
-        resources.add(resource);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/SecurityDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.security.*;
-import java.awt.AWTPermission;
-
-/**
- * The security element.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.7 $
- */
-public class SecurityDesc {
-
-    /*
-     * We do not verify security here, the classloader deals with security
-     */
-
-    /** All permissions. */
-    public static final Object ALL_PERMISSIONS = "All";
-
-    /** Applet permissions. */
-    public static final Object SANDBOX_PERMISSIONS = "Sandbox";
-
-    /** J2EE permissions. */
-    public static final Object J2EE_PERMISSIONS = "J2SE";
-
-    /** permissions type */
-    private Object type;
-
-    /** the download host */
-    private String downloadHost;
-
-    /** the JNLP file */
-    private JNLPFile file;
-
-    // We go by the rules here:
-    // http://java.sun.com/docs/books/tutorial/deployment/doingMoreWithRIA/properties.html
-
-    // Since this is security sensitive, take a conservative approach:
-    // Allow only what is specifically allowed, and deny everything else
-
-    /** basic permissions for restricted mode */
-    private static Permission j2eePermissions[] = {
-        new AWTPermission("accessClipboard"),
-        // disabled because we can't at this time prevent an
-        // application from accessing other applications' event
-        // queues, or even prevent access to security dialog queues.
-        //
-        // new AWTPermission("accessEventQueue"),
-        new AWTPermission("showWindowWithoutWarningBanner"),
-        new RuntimePermission("exitVM"),
-        new RuntimePermission("loadLibrary"),
-        new RuntimePermission("queuePrintJob"),
-        new SocketPermission("*", "connect"),
-        new SocketPermission("localhost:1024-", "accept, listen"),
-        new FilePermission("*", "read, write"),
-        new PropertyPermission("*", "read"),
-    };
-
-    /** basic permissions for restricted mode */
-    private static Permission sandboxPermissions[] = {
-        new SocketPermission("localhost:1024-", "listen"),
-        // new SocketPermission("<DownloadHost>", "connect, accept"), // added by code
-        new PropertyPermission("java.version", "read"),
-        new PropertyPermission("java.vendor", "read"),
-        new PropertyPermission("java.vendor.url", "read"),
-        new PropertyPermission("java.class.version", "read"),
-        new PropertyPermission("os.name", "read"),
-        new PropertyPermission("os.version", "read"),
-        new PropertyPermission("os.arch", "read"),
-        new PropertyPermission("file.separator", "read"),
-        new PropertyPermission("path.separator", "read"),
-        new PropertyPermission("line.separator", "read"),
-        new PropertyPermission("java.specification.version", "read"),
-        new PropertyPermission("java.specification.vendor", "read"),
-        new PropertyPermission("java.specification.name", "read"),
-        new PropertyPermission("java.vm.specification.vendor", "read"),
-        new PropertyPermission("java.vm.specification.name", "read"),
-        new PropertyPermission("java.vm.version", "read"),
-        new PropertyPermission("java.vm.vendor", "read"),
-        new PropertyPermission("java.vm.name", "read"),
-        new PropertyPermission("javawebstart.version", "read"),
-        new PropertyPermission("javaplugin.*", "read"),
-        new PropertyPermission("jnlp.*", "read,write"),
-        new PropertyPermission("javaws.*", "read,write"),
-        new RuntimePermission("exitVM"),
-        new RuntimePermission("stopThread"),
-        new AWTPermission("showWindowWithoutWarningBanner"),
-        // disabled because we can't at this time prevent an
-        // application from accessing other applications' event
-        // queues, or even prevent access to security dialog queues.
-        //
-        // new AWTPermission("accessEventQueue"),
-    };
-
-    /** basic permissions for restricted mode */
-    private static Permission jnlpRIAPermissions[] = {
-        new PropertyPermission("awt.useSystemAAFontSettings", "read,write"),
-        new PropertyPermission("http.agent", "read,write"),
-        new PropertyPermission("http.keepAlive", "read,write"),
-        new PropertyPermission("java.awt.syncLWRequests", "read,write"),
-        new PropertyPermission("java.awt.Window.locationByPlatform", "read,write"),
-        new PropertyPermission("javaws.cfg.jauthenticator", "read,write"),
-        new PropertyPermission("javax.swing.defaultlf", "read,write"),
-        new PropertyPermission("sun.awt.noerasebackground", "read,write"),
-        new PropertyPermission("sun.awt.erasebackgroundonresize", "read,write"),
-        new PropertyPermission("sun.java2d.d3d", "read,write"),
-        new PropertyPermission("sun.java2d.dpiaware", "read,write"),
-        new PropertyPermission("sun.java2d.noddraw", "read,write"),
-        new PropertyPermission("sun.java2d.opengl", "read,write"),
-        new PropertyPermission("swing.boldMetal", "read,write"),
-        new PropertyPermission("swing.metalTheme", "read,write"),
-        new PropertyPermission("swing.noxp", "read,write"),
-        new PropertyPermission("swing.useSystemFontSettings", "read,write"),
-    };
-
-    /**
-     * Create a security descriptor.
-     *
-     * @param file the JNLP file
-     * @param type the type of security
-     * @param downloadHost the download host (can always connect to)
-     */
-    public SecurityDesc(JNLPFile file, Object type, String downloadHost) {
-        this.file = file;
-        this.type = type;
-        this.downloadHost = downloadHost;
-    }
-
-    /**
-     * Returns the permissions type, one of: ALL_PERMISSIONS,
-     * SANDBOX_PERMISSIONS, J2EE_PERMISSIONS.
-     */
-    public Object getSecurityType() {
-        return type;
-    }
-
-    /**
-     * Returns a PermissionCollection containing the basic
-     * permissions granted depending on the security type.
-     */
-    public PermissionCollection getPermissions() {
-        PermissionCollection permissions = getSandBoxPermissions();
-
-        // discard sandbox, give all
-        if (type == ALL_PERMISSIONS) {
-            permissions = new Permissions();
-            permissions.add(new AllPermission());
-            return permissions;
-        }
-
-        // add j2ee to sandbox if needed
-        if (type == J2EE_PERMISSIONS)
-            for (int i=0; i < j2eePermissions.length; i++)
-                permissions.add(j2eePermissions[i]);
-
-        return permissions;
-    }
-
-    /**
-     * Returns a PermissionCollection containing the sandbox permissions
-     */
-    public PermissionCollection getSandBoxPermissions() {
-
-        Permissions permissions = new Permissions();
-
-        for (int i=0; i < sandboxPermissions.length; i++)
-            permissions.add(sandboxPermissions[i]);
-
-        if (file.isApplication())
-            for (int i=0; i < jnlpRIAPermissions.length; i++)
-                permissions.add(jnlpRIAPermissions[i]);
-
-        if (downloadHost != null)
-            permissions.add(new SocketPermission(downloadHost,
-                                                 "connect, accept"));
-
-        return permissions;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/ShortcutDesc.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp;
-
-public final class ShortcutDesc {
-
-    /** the application wants to be placed on the desktop */
-    private boolean onDesktop = false;
-
-    /** the application needs to be launched online */
-    private boolean requiresOnline = true;
-
-    /** the menu descriptor */
-    private MenuDesc menu = null;
-
-    /**
-     * Create a new Shortcut descriptor
-     * @param requiresOnline whether the shortcut requires connectivity
-     * @param onDesktop whether the shortcut wants to be placed on the desktop
-     */
-    public ShortcutDesc(boolean requiresOnline, boolean onDesktop) {
-        this.requiresOnline = requiresOnline;
-        this.onDesktop = onDesktop;
-    }
-
-    /**
-     * Returns whether the shortcut requires being online
-     */
-    public boolean isOnline() {
-        return requiresOnline;
-    }
-
-    /**
-     * Return whether the shortcut should be placed on the desktop
-     */
-    public boolean onDesktop() {
-        return onDesktop;
-    }
-
-    /**
-     * Add a shortcut to the 'start menu'
-     * (whatever that means on gnome/kde/other ...)
-     * @param menu if/what menu this shortcut should be added to
-     */
-    public void addMenu(MenuDesc menu) {
-        this.menu = menu;
-    }
-
-    /**
-     * Returns the menu this shortcut should be added to
-     */
-    public MenuDesc getMenu() {
-        return menu;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/StreamEater.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * This class reads the output from a launched process and writes it to stdout.
- */
-public class StreamEater extends Thread {
-    private InputStream stream;
-
-    public StreamEater(InputStream stream) {
-        this.stream = new BufferedInputStream(stream);
-    }
-
-    public void run() {
-        try {
-            while (true) {
-                int c = stream.read();
-                if (c == -1)
-                    break;
-
-                System.out.write(c);
-            }
-        } catch (IOException ex) {
-        }
-    }
-}
--- a/netx/net/sourceforge/jnlp/Version.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,352 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * A JNLP Version string in the form "1.2-3_abc" followed by an
- * optional + (includes all later versions) or * (matches any
- * suffixes on versions).  More than one version can be included
- * in a string by separating them with spaces.<p>
- *
- * Version strings are divided by "._-" charecters into parts.
- * These parts are compared numerically if they can be parsed as
- * integers or lexographically as strings otherwise.  If the
- * number of parts is different between two version strings then
- * the smaller one is padded with zero or the empty string.  Note
- * that the padding in this version means that 1.2+ matches
- * 1.4.0-beta1, but may not in future versions.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.5 $
- */
-public class Version {
-
-    // to do: web start does not match versions with a "-" like
-    // "1.4-beta1" using the + modifier, change to mimic that
-    // behavior.
-
-    // also refactor into Version and VersionID classes so that
-    // individual version ids can be easily modified to add/remove
-    // "*" and "+" modifiers.
-
-    /** separates parts of a version string */
-    private static String seperators = ".-_";
-
-    /** magic key for whether a version part was created due to normalization */
-    private static String emptyString = new String("<EMPTY>"); // not intern'ed
-
-    /** contains all the versions matched */
-    private String versionString;
-
-
-    /**
-     * Create a Version object based on a version string (ie,
-     * "1.2.3+ 4.56*").
-     */
-    public Version(String versions) {
-        versionString = versions;
-    }
-
-    /**
-     * Returns true if the version represents a <i>version-id</i> (a
-     * single version number such as 1.2) and false otherwise.
-     */
-    public boolean isVersionId() {
-        if (-1 != versionString.indexOf(" "))
-            return false;
-
-        return true;
-    }
-
-    /**
-     * Returns true if all of this version's version-ids match one
-     * or more of the specifed version's version-id.
-     *
-     * @param version a version string
-     */
-    public boolean matches(String version) {
-        return matches(new Version(version));
-    }
-
-    /**
-     * Returns true if all of this version's version-ids match one
-     * or more of the specifed version's version-id.
-     *
-     * @param version a Version object
-     */
-    public boolean matches(Version version) {
-        List versionStrings = version.getVersionStrings();
-
-        for (int i=0; i < versionStrings.size(); i++) {
-            if (!this.matchesSingle( (String)versionStrings.get(i) ))
-                return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns true if any of this version's version-ids match one
-     * or more of the specifed version's version-id.
-     *
-     * @param version a version string
-     */
-    public boolean matchesAny(String version) {
-        return matches(new Version(version));
-    }
-
-
-    /**
-     * Returns true if any of this version's version-ids match one
-     * or more of the specifed version's version-id.
-     *
-     * @param version a Version object
-     */
-    public boolean matchesAny(Version version) {
-        List versionStrings = version.getVersionStrings();
-
-        for (int i=0; i < versionStrings.size(); i++) {
-            if (this.matchesSingle( (String)versionStrings.get(i) ))
-                return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns whether a single version string is supported by this
-     * Version.
-     *
-     * @param version a non-compound version of the form "1.2.3[+*]"
-     */
-    private boolean matchesSingle(String version) {
-        List versionStrings = this.getVersionStrings();
-        for (int i=0; i < versionStrings.size(); i++) {
-            if ( matches(version, (String)versionStrings.get(i)) )
-                return true;
-        }
-        return false;
-    }
-
-
-    /**
-     * Returns whether a single version string is supported by
-     * another single version string.
-     *
-     * @param subversion a non-compound version without "+" or "*"
-     * @param version a non-compound version optionally with "+" or "*"
-     */
-    private boolean matches(String subversion, String version) {
-        List subparts = getParts(subversion);
-        List parts = getParts(version);
-
-        int maxLength = Math.max(subversion.length(), version.length());
-        if (version.endsWith("*")) // star means rest of parts irrelevant: truncate them
-            maxLength = parts.size();
-
-        normalize(new List[] {subparts, parts}, maxLength);
-
-        if (equal(subparts, parts))
-            return true;
-
-        if (version.endsWith("+") && greater(subparts, parts))
-            return true;
-
-        return false;
-    }
-
-    /**
-     * Returns whether the parts of one version are equal to the
-     * parts of another version.
-     *
-     * @param parts1 normalized version parts
-     * @param parts2 normalized version parts
-     */
-    protected boolean equal(List parts1, List parts2) {
-        for (int i=0; i < parts1.size(); i++) {
-            if ( 0 != compare((String)parts1.get(i), (String)parts2.get(i)) )
-                return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns whether the parts of one version are greater than
-     * the parts of another version.
-     *
-     * @param parts1 normalized version parts
-     * @param parts2 normalized version parts
-     */
-    protected boolean greater(List parts1, List parts2) {
-        //if (true) return false;
-
-        for (int i=0; i < parts1.size(); i++) {
-            // if part1 > part2 then it's a later version, so return true
-            if (compare((String)parts1.get(i), (String)parts2.get(i)) > 0)
-                return true;
-
-            // if part1 < part2 then it's a ealier version, so return false
-            if (compare((String)parts1.get(i), (String)parts2.get(i)) < 0)
-                return false;
-
-            // if equal go to next part
-        }
-
-        // all parts were equal
-        return false; // not greater than
-    }
-
-    /**
-     * Compares two parts of a version string, by value if both can
-     * be interpreted as integers or lexically otherwise.  If a part
-     * is the result of normalization then it can be the Integer
-     * zero or an empty string.
-     *
-     * Returns a value equivalent to part1.compareTo(part2);
-     *
-     * @param part1 a part of a version string
-     * @param part2 a part of a version string
-     * @return comparison of the two parts
-     */
-    protected int compare(String part1, String part2) {
-        Integer number1 = new Integer(0);
-        Integer number2 = new Integer(0);
-
-        // compare as integers
-        try {
-            if (!(part1 == emptyString)) // compare to magic normalization key
-                number1 = Integer.valueOf(part1);
-
-            if (!(part2 == emptyString)) // compare to magic normalization key
-                number2 = Integer.valueOf(part2);
-
-            return number1.compareTo(number2);
-        }
-        catch (NumberFormatException ex) {
-            // means to compare as strings
-        }
-
-        if (part1 == emptyString)
-            part1 = "";
-        if (part2 == emptyString)
-            part2 = "";
-
-        return part1.compareTo(part2);
-    }
-
-    /**
-     * Normalize version strings so that they contain the same
-     * number of constituent parts.
-     *
-     * @param versions list array of parts of a version string
-     * @param maxLength truncate lists to this maximum length
-     */
-    protected void normalize(List versions[], int maxLength) {
-        int length = 0;
-        for (int i=0; i < versions.length; i++)
-            length = Math.max(length, versions[i].size());
-
-        if (length > maxLength)
-            length = maxLength;
-
-        for (int i=0; i < versions.length; i++) {
-            // remove excess elements
-            while (versions[i].size() > length)
-                versions[i].remove( versions[i].size()-1 );
-
-            // add in empty pad elements
-            while (versions[i].size() < length)
-                versions[i].add( emptyString );
-        }
-    }
-
-    /**
-     * Return the individual version strings that make up a Version.
-     */
-    protected List getVersionStrings() {
-        ArrayList strings = new ArrayList();
-
-        StringTokenizer st = new StringTokenizer(versionString, " ");
-        while (st.hasMoreTokens())
-            strings.add( st.nextToken() );
-
-        return strings;
-    }
-
-    /**
-     * Return the constituent parts of a version string.
-     *
-     * @param oneVersion a single version id string (not compound)
-     */
-    protected List getParts(String oneVersion) {
-        ArrayList strings = new ArrayList();
-
-        StringTokenizer st = new StringTokenizer(oneVersion, seperators+"+*");
-        while (st.hasMoreTokens()) {
-            strings.add( st.nextToken() );
-        }
-
-        return strings;
-    }
-
-    public String toString() {
-        return versionString;
-    }
-
-    /**
-     * Test.
-     */
-    /*
-    public static void main(String args[]) {
-        Version jvms[] = {
-            new Version("1.1* 1.3*"),
-            new Version("1.2+"),
-        };
-
-        Version versions[] = {
-            new Version("1.1"),
-            new Version("1.1.8"),
-            new Version("1.2"),
-            new Version("1.3"),
-            new Version("2.0"),
-            new Version("1.3.1"),
-            new Version("1.2.1"),
-            new Version("1.3.1-beta"),
-            new Version("1.1 1.2"),
-            new Version("1.2 1.3"),
-        };
-
-        for (int j = 0; j < jvms.length; j++) {
-            for (int v = 0; v < versions.length; v++) {
-                System.out.print( jvms[j].toString() + " " );
-                if (!jvms[j].matches(versions[v]))
-                    System.out.print( "!" );
-                System.out.println( "matches " + versions[v].toString() );
-            }
-        }
-
-        System.out.println("Test completed");
-    }
-    */
-
-}
--- a/netx/net/sourceforge/jnlp/cache/CacheEntry.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.cache;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.reflect.*;
-import java.security.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.*;
-import net.sourceforge.jnlp.util.*;
-
-/**
- * Describes an entry in the cache.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.10 $
- */
-public class CacheEntry {
-
-    /** the remote resource location */
-    private URL location;
-
-    /** the requested version */
-    private Version version;
-
-    /** info about the cached file */
-    private PropertiesFile properties;
-
-
-    /**
-     * Create a CacheEntry for the resources specified as a remote
-     * URL.
-     *
-     * @param location the remote resource location
-     * @param version the version of the resource
-     */
-    public CacheEntry(URL location, Version version) {
-        this.location = location;
-        this.version = version;
-
-        File infoFile = CacheUtil.getCacheFile(location, version);
-        infoFile = new File(infoFile.getPath()+".info"); // replace with something that can't be clobbered
-
-        properties = new PropertiesFile(infoFile, JNLPRuntime.getMessage("CAutoGen"));
-    }
-
-    /**
-     * Initialize the cache entry data from a connection to the
-     * remote resource (does not store data).
-     */
-    void initialize(URLConnection connection) {
-        long modified = connection.getLastModified();
-        long length = connection.getContentLength(); // an int
-
-        properties.setProperty("content-length", Long.toString(length));
-        properties.setProperty("last-modified", Long.toString(modified));
-    }
-
-    /**
-     * Returns the remote location this entry caches.
-     */
-    public URL getLocation() {
-        return location;
-    }
-
-    /**
-     * Returns the time in the local system clock that the file was
-     * most recently checked for an update.
-     */
-    public long getLastUpdated() {
-        try {
-            return Long.parseLong(properties.getProperty("last-updated"));
-        }
-        catch (Exception ex) {
-            return 0;
-        }
-    }
-
-    /**
-     * Sets the time in the local system clock that the file was
-     * most recently checked for an update.
-     */
-    public void setLastUpdated(long updatedTime) {
-        properties.setProperty("last-updated", Long.toString(updatedTime));
-    }
-
-    /**
-     * Returns whether there is a version of the URL contents in
-     * the cache and it is up to date.  This method may not return
-     * immediately.
-     *
-     * @param connection a connection to the remote URL
-     * @return whether the cache contains the version
-     */
-    public boolean isCurrent(URLConnection connection) {
-        boolean cached = isCached();
-
-        if (!cached)
-            return false;
-
-        try {
-            long remoteModified = connection.getLastModified();
-            long cachedModified = Long.parseLong(properties.getProperty("last-modified"));
-
-            if (remoteModified > 0 && remoteModified <= cachedModified)
-                return true;
-            else
-                return false;
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            return cached; // if can't connect return whether already in cache
-        }
-    }
-
-    /**
-     * Returns true if the cache has a local copy of the contents
-     * of the URL matching the specified version string.
-     *
-     * @return true if the resource is in the cache
-     */
-    public boolean isCached() {
-        File localFile = CacheUtil.getCacheFile(location, version);
-        if (!localFile.exists())
-            return false;
-
-        try {
-            long cachedLength = localFile.length();
-            long remoteLength = Long.parseLong(properties.getProperty("content-length", "-1"));
-
-            if (remoteLength >= 0 && cachedLength != remoteLength)
-                return false;
-            else
-                return true;
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            return false; // should throw?
-        }
-    }
-
-    /**
-     * Save the current information for the cache entry.
-     */
-    protected void store() {
-        properties.store();
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,379 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.cache;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.reflect.*;
-import java.security.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.*;
-import net.sourceforge.jnlp.util.FileUtils;
-
-/**
- * Provides static methods to interact with the cache, download
- * indicator, and other utility methods.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.17 $
- */
-public class CacheUtil {
-
-    private static String R(String key, Object param) {
-        return JNLPRuntime.getMessage(key, new Object[] {param});
-    }
-
-    /**
-     * Compares a URL using string compare of its protocol, host,
-     * port, path, query, and anchor.  This method avoids the host
-     * name lookup that URL.equals does for http: protocol URLs.
-     * It may not return the same value as the URL.equals method
-     * (different hostnames that resolve to the same IP address,
-     * ie sourceforge.net and www.sourceforge.net).
-     */
-    public static boolean urlEquals(URL u1, URL u2) {
-        if (u1==u2)
-            return true;
-        if (u1==null || u2==null)
-            return false;
-
-        if (!compare(u1.getProtocol(), u2.getProtocol(), true) ||
-            !compare(u1.getHost(), u2.getHost(), true) ||
-            //u1.getDefaultPort() != u2.getDefaultPort() || // only in 1.4
-            !compare(u1.getPath(), u2.getPath(), false) ||
-            !compare(u1.getQuery(), u2.getQuery(), false) ||
-            !compare(u1.getRef(), u2.getRef(), false))
-            return false;
-        else
-            return true;
-    }
-
-    /**
-     * Caches a resource and returns a URL for it in the cache;
-     * blocks until resource is cached.  If the resource location is
-     * not cacheable (points to a local file, etc) then the original
-     * URL is returned.<p>
-     *
-     * @param location location of the resource
-     * @param version the version, or null
-     * @return either the location in the cache or the original location
-     */
-    public static URL getCachedResource(URL location, Version version, UpdatePolicy policy) {
-        ResourceTracker rt = new ResourceTracker();
-        rt.addResource(location, version, policy);
-        try {
-            File f = rt.getCacheFile(location);
-            return f.toURL();
-        }
-        catch (MalformedURLException ex) {
-            return location;
-        }
-    }
-
-    /**
-     * Compare strings that can be null.
-     */
-    private static boolean compare(String s1, String s2, boolean ignore) {
-        if (s1==s2)
-            return true;
-        if (s1==null || s2==null)
-            return false;
-
-        if (ignore)
-            return s1.equalsIgnoreCase(s2);
-        else
-            return s1.equals(s2);
-    }
-
-    /**
-     * Returns the Permission object necessary to access the
-     * resource, or null if no permission is needed.
-     */
-    public static Permission getReadPermission(URL location, Version version) {
-        if (CacheUtil.isCacheable(location, version)) {
-            File file = CacheUtil.getCacheFile(location, version);
-
-            return new FilePermission(file.getPath(), "read");
-        }
-        else {
-            try {
-                // this is what URLClassLoader does
-                return location.openConnection().getPermission();
-            }
-            catch (java.io.IOException ioe) {
-                // should try to figure out the permission
-                if (JNLPRuntime.isDebug())
-                        ioe.printStackTrace();
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns whether there is a version of the URL contents in the
-     * cache and it is up to date.  This method may not return
-     * immediately.
-     *
-     * @param source the source URL
-     * @param version the versions to check for
-     * @param connection a connection to the URL, or null
-     * @return whether the cache contains the version
-     * @throws IllegalArgumentException if the source is not cacheable
-     */
-    public static boolean isCurrent(URL source, Version version, URLConnection connection) {
-
-        if (!isCacheable(source, version))
-            throw new IllegalArgumentException(R("CNotCacheable", source));
-
-        try {
-            if (connection == null)
-                connection = source.openConnection();
-
-            connection.connect();
-
-            CacheEntry entry = new CacheEntry(source, version); // could pool this
-            boolean result = entry.isCurrent(connection);
-
-            if (JNLPRuntime.isDebug())
-                System.out.println("isCurrent: "+source+" = "+result);
-
-            return result;
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            return isCached(source, version); // if can't connect return whether already in cache
-        }
-    }
-
-    /**
-     * Returns true if the cache has a local copy of the contents of
-     * the URL matching the specified version string.
-     *
-     * @param source the source URL
-     * @param version the versions to check for
-     * @return true if the source is in the cache
-     * @throws IllegalArgumentException if the source is not cacheable
-     */
-    public static boolean isCached(URL source, Version version) {
-        if (!isCacheable(source, version))
-            throw new IllegalArgumentException(R("CNotCacheable", source));
-
-        CacheEntry entry = new CacheEntry(source, version); // could pool this
-        boolean result = entry.isCached();
-
-        if (JNLPRuntime.isDebug())
-            System.out.println("isCached: "+source+" = "+result);
-
-        return result;
-    }
-
-    /**
-     * Returns whether the resource can be cached as a local file;
-     * if not, then URLConnection.openStream can be used to obtain
-     * the contents.
-     */
-    public static boolean isCacheable(URL source, Version version) {
-        if (source == null)
-            return false;
-
-        if (source.getProtocol().equals("file"))
-            return false;
-
-        if (source.getProtocol().equals("jar"))
-            return false;
-
-        return true;
-    }
-
-    /**
-     * Returns the file for the locally cached contents of the
-     * source.  This method returns the file location only and does
-     * not download the resource.  The latest version of the
-     * resource that matches the specified version will be returned.
-     *
-     * @param source the source URL
-     * @param version the version id of the local file
-     * @return the file location in the cache, or null if no versions cached
-     * @throws IllegalArgumentException if the source is not cacheable
-     */
-    public static File getCacheFile(URL source, Version version) {
-        // ensure that version is an version id not version string
-
-        if (!isCacheable(source, version))
-            throw new IllegalArgumentException(R("CNotCacheable", source));
-
-        try {
-            File localFile = urlToPath(source, "cache");
-            localFile.getParentFile().mkdirs();
-
-            return localFile;
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            return null;
-        }
-    }
-
-    /**
-     * Returns a buffered output stream open for writing to the
-     * cache file.
-     *
-     * @param source the remote location
-     * @param version the file version to write to
-     */
-    public static OutputStream getOutputStream(URL source, Version version) throws IOException {
-        File localFile = getCacheFile(source, version);
-        OutputStream out = new FileOutputStream(localFile);
-
-        return new BufferedOutputStream(out);
-    }
-
-    /**
-     * Copies from an input stream to an output stream.  On
-     * completion, both streams will be closed.  Streams are
-     * buffered automatically.
-     */
-    public static void streamCopy(InputStream is, OutputStream os) throws IOException {
-        if (!(is instanceof BufferedInputStream))
-            is = new BufferedInputStream(is);
-
-        if (!(os instanceof BufferedOutputStream))
-            os = new BufferedOutputStream(os);
-
-        try {
-            byte b[] = new byte[4096];
-            while (true) {
-                int c = is.read(b, 0, b.length);
-                if (c == -1)
-                    break;
-
-                os.write(b, 0, c);
-            }
-        }
-        finally {
-            is.close();
-            os.close();
-        }
-    }
-
-    /**
-     * Converts a URL into a local path string within the runtime's
-     * base directory.
-     *
-     * @param location the url
-     * @param subdir subdirectory under the base directory
-     * @return the file
-     */
-    public static File urlToPath(URL location, String subdir) {
-        StringBuffer path = new StringBuffer();
-
-        if (subdir != null) {
-            path.append(subdir);
-            path.append(File.separatorChar);
-        }
-
-        path.append(location.getProtocol());
-        path.append(File.separatorChar);
-        path.append(location.getHost());
-        path.append(File.separatorChar);
-        path.append(location.getPath().replace('/', File.separatorChar));
-
-        return new File(JNLPRuntime.getBaseDir(), FileUtils.sanitizePath(path.toString()));
-    }
-
-
-    /**
-     * Waits until the resources are downloaded, while showing a
-     * progress indicator.
-     *
-     * @param tracker the resource tracker
-     * @param resources the resources to wait for
-     * @param title name of the download
-     */
-    public static void waitForResources(ApplicationInstance app, ResourceTracker tracker, URL resources[], String title) {
-        DownloadIndicator indicator = JNLPRuntime.getDefaultDownloadIndicator();
-        DownloadServiceListener listener = null;
-
-        try {
-            if (indicator == null) {
-                tracker.waitForResources(resources, 0);
-                return;
-            }
-
-            // see if resources can be downloaded very quickly; avoids
-            // overhead of creating display components for the resources
-            if (tracker.waitForResources(resources, indicator.getInitialDelay()))
-                return;
-
-            // only resources not starting out downloaded are displayed
-            List urlList = new ArrayList();
-            for (int i=0; i < resources.length; i++) {
-                if (!tracker.checkResource(resources[i]))
-                    urlList.add(resources[i]);
-            }
-            URL undownloaded[] = (URL[]) urlList.toArray( new URL[urlList.size()] );
-
-            listener = indicator.getListener(app, title, undownloaded);
-
-            do {
-                long read = 0;
-                long total = 0;
-
-                for (int i=0; i < undownloaded.length; i++) {
-                    // add in any -1's; they're insignificant
-                    total += tracker.getTotalSize(undownloaded[i]);
-                    read += tracker.getAmountRead(undownloaded[i]);
-                }
-
-                int percent = (int)( (100*read)/Math.max(1,total) );
-
-                for (int i=0; i < undownloaded.length; i++)
-                    listener.progress(undownloaded[i], "version",
-                                      tracker.getAmountRead(undownloaded[i]),
-                                      tracker.getTotalSize(undownloaded[i]),
-                                      percent);
-            }
-            while (!tracker.waitForResources(resources, indicator.getUpdateRate()));
-
-            // make sure they read 100% until indicator closes
-            for (int i=0; i < undownloaded.length; i++)
-                listener.progress(undownloaded[i], "version",
-                                  tracker.getTotalSize(undownloaded[i]),
-                                  tracker.getTotalSize(undownloaded[i]),
-                                  100);
-
-        }
-        catch (InterruptedException ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-        }
-        finally {
-            if (listener != null)
-                indicator.disposeListener(listener);
-        }
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,320 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.cache;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.net.*;
-import java.util.*;
-import java.util.List;
-import javax.swing.*;
-import javax.swing.Timer;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.*;
-
-/**
- * Show the progress of downloads.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.3 $
- */
-public class DefaultDownloadIndicator implements DownloadIndicator {
-
-    // todo: rewrite this to cut down on size/complexity; smarter
-    // panels (JList, renderer) understand resources instead of
-    // nested panels and grid-bag mess.
-
-    // todo: fix bug where user closes download box and it
-    // never(?) reappears.
-
-    // todo: UI for user to cancel/restart download
-
-    // todo: this should be synchronized at some point but conflicts
-    // aren't very likely.
-
-    private static String downloading = JNLPRuntime.getMessage("CDownloading");
-    private static String complete = JNLPRuntime.getMessage("CComplete");
-
-    /** time to wait after completing but before window closes */
-    private static final int CLOSE_DELAY = 750;
-
-    /** the display window */
-    private static JFrame frame;
-
-    /** shared constraint */
-    static GridBagConstraints vertical;
-    static GridBagConstraints verticalIndent;
-    static {
-        vertical = new GridBagConstraints();
-        vertical.gridwidth = GridBagConstraints.REMAINDER;
-        vertical.weightx = 1.0;
-        vertical.fill = GridBagConstraints.HORIZONTAL;
-        vertical.anchor = GridBagConstraints.WEST;
-
-        verticalIndent = (GridBagConstraints) vertical.clone();
-        verticalIndent.insets = new Insets(0, 10, 3, 0);
-    }
-
-    /**
-     * Return the update rate.
-     */
-    public int getUpdateRate() {
-        return 150; //ms
-    }
-
-    /**
-     * Return the initial delay before obtaining a listener.
-     */
-    public int getInitialDelay() {
-        return 300; //ms
-    }
-
-    /**
-     * Return a download service listener that displays the progress
-     * in a shared download info window.
-     *
-     * @param app the downloading application, or null if N/A
-     * @param downloadName name identifying the download to the user
-     * @param resources initial urls to display (not required)
-     */
-    public DownloadServiceListener getListener(ApplicationInstance app, String downloadName, URL resources[]) {
-        DownloadPanel result = new DownloadPanel(downloadName);
-
-        if (frame == null) {
-            frame = new JFrame(downloading+"...");
-            frame.getContentPane().setLayout(new GridBagLayout());
-        }
-
-        if (resources != null)
-            for (int i=0; i < resources.length; i++)
-                result.addProgressPanel(resources[i], null);
-
-        frame.getContentPane().add(result, vertical);
-        frame.pack();
-
-        if (!frame.isVisible()) {
-            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-            Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(frame.getGraphicsConfiguration());
-            Dimension screen = new Dimension(screenSize.width - insets.left ,
-                    screenSize.height - insets.top);
-            frame.setLocation(screen.width-frame.getWidth(),
-                              screen.height-frame.getHeight());
-        }
-
-        frame.show();
-
-        return result;
-    }
-
-    /**
-     * Remove a download service listener that was obtained by
-     * calling the getDownloadListener method from the shared
-     * download info window.
-     */
-    public void disposeListener(final DownloadServiceListener listener) {
-        if (!(listener instanceof DownloadPanel))
-            return;
-
-        ActionListener hider = new ActionListener() {
-            public void actionPerformed(ActionEvent evt) {
-                if (frame.getContentPane().getComponentCount() == 1)
-                    frame.hide();
-
-                frame.getContentPane().remove((DownloadPanel) listener);
-                frame.pack();
-            }
-        };
-
-        Timer timer = new Timer(CLOSE_DELAY, hider);
-        timer.setRepeats(false);
-        timer.start();
-    }
-
-
-
-    /**
-     * Groups the url progress in a panel.
-     */
-    static class DownloadPanel extends JPanel implements DownloadServiceListener {
-
-        /** the download name */
-        private String downloadName;
-
-        /** Downloading part: */
-        private JLabel header = new JLabel();
-
-        /** list of URLs being downloaded */
-        private List urls = new ArrayList();
-
-        /** list of ProgressPanels */
-        private List panels = new ArrayList();
-
-
-        /**
-         * Create a new download panel for with the specified download
-         * name.
-         */
-        protected DownloadPanel(String downloadName) {
-            setLayout(new GridBagLayout());
-
-            this.downloadName = downloadName;
-            this.add(header, vertical);
-            header.setFont(header.getFont().deriveFont(Font.BOLD));
-
-            setOverallPercent(0);
-        }
-
-        /**
-         * Add a ProgressPanel for a URL.
-         */
-        protected void addProgressPanel(URL url, String version) {
-            if (!urls.contains(url)) {
-                ProgressPanel panel = new ProgressPanel(url, version);
-
-                add(panel, verticalIndent);
-                frame.pack();
-
-                urls.add(url);
-                panels.add(panel);
-            }
-        }
-
-        /**
-         * Update the download progress of a url.
-         */
-        protected void update(final URL url, final String version, final long readSoFar, final long total, final int overallPercent) {
-            Runnable r = new Runnable() {
-                public void run() {
-                    if (!urls.contains(url))
-                        addProgressPanel(url, version);
-
-                    setOverallPercent(overallPercent);
-
-                    ProgressPanel panel = (ProgressPanel) panels.get(urls.indexOf(url));
-                    panel.setProgress(readSoFar, total);
-                    panel.repaint();
-                }
-            };
-            SwingUtilities.invokeLater(r);
-        }
-
-        /**
-         * Sets the overall percent completed.
-         */
-        public void setOverallPercent(int percent) {
-            // don't get whole string from resource and sub in
-            // values because it'll be doing a MessageFormat for
-            // each update.
-            header.setText(downloading+" "+downloadName+": "+percent+"% "+complete+".");
-        }
-
-        /**
-         * Called when a download failed.
-         */
-        public void downloadFailed(URL url, String version) {
-            update(url, version, -1, -1, -1);
-        }
-
-        /**
-         * Called when a download has progressed.
-         */
-        public void progress(URL url, String version, long readSoFar, long total, int overallPercent) {
-            update(url, version, readSoFar, total, overallPercent);
-        }
-
-        /**
-         * Called when an archive is patched.
-         */
-        public void upgradingArchive(URL url, String version, int patchPercent, int overallPercent) {
-            update(url, version, patchPercent, 100, overallPercent);
-        }
-
-        /**
-         * Called when a download is being validated.
-         */
-        public void validating(URL url, String version, long entry, long total, int overallPercent) {
-            update(url, version, entry, total, overallPercent);
-        }
-
-    };
-
-
-
-    /**
-     * A progress bar with the URL next to it.
-     */
-    static class ProgressPanel extends JPanel {
-        private JPanel bar = new JPanel();
-
-        private long total;
-        private long readSoFar;
-
-        ProgressPanel(URL url, String version) {
-            JLabel location = new JLabel(" "+url.getHost()+"/"+url.getFile());
-
-            bar.setMinimumSize(new Dimension(80,15));
-            bar.setPreferredSize(new Dimension(80,15));
-            bar.setOpaque(false);
-
-            setLayout(new GridBagLayout());
-
-            GridBagConstraints gbc = new GridBagConstraints();
-            gbc.weightx = 0.0;
-            gbc.fill = GridBagConstraints.NONE;
-            gbc.gridwidth = GridBagConstraints.RELATIVE;
-            add(bar, gbc);
-
-            gbc.insets = new Insets(0, 3, 0, 0);
-            gbc.weightx = 1.0;
-            gbc.fill = GridBagConstraints.HORIZONTAL;
-            gbc.gridwidth = GridBagConstraints.REMAINDER;
-            gbc.anchor = GridBagConstraints.WEST;
-            add(location, gbc);
-        }
-
-        public void setProgress(long readSoFar, long total) {
-            this.readSoFar = readSoFar;
-            this.total = total;
-        }
-
-        public void paintComponent(Graphics g) {
-            super.paintComponent(g);
-
-            int x = bar.getX();
-            int y = bar.getY();
-            int h = bar.getHeight();
-            int w = bar.getWidth();
-
-            if (readSoFar <= 0 || total <= 0) {
-                // make barber pole
-            }
-            else {
-                double progress = (double)readSoFar / (double)total;
-                int divide = (int)(w * progress);
-
-                g.setColor(Color.white);
-                g.fillRect(x, y, w, h);
-                g.setColor(Color.blue);
-                g.fillRect(x+1, y+1, divide-1, h-1);
-            }
-        }
-    };
-
-}
--- a/netx/net/sourceforge/jnlp/cache/DownloadIndicator.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.cache;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.net.*;
-import java.util.*;
-import java.util.List;
-import javax.swing.*;
-import javax.swing.Timer;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.*;
-
-/**
- * A DownloadIndicator creates DownloadServiceListeners that are
- * notified of resources being transferred and their progress.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.8 $
- */
-public interface DownloadIndicator {
-
-    /**
-     * Return a download service listener that displays the progress
-     * of downloading resources.  Update messages may be reported
-     * for URLs that are not included initially.<p>
-     *
-     * Progress messages are sent as if the DownloadServiceListener
-     * were listening to a DownloadService request.  The listener
-     * will receive progress messages from time to time during the
-     * download. <p>
-     *
-     * @param app JNLP application downloading the files, or null if not applicable
-     * @param downloadName name identifying the download to the user
-     * @param resources initial urls to display, empty if none known at start
-     */
-    public DownloadServiceListener getListener(ApplicationInstance app,
-                                               String downloadName,
-                                               URL resources[]);
-
-    /**
-     * Indicates that a download service listener that was obtained
-     * from the getDownloadListener method will no longer be used.
-     * This method can be used to ensure that progress dialogs are
-     * properly removed once a particular download is finished.
-     *
-     * @param listener the listener that is no longer in use
-     */
-    public void disposeListener(DownloadServiceListener listener);
-
-    /**
-     * Return the desired time in milliseconds between updates.
-     * Updates are not guarenteed to occur based on this value; for
-     * example, they may occur based on the download percent or some
-     * other factor.
-     *
-     * @return rate in milliseconds, must be &gt;= 0
-     */
-    public int getUpdateRate();
-
-    /**
-     * Return a time in milliseconds to wait for a download to
-     * complete before obtaining a listener for the download.  This
-     * value can be used to skip lengthy operations, such as
-     * initializing a GUI, for downloads that complete quickly.  The
-     * getListener method is not called if the download completes
-     * in less time than the returned delay.
-     *
-     * @return delay in milliseconds, must be &gt;= 0
-     */
-    public int getInitialDelay();
-
-}
--- a/netx/net/sourceforge/jnlp/cache/Resource.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,269 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.cache;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.*;
-import net.sourceforge.jnlp.util.*;
-
-/**
- * Information about a single resource to download.
- * This class tracks the downloading of various resources of a
- * JNLP file to local files.  It can be used to download icons,
- * jnlp and extension files, jars, and jardiff files using the
- * version based protocol or any file using the basic download
- * protocol.<p>
- *
- * Resources can be put into download groups by specifying a part
- * name for the resource.  The resource tracker can also be
- * configured to prefetch resources, which are downloaded in the
- * order added to the media tracker.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.9 $
- */
-public class Resource {
-
-    // todo: fix resources to handle different versions
-
-    // todo: IIRC, any resource is checked for being up-to-date
-    // only once, regardless of UpdatePolicy.  verify and fix.
-
-    /** status bits */
-    public static final int UNINITIALIZED = 0;
-    public static final int CONNECT = 1;
-    public static final int CONNECTING = 2;
-    public static final int CONNECTED = 4;
-    public static final int DOWNLOAD = 8;
-    public static final int DOWNLOADING = 16;
-    public static final int DOWNLOADED = 32;
-    public static final int ERROR = 64;
-    public static final int STARTED = 128; // enqueued or being worked on
-
-    /** list of weak references of resources currently in use */
-    private static WeakList resources = new WeakList();
-
-    /** weak list of trackers monitoring this resource */
-    private WeakList trackers = new WeakList();
-
-    /** the remote location of the resource */
-    URL location;
-
-    /** the local file downloaded to */
-    File localFile;
-
-    /** the requested version */
-    Version requestVersion;
-
-    /** the version downloaded from server */
-    Version downloadVersion;
-
-    /** connection to resource */
-    URLConnection connection;
-
-    /** amount in bytes transferred */
-    long transferred = 0;
-
-    /** total size of the resource, or -1 if unknown */
-    long size = -1;
-
-    /** the status of the resource */
-    int status = UNINITIALIZED;
-
-    /** Update policy for this resource */
-    UpdatePolicy updatePolicy;
-
-    /**
-     * Create a resource.
-     */
-    private Resource(URL location, Version requestVersion, UpdatePolicy updatePolicy) {
-        this.location = location;
-        this.requestVersion = requestVersion;
-        this.updatePolicy = updatePolicy;
-    }
-
-    /**
-     * Return a shared Resource object representing the given
-     * location and version.
-     */
-    public static Resource getResource(URL location, Version requestVersion, UpdatePolicy updatePolicy) {
-        synchronized (resources) {
-            Resource resource = new Resource(location, requestVersion, updatePolicy);
-
-            int index = resources.indexOf(resource);
-            if (index >= 0) { // return existing object
-                Resource result = (Resource) resources.get(index);
-                if (result != null)
-                    return result;
-            }
-
-            resources.add(resource);
-            resources.trimToSize();
-
-            return resource;
-        }
-    }
-
-    /**
-     * Returns the remote location of the resource.
-     */
-    public URL getLocation() {
-        return location;
-    }
-
-    /**
-     * Returns the tracker that first created or monitored the
-     * resource, or null if no trackers are monitoring the resource.
-     */
-    ResourceTracker getTracker() {
-        synchronized (trackers) {
-            List t = trackers.hardList();
-            if (t.size() > 0)
-                return (ResourceTracker) t.get(0);
-
-            return null;
-        }
-    }
-
-    /**
-     * Returns true if any of the specified flags are set.
-     */
-    public boolean isSet(int flag) {
-        if (flag == UNINITIALIZED)
-            return status == UNINITIALIZED;
-        else
-            return (status & flag) != 0;
-    }
-
-    /**
-     * Returns the update policy for this resource
-     *
-     * @return The update policy
-     */
-    public UpdatePolicy getUpdatePolicy() {
-        return this.updatePolicy;
-    }
-
-    /**
-     * Returns a human-readable status string.
-     */
-    private String getStatusString(int flag) {
-        StringBuffer result = new StringBuffer();
-
-        if (flag == 0) result.append("<> ");
-        if ((flag & CONNECT) != 0) result.append("CONNECT ");
-        if ((flag & CONNECTING) != 0) result.append("CONNECTING ");
-        if ((flag & CONNECTED) != 0) result.append("CONNECTED ");
-        if ((flag & DOWNLOAD) != 0) result.append("DOWNLOAD ");
-        if ((flag & DOWNLOADING) != 0) result.append("DOWNLOADING ");
-        if ((flag & DOWNLOADED) != 0) result.append("DOWNLOADED ");
-        if ((flag & ERROR) != 0) result.append("ERROR ");
-        if ((flag & STARTED) != 0) result.append("STARTED ");
-
-        return result.deleteCharAt(result.length()-1).toString();
-    }
-
-    /**
-     * Changes the status by clearing the flags in the first
-     * parameter and setting the flags in the second.  This method
-     * is synchronized on this resource.
-     */
-    public void changeStatus(int clear, int add) {
-        int orig = 0;
-
-        synchronized(this) {
-            orig = status;
-
-            this.status &= ~clear;
-            this.status |= add;
-        }
-
-        if (JNLPRuntime.isDebug())
-            if (status != orig) {
-                System.out.print("Status: "+getStatusString(status));
-                if ((status & ~orig) != 0)
-                    System.out.print(" +("+getStatusString(status & ~orig)+")");
-                if ((~status & orig) != 0)
-                    System.out.print(" -("+getStatusString(~status & orig)+")");
-                System.out.println(" @ "+location.getPath());
-            }
-    }
-
-    /**
-     * Removes the tracker to the list of trackers monitoring this
-     * resource.
-     */
-    public void removeTracker(ResourceTracker tracker) {
-        synchronized (trackers) {
-            trackers.remove(tracker);
-            trackers.trimToSize();
-        }
-    }
-
-    /**
-     * Adds the tracker to the list of trackers monitoring this
-     * resource.
-     */
-    public void addTracker(ResourceTracker tracker) {
-        synchronized (trackers) {
-            List t = trackers.hardList(); // prevent GC between contains and add
-            if (!t.contains(tracker))
-                trackers.add(tracker);
-
-            trackers.trimToSize();
-        }
-    }
-
-    /**
-     * Instructs the trackers monitoring this resource to fire a
-     * download event.
-     */
-    protected void fireDownloadEvent() {
-        List send;
-
-        synchronized (trackers) {
-            send = trackers.hardList();
-        }
-
-        for (int i=0; i < send.size(); i++) {
-            ResourceTracker rt = (ResourceTracker) send.get(i);
-            rt.fireDownloadEvent(this);
-        }
-    }
-
-    public boolean equals(Object other) {
-        if (other instanceof Resource) {
-            // this prevents the URL handler from looking up the IP
-            // address and doing name resolution; much faster so less
-            // time spent in synchronized addResource determining if
-            // Resource is already in a tracker, and better for offline
-            // mode on some OS.
-            return CacheUtil.urlEquals(location, ((Resource)other).location);
-        }
-        return false;
-    }
-
-    public String toString() {
-        return "location="+location.toString() + " state="+getStatusString(status);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1049 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.cache;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Pack200;
-import java.util.jar.Pack200.Unpacker;
-import java.util.zip.GZIPInputStream;
-
-import net.sourceforge.jnlp.Version;
-import net.sourceforge.jnlp.event.DownloadEvent;
-import net.sourceforge.jnlp.event.DownloadListener;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.util.WeakList;
-
-/**
- * This class tracks the downloading of various resources of a
- * JNLP file to local files in the cache.  It can be used to
- * download icons, jnlp and extension files, jars, and jardiff
- * files using the version based protocol or any file using the
- * basic download protocol (jardiff and version not implemented
- * yet).<p>
- *
- * The resource tracker can be configured to prefetch resources,
- * which are downloaded in the order added to the media
- * tracker.<p>
- *
- * Multiple threads are used to download and cache resources that
- * are actively being waited for (blocking a caller) or those that
- * have been started downloading by calling the startDownload
- * method.  Resources that are prefetched are downloaded one at a
- * time and only if no other trackers have requested downloads.
- * This allows the tracker to start downloading many items without
- * using many system resources, but still quickly download items
- * as needed.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.22 $
- */
-public class ResourceTracker {
-
-    // todo: use event listener arrays instead of lists
-
-    // todo: see if there is a way to set the socket options just
-    // for use by the tracker so checks for updates don't hang for
-    // a long time.
-
-    // todo: ability to restart/retry a hung download
-
-    // todo: move resource downloading/processing code into Resource
-    // class, threading stays in ResourceTracker
-
-    // todo: get status method? and some way to convey error status
-    // to the caller.
-
-    // todo: might make a tracker be able to download more than one
-    // version of a resource, but probably not very useful.
-
-
-    // defines
-    //    ResourceTracker.Downloader (download threads)
-
-    // separately locks on (in order of aquire order, ie, sync on prefetch never syncs on lock):
-    //   lock, prefetch, this.resources, each resource, listeners
-
-    /** notified on initialization or download of a resource */
-    private static Object lock = new Integer(0); // used to lock static structures
-
-    // shortcuts
-    private static final int UNINITIALIZED = Resource.UNINITIALIZED;
-    private static final int CONNECT = Resource.CONNECT;
-    private static final int CONNECTING = Resource.CONNECTING;
-    private static final int CONNECTED = Resource.CONNECTED;
-    private static final int DOWNLOAD = Resource.DOWNLOAD;
-    private static final int DOWNLOADING = Resource.DOWNLOADING;
-    private static final int DOWNLOADED = Resource.DOWNLOADED;
-    private static final int ERROR = Resource.ERROR;
-    private static final int STARTED = Resource.STARTED;
-
-    /** max threads */
-    private static final int maxThreads = 5;
-
-    /** running threads */
-    private static int threads = 0;
-
-    /** weak list of resource trackers with resources to prefetch */
-    private static WeakList prefetchTrackers = new WeakList();
-
-    /** resources requested to be downloaded */
-    private static ArrayList queue = new ArrayList();
-
-    /** resource trackers threads are working for (used for load balancing across multi-tracker downloads) */
-    private static ArrayList active = new ArrayList(); //
-
-    /** the resources known about by this resource tracker */
-    private List resources = new ArrayList();
-
-    /** download listeners for this tracker */
-    private List listeners = new ArrayList();
-
-    /** whether to download parts before requested */
-    private boolean prefetch;
-
-
-    /**
-     * Creates a resource tracker that does not prefetch resources.
-     */
-    public ResourceTracker() {
-        this(false);
-    }
-
-    /**
-     * Creates a resource tracker.
-     *
-     * @param prefetch whether to download resources before requested.
-     */
-    public ResourceTracker(boolean prefetch) {
-        this.prefetch = prefetch;
-
-        if (prefetch) {
-            synchronized (prefetchTrackers) {
-                prefetchTrackers.add(this);
-                prefetchTrackers.trimToSize();
-            }
-        }
-    }
-
-    /**
-     * Add a resource identified by the specified location and
-     * version.  The tracker only downloads one version of a given
-     * resource per instance (ie cannot download both versions 1 and
-     * 2 of a resource in the same tracker).
-     *
-     * @param location the location of the resource
-     * @param version the resource version
-     * @param updatePolicy whether to check for updates if already in cache
-     */
-    public void addResource(URL location, Version version, UpdatePolicy updatePolicy) {
-        if (location == null)
-            throw new IllegalArgumentException("location==null");
-
-        Resource resource = Resource.getResource(location, version, updatePolicy);
-        boolean downloaded = false;
-
-        synchronized (resources) {
-            if (resources.contains(resource))
-                return;
-            resource.addTracker(this);
-            resources.add(resource);
-        }
-
-        // checkCache may take a while (loads properties file).  this
-        // should really be synchronized on resources, but the worst
-        // case should be that the resource will be updated once even
-        // if unnecessary.
-        downloaded = checkCache(resource, updatePolicy);
-
-        synchronized (lock) {
-            if (!downloaded)
-                if (prefetch && threads == 0) // existing threads do pre-fetch when queue empty
-                    startThread();
-        }
-    }
-
-    /**
-     * Removes a resource from the tracker.  This method is useful
-     * to allow memory to be reclaimed, but calling this method is
-     * not required as resources are reclaimed when the tracker is
-     * collected.
-     *
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    public void removeResource(URL location) {
-        synchronized (resources) {
-            Resource resource = getResource(location);
-
-            if (resource != null) {
-                resources.remove(resource);
-                resource.removeTracker(this);
-            }
-
-            // should remove from queue? probably doesn't matter
-        }
-    }
-
-    /**
-     * Check the cache for a resource, and initialize the resource
-     * as already downloaded if found. <p>
-     *
-     * @param updatePolicy whether to check for updates if already in cache
-     * @return whether the resource are already downloaded
-     */
-    private boolean checkCache(Resource resource, UpdatePolicy updatePolicy) {
-        if (!CacheUtil.isCacheable(resource.location, resource.downloadVersion)) {
-            // pretend that they are already downloaded; essentially
-            // they will just 'pass through' the tracker as if they were
-            // never added (for example, not affecting the total download size).
-            synchronized (resource) {
-                resource.changeStatus(0, DOWNLOADED|CONNECTED|STARTED);
-            }
-            fireDownloadEvent(resource);
-            return true;
-        }
-
-        if (updatePolicy != UpdatePolicy.ALWAYS && updatePolicy != UpdatePolicy.FORCE) { // save loading entry props file
-            CacheEntry entry = new CacheEntry(resource.location, resource.downloadVersion);
-
-            if (entry.isCached() && !updatePolicy.shouldUpdate(entry)) {
-                if (JNLPRuntime.isDebug())
-                    System.out.println("not updating: "+resource.location);
-
-                synchronized (resource) {
-                    resource.localFile = CacheUtil.getCacheFile(resource.location, resource.downloadVersion);
-                    resource.size = resource.localFile.length();
-                    resource.transferred = resource.localFile.length();
-                    resource.changeStatus(0, DOWNLOADED|CONNECTED|STARTED);
-                }
-                fireDownloadEvent(resource);
-                return true;
-            }
-        }
-
-        if (updatePolicy == UpdatePolicy.FORCE) { // ALWAYS update
-            // When we are "always" updating, we update for each instance. Reset resource status.
-            resource.changeStatus(Integer.MAX_VALUE, 0);
-        }
-
-        // may or may not be cached, but check update when connection
-        // is open to possibly save network communication time if it
-        // has to be downloaded, and allow this call to return quickly
-        return false;
-    }
-
-    /**
-     * Adds the listener to the list of objects interested in
-     * receivind DownloadEvents.<p>
-     *
-     * @param location the resource to add a callback for
-     * @param runnable the runnable to call when resource is completed
-     */
-    public void addDownloadListener(DownloadListener listener) {
-        synchronized (listeners) {
-            if (!listeners.contains(listener))
-                listeners.add(listener);
-        }
-    }
-
-    /**
-     * Removes a download listener.
-     */
-    public void removeDownloadListener(DownloadListener listener) {
-        synchronized (listeners) {
-            listeners.remove(listener);
-        }
-    }
-
-    /**
-     * Fires the download event corresponding to the resource's
-     * state.  This method is typicall called by the Resource itself
-     * on each tracker that is monitoring the resource.  Do not call
-     * this method with any locks because the listeners may call
-     * back to this ResourceTracker.
-     */
-    protected void fireDownloadEvent(Resource resource) {
-        DownloadListener l[] = null;
-        synchronized (listeners) {
-            l = (DownloadListener[]) listeners.toArray(new DownloadListener[0]);
-        }
-
-        int status;
-        synchronized (resource) {
-            status = resource.status;
-        }
-
-        DownloadEvent event = new DownloadEvent(this, resource);
-        for (int i=0; i < l.length; i++) {
-            if (0 != ((ERROR|DOWNLOADED) & status))
-                l[i].downloadCompleted(event);
-            else if (0 != (DOWNLOADING & status))
-                l[i].downloadStarted(event);
-            else if (0 != (CONNECTING & status))
-                l[i].updateStarted(event);
-        }
-    }
-
-    /**
-     * Returns a URL pointing to the cached location of the
-     * resource, or the resource itself if it is a non-cacheable
-     * resource.<p>
-     *
-     * If the resource has not downloaded yet, the method will block
-     * until it has been transferred to the cache.<p>
-     *
-     * @param location the resource location
-     * @return the resource, or null if it could not be downloaded
-     * @throws IllegalArgumentException if the resource is not being tracked
-     * @see CacheUtil#isCacheable
-     */
-    public URL getCacheURL(URL location) {
-        try {
-            File f = getCacheFile(location);
-            if (f != null)
-                return f.toURL();
-        }
-        catch (MalformedURLException ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-        }
-
-        return location;
-    }
-
-    /**
-     * Returns a file containing the downloaded resource.  If the
-     * resource is non-cacheable then null is returned unless the
-     * resource is a local file (the original file is returned).<p>
-     *
-     * If the resource has not downloaded yet, the method will block
-     * until it has been transferred to the cache.<p>
-     *
-     * @param location the resource location
-     * @return a local file containing the resource, or null
-     * @throws IllegalArgumentException if the resource is not being tracked
-     * @see CacheUtil#isCacheable
-     */
-    public File getCacheFile(URL location) {
-        try {
-            Resource resource = getResource(location);
-            if (!resource.isSet(DOWNLOADED|ERROR))
-                waitForResource(location, 0);
-
-            if (resource.isSet(ERROR))
-                return null;
-
-            if (resource.localFile != null)
-                return resource.localFile;
-
-            if (location.getProtocol().equalsIgnoreCase("file")) {
-                File file = new File(location.getFile());
-                if (file.exists())
-                    return file;
-            }
-
-            return null;
-        }
-        catch (InterruptedException ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            return null; // need an error exception to throw
-        }
-    }
-
-    /**
-     * Returns an input stream that reads the contents of the
-     * resource.  For non-cacheable resources, an InputStream that
-     * reads from the source location is returned.  Otherwise the
-     * InputStream reads the cached resource.<p>
-     *
-     * This method will block while the resource is downloaded to
-     * the cache.
-     *
-     * @throws IOException if there was an error opening the stream
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    public InputStream getInputStream(URL location) throws IOException {
-        try {
-            Resource resource = getResource(location);
-            if (!resource.isSet(DOWNLOADED|ERROR))
-                waitForResource(location, 0);
-
-            if (resource.localFile != null)
-                return new FileInputStream(resource.localFile);
-
-            return resource.location.openStream();
-        }
-        catch (InterruptedException ex) {
-            throw new IOException("wait was interrupted");
-        }
-    }
-
-    /**
-     * Wait for a group of resources to be downloaded and made
-     * available locally.
-     *
-     * @param urls the resources to wait for
-     * @param timeout the time in ms to wait before returning, 0 for no timeout
-     * @return whether the resources downloaded before the timeout
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    public boolean waitForResources(URL urls[], long timeout) throws InterruptedException {
-        Resource resources[] = new Resource[ urls.length ];
-
-        synchronized(resources) {
-            // keep the lock so getResource doesn't have to aquire it each time
-            for (int i=0; i < urls.length; i++)
-                resources[i] = getResource(urls[i]);
-        }
-
-        if (resources.length > 0)
-            return wait(resources, timeout);
-
-        return true;
-    }
-
-    /**
-     * Wait for a particular resource to be downloaded and made
-     * available.
-     *
-     * @param location the resource to wait for
-     * @param timeout the timeout, or 0 to wait until completed
-     * @return whether the resource downloaded before the timeout
-     * @throws InterruptedException if another thread interrupted the wait
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    public boolean waitForResource(URL location, long timeout) throws InterruptedException {
-        return wait(new Resource[] { getResource(location) }, timeout);
-    }
-
-    /**
-     * Returns the number of bytes downloaded for a resource.
-     *
-     * @param location the resource location
-     * @return the number of bytes transferred
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    public long getAmountRead(URL location) {
-        // not atomic b/c transferred is a long, but so what (each
-        // byte atomic? so probably won't affect anything...)
-        return getResource(location).transferred;
-    }
-
-    /**
-     * Returns whether a resource is available for use (ie, can be
-     * accessed with the getCacheFile method).
-     *
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    public boolean checkResource(URL location) {
-        return getResource(location).isSet(DOWNLOADED|ERROR); // isSet atomic
-    }
-
-    /**
-     * Starts loading the resource if it is not already being
-     * downloaded or already cached.  Resources started downloading
-     * using this method may download faster than those prefetched
-     * by the tracker because the tracker will only prefetch one
-     * resource at a time to conserve system resources.
-     *
-     * @return true if the resource is already downloaded (or an error occurred)
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    public boolean startResource(URL location) {
-        Resource resource = getResource(location);
-
-        return startResource(resource);
-    }
-
-    /**
-     * Sets the resource status to connect and download, and
-     * enqueues the resource if not already started.
-     *
-     * @return true if the resource is already downloaded (or an error occurred)
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    private boolean startResource(Resource resource) {
-        boolean enqueue = false;
-
-        synchronized (resource) {
-            if (resource.isSet(ERROR))
-                return true;
-
-            enqueue = !resource.isSet(STARTED);
-
-            if (!resource.isSet(CONNECTED | CONNECTING))
-                resource.changeStatus(0, CONNECT|STARTED);
-            if (!resource.isSet(DOWNLOADED | DOWNLOADING))
-                resource.changeStatus(0, DOWNLOAD|STARTED);
-
-            if (!resource.isSet(DOWNLOAD|CONNECT))
-                enqueue = false;
-        }
-
-        if (enqueue)
-            queueResource(resource);
-
-        return !enqueue;
-    }
-
-    /**
-     * Returns the number of total size in bytes of a resource, or
-     * -1 it the size is not known.
-     *
-     * @param location the resource location
-     * @return the number of bytes, or -1
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    public long getTotalSize(URL location) {
-        return getResource(location).size; // atomic
-    }
-
-    /**
-     * Start a new download thread if there are not too many threads
-     * already running.<p>
-     *
-     * Calls to this method should be synchronized on lock.
-     */
-    protected void startThread() {
-        if (threads < maxThreads) {
-            threads++;
-
-            Thread thread = new Thread(new Downloader());
-            thread.start();
-        }
-    }
-
-    /**
-     * A thread is ending, called by the thread itself.<p>
-     *
-     * Calls to this method should be synchronized.
-     */
-    private void endThread() {
-        threads--;
-
-        if (threads < 0) {
-            // this should never happen but try to recover
-            threads = 0;
-
-            if (queue.size() > 0) // if any on queue make sure a thread is running
-                startThread(); // look into whether this could create a loop
-
-            throw new RuntimeException("tracker threads < 0");
-        }
-
-        if (threads == 0) {
-            synchronized (prefetchTrackers) {
-                queue.trimToSize(); // these only accessed by threads so no sync needed
-                active.clear(); // no threads so no trackers actively downloading
-                active.trimToSize();
-                prefetchTrackers.trimToSize();
-            }
-        }
-    }
-
-    /**
-     * Add a resource to the queue and start a thread to download or
-     * initialize it.
-     */
-    private void queueResource(Resource resource) {
-        synchronized (lock) {
-            if (!resource.isSet(CONNECT|DOWNLOAD))
-                throw new IllegalArgumentException("Invalid resource state (resource: "+resource+")");
-
-            queue.add(resource);
-            startThread();
-        }
-    }
-
-    /**
-     * Process the resource by either downloading it or initializing
-     * it.
-     */
-    private void processResource(Resource resource) {
-        boolean doConnect = false;
-        boolean doDownload = false;
-
-        synchronized (resource) {
-            if (resource.isSet(CONNECTING))
-                doConnect = true;
-        }
-        if (doConnect)
-            initializeResource(resource);
-
-        synchronized (resource) {
-            // return to queue if we just initalized but it still needs
-            // to download (not cached locally / out of date)
-            if (resource.isSet(DOWNLOAD)) // would be DOWNLOADING if connected before this method
-                queueResource(resource);
-
-            if (resource.isSet(DOWNLOADING))
-                doDownload = true;
-        }
-        if (doDownload)
-            downloadResource(resource);
-    }
-
-    /**
-     * Downloads a resource to a file, uncompressing it if required
-     *
-     * @param resource the resource to download
-     */
-    private void downloadResource(Resource resource) {
-        resource.fireDownloadEvent(); // fire DOWNLOADING
-
-        try {
-            // create out second in case in does not exist
-            URLConnection con = getVersionedResourceURL(resource).openConnection();
-            con.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip");
-
-            con.connect();
-
-            /*
-             * We dont really know what we are downloading. If we ask for
-             * foo.jar, the server might send us foo.jar.pack.gz or foo.jar.gz
-             * instead. So we save the file with the appropriate extension
-             */
-            URL downloadLocation = resource.location;
-
-            String contentEncoding = con.getContentEncoding();
-
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("Content encoding for " + resource.location + ": "
-                        + contentEncoding);
-            }
-
-            if (contentEncoding != null) {
-                if (contentEncoding.equals("gzip")) {
-                    downloadLocation = new URL(downloadLocation.toString() + ".gz");
-                } else if (contentEncoding.equals("pack200-gzip")) {
-                    downloadLocation = new URL(downloadLocation.toString() + ".pack.gz");
-                }
-            }
-
-            InputStream in = new BufferedInputStream(con.getInputStream());
-            OutputStream out = CacheUtil.getOutputStream(downloadLocation, resource.downloadVersion);
-            byte buf[] = new byte[1024];
-            int rlen;
-
-            while (-1 != (rlen = in.read(buf))) {
-                resource.transferred += rlen;
-                out.write(buf, 0, rlen);
-            }
-
-            in.close();
-            out.close();
-
-            // explicitly close the URLConnection.
-            if (con instanceof HttpURLConnection)
-                ((HttpURLConnection)con).disconnect();
-
-            /*
-             * If the file was compressed, uncompress it.
-             */
-            if (contentEncoding != null) {
-                if (contentEncoding.equals("gzip")) {
-                    GZIPInputStream gzInputStream = new GZIPInputStream(new FileInputStream(CacheUtil
-                            .getCacheFile(downloadLocation, resource.downloadVersion)));
-                    InputStream inputStream = new BufferedInputStream(gzInputStream);
-
-                    BufferedOutputStream outputStream = new BufferedOutputStream(
-                            new FileOutputStream(CacheUtil.getCacheFile(resource.location,
-                                    resource.downloadVersion)));
-
-                    while (-1 != (rlen = inputStream.read(buf))) {
-                        outputStream.write(buf, 0, rlen);
-                    }
-
-                    outputStream.close();
-                    inputStream.close();
-                    gzInputStream.close();
-
-                } else if (contentEncoding.equals("pack200-gzip")) {
-                    GZIPInputStream gzInputStream = new GZIPInputStream(new FileInputStream(
-                            CacheUtil.getCacheFile(downloadLocation, resource.downloadVersion)));
-                    InputStream inputStream = new BufferedInputStream(gzInputStream);
-
-                    JarOutputStream outputStream = new JarOutputStream(new FileOutputStream(
-                            CacheUtil.getCacheFile(resource.location, resource.downloadVersion)));
-
-                    Unpacker unpacker = Pack200.newUnpacker();
-                    unpacker.unpack(inputStream, outputStream);
-
-                    outputStream.close();
-                    inputStream.close();
-                    gzInputStream.close();
-                }
-            }
-
-            resource.changeStatus(DOWNLOADING, DOWNLOADED);
-            synchronized(lock) {
-                lock.notifyAll(); // wake up wait's to check for completion
-            }
-            resource.fireDownloadEvent(); // fire DOWNLOADED
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            resource.changeStatus(0, ERROR);
-            synchronized(lock) {
-                lock.notifyAll(); // wake up wait's to check for completion
-            }
-            resource.fireDownloadEvent(); // fire ERROR
-        }
-    }
-
-    /**
-     * Open a URL connection and get the content length and other
-     * fields.
-     */
-    private void initializeResource(Resource resource) {
-        resource.fireDownloadEvent(); // fire CONNECTING
-
-        try {
-            File localFile = CacheUtil.getCacheFile(resource.location, resource.downloadVersion);
-
-            // connect
-            URLConnection connection = getVersionedResourceURL(resource).openConnection(); // this won't change so should be okay unsynchronized
-            connection.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip");
-
-            int size = connection.getContentLength();
-            boolean current = CacheUtil.isCurrent(resource.location, resource.requestVersion, connection) && resource.getUpdatePolicy() != UpdatePolicy.FORCE;
-
-            synchronized(resource) {
-                resource.localFile = localFile;
-                // resource.connection = connection;
-                resource.size = size;
-                resource.changeStatus(CONNECT|CONNECTING, CONNECTED);
-
-                // check if up-to-date; if so set as downloaded
-                if (current)
-                    resource.changeStatus(DOWNLOAD|DOWNLOADING, DOWNLOADED);
-            }
-
-            // update cache entry
-            CacheEntry entry = new CacheEntry(resource.location, resource.requestVersion);
-            if (!current)
-                entry.initialize(connection);
-
-            entry.setLastUpdated(System.currentTimeMillis());
-            entry.store();
-
-            synchronized(lock) {
-                lock.notifyAll(); // wake up wait's to check for completion
-            }
-            resource.fireDownloadEvent(); // fire CONNECTED
-
-            // explicitly close the URLConnection.
-                        if (connection instanceof HttpURLConnection)
-                ((HttpURLConnection)connection).disconnect();
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            resource.changeStatus(0, ERROR);
-            synchronized(lock) {
-                lock.notifyAll(); // wake up wait's to check for completion
-            }
-            resource.fireDownloadEvent(); // fire ERROR
-        }
-    }
-
-    /**
-     * Returns the versioned url for a resource
-     * @param resource the resource to get the url for
-     */
-    private URL getVersionedResourceURL(Resource resource) {
-        String actualLocation = resource.location.getProtocol() + "://"
-                + resource.location.getHost();
-        if (resource.location.getPort() != -1) {
-            actualLocation += ":" + resource.location.getPort();
-        }
-        actualLocation += resource.location.getPath();
-        if (resource.requestVersion != null
-                && resource.requestVersion.isVersionId()) {
-            actualLocation += "?version-id=" + resource.requestVersion;
-        }
-        URL versionedURL;
-        try {
-            versionedURL = new URL(actualLocation);
-        } catch (MalformedURLException e) {
-            return resource.location;
-        }
-        return versionedURL;
-    }
-
-
-    /**
-     * Pick the next resource to download or initialize.  If there
-     * are no more resources requested then one is taken from a
-     * resource tracker with prefetch enabled.<p>
-     *
-     * The resource state is advanced before it is returned
-     * (CONNECT-&gt;CONNECTING).<p>
-     *
-     * Calls to this method should be synchronized on lock.<p>
-     *
-     * @return the resource to initialize or download, or null
-     */
-    private static Resource selectNextResource() {
-        Resource result;
-
-        // pick from queue
-        result = selectByFlag(queue, CONNECT, ERROR); // connect but not error
-        if (result == null)
-            result = selectByFlag(queue, DOWNLOAD, ERROR|CONNECT|CONNECTING);
-
-        // remove from queue if found
-        if (result != null)
-            queue.remove(result);
-
-        // prefetch if nothing found so far and this is the last thread
-        if (result == null && threads == 1)
-            result = getPrefetch();
-
-        if (result == null)
-            return null;
-
-        synchronized (result) {
-            if (result.isSet(CONNECT)) {
-                result.changeStatus(CONNECT, CONNECTING);
-            }
-            else if (result.isSet(DOWNLOAD)) {
-                // only download if *not* connecting, when done connecting
-                // select next will pick up the download part.  This makes
-                // all requested connects happen before any downloads, so
-                // the size is known as early as possible.
-                result.changeStatus(DOWNLOAD, DOWNLOADING);
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * Returns the next resource to be prefetched before
-     * requested.<p>
-     *
-     * Calls to this method should be synchronized on lock.<p>
-     */
-    private static Resource getPrefetch() {
-        Resource result = null;
-        Resource alternate = null;
-
-        // first find one to initialize
-        synchronized (prefetchTrackers) {
-            for (int i=0; i < prefetchTrackers.size() && result == null; i++) {
-                ResourceTracker tracker = (ResourceTracker) prefetchTrackers.get(i);
-                if (tracker == null)
-                    continue;
-
-                synchronized (tracker.resources) {
-                    result = selectByFlag(tracker.resources, UNINITIALIZED, ERROR);
-
-                    if (result == null && alternate == null)
-                        alternate = selectByFlag(tracker.resources, CONNECTED, ERROR|DOWNLOADED|DOWNLOADING|DOWNLOAD);
-                }
-            }
-        }
-
-        // if none to initialize, switch to download
-        if (result == null)
-            result = alternate;
-
-        if (result == null)
-            return null;
-
-        synchronized (result) {
-            ResourceTracker tracker = result.getTracker();
-            if (tracker == null)
-                return null; // GC of tracker happened between above code and here
-
-            // prevents startResource from putting it on queue since
-            // we're going to return it.
-            result.changeStatus(0, STARTED);
-
-            tracker.startResource(result);
-        }
-
-        return result;
-    }
-
-    /**
-     * Selects a resource from the source list that has the
-     * specified flag set.<p>
-     *
-     * Calls to this method should be synchronized on lock and
-     * source list.<p>
-     */
-    private static Resource selectByFlag(List source, int flag, int notflag) {
-        Resource result = null;
-        int score = Integer.MAX_VALUE;
-
-        for (int i=0; i < source.size(); i++) {
-            Resource resource = (Resource) source.get(i);
-            boolean selectable = false;
-
-            synchronized (resource) {
-                if (resource.isSet(flag) && !resource.isSet(notflag))
-                    selectable = true;
-            }
-
-            if (selectable) {
-                int activeCount = 0;
-
-                for (int j=0; j < active.size(); j++)
-                    if ((ResourceTracker)active.get(j) == resource.getTracker())
-                        activeCount++;
-
-                // try to spread out the downloads so that a slow host
-                // won't monopolize the downloads
-                if (activeCount < score) {
-                    result = resource;
-                    score = activeCount;
-                }
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * Return the resource matching the specified URL.
-     *
-     * @throws IllegalArgumentException if the resource is not being tracked
-     */
-    private Resource getResource(URL location) {
-        synchronized (resources) {
-            for (int i=0; i < resources.size(); i++) {
-                Resource resource = (Resource) resources.get(i);
-
-                if (CacheUtil.urlEquals(resource.location, location))
-                    return resource;
-            }
-        }
-
-        throw new IllegalArgumentException("Location does not specify a resource being tracked.");
-    }
-
-    /**
-     * Wait for some resources.
-     *
-     * @param resources the resources to wait for
-     * @param timeout the timeout, or 0 to wait until completed
-     * @returns true if the resources were downloaded or had errors,
-     * false if the timeout was reached
-     * @throws InterruptedException if another thread interrupted the wait
-     */
-    private boolean wait(Resource resources[], long timeout) throws InterruptedException {
-        long startTime = System.currentTimeMillis();
-
-        // start them downloading / connecting in background
-        for (int i=0; i < resources.length; i++)
-            startResource(resources[i]);
-
-        // wait for completion
-        while (true) {
-            boolean finished = true;
-
-            synchronized (lock) {
-                // check for completion
-                for (int i=0; i < resources.length; i++) {
-                        //NetX Deadlocking may be solved by removing this
-                        //synch block.
-                    synchronized (resources[i]) {
-                        if (!resources[i].isSet(DOWNLOADED | ERROR)) {
-                            finished = false;
-                            break;
-                        }
-                    }
-                }
-                if (finished)
-                    return true;
-
-                // wait
-                long waitTime = 0;
-
-                if (timeout > 0) {
-                    waitTime = timeout - (System.currentTimeMillis()-startTime);
-                    if (waitTime <= 0)
-                        return false;
-                }
-
-                lock.wait(waitTime);
-            }
-        }
-    }
-
-
-    // inner classes
-
-    /**
-     * This class downloads and initializes the queued resources.
-     */
-    class Downloader implements Runnable {
-        Resource resource = null;
-
-        public void run() {
-            while (true) {
-                synchronized (lock) {
-                    // remove from active list, used for load balancing
-                    if (resource != null)
-                        active.remove(resource.getTracker());
-
-                    resource = selectNextResource();
-
-                    if (resource == null) {
-                        endThread();
-                        break;
-                    }
-
-                    // add to active list, used for load balancing
-                    active.add(resource.getTracker());
-                }
-
-                try {
-                    processResource(resource);
-                }
-                catch (Exception ex) {
-                    if (JNLPRuntime.isDebug())
-                        ex.printStackTrace();
-                }
-            }
-            // should have a finally in case some exception is thrown by
-            // selectNextResource();
-        }
-    };
-
-}
--- a/netx/net/sourceforge/jnlp/cache/UpdatePolicy.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-// Copyright (C) 2002 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.cache;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.reflect.*;
-import java.security.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.*;
-import net.sourceforge.jnlp.util.*;
-/**
- * A policy that determines when a resource should be checked for
- * an updated version.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.3 $
- */
-public class UpdatePolicy {
-
-    // todo: implement session updating
-
-    // todo: doesn't seem to work in the same JVM, probably because
-    // Resource is being held by a tracker so it isn't collected;
-    // then next time a tracker adds the resource even if
-    // shouldUpdate==true it's state is already marked
-    // CONNECTED|DOWNLOADED.  Let the resource be collected or reset
-    // to UNINITIALIZED.
-
-    public static UpdatePolicy ALWAYS = new UpdatePolicy(0);
-    public static UpdatePolicy SESSION = new UpdatePolicy(-1);
-    public static UpdatePolicy FORCE = new UpdatePolicy(Long.MIN_VALUE);
-    public static UpdatePolicy NEVER = new UpdatePolicy(Long.MAX_VALUE);
-
-    private long timeDiff = -1;
-
-
-    /**
-     * Create a new update policy; this policy always updates the
-     * entry unless the shouldUpdate method is overridden.
-     */
-    public UpdatePolicy() {
-    }
-
-    /**
-     * Create an update policy that only checks a file for being
-     * updated if it has not been checked for longer than the
-     * specified time.
-     *
-     * @param timeDiff how long in ms until update needed
-     */
-    public UpdatePolicy(long timeDiff) {
-        this.timeDiff = timeDiff;
-    }
-
-    /**
-     * Returns whether the resource should be checked for being
-     * up-to-date.
-     */
-    public boolean shouldUpdate(CacheEntry entry) {
-        long updated = entry.getLastUpdated();
-        long current = System.currentTimeMillis();
-
-        if (current - updated >= timeDiff)
-            return true;
-        else
-            return false;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/cache/package.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-This package contains the JNLP cache.
-
-<h2>Package Specification</h2>
-
-<ul>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/download-spec.html">JNLP specification</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-<li><a target="_top" href="http://jnlp.sourceforge.net/netx/">Netx JNLP Client</a>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/">Java Web Start JNLP Client</a>
-</ul>
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
-</html>
-
-
--- a/netx/net/sourceforge/jnlp/event/ApplicationEvent.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-// Copyright (C) 2002 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.event;
-
-import java.util.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.*;
-
-/**
- * This event is sent when an application is terminated.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.5 $
- */
-public class ApplicationEvent extends EventObject {
-
-    /** the application instance */
-    private ApplicationInstance application;
-
-
-    /**
-     * Creates a launch event for the specified application
-     * instance.
-     *
-     * @param source the application instance
-     */
-    public ApplicationEvent(ApplicationInstance source) {
-        super(source);
-
-        this.application = source;
-    }
-
-    /**
-     * Returns the application instance.
-     */
-    public ApplicationInstance getApplication() {
-        return application;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/event/ApplicationListener.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (C) 2002 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.event;
-
-import java.util.*;
-
-
-/**
- * The listener that is notified when an application instance is
- * terminated.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.5 $
- */
-public interface ApplicationListener extends EventListener {
-
-    /**
-     * Invoked when the application is destroyed.
-     */
-    public void applicationDestroyed(ApplicationEvent applicationEvent);
-
-}
--- a/netx/net/sourceforge/jnlp/event/DownloadEvent.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-// Copyright (C) 2002 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.event;
-
-import java.net.*;
-import java.util.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.cache.*;
-import net.sourceforge.jnlp.runtime.*;
-
-/**
- * This event is sent during the launch of an
- * application.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.3 $
- */
-public class DownloadEvent extends EventObject {
-
-    /** the tracker */
-    private ResourceTracker tracker;
-
-    /** the resource */
-    private Resource resource;
-
-
-    /**
-     * Creates a launch event for the specified application
-     * instance.
-     *
-     * @param source the resource tracker
-     * @param resource the resource
-     */
-    public DownloadEvent(ResourceTracker source, Resource resource) {
-        super(source);
-
-        this.tracker = source;
-        this.resource = resource;
-    }
-
-    /**
-     * Returns the tracker that owns the resource.
-     */
-    public ResourceTracker getTracker() {
-        return tracker;
-    }
-
-    /**
-     * Returns the location of the resource being downloaded.
-     */
-    public URL getResourceLocation() {
-        return resource.getLocation();
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/event/DownloadListener.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (C) 2002 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.event;
-
-import java.util.*;
-
-
-/**
- * The listener that is notified of the state of resources being
- * downloaded by a ResourceTracker.  Events may be delivered on a
- * background thread, and the event methods should complete
- * quickly so that they do not slow down other downloading in
- * progress by tying up a thread.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.3 $
- */
-public interface DownloadListener extends EventListener {
-
-    /**
-     * Called when a resource is checked for being up-to-date.
-     */
-    public void updateStarted(DownloadEvent downloadEvent);
-
-    /**
-     * Called when a download starts.
-     */
-    public void downloadStarted(DownloadEvent downloadEvent);
-
-    /**
-     * Called when a download completed or there was an error.
-     */
-    public void downloadCompleted(DownloadEvent downloadEvent);
-
-}
--- a/netx/net/sourceforge/jnlp/event/package.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-This package contains the JNLP events.
-
-<h2>Package Specification</h2>
-
-<ul>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/download-spec.html">JNLP specification</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-<li><a target="_top" href="http://jnlp.sourceforge.net/netx/">Netx JNLP Client</a>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/">Java Web Start JNLP Client</a>
-</ul>
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
-</html>
-
-
--- a/netx/net/sourceforge/jnlp/package.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-This package contains the classes that represent the parts of a
-Java Network Launching Protocol (JNLP) file as objects, and a way
-to launch a JNLP file as an application, applet, or installer.
-
-<h2>Package Specification</h2>
-
-<ul>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/download-spec.html">JNLP specification</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-<li><a target="_top" href="http://jnlp.sourceforge.net/netx/">Netx JNLP Client</a>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/">Java Web Start JNLP Client</a>
-</ul>
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
-</html>
-
-
--- a/netx/net/sourceforge/jnlp/resources/Manifest.mf	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-Created-By: jnlp.sourceforge.net
-Specification-Title: netx JNLP client
-Sealed: true
-Main-Class: net.sourceforge.jnlp.runtime.Boot13
-
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-# Default (English) UI messages for netx
-# L=Launcher, B=Boot, P=Parser, C=cache S=security
-#
-# General
-NullParameter=Null parameter
-ButOk=OK
-ButCancel=\ Cancel\ 
-ButBrowse=Browse...
-
-# LS - Severity
-LSMinor=Minor
-LSFatal=Fatal
-
-# LC - Category 
-LCSystem=System Error
-LCExternalLaunch=External Launch Error
-LCFileFormat=File Format Error
-LCReadError=Read Error
-LCClient=Application Error
-LCLaunching=Launch Error
-LCNotSupported=Unsupported Feature
-LCInit=Initialization Error
- 
-LAllThreadGroup=All JNLP applications
-LNullUpdatePolicy=Update policy cannot be null.
- 
-LThreadInterrupted=Thread interrupted while waiting for file to launch.
-LThreadInterruptedInfo=
-LCouldNotLaunch=Could not launch JNLP file.
-LCouldNotLaunchInfo=
-LCantRead=Could not read or parse the JNLP file.
-LCantReadInfo=
-LNullLocation=Could not determine .jnlp file location.
-LNullLocationInfo=An attempt was made to launch a JNLP file in another JVM, but the file could not be located.  In order to launch in an external JVM, the runtime must be able to locate the .jnlp file either in the local filesystem or on a server.
-LNetxJarMissing=Could not determine location of netx.jar.
-LNetxJarMissingInfo=An attempt was made to lauch a JNLP file in another JVM, but the netx.jar could not be located.  In order to launch in an external JVM, the runtime must be able to locate the netx.jar file.
-LNotToSpec=JNLP file not strictly to spec.
-LNotToSpecInfo=The JNLP file contains data that is prohibited by the JNLP specification.  The runtime can attempt to ignore the invalid information and continue launching the file.
-LNotApplication=Not an application file.
-LNotApplicationInfo=An attempt was made to load a non-application file as an application.
-LNotApplet=Not an applet file.
-LNotAppletInfo=An attempt was made to load a non-applet file as an applet.
-LNoInstallers=Installers not supported.
-LNoInstallersInfo=JNLP installer files are not yet supported.
-LInitApplet=Could not initialize applet.
-LInitAppletInfo=
-LInitApplication=Could not initialize application.
-LInitApplicationInfo=
-LNotLaunchable=Not a launchable JNLP file.
-LNotLaunchableInfo=File must be a JNLP application, applet, or installer type.
-LCantDetermineMainClass=Unknown Main-Class.
-LCantDetermineMainClassInfo=Could not determine the main class for this application.
-LUnsignedJarWithSecurity=Cannot grant permissions to unsigned jars.
-LUnsignedJarWithSecurityInfo=Application requested security permissions, but jars are not signed.
-LSignedAppJarUsingUnsignedJar=Signed application using unsigned jars.
-LSignedAppJarUsingUnsignedJarInfo=The main application jar is signed, but some of the jars it is using aren't.
-
-JNotApplet=File is not an applet.
-JNotApplication=File is not an application.
-JNotComponent=File is not a component.
-JNotInstaller=File is not an installer.
-JInvalidExtensionDescriptor=Extension does not refer to a component or installer (name={1}, location={2}).
-
-LNotVerified=Jars not verified.
-LCancelOnUserRequest=Canceled on user request.
-LFatalVerification=A fatal error occurred while trying to verify jars.
-LFatalVerificationInfo=
-
-LNotVerifiedDialog=Not all jars could be verified.
-LAskToContinue=Would you still like to continue running this application?
-
-# Parser
-PInvalidRoot=Root node is not a jnlp node
-PSpecUnsupported=Spec version not supported (supports {0})
-PNoResources=No resources section defined
-PUntrustedNative=nativelib element cannot be specified unless a trusted environment is requested.
-PExtensionHasJ2SE=j2se element cannot be specified in a component extension file.
-PInnerJ2SE=j2se element cannot be specified within a j2se element.
-PTwoMains=Duplicate main JAR defined in a resources element (there can be only one)
-PNativeHasMain=Cannot specify main attribute on native JARs.
-PNoInfoElement=No information section defined
-PTwoDescriptions=Duplicate description of kind {0}
-PSharing=Element "sharing-allowed" is illegal in a standard JNLP file
-PTwoSecurity=Only one security element allowed per JNLPFile.
-PEmptySecurity=Security element specified but does not contain a permissions element.
-PTwoDescriptors=Only one application descriptor element allowed per JNLPFile.
-PTwoDesktops=Only one desktop element allowed
-PTwoMenus=Only one menu element allowed
-PTwoTitles=Only one title element allowed
-PTwoIcons=Only one icon element allowed
-PUnknownApplet=Unknown Applet
-PBadWidth=Invalid applet width.
-PBadHeight=Invalid applet height.
-PUrlNotInCodebase=Relative URL does not specify a subdirectory of the codebase. (node={0}, href={1}, base={2})
-PBadRelativeUrl=Invalid relative URL (node={0}, href={1}, base={2})
-PBadNonrelativeUrl=Invalid non-relative URL (node={0}, href={0}).
-PNeedsAttribute=The {0} element must specify a {1} attribute.
-PBadXML=Invalid XML document syntax.
-PBadHeapSize=Invalid value for heap size ({0})
-
-# Runtime
-BLaunchAbout=Launching about window...
-BNeedsFile=Must specify a .jnlp file
-BFileLoc=JNLP file location
-BArgNA=Arguments not used for this type of JNLP file (ignored).
-BParamNA=Parameters not used for this type of JNLP file (ignored).
-BBadProp=Incorrect property format {0} (should be key=value)
-BBadParam=Incorrect parameter format {0} (should be name=value)
-BNoDir=Directory {0} does not exist.
-BNoBase=No base directory (contains cache and other data)
-RNoResource=Missing Resource: {0}
-RShutdown=This exception to prevent shutdown of JVM, but the process has been terminated.
-RExitTaken=Exit class already set and caller is not exit class.
-RCantReplaceSM=Changing the SecurityManager is not allowed.
-RDenyStopped=Stopped applications have no permissions.
-RExitNoApp=Can not exit the JVM because the current application cannot be determined.
-RNoLockDir=Unable to create locks directory ({0})
-RNestedJarExtration=Unable to extract nested jar.
-RUnexpected=Unexpected {0} at {1}
-
-# Boot options, message should be shorter than this ---------------->
-BOUsage=javaws [-run-options] <jnlp file>
-BOUsage2=javaws [-control-options]
-BOBasedir   = Directory where the cache is kept.
-BOJnlp      = Location of JNLP file to launch (url or file).
-BOArg       = Adds an application argument before launching.
-BOParam     = Adds an applet parameter before launching.
-BOProperty  = Sets a system property before launching.
-BOUpdate    = Update check if seconds since last checked.
-BOLicense   = Display the GPL license and exit.
-BOVerbose   = Enable verbose output.
-BOAbout     = Shows a sample application.
-BONosecurity= Disables the secure runtime environment.
-BONoupdate  = Disables checking for updates.
-BOHeadless  = Disables download window, other UIs.
-BOStrict    = Enables strict checking of JNLP file format.
-BOViewer    = Shows the trusted certificate viewer.
-BOUmask     = Sets the umask for files created by an application.
-BXnofork    = Do not create another JVM.
-BOHelp      = Print this message and exit.
-
-# Cache
-CAutoGen=automatically generated - do not edit
-CNotCacheable={0} is not a cacheable resource
-CDownloading=Downloading
-CComplete=Complete
-CChooseCache=Choose a cache directory...
-CChooseCacheInfo=Netx needs a location for storing cache files.
-CChooseCacheDir=Cache directory
-
-# Security
-SFileReadAccess=The application has requested read access to a file on the machine. Do you want to allow this action?
-SFileWriteAccess=The application has requested write access to a file on the machine. Do you want to allow this action?
-SDesktopShortcut=The application has requested permission to create a desktop launcher. Do you want to allow this action?
-SSigUnverified=The application's digital signature cannot be verified. Do you want to run the application?
-SSigVerified=The application's digital signature has been verified. Do you want to run the application?
-SSignatureError=The application's digital signature has an error. Do you want to run the application?
-SUntrustedSource=The digital signature could not be verified by a trusted source. Only run if you trust the origin of the application.
-STrustedSource=The digital signature has been validated by a trusted source.
-SClipboardReadAccess=The application has requested read-only access to the system clipboard. Do you want to allow this action?
-SClipboardWriteAccess=The application has requested write-only access to the system clipboard. Do you want to allow this action?
-SPrinterAccess=The application has requested printer access. Do you want to allow this action?
-SNetworkAccess=The application has requested permission to establish connections to {0}. Do you want to allow this action?
-
-# Security - used for the More Information dialog
-SBadKeyUsage=Resources contain entries whose signer certificate's KeyUsage extension doesn't allow code signing.
-SBadExtendedKeyUsage=Resources contain entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing.
-SBadNetscapeCertType=Resources contain entries whose signer certificate's NetscapeCertType extension doesn't allow code signing.
-SHasUnsignedEntry=Resources contain unsigned entries which have not been integrity-checked.
-SHasExpiredCert=The digital signature has expired.
-SHasExpiringCert=Resources contain entries whose signer certificate will expire within six months.
-SNotYetValidCert=Resources contain entries whose signer certificate is not yet valid.
-SUntrustedCertificate=The digital signature was generated with an untrusted certificate.
-STrustedCertificate=The digital signature was generated with a trusted certificate.
-SCNMisMatch=The expected hostname for this certificate is: "{0}"<BR>The address being connected to is: "{1}"
-SRunWithoutRestrictions=This application will be run without the security restrictions normally provided by java.
-
-
--- a/netx/net/sourceforge/jnlp/resources/about.jnlp	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="1.0" href="about.jnlp" codebase="http://icedtea.classpath.org/netx/">
-  <information>
-    <title>About window for NetX</title>
-    <vendor>NetX</vendor>
-    <homepage href="http://jnlp.sourceforge.net/netx/"/>
-    <description>Displays information about NetX</description>
-    <offline/>
-  </information>
-  <resources>
-    <j2se version="1.4+"/>
-    <jar href="about.jar"/>
-  </resources>
-  <security>
-    <all-permissions/>
-  </security>
-  <application-desc main-class="net.sourceforge.jnlp.about.Main">
-  </application-desc>
-</jnlp>
-
--- a/netx/net/sourceforge/jnlp/resources/default.jnlp	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="1.0" href="default.jnlp" codebase="http://icedtea.classpath.org/netx/">
-  <information>
-    <title>About window for NetX</title>
-    <vendor>NetX</vendor>
-    <homepage href="http://jnlp.sourceforge.net/netx/"/>
-    <description>Displays information about NetX</description>
-    <offline/>
-  </information>
-  <resources>
-    <j2se version="1.4+"/>
-    <jar href="default.jar"/>
-  </resources>
-  <security>
-    <all-permissions/>
-  </security>
-  <application-desc main-class="net.sourceforge.jnlp.about.Main">
-  </application-desc>
-</jnlp>
-
Binary file netx/net/sourceforge/jnlp/resources/info-small.png has changed
Binary file netx/net/sourceforge/jnlp/resources/install.png has changed
Binary file netx/net/sourceforge/jnlp/resources/netx-icon.png has changed
Binary file netx/net/sourceforge/jnlp/resources/warning-small.png has changed
Binary file netx/net/sourceforge/jnlp/resources/warning.png has changed
--- a/netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.awt.*;
-
-/**
- * Thread group for a JNLP application.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.5 $
- */
-public class AppThreadGroup extends ThreadGroup {
-
-    /** the app */
-    private ApplicationInstance app = null;
-
-
-    /**
-     * Creates new JavaAppThreadGroup
-     *
-     * @param name of the App
-     */
-    public AppThreadGroup(ThreadGroup parent, String name) {
-        super(parent, name);
-    }
-
-    /**
-     * Sets the JNLP app this group is for; can only be called once.
-     */
-    public void setApplication(ApplicationInstance app) {
-        if (this.app != null)
-            throw new IllegalStateException("Application can only be set once");
-
-        this.app = app;
-    }
-
-    /**
-     * Returns the JNLP app for this thread group.
-     */
-    public ApplicationInstance getApplication() {
-        return app;
-    }
-
-    /**
-     * Handle uncaught exceptions for the app.
-     */
-    public void uncaughtException(Thread t, Throwable e) {
-        super.uncaughtException(t, e);
-    }
-
-
-}
--- a/netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.net.*;
-import java.io.*;
-import java.applet.*;
-import javax.sound.sampled.*;
-
-// based on Deane Richan's AppletAudioClip
-
-/**
- * An applet audio clip using the javax.sound API.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.8 $
- */
-public class AppletAudioClip implements AudioClip {
-
-    /** the clip */
-    private Clip clip;
-
-
-    /**
-     * Creates new AudioClip.  If the clip cannot be opened no
-     * exception is thrown, instead the methods of the AudioClip
-     * return without performing any operations.
-     *
-     * @param location the clip location
-     */
-    public AppletAudioClip(URL location) {
-        try {
-            AudioInputStream stream = AudioSystem.getAudioInputStream(location);
-
-            clip = (Clip) AudioSystem.getLine(new Line.Info(Clip.class));
-            clip.open(stream);
-        }
-        catch (Exception ex) {
-            System.err.println("Error loading sound:"+location.toString());
-            clip = null;
-        }
-    }
-
-    /**
-     * Plays the clip in a continuous loop until the stop method is
-     * called.
-     */
-    public void loop() {
-        if (clip == null)
-            return;
-
-        clip.loop(Clip.LOOP_CONTINUOUSLY);
-    }
-
-    /**
-     * Plays the clip from the beginning.
-     */
-    public void play() {
-        if (clip == null)
-            return;
-
-        // applet audio clip resets to beginning when played again
-        clip.stop();
-        clip.setFramePosition(0);
-        clip.start();
-    }
-
-    /**
-     * Stops playing the clip.
-     */
-    public void stop() {
-        if (clip == null)
-            return;
-
-        clip.stop();
-    }
-
-    /**
-     * Stops playing the clip and disposes it; the clip cannot be
-     * played after being disposed.
-     */
-    void dispose() {
-        if (clip != null) {
-            clip.stop();
-            clip.flush();
-            clip.close();
-        }
-
-        clip = null;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.applet.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.util.*;
-import java.util.List;
-import java.lang.reflect.InvocationTargetException;
-import java.net.*;
-import java.io.*;
-import javax.swing.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.util.*;
-
-/**
- * The applet environment including stub, context, and frame.  The
- * default environment puts the applet in a non-resiable frame;
- * this can be changed by obtaining the frame and setting it
- * resizable.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.12 $
- */
-public class AppletEnvironment implements AppletContext, AppletStub {
-
-    /** the JNLP file */
-    private JNLPFile file;
-
-    /** the applet instance */
-    private AppletInstance appletInstance;
-
-    /** the applet */
-    private Applet applet;
-
-    /** the parameters */
-    private Map parameters;
-
-    /** the applet container */
-    private Container cont;
-
-    /** weak references to the audio clips */
-    private WeakList weakClips = new WeakList();
-
-    /** whether the applet has been started / displayed */
-    private boolean appletStarted = false;
-
-    /** whether the applet has been destroyed */
-    private boolean destroyed = false;
-
-
-    /**
-     * Create a new applet environment for the applet specified by
-     * the JNLP file.
-     */
-    public AppletEnvironment(JNLPFile file, final AppletInstance appletInstance, Container cont) {
-        this.file = file;
-        this.appletInstance = appletInstance;
-        this.applet = appletInstance.getApplet();
-
-        parameters = file.getApplet().getParameters();
-        this.cont = cont;
-    }
-
-    /**
-     * Create a new applet environment for the applet specified by
-     * the JNLP file, in a new frame.
-     */
-    public AppletEnvironment(JNLPFile file, final AppletInstance appletInstance) {
-        this(file, appletInstance, null);
-
-        Frame frame = new Frame(file.getApplet().getName() + " - Applet");
-        frame.setResizable(false);
-
-        appletInstance.addWindow(frame);
-        // may not need this once security manager can close windows
-        // that do not have app code on the stack
-        WindowListener closer = new WindowAdapter() {
-            public void windowClosing(WindowEvent event) {
-                appletInstance.destroy();
-                System.exit(0);
-            }
-        };
-        frame.addWindowListener(closer);
-        this.cont = frame;
-    }
-
-    /**
-     * Checks whether the applet has been destroyed, and throws an
-     * IllegalStateException if the applet has been destroyed of.
-     *
-     * @throws IllegalStateException
-     */
-    private void checkDestroyed() {
-        if (destroyed)
-            throw new IllegalStateException("Illegal applet stub/context access: applet destroyed.");
-    }
-
-    /**
-     * Disposes the applet's resources and disables the applet
-     * environment from further use; after calling this method the
-     * applet stub and context methods throw IllegalStateExceptions.
-     */
-    public void destroy() {
-        destroyed = true;
-
-        List clips = weakClips.hardList();
-        for (int i = 0; i < clips.size(); i++) {
-            ((AppletAudioClip)clips.get(i)).dispose();
-        }
-    }
-
-    /**
-     * Returns the frame that contains the applet.  Disposing this
-     * frame will destroy the applet.
-     */
-    public Container getAppletFrame() {
-        // TODO: rename this method to getAppletContainer ?
-        return cont;
-    }
-
-    /**
-     * Initialize, start, and show the applet.
-     */
-    public void startApplet() {
-        checkDestroyed();
-
-        if (appletStarted)
-            return;
-
-        appletStarted = true;
-
-        try {
-            AppletDesc appletDesc = file.getApplet();
-
-            if (cont instanceof AppletStub)
-                applet.setStub((AppletStub)cont);
-            else
-                applet.setStub(this);
-
-            cont.setLayout(new BorderLayout());
-            cont.add("Center", applet);
-            cont.validate();
-
-            // This is only needed if the applet is in its own frame.
-            if (cont instanceof Frame) {
-                Frame frame = (Frame) cont;
-                frame.pack(); // cause insets to be calculated
-
-                Insets insets = frame.getInsets();
-                frame.setSize(appletDesc.getWidth() + insets.left + insets.right,
-                              appletDesc.getHeight() + insets.top + insets.bottom);
-            }
-
-            try {
-                SwingUtilities.invokeAndWait(new Runnable() {
-                        public void run() {
-                                // do first because some applets need to be displayed before
-                                // starting (they use Component.getImage or something)
-                                cont.setVisible(true);
-
-                                applet.init();
-                                applet.start();
-
-                                cont.invalidate(); // this should force the applet to
-                                cont.validate();   // the correct size and to repaint
-                                cont.repaint();
-                        }
-                });
-            } catch (InterruptedException ie) {
-
-            } catch (InvocationTargetException ite) {
-
-            }
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            // should also kill the applet?
-        }
-    }
-
-    // applet context methods
-
-    /**
-     * Returns the applet if the applet's name is specified,
-     * otherwise return null.
-     */
-    public Applet getApplet(String name) {
-        checkDestroyed();
-
-        if (name != null && name.equals(file.getApplet().getName()))
-            return applet;
-        else
-            return null;
-    }
-
-    /**
-     * Returns an enumeration that contains only the applet
-     * from the JNLP file.
-     */
-    public Enumeration getApplets() {
-        checkDestroyed();
-
-        return Collections.enumeration( Arrays.asList(new Applet[] { applet }) );
-    }
-
-    /**
-     * Returns an audio clip.
-     */
-    public AudioClip getAudioClip(URL location) {
-        checkDestroyed();
-
-        AppletAudioClip clip = new AppletAudioClip(location);
-
-        weakClips.add(clip);
-        weakClips.trimToSize();
-
-        return clip;
-    }
-
-    /**
-     * Return an image loaded from the specified location.
-     */
-    public Image getImage(URL location) {
-        checkDestroyed();
-
-        //return Toolkit.getDefaultToolkit().createImage(location);
-        Image image = (new ImageIcon(location)).getImage();
-
-        return image;
-    }
-
-    /**
-     * Not implemented yet.
-     */
-    public void showDocument(java.net.URL uRL) {
-        checkDestroyed();
-
-    }
-
-    /**
-     * Not implemented yet.
-     */
-    public void showDocument(java.net.URL uRL, java.lang.String str) {
-        checkDestroyed();
-
-    }
-
-    /**
-     * Not implemented yet.
-     */
-    public void showStatus(java.lang.String str) {
-        checkDestroyed();
-
-    }
-
-    /**
-     * Required for JRE1.4, but not implemented yet.
-     */
-    public void setStream(String key, InputStream stream) {
-        checkDestroyed();
-
-    }
-
-    /**
-     * Required for JRE1.4, but not implemented yet.
-     */
-    public InputStream getStream(String key) {
-        checkDestroyed();
-
-        return null;
-    }
-
-    /**
-     * Required for JRE1.4, but not implemented yet.
-     */
-    public Iterator getStreamKeys()  {
-        checkDestroyed();
-
-        return null;
-    }
-
-    // stub methods
-
-    public void appletResize(int width, int height) {
-        checkDestroyed();
-
-        if (cont instanceof Frame) {
-            Frame frame = (Frame) cont;
-            Insets insets = frame.getInsets();
-
-            frame.setSize(width + insets.left + insets.right,
-                          height + insets.top + insets.bottom);
-        }
-    }
-
-    public AppletContext getAppletContext() {
-        checkDestroyed();
-
-        return this;
-    }
-
-    public URL getCodeBase() {
-        checkDestroyed();
-
-        return file.getCodeBase();
-    }
-
-    public URL getDocumentBase() {
-        checkDestroyed();
-
-        return file.getApplet().getDocumentBase();
-    }
-
-    // FIXME: Sun's applet code forces all parameters to lower case.
-    // Does Netx's JNLP code do the same, so we can remove the first lookup?
-    public String getParameter(String name) {
-        checkDestroyed();
-
-        String s = (String) parameters.get(name);
-        if (s != null)
-            return s;
-
-        return (String) parameters.get(name.toLowerCase());
-    }
-
-    public boolean isActive() {
-        checkDestroyed();
-
-        // it won't be started or stopped, so if it can call it's running
-        return true;
-    }
-
-
-}
--- a/netx/net/sourceforge/jnlp/runtime/AppletInstance.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.applet.*;
-import java.awt.*;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.List;
-import java.security.*;
-import java.lang.reflect.*;
-import java.lang.ref.*;
-
-import net.sourceforge.jnlp.*;
-
-
-/**
- * Represents a launched application instance created from a JNLP
- * file.  This class does not control the operation of the applet,
- * use the AppletEnvironment class to start and stop the applet.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.9 $
- */
-public class AppletInstance extends ApplicationInstance {
-
-    /** whether the applet's stop and destroy methods have been called */
-    private boolean appletStopped = false;
-
-    /** the applet */
-    private Applet applet;
-
-    /** the applet environment */
-    private AppletEnvironment environment;
-
-
-    /**
-     * Create a New Task based on the Specified URL
-     */
-    public AppletInstance(JNLPFile file, ThreadGroup group, ClassLoader loader, Applet applet) {
-        super(file, group, loader);
-
-        this.applet = applet;
-
-        this.environment = new AppletEnvironment(file, this);
-    }
-
-    /**
-     *
-     */
-    public AppletInstance(JNLPFile file, ThreadGroup group, ClassLoader loader, Applet applet, Container cont) {
-        super(file, group, loader);
-        this.applet = applet;
-        this.environment = new AppletEnvironment(file, this, cont);
-    }
-
-    /**
-     * Sets whether the applet is resizable or not.  Applets default
-     * to being not resizable.
-     */
-    public void setResizable(boolean resizable) {
-        Container c = environment.getAppletFrame();
-        if (c instanceof Frame)
-            ((Frame) c).setResizable(resizable);
-    }
-
-    /**
-     * Returns whether the applet is resizable.
-     */
-    public boolean isResizable() {
-        Container c = environment.getAppletFrame();
-        if (c instanceof Frame)
-            return ((Frame) c).isResizable();
-
-        return false;
-    }
-
-    /**
-     * Returns the application title.
-     */
-    public String getTitle() {
-        return getJNLPFile().getApplet().getName();
-    }
-
-    /**
-     * Returns the applet environment.
-     */
-    public AppletEnvironment getAppletEnvironment() {
-        return environment;
-    }
-
-    /**
-     * Returns the applet.
-     */
-    public Applet getApplet() {
-        return applet;
-    }
-
-    /**
-     * Stop the application and destroy its resources.
-     */
-    public void destroy() {
-        if (appletStopped)
-            return;
-
-        appletStopped = true;
-
-        try {
-            applet.stop();
-            applet.destroy();
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-        }
-
-        environment.destroy();
-
-        super.destroy();
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.awt.Window;
-import java.net.URL;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.CodeSource;
-import java.security.PrivilegedAction;
-import java.security.ProtectionDomain;
-
-import javax.swing.event.EventListenerList;
-
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.PropertyDesc;
-import net.sourceforge.jnlp.SecurityDesc;
-import net.sourceforge.jnlp.ShortcutDesc;
-import net.sourceforge.jnlp.event.ApplicationEvent;
-import net.sourceforge.jnlp.event.ApplicationListener;
-import net.sourceforge.jnlp.security.SecurityWarningDialog.AccessType;
-import net.sourceforge.jnlp.services.ServiceUtil;
-import net.sourceforge.jnlp.util.WeakList;
-import net.sourceforge.jnlp.util.XDesktopEntry;
-
-/**
- * Represents a running instance of an application described in a
- * JNLPFile.  This class provides a way to track the application's
- * resources and destroy the application.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.15 $
- */
-public class ApplicationInstance {
-
-    // todo: should attempt to unload the environment variables
-    // installed by the application.
-
-
-    /** the file */
-    private JNLPFile file;
-
-    /** the thread group */
-    private ThreadGroup group;
-
-    /** the classloader */
-    private ClassLoader loader;
-
-    /** whether the application has stopped running */
-    private boolean stopped = false;
-
-    /** weak list of windows opened by the application */
-    private WeakList weakWindows = new WeakList();
-
-    /** list of application listeners  */
-    private EventListenerList listeners = new EventListenerList();
-
-        /** whether or not this application is signed */
-        private boolean isSigned = false;
-
-    /**
-     * Create an application instance for the file.
-     */
-    public ApplicationInstance(JNLPFile file, ThreadGroup group, ClassLoader loader) {
-        this.file = file;
-        this.group = group;
-        this.loader = loader;
-        this.isSigned = ((JNLPClassLoader) loader).getSigning();
-    }
-
-    /**
-     * Add an Application listener
-     */
-    public void addApplicationListener(ApplicationListener listener) {
-        listeners.add(ApplicationListener.class, listener);
-    }
-
-    /**
-     * Remove an Application Listener
-     */
-    public void removeApplicationListener(ApplicationListener listener) {
-        listeners.remove(ApplicationListener.class, listener);
-    }
-
-    /**
-     * Notify listeners that the application has been terminated.
-     */
-    protected void fireDestroyed() {
-        Object list[] = listeners.getListenerList();
-        ApplicationEvent event = null;
-
-        for (int i=list.length-1; i>0; i-=2) { // last to first required
-            if (event == null)
-                event = new ApplicationEvent(this);
-
-            ((ApplicationListener)list[i]).applicationDestroyed(event);
-        }
-    }
-
-    /**
-     * Initialize the application's environment (installs
-     * environment variables, etc).
-     */
-    public void initialize() {
-        installEnvironment();
-
-        //Fixme: -Should check whether a desktop entry already exists for
-        //        for this jnlp file, and do nothing if it exists.
-        //       -If no href is specified in the jnlp tag, it should
-        //        default to using the one passed in as an argument.
-        addMenuAndDesktopEntries();
-    }
-
-    /**
-     * Creates menu and desktop entries if required by the jnlp file
-     */
-
-    private void addMenuAndDesktopEntries() {
-        XDesktopEntry entry = new XDesktopEntry(file);
-        ShortcutDesc sd = file.getInformation().getShortcut();
-
-        if (sd != null && sd.onDesktop()) {
-            if (ServiceUtil.checkAccess(this, AccessType.CREATE_DESTKOP_SHORTCUT)) {
-                entry.createDesktopShortcut();
-            }
-        }
-
-        if (sd != null && sd.getMenu() != null) {
-            /*
-             * Sun's WebStart implementation doesnt seem to do anything under GNOME
-             */
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("ApplicationInstance.addMenuAndDesktopEntries():"
-                        + " Adding menu entries NOT IMPLEMENTED");
-            }
-        }
-
-    }
-
-    /**
-     * Releases the application's resources before it is collected.
-     * Only collectable if classloader and thread group are
-     * also collectable so basically is almost never called (an
-     * application would have to close its windows and exit its
-     * threads but not call System.exit).
-     */
-    public void finalize() {
-        destroy();
-    }
-
-    /**
-     * Install the environment variables.
-     */
-    void installEnvironment() {
-        final PropertyDesc props[] = file.getResources().getProperties();
-
-        CodeSource cs = new CodeSource((URL) null, (java.security.cert.Certificate  [])null);
-
-        JNLPClassLoader loader = (JNLPClassLoader) this.loader;
-        SecurityDesc s = loader.getSecurity();
-
-        ProtectionDomain pd = new ProtectionDomain(cs, s.getPermissions(), null, null);
-
-        // Add to hashmap
-        AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] {pd});
-
-        PrivilegedAction installProps = new PrivilegedAction() {
-            public Object run() {
-                for (int i=0; i < props.length; i++) {
-                    System.setProperty(props[i].getKey(), props[i].getValue());
-                }
-
-                return null;
-            }
-        };
-        AccessController.doPrivileged(installProps, acc);
-    }
-
-    /**
-     * Returns the JNLP file for this task.
-     */
-    public JNLPFile getJNLPFile() {
-        return file;
-    }
-
-    /**
-     * Returns the application title.
-     */
-    public String getTitle() {
-        return file.getTitle();
-    }
-
-    /**
-     * Returns whether the application is running.
-     */
-    public boolean isRunning() {
-        return !stopped;
-    }
-
-    /**
-     * Stop the application and destroy its resources.
-     */
-    public void destroy() {
-        if (stopped)
-            return;
-
-        try {
-            // destroy resources
-            for (int i=0; i < weakWindows.size(); i++) {
-                Window w = (Window) weakWindows.get(i);
-                if (w != null)
-                    w.dispose();
-            }
-
-            weakWindows.clear();
-
-             // interrupt threads
-            Thread threads[] = new Thread[ group.activeCount() * 2 ];
-            int nthreads = group.enumerate(threads);
-            for (int i=0; i < nthreads; i++) {
-                if (JNLPRuntime.isDebug())
-                    System.out.println("Interrupt thread: "+threads[i]);
-
-                threads[i].interrupt();
-            }
-
-            // then stop
-            Thread.currentThread().yield();
-            nthreads = group.enumerate(threads);
-            for (int i=0; i < nthreads; i++) {
-                if (JNLPRuntime.isDebug())
-                    System.out.println("Stop thread: "+threads[i]);
-
-                threads[i].stop();
-            }
-
-            // then destroy - except Thread.destroy() not implemented in jdk
-
-       }
-        finally {
-            stopped = true;
-            fireDestroyed();
-        }
-    }
-
-    /**
-     * Returns the thread group.
-     *
-     * @throws IllegalStateException if the app is not running
-     */
-    public ThreadGroup getThreadGroup() throws IllegalStateException {
-        if (stopped)
-            throw new IllegalStateException();
-
-        return group;
-    }
-
-    /**
-     * Returns the classloader.
-     *
-     * @throws IllegalStateException if the app is not running
-     */
-    public ClassLoader getClassLoader() throws IllegalStateException {
-        if (stopped)
-            throw new IllegalStateException();
-
-        return loader;
-    }
-
-    /**
-     * Adds a window that this application opened.  When the
-     * application is disposed, these windows will also be disposed.
-     */
-    protected void addWindow(Window window) {
-        weakWindows.add(window);
-        weakWindows.trimToSize();
-    }
-
-        /**
-         * Returns whether or not this jar is signed.
-         */
-        public boolean isSigned() {
-                return isSigned;
-        }
-}
--- a/netx/net/sourceforge/jnlp/runtime/Boot.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,450 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-
-import net.sourceforge.jnlp.AppletDesc;
-import net.sourceforge.jnlp.ApplicationDesc;
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.LaunchException;
-import net.sourceforge.jnlp.Launcher;
-import net.sourceforge.jnlp.ParseException;
-import net.sourceforge.jnlp.PropertyDesc;
-import net.sourceforge.jnlp.ResourcesDesc;
-import net.sourceforge.jnlp.cache.UpdatePolicy;
-import net.sourceforge.jnlp.security.VariableX509TrustManager;
-import net.sourceforge.jnlp.security.viewer.CertificateViewer;
-import net.sourceforge.jnlp.services.ServiceUtil;
-
-/**
- * This is the main entry point for the JNLP client.  The main
- * method parses the command line parameters and loads a JNLP
- * file into the secure runtime environment.  This class is meant
- * to be called from the command line or file association; to
- * initialize the netx engine from other code invoke the
- * <code>JNLPRuntime.initialize</code> method after configuring
- * the runtime.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.21 $
- */
-public final class Boot implements PrivilegedAction {
-
-    // todo: decide whether a spawned netx (external launch)
-    // should inherit the same options as this instance (store argv?)
-
-    private static String R(String key) { return JNLPRuntime.getMessage(key); }
-    private static String R(String key, Object param) { return JNLPRuntime.getMessage(key, new Object[] {param}); }
-
-    private static final String version = "0.5";
-
-    /** the text to display before launching the about link */
-    private static final String aboutMessage = ""
-        + "netx v"+version+" - (C)2001-2003 Jon A. Maxwell (jmaxwell@users.sourceforge.net)\n"
-        + "\n"
-        + R("BLaunchAbout");
-
-    private static final String miniLicense = "\n"
-        + "   netx - an open-source JNLP client.\n"
-        + "   Copyright (C) 2001-2003 Jon A. Maxwell (JAM)\n"
-        + "\n"
-        + "   // This library is free software; you can redistribute it and/or\n"
-        + "   modify it under the terms of the GNU Lesser General Public\n"
-        + "   License as published by the Free Software Foundation; either\n"
-        + "   version 2.1 of the License, or (at your option) any later version.\n"
-        + "\n"
-        + "   This library is distributed in the hope that it will be useful,\n"
-        + "   but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-        + "   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
-        + "   Lesser General Public License for more details.\n"
-        + "\n"
-        + "   You should have received a copy of the GNU Lesser General Public\n"
-        + "   License along with this library; if not, write to the Free Software\n"
-        + "   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\n"
-        + "\n";
-
-    private static final String helpMessage = "\n"
-        + "Usage:   " + R("BOUsage")+"\n"
-        + "         " + R("BOUsage2")+"\n"
-        + "\n"
-        + "control-options:"+"\n"
-        + "  -about                "+R("BOAbout")+"\n"
-        + "  -viewer               "+R("BOViewer")+"\n"
-        + "\n"
-        + "run-options:"+"\n"
-        + "  -basedir dir          "+R("BOBasedir")+"\n"
-        + "  -arg arg              "+R("BOArg")+"\n"
-        + "  -param name=value     "+R("BOParam")+"\n"
-        + "  -property name=value  "+R("BOProperty")+"\n"
-        + "  -update seconds       "+R("BOUpdate")+"\n"
-        + "  -license              "+R("BOLicense")+"\n"
-        + "  -verbose              "+R("BOVerbose")+"\n"
-        + "  -nosecurity           "+R("BONosecurity")+"\n"
-        + "  -noupdate             "+R("BONoupdate")+"\n"
-        + "  -headless             "+R("BOHeadless")+"\n"
-        + "  -strict               "+R("BOStrict")+"\n"
-        + "  -umask=value          "+R("BOUmask")+"\n"
-        + "  -Xnofork              "+R("BXnofork")+"\n"
-        + "  -help                 "+R("BOHelp")+"\n";
-
-    private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update";
-
-    private static String args[]; // avoid the hot potato
-
-
-    /**
-     * Launch the JNLP file specified by the command-line arguments.
-     */
-    public static void main(String[] argsIn) {
-        args = argsIn;
-
-        if (null != getOption("-viewer")) {
-
-            try {
-                CertificateViewer.main(null);
-                System.exit(0);
-            } catch (Exception e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-
-        }
-
-        if (null != getOption("-license")) {
-            System.out.println(miniLicense);
-            System.exit(0);
-        }
-
-        if (null != getOption("-help")) {
-            System.out.println(helpMessage);
-            System.exit(0);
-        }
-
-        if (null != getOption("-about"))
-            System.out.println(aboutMessage);
-
-        if (null != getOption("-verbose"))
-            JNLPRuntime.setDebug(true);
-
-        if (null != getOption("-update")) {
-            int value = Integer.parseInt(getOption("-update"));
-            JNLPRuntime.setDefaultUpdatePolicy(new UpdatePolicy(value*1000l));
-        }
-
-        if (null != getOption("-headless"))
-            JNLPRuntime.setHeadless(true);
-
-
-        if (null != getOption("-noupdate"))
-            JNLPRuntime.setDefaultUpdatePolicy(UpdatePolicy.NEVER);
-
-        if (null != getOption("-Xnofork")) {
-            JNLPRuntime.setForksAllowed(false);
-        }
-
-        // wire in custom authenticator
-        try {
-            SSLSocketFactory sslSocketFactory;
-            SSLContext context = SSLContext.getInstance("SSL");
-            TrustManager[] trust = new TrustManager[] { VariableX509TrustManager.getInstance() };
-            context.init(null, trust, null);
-            sslSocketFactory = context.getSocketFactory();
-
-            HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
-        } catch (Exception e) {
-            System.err.println("Unable to set SSLSocketfactory (may _prevent_ access to sites that should be trusted)! Continuing anyway...");
-            e.printStackTrace();
-        }
-
-        JNLPRuntime.setInitialArgments(Arrays.asList(argsIn));
-
-        // do in a privileged action to clear the security context of
-        // the Boot13 class, which doesn't have any privileges in
-        // JRE1.3; JRE1.4 works without Boot13 or this PrivilegedAction.
-        AccessController.doPrivileged(new Boot());
-
-    }
-
-    /**
-     * The privileged part (jdk1.3 compatibility).
-     */
-    public Object run() {
-        JNLPRuntime.setBaseDir(getBaseDir());
-        JNLPRuntime.setSecurityEnabled(null == getOption("-nosecurity"));
-        JNLPRuntime.initialize(true);
-
-        try {
-            new Launcher().launch(getFile());
-        }
-        catch (LaunchException ex) {
-            // default handler prints this
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-
-            fatalError(JNLPRuntime.getMessage("RUnexpected",
-                        new Object[] {ex.toString(), ex.getStackTrace()[0]} ));
-        }
-
-        return null;
-    }
-
-    private static void fatalError(String message) {
-        System.err.println("netx: "+message);
-        System.exit(1);
-    }
-
-    /**
-     * Returns the about.jnlp file in {java.home}/lib or null if this file
-     * does not exist.
-     */
-    private static String getAboutFile() {
-
-        if (new File(JNLPRuntime.NETX_ABOUT_FILE).exists())
-            return JNLPRuntime.NETX_ABOUT_FILE;
-        else
-            return null;
-    }
-
-    /**
-     * Returns the file to open; does not return if no file was
-     * specified.
-     */
-    private static JNLPFile getFile() throws ParseException, MalformedURLException, IOException {
-
-        String location = getJNLPFile();
-
-        // override -jnlp with aboutFile
-        if (getOption("-about") != null) {
-            location = getAboutFile();
-            if (location == null)
-                fatalError("Unable to find about.jnlp in {java.home}/lib/");
-        } else {
-            location = getJNLPFile();
-        }
-
-        if (location == null) {
-            System.out.println(helpMessage);
-            System.exit(1);
-        }
-
-        if (JNLPRuntime.isDebug())
-            System.out.println(R("BFileLoc")+": "+location);
-
-        URL url = null;
-
-        try {
-            if (new File(location).exists())
-                url = new File(location).toURL(); // Why use file.getCanonicalFile?
-            else
-                url = new URL(ServiceUtil.getBasicService().getCodeBase(), location);
-        } catch (Exception e) {
-            fatalError("Invalid jnlp file " + location);
-            if (JNLPRuntime.isDebug())
-                e.printStackTrace();
-        }
-
-        boolean strict = (null != getOption("-strict"));
-
-        JNLPFile file = new JNLPFile(url, strict);
-
-        // Launches the jnlp file where this file originated.
-        if (file.getSourceLocation() != null) {
-            file = new JNLPFile(file.getSourceLocation(), strict);
-        }
-
-        // add in extra params from command line
-        addProperties(file);
-
-        if (file.isApplet())
-            addParameters(file);
-
-        if (file.isApplication())
-            addArguments(file);
-
-        if (JNLPRuntime.isDebug()) {
-            if (getOption("-arg") != null)
-                if (file.isInstaller() || file.isApplet())
-                    System.out.println(R("BArgsNA"));
-
-            if (getOption("-param") != null)
-                if (file.isApplication())
-                    System.out.println(R("BParamNA"));
-        }
-
-        return file;
-    }
-
-    /**
-     * Add the properties to the JNLP file.
-     */
-    private static void addProperties(JNLPFile file) {
-        String props[] = getOptions("-property");
-        ResourcesDesc resources = file.getResources();
-
-        for (int i=0; i < props.length; i++) {
-            // allows empty property, not sure about validity of that.
-            int equals = props[i].indexOf("=");
-            if (equals == -1)
-                fatalError(R("BBadProp", props[i]));
-
-            String key = props[i].substring(0, equals);
-            String value = props[i].substring(equals+1, props[i].length());
-
-            resources.addResource(new PropertyDesc(key, value));
-        }
-    }
-
-    /**
-     * Add the params to the JNLP file; only call if file is
-     * actually an applet file.
-     */
-    private static void addParameters(JNLPFile file) {
-        String params[] = getOptions("-param");
-        AppletDesc applet = file.getApplet();
-
-        for (int i=0; i < params.length; i++) {
-            // allows empty param, not sure about validity of that.
-            int equals = params[i].indexOf("=");
-            if (equals == -1)
-                fatalError(R("BBadParam", params[i]));
-
-            String name = params[i].substring(0, equals);
-            String value = params[i].substring(equals+1, params[i].length());
-
-            applet.addParameter(name, value);
-        }
-    }
-
-    /**
-     * Add the arguments to the JNLP file; only call if file is
-     * actually an application (not installer).
-     */
-    private static void addArguments(JNLPFile file) {
-        String args[] = getOptions("-arg");  // FYI args also global variable
-        ApplicationDesc app = file.getApplication();
-
-        for (int i=0; i < args.length; i++) {
-            app.addArgument(args[i]);
-        }
-    }
-
-    /**
-     * Gets the JNLP file from the command line arguments, or exits upon error.
-     */
-    private static String getJNLPFile() {
-
-        if (args.length == 0) {
-            System.out.println(helpMessage);
-            System.exit(0);
-        } else if (args.length == 1) {
-            return args[args.length - 1];
-        } else {
-            String lastArg = args[args.length - 1];
-            String secondLastArg = args[args.length - 2];
-
-            if (doubleArgs.indexOf(secondLastArg) == -1) {
-                return lastArg;
-            } else {
-                System.out.println(helpMessage);
-                System.exit(0);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Return value of the first occurence of the specified
-     * option, or null if the option is not present.  If the
-     * option is a flag (0-parameter) and is present then the
-     * option name is returned.
-     */
-    private static String getOption(String option) {
-        String result[] = getOptions(option);
-
-        if (result.length == 0)
-            return null;
-        else
-            return result[0];
-    }
-
-    /**
-     * Return all the values of the specified option, or an empty
-     * array if the option is not present.  If the option is a
-     * flag (0-parameter) and is present then the option name is
-     * returned once for each occurrence.
-     */
-    private static String[] getOptions(String option) {
-        List result = new ArrayList();
-
-        for (int i=0; i < args.length; i++) {
-            if (option.equals(args[i])) {
-                if (-1 == doubleArgs.indexOf(option))
-                    result.add(option);
-                else
-                    if (i+1 < args.length)
-                        result.add(args[i+1]);
-            }
-
-            if (args[i].startsWith("-") && -1 != doubleArgs.indexOf(args[i]))
-                i++;
-        }
-
-        return (String[]) result.toArray( new String[result.size()] );
-    }
-
-    /**
-     * Return the base dir.  If the base dir parameter is not set
-     * the value is read from JNLPRuntime.NETX_ABOUT_FILE file.
-     * If that file does not exist, an install dialog is displayed
-     * to select the base directory.
-     */
-    private static File getBaseDir() {
-        if (getOption("-basedir") != null) {
-            File basedir = new File(getOption("-basedir"));
-
-            if (!basedir.exists() || !basedir.isDirectory())
-                fatalError(R("BNoDir", basedir));
-
-            return basedir;
-        }
-
-        // check .netxrc
-        File basedir = JNLPRuntime.getDefaultBaseDir();
-        if (basedir == null)
-            fatalError(R("BNoBase"));
-
-        return basedir;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/runtime/Boot13.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.lang.reflect.*;
-import java.io.*;
-import java.net.*;
-import java.security.*;
-import javax.swing.*;
-
-/**
- * Allows a Policy and SecurityManager to be set in JRE1.3 without
- * running the code with only applet permissions; this class is
- * for backward compatibility only and is totally unnecessary if
- * running in jdk 1.4 or later (can call Boot directly).
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.5 $
- */
-public class Boot13 extends URLClassLoader {
-
-    // The problem with setting a Policy in jdk1.3 is that the
-    // system and application classes seem to be loaded in such a
-    // way that only their protection domain determines the
-    // permissions; the policy object is never asked for permissions
-    // after the class is loaded.  This hack creates a classloader
-    // that loads duplicate versions of the classes in such a
-    // manner where they ask with the policy object.  The jdk1.4
-    // correctly honors the Policy object making this unneccessary
-    // post-1.3.
-
-    private Boot13(URL source[]) {
-        super(source);
-    }
-
-    protected PermissionCollection getPermissions(CodeSource source) {
-        Permissions result = new Permissions();
-        result.add( new AllPermission() );
-
-        return result;
-    }
-
-    public Class loadClass(String name) throws ClassNotFoundException {
-        Class c = findLoadedClass(name);
-        if (c != null)
-            return c;
-
-        // reverse the search order so that classes from this
-        // classloader, which sets the right permissions, are found
-        // before the parent classloader which has the same classes
-        // but the wrong permissions.
-        try {
-            return findClass(name);
-        }
-        catch (ClassNotFoundException ex) {
-        }
-
-        return getParent().loadClass(name);
-    }
-
-    public static void main(final String args[]) throws Exception {
-        URL cs = Boot13.class.getProtectionDomain().getCodeSource().getLocation();
-        //  instead of using a custom loadClass search order, we could
-        //  put the classes in a boot/ subdir of the JAR and load
-        //  them from there.  This would be an improvement by not
-        //  allowing applications to get a duplicate jnlp engine (one
-        //  with applet access permissions) by using the system
-        //  classloader but a drawback by not allowing Boot to be
-        //  called directly.
-        //cs = new URL("jar:"+cs+"!/boot/");
-
-        if (cs == null) {
-            System.err.println("fatal: cannot determine code source.");
-            System.exit(1);
-        }
-
-        Boot13 b = new Boot13(new URL[] {cs});
-
-        Thread.currentThread().setContextClassLoader(b); // try to prevent getting the non-policy version of classes
-
-        Class c = b.loadClass("net.sourceforge.jnlp.runtime.Boot");
-        Method main = c.getDeclaredMethod("main", new Class[] {String[].class} );
-
-        main.invoke(null, new Object[] { args } );
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1191 +0,0 @@
-
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.AllPermission;
-import java.security.CodeSource;
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.TreeSet;
-import java.util.Vector;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import net.sourceforge.jnlp.ExtensionDesc;
-import net.sourceforge.jnlp.JARDesc;
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.LaunchException;
-import net.sourceforge.jnlp.ParseException;
-import net.sourceforge.jnlp.PluginBridge;
-import net.sourceforge.jnlp.ResourcesDesc;
-import net.sourceforge.jnlp.SecurityDesc;
-import net.sourceforge.jnlp.Version;
-import net.sourceforge.jnlp.cache.CacheUtil;
-import net.sourceforge.jnlp.cache.ResourceTracker;
-import net.sourceforge.jnlp.cache.UpdatePolicy;
-import net.sourceforge.jnlp.security.SecurityWarningDialog;
-import net.sourceforge.jnlp.tools.JarSigner;
-import sun.misc.JarIndex;
-
-/**
- * Classloader that takes it's resources from a JNLP file.  If the
- * JNLP file defines extensions, separate classloaders for these
- * will be created automatically.  Classes are loaded with the
- * security context when the classloader was created.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.20 $
- */
-public class JNLPClassLoader extends URLClassLoader {
-
-    // todo: initializePermissions should get the permissions from
-    // extension classes too so that main file classes can load
-    // resources in an extension.
-
-    /** shortcut for resources */
-    private static String R(String key) { return JNLPRuntime.getMessage(key); }
-
-    /** map from JNLPFile url to shared classloader */
-    private static Map urlToLoader = new HashMap(); // never garbage collected!
-
-    /** the directory for native code */
-    private File nativeDir = null; // if set, some native code exists
-
-    /** a list of directories that contain native libraries */
-    private List<File> nativeDirectories = Collections.synchronizedList(new LinkedList<File>());
-
-    /** security context */
-    private AccessControlContext acc = AccessController.getContext();
-
-    /** the permissions for the cached jar files */
-    private List resourcePermissions;
-
-    /** the app */
-    private ApplicationInstance app = null; // here for faster lookup in security manager
-
-    /** list of this, local and global loaders this loader uses */
-    private JNLPClassLoader loaders[] = null; // ..[0]==this
-
-    /** whether to strictly adhere to the spec or not */
-    private boolean strict = true;
-
-    /** loads the resources */
-    private ResourceTracker tracker = new ResourceTracker(true); // prefetch
-
-    /** the update policy for resources */
-    private UpdatePolicy updatePolicy;
-
-    /** the JNLP file */
-    private JNLPFile file;
-
-    /** the resources section */
-    private ResourcesDesc resources;
-
-    /** the security section */
-    private SecurityDesc security;
-
-    /** Permissions granted by the user during runtime. */
-    private ArrayList<Permission> runtimePermissions = new ArrayList<Permission>();
-
-    /** all jars not yet part of classloader or active */
-    private List available = new ArrayList();
-
-        /** all of the jar files that were verified */
-        private ArrayList<String> verifiedJars = null;
-
-        /** all of the jar files that were not verified */
-        private ArrayList<String> unverifiedJars = null;
-
-        /** the jarsigner tool to verify our jars */
-        private JarSigner js = null;
-
-        private boolean signing = false;
-
-        /** ArrayList containing jar indexes for various jars available to this classloader */
-        private ArrayList<JarIndex> jarIndexes = new ArrayList<JarIndex>();
-
-        /** File entries in the jar files available to this classloader */
-        private TreeSet jarEntries = new TreeSet();
-
-        /** Map of specific codesources to securitydesc */
-        private HashMap<URL, SecurityDesc> jarLocationSecurityMap = new HashMap<URL, SecurityDesc>();
-
-    /**
-     * Create a new JNLPClassLoader from the specified file.
-     *
-     * @param file the JNLP file
-     */
-    protected JNLPClassLoader(JNLPFile file, UpdatePolicy policy) throws LaunchException {
-        super(new URL[0], JNLPClassLoader.class.getClassLoader());
-
-        if (JNLPRuntime.isDebug())
-            System.out.println("New classloader: "+file.getFileLocation());
-
-        this.file = file;
-        this.updatePolicy = policy;
-        this.resources = file.getResources();
-
-        // initialize extensions
-        initializeExtensions();
-
-        // initialize permissions
-        initializePermissions();
-
-        initializeResources();
-
-        setSecurity();
-
-    }
-
-    private void setSecurity() throws LaunchException {
-
-        URL codebase = null;
-
-        if (file.getCodeBase() != null) {
-            codebase = file.getCodeBase();
-        } else {
-            //Fixme: codebase should be the codebase of the Main Jar not
-            //the location. Although, it still works in the current state.
-            codebase = file.getResources().getMainJAR().getLocation();
-        }
-
-        /**
-         * When we're trying to load an applet, file.getSecurity() will return
-         * null since there is no jnlp file to specify permissions. We
-         * determine security settings here, after trying to verify jars.
-         */
-        if (file instanceof PluginBridge) {
-            if (signing == true) {
-                this.security = new SecurityDesc(file,
-                    SecurityDesc.ALL_PERMISSIONS,
-                    codebase.getHost());
-            } else {
-                this.security = new SecurityDesc(file,
-                    SecurityDesc.SANDBOX_PERMISSIONS,
-                    codebase.getHost());
-            }
-        } else { //regular jnlp file
-
-            /*
-             * Various combinations of the jars being signed and <security> tags being
-             * present are possible. They are treated as follows
-             *
-             * Jars          JNLP File         Result
-             *
-             * Signed        <security>        Appropriate Permissions
-             * Signed        no <security>     Sandbox
-             * Unsigned      <security>        Error
-             * Unsigned      no <security>     Sandbox
-             *
-             */
-            if (!file.getSecurity().getSecurityType().equals(SecurityDesc.SANDBOX_PERMISSIONS) && !signing) {
-                throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LUnsignedJarWithSecurity"), R("LUnsignedJarWithSecurityInfo"));
-            }
-            else if (signing == true) {
-                this.security = file.getSecurity();
-            } else {
-                this.security = new SecurityDesc(file,
-                        SecurityDesc.SANDBOX_PERMISSIONS,
-                        codebase.getHost());
-            }
-        }
-    }
-
-    /**
-     * Returns a JNLP classloader for the specified JNLP file.
-     *
-     * @param file the file to load classes for
-     * @param policy the update policy to use when downloading resources
-     */
-    public static JNLPClassLoader getInstance(JNLPFile file, UpdatePolicy policy) throws LaunchException {
-        JNLPClassLoader baseLoader = null;
-        JNLPClassLoader loader = null;
-        String uniqueKey = file.getUniqueKey();
-
-        if (uniqueKey != null)
-            baseLoader = (JNLPClassLoader) urlToLoader.get(uniqueKey);
-
-                try {
-
-                    // If base loader is null, or the baseloader's file and this
-                    // file is different, initialize a new loader
-                    if (baseLoader == null ||
-                        !baseLoader.getJNLPFile().getFileLocation().equals(file.getFileLocation())) {
-
-                        loader = new JNLPClassLoader(file, policy);
-
-                        // New loader init may have caused extentions to create a
-                        // loader for this unique key. Check.
-                        JNLPClassLoader extLoader = (JNLPClassLoader) urlToLoader.get(uniqueKey);
-
-                        if (extLoader != null && extLoader != loader) {
-                            if (loader.signing && !extLoader.signing)
-                                if (!SecurityWarningDialog.showNotAllSignedWarningDialog(file))
-                                    throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo"));
-
-                                loader.merge(extLoader);
-                        }
-
-                // loader is now current + ext. But we also need to think of
-                // the baseLoader
-                        if (baseLoader != null && baseLoader != loader) {
-                                loader.merge(baseLoader);
-                }
-
-                    } else {
-                        // if key is same and locations match, this is the loader we want
-                        loader = baseLoader;
-                    }
-
-                } catch (LaunchException e) {
-                        throw e;
-                }
-
-        // loaders are mapped to a unique key. Only extensions and parent
-        // share a key, so it is safe to always share based on it
-        urlToLoader.put(uniqueKey, loader);
-
-        return loader;
-    }
-
-    /**
-     * Returns a JNLP classloader for the JNLP file at the specified
-     * location.
-     *
-     * @param location the file's location
-     * @param version the file's version
-     * @param policy the update policy to use when downloading resources
-     */
-    public static JNLPClassLoader getInstance(URL location, String uniqueKey, Version version, UpdatePolicy policy)
-            throws IOException, ParseException, LaunchException {
-        JNLPClassLoader loader = (JNLPClassLoader) urlToLoader.get(uniqueKey);
-
-        if (loader == null || !location.equals(loader.getJNLPFile().getFileLocation()))
-            loader = getInstance(new JNLPFile(location, uniqueKey, version, false, policy), policy);
-
-        return loader;
-    }
-
-    /**
-     * Load the extensions specified in the JNLP file.
-     */
-    void initializeExtensions() {
-        ExtensionDesc[] ext = resources.getExtensions();
-
-        List loaderList = new ArrayList();
-
-        loaderList.add(this);
-
-                //if (ext != null) {
-                for (int i=0; i < ext.length; i++) {
-                try {
-                    String uniqueKey = this.getJNLPFile().getUniqueKey();
-                    JNLPClassLoader loader = getInstance(ext[i].getLocation(), uniqueKey, ext[i].getVersion(), updatePolicy);
-                    loaderList.add(loader);
-                }
-                catch (Exception ex) {
-                        ex.printStackTrace();
-                }
-                }
-                //}
-
-        loaders = (JNLPClassLoader[]) loaderList.toArray(new JNLPClassLoader[ loaderList.size()]);
-    }
-
-    /**
-     * Make permission objects for the classpath.
-     */
-    void initializePermissions() {
-        resourcePermissions = new ArrayList();
-
-        JARDesc jars[] = resources.getJARs();
-        for (int i=0; i < jars.length; i++) {
-            Permission p = CacheUtil.getReadPermission(jars[i].getLocation(),
-                                                       jars[i].getVersion());
-
-            if (JNLPRuntime.isDebug()) {
-                if (p == null)
-                        System.out.println("Unable to add permission for " + jars[i].getLocation());
-                else
-                        System.out.println("Permission added: " + p.toString());
-            }
-            if (p != null)
-                resourcePermissions.add(p);
-        }
-    }
-
-    /**
-     * Load all of the JARs used in this JNLP file into the
-     * ResourceTracker for downloading.
-     */
-    void initializeResources() throws LaunchException {
-        JARDesc jars[] = resources.getJARs();
-                if (jars == null || jars.length == 0)
-                        return;
-                /*
-                if (jars == null || jars.length == 0) {
-                        throw new LaunchException(null, null, R("LSFatal"),
-                                            R("LCInit"), R("LFatalVerification"), "No jars!");
-                }
-                */
-        List initialJars = new ArrayList();
-
-        for (int i=0; i < jars.length; i++) {
-
-            available.add(jars[i]);
-
-            if (jars[i].isEager())
-                initialJars.add(jars[i]); // regardless of part
-
-            tracker.addResource(jars[i].getLocation(),
-                                jars[i].getVersion(),
-                                jars[i].isCacheable() ? JNLPRuntime.getDefaultUpdatePolicy() : UpdatePolicy.FORCE
-                               );
-        }
-
-        if (strict)
-            fillInPartJars(initialJars); // add in each initial part's lazy jars
-
-                if (JNLPRuntime.isVerifying()) {
-
-                        JarSigner js;
-                        waitForJars(initialJars); //download the jars first.
-
-                        try {
-                                js = verifyJars(initialJars);
-                        } catch (Exception e) {
-                                //we caught an Exception from the JarSigner class.
-                                //Note: one of these exceptions could be from not being able
-                                //to read the cacerts or trusted.certs files.
-                                e.printStackTrace();
-                                throw new LaunchException(null, null, R("LSFatal"),
-                                        R("LCInit"), R("LFatalVerification"), R("LFatalVerificationInfo"));
-                        }
-
-                        //Case when at least one jar has some signing
-                        if (js.anyJarsSigned()){
-                                signing = true;
-
-                                if (!js.allJarsSigned() &&
-                                    !SecurityWarningDialog.showNotAllSignedWarningDialog(file))
-                                    throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo"));
-
-
-                                //user does not trust this publisher
-                                if (!js.getAlreadyTrustPublisher()) {
-                                    checkTrustWithUser(js);
-                                } else {
-                                        /**
-                                         * If the user trusts this publisher (i.e. the publisher's certificate
-                                         * is in the user's trusted.certs file), we do not show any dialogs.
-                                         */
-                                }
-                        } else {
-
-                                signing = false;
-                                //otherwise this jar is simply unsigned -- make sure to ask
-                                //for permission on certain actions
-                        }
-                }
-
-                for (JARDesc jarDesc: file.getResources().getJARs()) {
-                        try {
-                                URL location = tracker.getCacheFile(jarDesc.getLocation()).toURI().toURL();
-                                SecurityDesc jarSecurity = file.getSecurity();
-
-                                if (file instanceof PluginBridge) {
-
-                                URL codebase = null;
-
-                                if (file.getCodeBase() != null) {
-                                    codebase = file.getCodeBase();
-                                } else {
-                                    //Fixme: codebase should be the codebase of the Main Jar not
-                                    //the location. Although, it still works in the current state.
-                                    codebase = file.getResources().getMainJAR().getLocation();
-                                }
-
-                                        jarSecurity = new SecurityDesc(file,
-                                                        SecurityDesc.ALL_PERMISSIONS,
-                                                        codebase.getHost());
-                                }
-
-                                jarLocationSecurityMap.put(location, jarSecurity);
-                        } catch (MalformedURLException mfe) {
-                                System.err.println(mfe.getMessage());
-                        }
-                }
-
-        activateJars(initialJars);
-    }
-
-    private void checkTrustWithUser(JarSigner js) throws LaunchException {
-        if (!js.getRootInCacerts()) { //root cert is not in cacerts
-            boolean b = SecurityWarningDialog.showCertWarningDialog(
-                SecurityWarningDialog.AccessType.UNVERIFIED, file, js);
-            if (!b)
-                throw new LaunchException(null, null, R("LSFatal"),
-                    R("LCLaunching"), R("LNotVerified"), "");
-        } else if (js.getRootInCacerts()) { //root cert is in cacerts
-            boolean b = false;
-            if (js.noSigningIssues())
-                b = SecurityWarningDialog.showCertWarningDialog(
-                        SecurityWarningDialog.AccessType.VERIFIED, file, js);
-            else if (!js.noSigningIssues())
-                b = SecurityWarningDialog.showCertWarningDialog(
-                        SecurityWarningDialog.AccessType.SIGNING_ERROR, file, js);
-            if (!b)
-                throw new LaunchException(null, null, R("LSFatal"),
-                    R("LCLaunching"), R("LCancelOnUserRequest"), "");
-        }
-    }
-
-    /**
-     * Add applet's codebase URL.  This allows compatibility with
-     * applets that load resources from their codebase instead of
-     * through JARs, but can slow down resource loading.  Resources
-     * loaded from the codebase are not cached.
-     */
-    public void enableCodeBase() {
-        addURL( file.getCodeBase() ); // nothing happens if called more that once?
-    }
-
-    /**
-     * Sets the JNLP app this group is for; can only be called once.
-     */
-    public void setApplication(ApplicationInstance app) {
-        if (this.app != null) {
-            if (JNLPRuntime.isDebug()) {
-                Exception ex = new IllegalStateException("Application can only be set once");
-                ex.printStackTrace();
-            }
-            return;
-        }
-
-        this.app = app;
-    }
-
-    /**
-     * Returns the JNLP app for this classloader
-     */
-    public ApplicationInstance getApplication() {
-        return app;
-    }
-
-    /**
-     * Returns the JNLP file the classloader was created from.
-     */
-    public JNLPFile getJNLPFile() {
-        return file;
-    }
-
-    /**
-     * Returns the permissions for the CodeSource.
-     */
-    protected PermissionCollection getPermissions(CodeSource cs) {
-        Permissions result = new Permissions();
-
-        // should check for extensions or boot, automatically give all
-        // access w/o security dialog once we actually check certificates.
-
-        // copy security permissions from SecurityDesc element
-         if (security != null) {
-            // Security desc. is used only to track security settings for the
-            // application. However, an application may comprise of multiple
-            // jars, and as such, security must be evaluated on a per jar basis.
-
-            // set default perms
-            PermissionCollection permissions = security.getSandBoxPermissions();
-
-            // If more than default is needed:
-            // 1. Code must be signed
-            // 2. ALL or J2EE permissions must be requested (note: plugin requests ALL automatically)
-            if (cs.getCodeSigners() != null &&
-                    (getCodeSourceSecurity(cs.getLocation()).getSecurityType().equals(SecurityDesc.ALL_PERMISSIONS) ||
-                     getCodeSourceSecurity(cs.getLocation()).getSecurityType().equals(SecurityDesc.J2EE_PERMISSIONS))
-                    ) {
-
-                permissions = getCodeSourceSecurity(cs.getLocation()).getPermissions();
-            }
-
-            Enumeration<Permission> e = permissions.elements();
-            while (e.hasMoreElements())
-                result.add(e.nextElement());
-        }
-
-        // add in permission to read the cached JAR files
-        for (int i=0; i < resourcePermissions.size(); i++)
-            result.add((Permission) resourcePermissions.get(i));
-
-        // add in the permissions that the user granted.
-        for (int i=0; i < runtimePermissions.size(); i++)
-                result.add(runtimePermissions.get(i));
-
-        return result;
-    }
-
-    protected void addPermission(Permission p) {
-        runtimePermissions.add(p);
-    }
-
-    /**
-     * Adds to the specified list of JARS any other JARs that need
-     * to be loaded at the same time as the JARs specified (ie, are
-     * in the same part).
-     */
-    protected void fillInPartJars(List jars) {
-        for (int i=0; i < jars.size(); i++) {
-            String part = ((JARDesc) jars.get(i)).getPart();
-
-            for (int a=0; a < available.size(); a++) {
-                JARDesc jar = (JARDesc) available.get(a);
-
-                if (part != null && part.equals(jar.getPart()))
-                    if (!jars.contains(jar))
-                        jars.add(jar);
-            }
-        }
-    }
-
-    /**
-     * Ensures that the list of jars have all been transferred, and
-     * makes them available to the classloader.  If a jar contains
-     * native code, the libraries will be extracted and placed in
-     * the path.
-     *
-     * @param jars the list of jars to load
-     */
-    protected void activateJars(final List jars) {
-        PrivilegedAction activate = new PrivilegedAction() {
-
-            public Object run() {
-                // transfer the Jars
-                waitForJars(jars);
-
-                for (int i=0; i < jars.size(); i++) {
-                    JARDesc jar = (JARDesc) jars.get(i);
-
-                    available.remove(jar);
-
-                    // add jar
-                    File localFile = tracker.getCacheFile(jar.getLocation());
-                    try {
-                        URL location = jar.getLocation(); // non-cacheable, use source location
-                        if (localFile != null) {
-                            location = localFile.toURL(); // cached file
-
-                            // This is really not the best way.. but we need some way for
-                            // PluginAppletViewer::getCachedImageRef() to check if the image
-                            // is available locally, and it cannot use getResources() because
-                            // that prefetches the resource, which confuses MediaTracker.waitForAll()
-                            // which does a wait(), waiting for notification (presumably
-                            // thrown after a resource is fetched). This bug manifests itself
-                            // particularly when using The FileManager applet from Webmin.
-
-                            JarFile jarFile = new JarFile(localFile);
-                            Enumeration e = jarFile.entries();
-                            while (e.hasMoreElements()) {
-
-                                JarEntry je = (JarEntry) e.nextElement();
-
-                                // another jar in my jar? it is more likely than you think
-                                if (je.getName().endsWith(".jar")) {
-                                    // We need to extract that jar so that it can be loaded
-                                    // (inline loading with "jar:..!/..." path will not work
-                                    // with standard classloader methods)
-
-                                    String extractedJarLocation = localFile.getParent() + "/" + je.getName();
-                                    File parentDir = new File(extractedJarLocation).getParentFile();
-                                    if (!parentDir.isDirectory() && !parentDir.mkdirs()) {
-                                        throw new RuntimeException(R("RNestedJarExtration"));
-                                    }
-                                    FileOutputStream extractedJar = new FileOutputStream(extractedJarLocation);
-                                    InputStream is = jarFile.getInputStream(je);
-
-                                    byte[] bytes = new byte[1024];
-                                    int read = is.read(bytes);
-                                    while (read > 0) {
-                                        extractedJar.write(bytes, 0, read);
-                                        read = is.read(bytes);
-                                    }
-
-                                    is.close();
-                                    extractedJar.close();
-
-                                    JarSigner signer = new JarSigner();
-                                    signer.verifyJar(extractedJarLocation);
-
-                                    if (signer.anyJarsSigned() && !signer.getAlreadyTrustPublisher()) {
-                                        checkTrustWithUser(signer);
-                                    }
-
-                                    try {
-                                        URL fileURL = new URL("file://" + extractedJarLocation);
-                                        addURL(fileURL);
-
-                                        SecurityDesc jarSecurity = file.getSecurity();
-
-                                        if (file instanceof PluginBridge) {
-
-                                            URL codebase = null;
-
-                                            if (file.getCodeBase() != null) {
-                                                codebase = file.getCodeBase();
-                                            } else {
-                                                //Fixme: codebase should be the codebase of the Main Jar not
-                                                //the location. Although, it still works in the current state.
-                                                codebase = file.getResources().getMainJAR().getLocation();
-                                            }
-
-                                            jarSecurity = new SecurityDesc(file,
-                                                SecurityDesc.ALL_PERMISSIONS,
-                                                codebase.getHost());
-                                        }
-
-                                        jarLocationSecurityMap.put(fileURL, jarSecurity);
-
-                                     } catch (MalformedURLException mfue) {
-                                        if (JNLPRuntime.isDebug())
-                                            System.err.println("Unable to add extracted nested jar to classpath");
-
-                                        mfue.printStackTrace();
-                                    }
-                                }
-
-                                jarEntries.add(je.getName());
-                            }
-
-                        }
-
-                        addURL(location);
-
-                        // there is currently no mechanism to cache files per
-                        // instance.. so only index cached files
-                        if (localFile != null) {
-                            JarIndex index = JarIndex.getJarIndex(new JarFile(localFile.getAbsolutePath()), null);
-
-                            if (index != null)
-                                jarIndexes.add(index);
-                        }
-
-                        if (JNLPRuntime.isDebug())
-                            System.err.println("Activate jar: "+location);
-                    }
-                    catch (Exception ex) {
-                        if (JNLPRuntime.isDebug())
-                            ex.printStackTrace();
-                    }
-
-                    // some programs place a native library in any jar
-                    activateNative(jar);
-                }
-
-                return null;
-            }
-        };
-
-        AccessController.doPrivileged(activate, acc);
-    }
-
-    /**
-     * Search for and enable any native code contained in a JAR by copying the
-     * native files into the filesystem. Called in the security context of the
-     * classloader.
-     */
-    protected void activateNative(JARDesc jar) {
-        if (JNLPRuntime.isDebug())
-            System.out.println("Activate native: "+jar.getLocation());
-
-        File localFile = tracker.getCacheFile(jar.getLocation());
-        if (localFile == null)
-            return;
-
-        if (nativeDir == null)
-            nativeDir = getNativeDir();
-
-        String[] librarySuffixes = { ".so", ".dylib", ".jnilib", ".framework", ".dll" };
-
-        try {
-            JarFile jarFile = new JarFile(localFile, false);
-            Enumeration<JarEntry> entries = jarFile.entries();
-
-            while (entries.hasMoreElements()) {
-                JarEntry e = entries.nextElement();
-
-                if (e.isDirectory()) {
-                    continue;
-                }
-
-                String name = new File(e.getName()).getName();
-                boolean isLibrary = false;
-
-                for (String suffix: librarySuffixes) {
-                    if (name.endsWith(suffix)) {
-                       isLibrary = true;
-                       break;
-                    }
-                }
-                if (!isLibrary) {
-                    continue;
-                }
-
-                File outFile = new File(nativeDir, name);
-
-                CacheUtil.streamCopy(jarFile.getInputStream(e),
-                                     new FileOutputStream(outFile));
-            }
-        }
-        catch (IOException ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-        }
-    }
-
-    /**
-     * Return the base directory to store native code files in.
-     * This method does not need to return the same directory across
-     * calls.
-     */
-    protected File getNativeDir() {
-        nativeDir = new File(System.getProperty("java.io.tmpdir")
-                             + File.separator + "netx-native-"
-                             + (new Random().nextInt() & 0xFFFF));
-
-        if (!nativeDir.mkdirs())
-            return null;
-        else {
-            // add this new native directory to the search path
-            addNativeDirectory(nativeDir);
-            return nativeDir;
-        }
-    }
-
-    /**
-     * Adds the {@link File} to the search path of this {@link JNLPClassLoader}
-     * when trying to find a native library
-     */
-    protected void addNativeDirectory(File nativeDirectory) {
-        nativeDirectories.add(nativeDirectory);
-    }
-
-    /**
-     * Returns a list of all directories in the search path of the current classloader
-     * when it tires to find a native library.
-     * @return a list of directories in the search path for native libraries
-     */
-    protected List<File> getNativeDirectories() {
-        return nativeDirectories;
-    }
-
-    /**
-     * Return the absolute path to the native library.
-     */
-    protected String findLibrary(String lib) {
-        String syslib = System.mapLibraryName(lib);
-
-        for (File dir: getNativeDirectories()) {
-            File target = new File(dir, syslib);
-            if (target.exists())
-                return target.toString();
-        }
-
-        String result = super.findLibrary(lib);
-        if (result != null)
-            return result;
-
-        return findLibraryExt(lib);
-    }
-
-    /**
-     * Try to find the library path from another peer classloader.
-     */
-    protected String findLibraryExt(String lib) {
-        for (int i=0; i < loaders.length; i++) {
-            String result = null;
-
-            if (loaders[i] != this)
-                result = loaders[i].findLibrary(lib);
-
-            if (result != null)
-                return result;
-        }
-
-        return null;
-    }
-
-    /**
-     * Wait for a group of JARs, and send download events if there
-     * is a download listener or display a progress window otherwise.
-     *
-     * @param jars the jars
-     */
-    private void waitForJars(List jars) {
-        URL urls[] = new URL[jars.size()];
-
-        for (int i=0; i < jars.size(); i++) {
-            JARDesc jar = (JARDesc) jars.get(i);
-
-            urls[i] = jar.getLocation();
-        }
-
-        CacheUtil.waitForResources(app, tracker, urls, file.getTitle());
-    }
-
-    /**
-         * Verifies code signing of jars to be used.
-         *
-         * @param jars the jars to be verified.
-         */
-        private JarSigner verifyJars(List<JARDesc> jars) throws Exception {
-
-                js = new JarSigner();
-                js.verifyJars(jars, tracker);
-                return js;
-        }
-
-    /**
-     * Find the loaded class in this loader or any of its extension loaders.
-     */
-    protected Class findLoadedClassAll(String name) {
-        for (int i=0; i < loaders.length; i++) {
-            Class result = null;
-
-            if (loaders[i] == this)
-                result = super.findLoadedClass(name);
-            else
-                result = loaders[i].findLoadedClassAll(name);
-
-            if (result != null)
-                return result;
-        }
-
-        return null;
-    }
-
-    /**
-     * Find a JAR in the shared 'extension' classloaders, this
-     * classloader, or one of the classloaders for the JNLP file's
-     * extensions.
-     */
-    public Class loadClass(String name) throws ClassNotFoundException {
-
-        Class result = findLoadedClassAll(name);
-
-        // try parent classloader
-        if (result == null) {
-            try {
-                ClassLoader parent = getParent();
-                if (parent == null)
-                    parent = ClassLoader.getSystemClassLoader();
-
-                return parent.loadClass(name);
-            }
-            catch (ClassNotFoundException ex) { }
-        }
-
-        // filter out 'bad' package names like java, javax
-        // validPackage(name);
-
-        // search this and the extension loaders
-        if (result == null)
-            try {
-                result = loadClassExt(name);
-            } catch (ClassNotFoundException cnfe) {
-
-                // Not found in external loader either. As a last resort, look in any available indexes
-
-                // Currently this loads jars directly from the site. We cannot cache it because this
-                // call is initiated from within the applet, which does not have disk read/write permissions
-                for (JarIndex index: jarIndexes) {
-                    LinkedList<String> jarList = index.get(name.replace('.', '/'));
-
-                    if (jarList != null) {
-                        for (String jarName: jarList) {
-                            JARDesc desc;
-                            try {
-                                desc = new JARDesc(new URL(file.getCodeBase(), jarName),
-                                        null, null, false, true, false, true);
-                            } catch (MalformedURLException mfe) {
-                                throw new ClassNotFoundException(name);
-                            }
-
-                            available.add(desc);
-
-                            tracker.addResource(desc.getLocation(),
-                                    desc.getVersion(),
-                                    JNLPRuntime.getDefaultUpdatePolicy()
-                            );
-
-                            URL remoteURL;
-                            try {
-                                remoteURL = new URL(file.getCodeBase() + jarName);
-                            } catch (MalformedURLException mfe) {
-                                throw new ClassNotFoundException(name);
-                            }
-
-                            URL u;
-
-                            try {
-                                u = tracker.getCacheURL(remoteURL);
-                            } catch (Exception e) {
-                                throw new ClassNotFoundException(name);
-                            }
-
-                            if (u != null)
-                                addURL(u);
-
-                        }
-
-                        // If it still fails, let it error out
-                        result = loadClassExt(name);
-                    }
-                }
-            }
-
-        return result;
-    }
-
-    /**
-     * Find the class in this loader or any of its extension loaders.
-     */
-    protected Class findClass(String name) throws ClassNotFoundException {
-        for (int i=0; i < loaders.length; i++) {
-            try {
-                if (loaders[i] == this)
-                    return super.findClass(name);
-                else
-                    return loaders[i].findClass(name);
-            }
-            catch(ClassNotFoundException ex) { }
-            catch(ClassFormatError cfe) {}
-        }
-
-        throw new ClassNotFoundException(name);
-    }
-
-    /**
-     * Search for the class by incrementally adding resources to the
-     * classloader and its extension classloaders until the resource
-     * is found.
-     */
-    private Class loadClassExt(String name) throws ClassNotFoundException {
-        // make recursive
-        addAvailable();
-
-        // find it
-        try {
-            return findClass(name);
-        }
-        catch(ClassNotFoundException ex) {
-        }
-
-        // add resources until found
-        while (true) {
-            JNLPClassLoader addedTo = addNextResource();
-
-            if (addedTo == null)
-                throw new ClassNotFoundException(name);
-
-            try {
-                return addedTo.findClass(name);
-            }
-            catch(ClassNotFoundException ex) {
-            }
-        }
-    }
-
-    /**
-     * Finds the resource in this, the parent, or the extension
-     * class loaders.
-     */
-    public URL getResource(String name) {
-        URL result = super.getResource(name);
-
-        for (int i=1; i < loaders.length; i++)
-            if (result == null)
-                result = loaders[i].getResource(name);
-
-        return result;
-    }
-
-    /**
-     * Finds the resource in this, the parent, or the extension
-     * class loaders.
-     */
-    public Enumeration findResources(String name) throws IOException {
-        Vector resources = new Vector();
-
-        for (int i=0; i < loaders.length; i++) {
-            Enumeration e;
-
-            if (loaders[i] == this)
-                e = super.findResources(name);
-            else
-                e = loaders[i].findResources(name);
-
-            while (e.hasMoreElements())
-                resources.add(e.nextElement());
-        }
-
-        return resources.elements();
-    }
-
-    /**
-     * Returns if the specified resource is available locally from a cached jar
-     *
-     * @param s The name of the resource
-     * @return Whether or not the resource is available locally
-     */
-    public boolean resourceAvailableLocally(String s) {
-        return jarEntries.contains(s);
-    }
-
-    /**
-     * Adds whatever resources have already been downloaded in the
-     * background.
-     */
-    protected void addAvailable() {
-        // go through available, check tracker for it and all of its
-        // part brothers being available immediately, add them.
-
-        for (int i=1; i < loaders.length; i++) {
-            loaders[i].addAvailable();
-        }
-    }
-
-    /**
-     * Adds the next unused resource to the classloader.  That
-     * resource and all those in the same part will be downloaded
-     * and added to the classloader before returning.  If there are
-     * no more resources to add, the method returns immediately.
-     *
-     * @return the classloader that resources were added to, or null
-     */
-    protected JNLPClassLoader addNextResource() {
-        if (available.size() == 0) {
-            for (int i=1; i < loaders.length; i++) {
-                JNLPClassLoader result = loaders[i].addNextResource();
-
-                if (result != null)
-                    return result;
-            }
-            return null;
-        }
-
-        // add jar
-        List jars = new ArrayList();
-        jars.add(available.get(0));
-
-        fillInPartJars(jars);
-
-
-                activateJars(jars);
-
-        return this;
-    }
-
-    // this part compatibility with previous classloader
-    /**
-     * @deprecated
-     */
-    public String getExtensionName() {
-        String result = file.getInformation().getTitle();
-
-        if (result == null)
-            result = file.getInformation().getDescription();
-        if (result == null && file.getFileLocation() != null)
-            result = file.getFileLocation().toString();
-        if (result == null && file.getCodeBase() != null)
-            result = file.getCodeBase().toString();
-
-        return result;
-    }
-
-    /**
-     * @deprecated
-     */
-    public String getExtensionHREF() {
-        return file.getFileLocation().toString();
-    }
-
-        public boolean getSigning() {
-                return signing;
-        }
-
-        protected SecurityDesc getSecurity() {
-                return security;
-        }
-
-        /**
-         * Returns the security descriptor for given code source URL
-         *
-         * @param source The code source
-         * @return The SecurityDescriptor for that source
-         */
-
-        protected SecurityDesc getCodeSourceSecurity(URL source) {
-                return jarLocationSecurityMap.get(source);
-        }
-
-        /**
-         * Merges the code source/security descriptor mapping from another loader
-         *
-         * @param extLoader The loader form which to merge
-         * @throws SecurityException if the code is called from an untrusted source
-         */
-        private void merge(JNLPClassLoader extLoader) {
-
-                try {
-                        System.getSecurityManager().checkPermission(new AllPermission());
-                } catch (SecurityException se) {
-                        throw new SecurityException("JNLPClassLoader() may only be called from trusted sources!");
-                }
-
-                // jars
-                for (URL u : extLoader.getURLs())
-                addURL(u);
-
-                // native search paths
-        for (File nativeDirectory: extLoader.getNativeDirectories())
-            addNativeDirectory(nativeDirectory);
-
-        // security descriptors
-                for (URL key: extLoader.jarLocationSecurityMap.keySet()) {
-                        jarLocationSecurityMap.put(key, extLoader.jarLocationSecurityMap.get(key));
-                }
-        }
-}
--- a/netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.security.*;
-import java.util.Enumeration;
-
-/**
- * Policy for JNLP environment.  This class delegates to the
- * system policy but always grants permissions to the JNLP code
- * and system CodeSources (no separate policy file needed).  This
- * class may also grant permissions to applications at runtime if
- * approved by the user.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.7 $
- */
-public class JNLPPolicy extends Policy {
-
-    /** classes from this source have all permissions */
-    private static CodeSource shellSource;
-
-    /** classes from this source have all permissions */
-    private static CodeSource systemSource;
-
-    /** the previous policy */
-    private static Policy systemPolicy;
-
-
-    protected JNLPPolicy() {
-        shellSource = JNLPPolicy.class.getProtectionDomain().getCodeSource();
-        systemSource = Policy.class.getProtectionDomain().getCodeSource();
-        systemPolicy = Policy.getPolicy();
-    }
-
-    /**
-     * Return a mutable, heterogeneous-capable permission collection
-     * for the source.
-     */
-    public PermissionCollection getPermissions(CodeSource source) {
-        if (source.equals(systemSource) || source.equals(shellSource))
-            return getAllPermissions();
-
-        // if we check the SecurityDesc here then keep in mind that
-        // code can add properties at runtime to the ResourcesDesc!
-        if (JNLPRuntime.getApplication() != null) {
-                if (JNLPRuntime.getApplication().getClassLoader() instanceof JNLPClassLoader) {
-                        JNLPClassLoader cl = (JNLPClassLoader) JNLPRuntime.getApplication().getClassLoader();
-
-                        PermissionCollection clPermissions = cl.getPermissions(source);
-
-                        // systempolicy permissions need to be accounted for as well
-                        CodeSource appletCS = new CodeSource(JNLPRuntime.getApplication().getJNLPFile().getSourceLocation(), (java.security.cert.Certificate[]) null);
-                        Enumeration e = systemPolicy.getPermissions(appletCS).elements();
-                while (e.hasMoreElements())
-                    clPermissions.add((Permission) e.nextElement());
-
-                        return clPermissions;
-                }
-        }
-
-        // delegate to original Policy object; required to run under WebStart
-        return systemPolicy.getPermissions(source);
-    }
-
-    /**
-     * Refresh.
-     */
-    public void refresh() {
-        // no op
-    }
-
-    /**
-     * Return an all-permissions collection.
-     */
-    private Permissions getAllPermissions() {
-        Permissions result = new Permissions();
-
-        result.add( new AllPermission() );
-        return result;
-    }
-
-        public boolean implies(ProtectionDomain domain, Permission permission) {
-                //Include the permissions that may be added during runtime.
-                PermissionCollection pc = getPermissions(domain.getCodeSource());
-                return super.implies(domain, permission) || pc.implies(permission);
-        }
-}
--- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,562 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.io.*;
-import java.awt.*;
-import java.text.*;
-import java.util.*;
-import java.util.List;
-import java.security.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.cache.*;
-import net.sourceforge.jnlp.services.*;
-import net.sourceforge.jnlp.util.*;
-
-
-/**
- * Configure and access the runtime environment.  This class
- * stores global jnlp properties such as default download
- * indicators, the install/base directory, the default resource
- * update policy, etc.  Some settings, such as the base directory,
- * cannot be changed once the runtime has been initialized.<p>
- *
- * The JNLP runtime can be locked to prevent further changes to
- * the runtime environment except by a specified class.  If set,
- * only instances of the <i>exit class</i> can exit the JVM or
- * change the JNLP runtime settings once the runtime has been
- * initialized.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.19 $
- */
-public class JNLPRuntime {
-
-    static {
-        loadResources();
-    }
-
-    /** the localized resource strings */
-    private static ResourceBundle resources;
-
-    /** the security manager */
-    private static JNLPSecurityManager security;
-
-    /** the security policy */
-    private static JNLPPolicy policy;
-
-    /** the base dir for cache, etc */
-    private static File baseDir;
-
-    /** a default launch handler */
-    private static LaunchHandler handler = null;
-
-    /** default download indicator */
-    private static DownloadIndicator indicator = null;
-
-    /** update policy that controls when to check for updates */
-    private static UpdatePolicy updatePolicy = UpdatePolicy.ALWAYS;
-
-    /** netx window icon */
-    private static Image windowIcon = null;
-
-    /** whether initialized */
-    private static boolean initialized = false;
-
-    /** whether netx is in command-line mode (headless) */
-    private static boolean headless = false;
-
-        /** whether we'll be checking for jar signing */
-        private static boolean verify = true;
-
-    /** whether the runtime uses security */
-    private static boolean securityEnabled = true;
-
-    /** whether debug mode is on */
-    private static boolean debug = false; // package access by Boot
-
-    /** mutex to wait on, for initialization */
-    public static Object initMutex = new Object();
-
-    /** set to true if this is a webstart application. */
-    private static boolean isWebstartApplication;
-
-    /** set to false to indicate another JVM should not be spawned, even if necessary */
-    private static boolean forksAllowed = true;
-
-    /** contains the arguments passed to the jnlp runtime */
-    private static List<String> initialArguments;
-
-    /** Username */
-    public static final String USER = System.getProperty("user.name");
-
-    /** User's home directory */
-    public static final String HOME_DIR = System.getProperty("user.home");
-
-    /** the ~/.netxrc file containing netx settings */
-    public static final String NETXRC_FILE = HOME_DIR + File.separator + ".netxrc";
-
-    /** the ~/.netx directory containing user-specific data */
-    public static final String NETX_DIR = HOME_DIR + File.separator + ".netx";
-
-    /** the ~/.netx/security directory containing security related information */
-    public static final String SECURITY_DIR = NETX_DIR + File.separator + "security";
-
-    /** the ~/.netx/security/trusted.certs file containing trusted certificates */
-    public static final String CERTIFICATES_FILE = SECURITY_DIR + File.separator + "trusted.certs";
-
-    /** the /tmp/ directory used for temporary files */
-    public static final String TMP_DIR = System.getProperty("java.io.tmpdir");
-
-    /**
-     * the /tmp/$USER/netx/locks/ directory containing locks for single instance
-     * applications
-     */
-    public static final String LOCKS_DIR = TMP_DIR + File.separator + USER + File.separator
-            + "netx" + File.separator + "locks";
-
-    /** the java.home directory */
-    public static final String JAVA_HOME_DIR = System.getProperty("java.home");
-
-    /** the JNLP file to open to display the network-based about window */
-    public static final String NETX_ABOUT_FILE = JAVA_HOME_DIR + File.separator + "lib"
-            + File.separator + "about.jnlp";
-
-
-
-    /**
-     * Returns whether the JNLP runtime environment has been
-     * initialized.  Once initialized, some properties such as the
-     * base directory cannot be changed.  Before
-     */
-    public static boolean isInitialized() {
-        return initialized;
-    }
-
-    /**
-     * Initialize the JNLP runtime environment by installing the
-     * security manager and security policy, initializing the JNLP
-     * standard services, etc.<p>
-     *
-     * This method cannot be called more than once.  Once
-     * initialized, methods that alter the runtime can only be
-     * called by the exit class.<p>
-     *
-     * @param isApplication is true if a webstart application is being initialized
-     *
-     * @throws IllegalStateException if the runtime was previously initialized
-     */
-    public static void initialize(boolean isApplication) throws IllegalStateException {
-        checkInitialized();
-
-        isWebstartApplication = isApplication;
-
-        //Setting the system property for javawebstart's version.
-        //The version stored will be the same as java's version.
-        System.setProperty("javawebstart.version", "javaws-" +
-            System.getProperty("java.version"));
-
-        if (headless == false)
-            checkHeadless();
-
-        if (!headless && windowIcon == null)
-            loadWindowIcon();
-
-        if (!headless && indicator == null)
-            indicator = new DefaultDownloadIndicator();
-
-        if (handler == null)
-            handler = new DefaultLaunchHandler();
-
-        if (baseDir == null)
-            baseDir = getDefaultBaseDir();
-
-        if (baseDir == null)
-            throw new IllegalStateException(JNLPRuntime.getMessage("BNoBase"));
-
-        ServiceManager.setServiceManagerStub(new XServiceManagerStub()); // ignored if we're running under Web Start
-
-        policy = new JNLPPolicy();
-        security = new JNLPSecurityManager(); // side effect: create JWindow
-
-        if (securityEnabled) {
-            Policy.setPolicy(policy); // do first b/c our SM blocks setPolicy
-            System.setSecurityManager(security);
-        }
-
-        initialized = true;
-    }
-
-    /**
-     * Returns true if a webstart application has been initialized, and false
-     * for a plugin applet.
-     */
-    public static boolean isWebstartApplication() {
-        return isWebstartApplication;
-    }
-
-    /**
-     * Returns the window icon.
-     */
-    public static Image getWindowIcon() {
-        return windowIcon;
-    }
-
-    /**
-     * Sets the window icon that is displayed in Java applications
-     * and applets instead of the default Java icon.
-     *
-     * @throws IllegalStateException if caller is not the exit class
-     */
-    public static void setWindowIcon(Image image) {
-        checkExitClass();
-        windowIcon = image;
-    }
-
-    /**
-     * Returns whether the JNLP client will use any AWT/Swing
-     * components.
-     */
-    public static boolean isHeadless() {
-        return headless;
-    }
-
-        /**
-         * Returns whether we are verifying code signing.
-         */
-        public static boolean isVerifying() {
-                return verify;
-        }
-    /**
-     * Sets whether the JNLP client will use any AWT/Swing
-     * components.  In headless mode, client features that use the
-     * AWT are disabled such that the client can be used in
-     * headless mode (<code>java.awt.headless=true</code>).
-     *
-     * @throws IllegalStateException if the runtime was previously initialized
-     */
-    public static void setHeadless(boolean enabled) {
-        checkInitialized();
-        headless = enabled;
-    }
-
-   /**
-        * Sets whether we will verify code signing.
-        * @throws IllegalStateException if the runtime was previously initialized
-        */
-    public static void setVerify(boolean enabled) {
-                checkInitialized();
-                verify = enabled;
-    }
-
-    /**
-     * Return the base directory containing the cache, persistence
-     * store, etc.
-     */
-    public static File getBaseDir() {
-        return baseDir;
-    }
-
-    /**
-     * Sets the base directory containing the cache, persistence
-     * store, etc.
-     *
-     * @throws IllegalStateException if caller is not the exit class
-     */
-    public static void setBaseDir(File baseDirectory) {
-        checkInitialized();
-        baseDir = baseDirectory;
-    }
-
-    /**
-     * Returns whether the secure runtime environment is enabled.
-     */
-    public static boolean isSecurityEnabled() {
-        return securityEnabled;
-    }
-
-    /**
-     * Sets whether to enable the secure runtime environment.
-     * Disabling security can increase performance for some
-     * applications, and can be used to use netx with other code
-     * that uses its own security manager or policy.
-     *
-     * Disabling security is not recommended and should only be
-     * used if the JNLP files opened are trusted.  This method can
-     * only be called before initalizing the runtime.<p>
-     *
-     * @param enabled whether security should be enabled
-     * @throws IllegalStateException if the runtime is already initialized
-     */
-    public static void setSecurityEnabled(boolean enabled) {
-        checkInitialized();
-        securityEnabled = enabled;
-    }
-
-    /**
-     * Returns the system default base dir for or if not set,
-     * prompts the user for the location.
-     *
-     * @return the base dir, or null if the user canceled the dialog
-     * @throws IOException if there was an io exception
-     */
-    public static File getDefaultBaseDir() {
-        PropertiesFile props = JNLPRuntime.getProperties();
-
-        String baseStr = props.getProperty("basedir");
-        if (baseStr != null)
-            return new File(baseStr);
-
-        String homeDir = HOME_DIR;
-        File baseDir = new File(NETX_DIR);
-        if (homeDir == null || (!baseDir.isDirectory() && !baseDir.mkdir()))
-            return null;
-
-        props.setProperty("basedir", baseDir.toString());
-        props.store();
-
-        return baseDir;
-    }
-
-    /**
-     * Set a class that can exit the JVM; if not set then any class
-     * can exit the JVM.
-     *
-     * @throws IllegalStateException if caller is not the exit class
-     */
-    public static void setExitClass(Class exitClass) {
-        checkExitClass();
-        security.setExitClass(exitClass);
-    }
-
-    /**
-     * Disables applets from calling exit.
-     *
-     * Once disabled, exit cannot be re-enabled for the duration of the JVM instance
-     */
-    public static void disableExit() {
-        security.disableExit();
-    }
-
-    /**
-     * Return the current Application, or null if none can be
-     * determined.
-     */
-    public static ApplicationInstance getApplication() {
-        return security.getApplication();
-    }
-
-    /**
-     * Return a PropertiesFile object backed by the runtime's
-     * properties file.
-     */
-    public static PropertiesFile getProperties() {
-        File netxrc = new File(NETXRC_FILE);
-        return new PropertiesFile(netxrc);
-    }
-
-    /**
-     * Return whether debug statements for the JNLP client code
-     * should be printed.
-     */
-    public static boolean isDebug() {
-        return debug;
-    }
-
-    /**
-     * Sets whether debug statements for the JNLP client code
-     * should be printed to the standard output.
-     *
-     * @throws IllegalStateException if caller is not the exit class
-     */
-    public static void setDebug(boolean enabled) {
-        checkExitClass();
-        debug = enabled;
-    }
-
-    /**
-     * Sets the default update policy.
-     *
-     * @throws IllegalStateException if caller is not the exit class
-     */
-    public static void setDefaultUpdatePolicy(UpdatePolicy policy) {
-        checkExitClass();
-        updatePolicy = policy;
-    }
-
-    /**
-     * Returns the default update policy.
-     */
-    public static UpdatePolicy getDefaultUpdatePolicy() {
-        return updatePolicy;
-    }
-
-    /**
-     * Sets the default launch handler.
-     */
-    public static void setDefaultLaunchHandler(LaunchHandler handler) {
-        checkExitClass();
-        JNLPRuntime.handler = handler;
-    }
-
-    /**
-     * Returns the default launch handler.
-     */
-    public static LaunchHandler getDefaultLaunchHandler() {
-        return handler;
-    }
-
-    /**
-     * Sets the default download indicator.
-     *
-     * @throws IllegalStateException if caller is not the exit class
-     */
-    public static void setDefaultDownloadIndicator(DownloadIndicator indicator) {
-        checkExitClass();
-        JNLPRuntime.indicator = indicator;
-    }
-
-    /**
-     * Returns the default download indicator.
-     */
-    public static DownloadIndicator getDefaultDownloadIndicator() {
-        return indicator;
-    }
-
-    /**
-     * Returns the localized resource string identified by the
-     * specified key.  If the message is empty, a null is
-     * returned.
-     */
-    public static String getMessage(String key) {
-        try {
-            String result = resources.getString(key);
-            if (result.length() == 0)
-                return null;
-            else
-                return result;
-        }
-        catch (Exception ex) {
-            if (!key.equals("RNoResource"))
-                return getMessage("RNoResource", new Object[] {key});
-            else
-                return "Missing resource: "+key;
-        }
-    }
-
-    /**
-     * Returns the localized resource string using the specified
-     * arguments.
-     *
-     * @param args the formatting arguments to the resource string
-     */
-    public static String getMessage(String key, Object args[]) {
-        return MessageFormat.format(getMessage(key), args);
-    }
-
-    /**
-     * Returns true if the current runtime will fork
-     */
-    public static boolean getForksAllowed() {
-        return forksAllowed;
-    }
-
-    public static void setForksAllowed(boolean value) {
-        checkInitialized();
-        forksAllowed = value;
-    }
-
-    /**
-     * Throws an exception if called when the runtime is
-     * already initialized.
-     */
-    private static void checkInitialized() {
-        if (initialized)
-            throw new IllegalStateException("JNLPRuntime already initialized.");
-    }
-
-    /**
-     * Throws an exception if called with security enabled but
-     * a caller is not the exit class and the runtime has been
-     * initialized.
-     */
-    private static void checkExitClass() {
-        if (securityEnabled && initialized)
-            if (!security.isExitClass())
-                throw new IllegalStateException("Caller is not the exit class");
-    }
-
-    /**
-     * Check whether the VM is in headless mode.
-     */
-    private static void checkHeadless() {
-        //if (GraphicsEnvironment.isHeadless()) // jdk1.4+ only
-        //    headless = true;
-        try {
-            if ("true".equalsIgnoreCase(System.getProperty("java.awt.headless")))
-                headless = true;
-        }
-        catch (SecurityException ex) {
-        }
-    }
-
-    /**
-     * Load the resources.
-     */
-    private static void loadResources() {
-        try {
-            resources = ResourceBundle.getBundle("net.sourceforge.jnlp.resources.Messages");
-        }
-        catch (Exception ex) {
-            throw new IllegalStateException("Missing resource bundle in netx.jar:net/sourceforge/jnlp/resource/Messages.properties");
-        }
-    }
-
-    /**
-     * Load the window icon.
-     */
-    private static void loadWindowIcon() {
-        if (windowIcon != null)
-            return;
-
-        try {
-            windowIcon = new javax.swing.ImageIcon((new sun.misc.Launcher())
-                        .getClassLoader().getResource("net/sourceforge/jnlp/resources/netx-icon.png")).getImage();
-        }
-        catch (Exception ex) {
-            if (JNLPRuntime.isDebug())
-                ex.printStackTrace();
-        }
-    }
-
-
-    public static void setInitialArgments(List<String> args) {
-        checkInitialized();
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null)
-            securityManager.checkPermission(new AllPermission());
-        initialArguments = args;
-    }
-
-    public static List<String> getInitialArguments() {
-        return initialArguments;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,540 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.runtime;
-
-import java.awt.Frame;
-import java.awt.Window;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.lang.ref.WeakReference;
-import java.net.SocketPermission;
-import java.security.AllPermission;
-import java.security.AccessControlException;
-import java.security.AccessController;
-import java.security.Permission;
-import java.security.PrivilegedAction;
-import java.security.SecurityPermission;
-import java.util.PropertyPermission;
-
-import javax.swing.JWindow;
-
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.security.SecurityWarningDialog;
-import net.sourceforge.jnlp.services.ServiceUtil;
-import net.sourceforge.jnlp.util.WeakList;
-import sun.security.util.SecurityConstants;
-
-/**
- * Security manager for JNLP environment.  This security manager
- * cannot be replaced as it always denies attempts to replace the
- * security manager or policy.<p>
- *
- * The JNLP security manager tracks windows created by an
- * application, allowing those windows to be disposed when the
- * application exits but the JVM does not.  If security is not
- * enabled then the first application to call System.exit will
- * halt the JVM.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.17 $
- */
-class JNLPSecurityManager extends SecurityManager {
-
-    // todo: some apps like JDiskReport can close the VM even when
-    // an exit class is set - fix!
-
-    // todo: create an event dispatch thread for each application,
-    // so that the context classloader doesn't have to be switched
-    // to the foreground application (the currently the approach
-    // since some apps need their classloader as event dispatch
-    // thread's context classloader).
-
-    // todo: use a custom Permission object to identify the current
-    // application in an AccessControlContext by setting a side
-    // effect in its implies method.  Use a custom
-    // AllPermissions-like permission to do this for apps granted
-    // all permissions (but investigate whether this will nuke
-    // the all-permission optimizations in the JRE).
-
-    // todo: does not exit app if close button pressed on JFrame
-    // with CLOSE_ON_EXIT (or whatever) set; if doesn't exit, use an
-    // WindowListener to catch WindowClosing event, then if exit is
-    // called immediately afterwards from AWT thread.
-
-    // todo: deny all permissions to applications that should have
-    // already been 'shut down' by closing their resources and
-    // interrupt the threads if operating in a shared-VM (exit class
-    // set).  Deny will probably will slow checks down a lot though.
-
-    // todo: weak remember last getProperty application and
-    // re-install properties if another application calls, or find
-    // another way for different apps to have different properties
-    // in java.lang.Sytem with the same names.
-
-    private static String R(String key) { return JNLPRuntime.getMessage(key); }
-
-    /** only class that can exit the JVM, if set */
-    private Object exitClass = null;
-
-    /** this exception prevents exiting the JVM */
-    private SecurityException closeAppEx = // making here prevents huge stack traces
-        new SecurityException(JNLPRuntime.getMessage("RShutdown"));
-
-    /** weak list of windows created */
-    private WeakList weakWindows = new WeakList();
-
-    /** weak list of applications corresponding to window list */
-    private WeakList weakApplications = new WeakList();
-
-    /** weak reference to most app who's windows was most recently activated */
-    private WeakReference activeApplication = null;
-
-    /** listener installs the app's classloader on the event dispatch thread */
-    private ContextUpdater contextListener = new ContextUpdater();
-
-    /** Sets whether or not exit is allowed (in the context of the plugin, this is always false) */
-    private boolean exitAllowed = true;
-
-    private class ContextUpdater extends WindowAdapter implements PrivilegedAction {
-        private ApplicationInstance app = null;
-
-        public void windowActivated(WindowEvent e) {
-            app = getApplication(e.getWindow());
-            AccessController.doPrivileged(this);
-            app = null;
-        }
-
-        public Object run() {
-            if (app != null) {
-                Thread.currentThread().setContextClassLoader(app.getClassLoader());
-                activeApplication = new WeakReference(app);
-            }
-            else
-                Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
-
-            return null;
-        }
-
-        public void windowDeactivated(WindowEvent e) {
-            activeApplication = null;
-        }
-
-        public void windowClosing(WindowEvent e) {
-                System.err.println("Disposing window");
-                e.getWindow().dispose();
-        }
-    };
-
-
-    /**
-     * Creates a JNLP SecurityManager.
-     */
-    JNLPSecurityManager() {
-        // this has the side-effect of creating the Swing shared Frame
-        // owner.  Since no application is running at this time, it is
-        // not added to any window list when checkTopLevelWindow is
-        // called for it (and not disposed).
-
-        if (!JNLPRuntime.isHeadless())
-            new JWindow().getOwner();
-    }
-
-    /**
-     * Returns whether the exit class is present on the stack, or
-     * true if no exit class is set.
-     */
-    public boolean isExitClass() {
-        return isExitClass(getClassContext());
-    }
-
-    /**
-     * Returns whether the exit class is present on the stack, or
-     * true if no exit class is set.
-     */
-    private boolean isExitClass(Class stack[]) {
-        if (exitClass == null)
-            return true;
-
-        for (int i=0; i < stack.length; i++)
-            if (stack[i] == exitClass)
-                return true;
-
-        return false;
-    }
-
-    /**
-     * Set the exit class, which is the only class that can exit the
-     * JVM; if not set then any class can exit the JVM.
-     *
-     * @param exitClass the exit class
-     * @throws IllegalStateException if the exit class is already set
-     */
-    public void setExitClass(Class exitClass) throws IllegalStateException {
-        if (this.exitClass != null)
-            throw new IllegalStateException(R("RExitTaken"));
-
-        this.exitClass = exitClass;
-    }
-
-    /**
-     * Return the current Application, or null if none can be
-     * determined.
-     */
-    protected ApplicationInstance getApplication() {
-        return getApplication(getClassContext(), 0);
-    }
-
-    /**
-     * Return the application the opened the specified window (only
-     * call from event dispatch thread).
-     */
-    protected ApplicationInstance getApplication(Window window) {
-        for (int i = weakWindows.size(); i-->0;) {
-            Window w = (Window) weakWindows.get(i);
-            if (w == null) {
-                weakWindows.remove(i);
-                weakApplications.remove(i);
-            }
-
-            if (w == window)
-                return (ApplicationInstance) weakApplications.get(i);
-        }
-
-        return null;
-    }
-
-    /**
-     * Return the current Application, or null.
-     */
-    protected ApplicationInstance getApplication(Class stack[], int maxDepth) {
-        if (maxDepth <= 0)
-                maxDepth = stack.length;
-
-        // this needs to be tightened up
-        for (int i=0; i < stack.length && i < maxDepth; i++) {
-                if (stack[i].getClassLoader() instanceof JNLPClassLoader) {
-                        JNLPClassLoader loader = (JNLPClassLoader) stack[i].getClassLoader();
-
-                        if (loader != null && loader.getApplication() != null) {
-                                return loader.getApplication();
-                        }
-                }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the application's thread group if the application can
-     * be determined; otherwise returns super.getThreadGroup()
-     */
-    public ThreadGroup getThreadGroup() {
-        ApplicationInstance app = getApplication();
-        if (app == null)
-            return super.getThreadGroup();
-
-        return app.getThreadGroup();
-    }
-
-    /**
-     * Throws a SecurityException if the permission is denied,
-     * otherwise return normally.  This method always denies
-     * permission to change the security manager or policy.
-     */
-    public void checkPermission(Permission perm) {
-        String name = perm.getName();
-
-        // Enable this manually -- it'll produce too much output for -verbose
-        // otherwise.
-        //      if (true)
-        //        System.out.println("Checking permission: " + perm.toString());
-
-        if (!JNLPRuntime.isWebstartApplication() &&
-              ("setPolicy".equals(name) || "setSecurityManager".equals(name)))
-            throw new SecurityException(R("RCantReplaceSM"));
-
-        try {
-            // deny all permissions to stopped applications
-                // The call to getApplication() below might not work if an
-                // application hasn't been fully initialized yet.
-//            if (JNLPRuntime.isDebug()) {
-//                if (!"getClassLoader".equals(name)) {
-//                    ApplicationInstance app = getApplication();
-//                    if (app != null && !app.isRunning())
-//                        throw new SecurityException(R("RDenyStopped"));
-//                }
-//            }
-
-                        try {
-                                super.checkPermission(perm);
-                        } catch (SecurityException se) {
-
-                                //This section is a special case for dealing with SocketPermissions.
-                                if (JNLPRuntime.isDebug())
-                                        System.err.println("Requesting permission: " + perm.toString());
-
-                                //Change this SocketPermission's action to connect and accept
-                                //(and resolve). This is to avoid asking for connect permission
-                                //on every address resolve.
-                                Permission tmpPerm = null;
-                                if (perm instanceof SocketPermission) {
-                                        tmpPerm = new SocketPermission(perm.getName(),
-                                                        SecurityConstants.SOCKET_CONNECT_ACCEPT_ACTION);
-
-                                        // before proceeding, check if we are trying to connect to same origin
-                                        ApplicationInstance app = getApplication();
-                                        JNLPFile file = app.getJNLPFile();
-
-                                        String srcHost =  file.getSourceLocation().getAuthority();
-                                        String destHost = name;
-
-                                        // host = abc.xyz.com or abc.xyz.com:<port>
-                                        if (destHost.indexOf(':') >= 0)
-                                                destHost = destHost.substring(0, destHost.indexOf(':'));
-
-                                        // host = abc.xyz.com
-                                        String[] hostComponents = destHost.split("\\.");
-
-                                        int length = hostComponents.length;
-                                        if (length >= 2) {
-
-                                                // address is in xxx.xxx.xxx format
-                                                destHost = hostComponents[length -2] + "." + hostComponents[length -1];
-
-                                                // host = xyz.com i.e. origin
-                                                boolean isDestHostName = false;
-
-                                                // make sure that it is not an ip address
-                                                try {
-                                                        Integer.parseInt(hostComponents[length -1]);
-                                                } catch (NumberFormatException e) {
-                                                        isDestHostName = true;
-                                                }
-
-                                                if (isDestHostName) {
-                                                        // okay, destination is hostname. Now figure out if it is a subset of origin
-                                                        if (srcHost.endsWith(destHost)) {
-                                                                addPermission(tmpPerm);
-                                                                return;
-                                                        }
-                                                }
-                                        }
-
-                                } else if (perm instanceof SecurityPermission) {
-
-                                    // JCE's initialization requires putProviderProperty permission
-                                    if (perm.equals(new SecurityPermission("putProviderProperty.SunJCE"))) {
-                                        if (inTrustedCallChain("com.sun.crypto.provider.SunJCE", "run")) {
-                                            return;
-                                        }
-                                    }
-
-                                } else if (perm instanceof RuntimePermission) {
-
-                                    // KeyGenerator's init method requires internal spec access
-                                    if (perm.equals(new SecurityPermission("accessClassInPackage.sun.security.internal.spec"))) {
-                                        if (inTrustedCallChain("javax.crypto.KeyGenerator", "init")) {
-                                            return;
-                                        }
-                                    }
-
-                                } else {
-                                    tmpPerm = perm;
-                                }
-
-                                if (tmpPerm != null) {
-                                    //askPermission will only prompt the user on SocketPermission
-                                    //meaning we're denying all other SecurityExceptions that may arise.
-                                    if (askPermission(tmpPerm)) {
-                                        addPermission(tmpPerm);
-                                        //return quietly.
-                                    } else {
-                                        throw se;
-                                    }
-                                }
-                        }
-        }
-        catch (SecurityException ex) {
-            if (JNLPRuntime.isDebug()) {
-                System.out.println("Denying permission: "+perm);
-            }
-            throw ex;
-        }
-    }
-
-    /**
-     * Returns weather the given class and method are in the current stack,
-     * and whether or not everything upto then is trusted
-     *
-     * @param className The name of the class to look for in the stack
-     * @param methodName The name of the method for the given class to look for in the stack
-     * @return Weather or not class::method() are in the chain, and everything upto there is trusted
-     */
-    private boolean inTrustedCallChain(String className, String methodName) {
-
-        StackTraceElement[] stack =  Thread.currentThread().getStackTrace();
-
-        for (int i=0; i < stack.length; i++) {
-
-            // Everything up to the desired class/method must be trusted
-            if (!stack[i].getClass().getProtectionDomain().implies(new AllPermission())) {
-                return false;
-            }
-
-            if (stack[i].getClassName().equals(className) &&
-                stack[i].getMethodName().equals(methodName)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Asks the user whether or not to grant permission.
-     * @param perm the permission to be granted
-     * @return true if the permission was granted, false otherwise.
-     */
-    private boolean askPermission(Permission perm)      {
-
-        ApplicationInstance app = getApplication();
-        if (app != null && !app.isSigned()) {
-                if (perm instanceof SocketPermission
-                                && ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.NETWORK, perm.getName())) {
-                        return true;
-                }
-        }
-
-        return false;
-    }
-
-    /**
-     * Adds a permission to the JNLPClassLoader.
-     * @param perm the permission to add to the JNLPClassLoader
-     */
-    private void addPermission(Permission perm) {
-        if (JNLPRuntime.getApplication().getClassLoader() instanceof JNLPClassLoader) {
-
-                JNLPClassLoader cl = (JNLPClassLoader) JNLPRuntime.getApplication().getClassLoader();
-                cl.addPermission(perm);
-                if (JNLPRuntime.isDebug()) {
-                        if (cl.getPermissions(null).implies(perm))
-                                System.err.println("Added permission: " + perm.toString());
-                        else
-                                System.err.println("Unable to add permission: " + perm.toString());
-                }
-        } else {
-                if (JNLPRuntime.isDebug())
-                        System.err.println("Unable to add permission: " + perm + ", classloader not JNLP.");
-        }
-    }
-
-    /**
-     * Checks whether the window can be displayed without an applet
-     * warning banner, and adds the window to the list of windows to
-     * be disposed when the calling application exits.
-     */
-    public boolean checkTopLevelWindow(Object window) {
-        ApplicationInstance app = getApplication();
-
-        // remember window -> application mapping for focus, close on exit
-        if (app != null && window instanceof Window) {
-            Window w = (Window) window;
-
-            if (JNLPRuntime.isDebug())
-                System.err.println("SM: app: "+app.getTitle()+" is adding a window: "+window);
-
-            weakWindows.add(window); // for mapping window -> app
-            weakApplications.add(app);
-
-            w.addWindowListener(contextListener); // for dynamic context classloader
-
-            app.addWindow(w);
-        }
-
-        // change coffee cup to netx for default icon
-        if (window instanceof Window)
-            for (Window w = (Window)window; w != null; w = w.getOwner())
-                if (window instanceof Frame)
-                    ((Frame)window).setIconImage(JNLPRuntime.getWindowIcon());
-
-        // todo: set awt.appletWarning to custom message
-        // todo: logo on with glass pane on JFrame/JWindow?
-
-        return super.checkTopLevelWindow(window);
-    }
-
-    /**
-     * Checks whether the caller can exit the system.  This method
-     * identifies whether the caller is a real call to Runtime.exec
-     * and has special behavior when returning from this method
-     * would exit the JVM and an exit class is set: if the caller is
-     * not the exit class then the calling application will be
-     * stopped and its resources destroyed (when possible), and an
-     * exception will be thrown to prevent the JVM from shutting
-     * down.<p>
-     *
-     * Calls not from Runtime.exit or with no exit class set will
-     * behave normally, and the exit class can always exit the JVM.
-     */
-    public void checkExit(int status) {
-
-        // applets are not allowed to exit, but the plugin main class (primordial loader) is
-        Class stack[] = getClassContext();
-        if (!exitAllowed) {
-                for (int i=0; i < stack.length; i++)
-                        if (stack[i].getClassLoader() != null)
-                                throw new AccessControlException("Applets may not call System.exit()");
-        }
-
-        super.checkExit(status);
-
-        boolean realCall = (stack[1] == Runtime.class);
-
-        if (isExitClass(stack)) // either exitClass called or no exitClass set
-            return; // to Runtime.exit or fake call to see if app has permission
-
-        // not called from Runtime.exit()
-        if (!realCall) {
-            // apps that can't exit should think they can exit normally
-            super.checkExit(status);
-            return;
-        }
-
-        // but when they really call, stop only the app instead of the JVM
-        ApplicationInstance app = getApplication(stack, 0);
-        if (app == null) {
-            // should check caller to make sure it is JFrame.close or
-            // other known System.exit call
-            if (activeApplication != null)
-                app = (ApplicationInstance) activeApplication.get();
-
-            if (app == null)
-                throw new SecurityException(R("RExitNoApp"));
-        }
-
-        app.destroy();
-
-        throw closeAppEx;
-    }
-
-    protected void disableExit() {
-        exitAllowed = false;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/runtime/package.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-This package contains the classes that manage the secure runtime
-environment for JNLP apps.
-
-<h2>Package Specification</h2>
-
-<ul>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/download-spec.html">JNLP specification</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-<li><a target="_top" href="http://jnlp.sourceforge.net/netx/">Netx JNLP Client</a>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/">Java Web Start JNLP Client</a>
-</ul>
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
-</html>
-
-
--- a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/* AccessWarningPane.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.BorderFactory;
-import javax.swing.BoxLayout;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-
-import net.sourceforge.jnlp.JNLPFile;
-
-/**
- * Provides a panel to show inside a SecurityWarningDialog. These dialogs are
- * used to warn the user when either signed code (with or without signing
- * issues) is going to be run, or when service permission (file, clipboard,
- * printer, etc) is needed with unsigned code.
- *
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- */
-public class AccessWarningPane extends SecurityDialogPanel {
-
-        JCheckBox alwaysAllow;
-        Object[] extras;
-
-        public AccessWarningPane(SecurityWarningDialog x, CertVerifier certVerifier) {
-                super(x, certVerifier);
-                addComponents();
-        }
-
-        public AccessWarningPane(SecurityWarningDialog x, Object[] extras, CertVerifier certVerifier) {
-                super(x, certVerifier);
-                this.extras = extras;
-                addComponents();
-        }
-
-        /**
-         * Creates the actual GUI components, and adds it to this panel
-         */
-        private void addComponents() {
-                SecurityWarningDialog.AccessType type = parent.getAccessType();
-                JNLPFile file = parent.getFile();
-
-                String name = "";
-                String publisher = "";
-                String from = "";
-
-                //We don't worry about exceptions when trying to fill in
-                //these strings -- we just want to fill in as many as possible.
-                try {
-                        name = file.getInformation().getTitle() != null ? file.getInformation().getTitle() : "<no associated certificate>";
-                } catch (Exception e) {
-                }
-
-                try {
-                        publisher = file.getInformation().getVendor() != null ? file.getInformation().getVendor() : "<no associated certificate>";
-                } catch (Exception e) {
-                }
-
-                try {
-                        from = !file.getInformation().getHomepage().toString().equals("") ? file.getInformation().getHomepage().toString() : file.getSourceLocation().getAuthority();
-                } catch (Exception e) {
-                        from = file.getSourceLocation().getAuthority();
-                }
-
-                //Top label
-                String topLabelText = "";
-                switch (type) {
-                        case READ_FILE:
-                                topLabelText = R("SFileReadAccess");
-                                break;
-                        case WRITE_FILE:
-                                topLabelText = R("SFileWriteAccess");
-                                break;
-                        case CREATE_DESTKOP_SHORTCUT:
-                            topLabelText = R("SDesktopShortcut");
-                            break;
-                        case CLIPBOARD_READ:
-                                topLabelText = R("SClipboardReadAccess");
-                                break;
-                        case CLIPBOARD_WRITE:
-                                topLabelText = R("SClipboardWriteAccess");
-                                break;
-                        case PRINTER:
-                                topLabelText = R("SPrinterAccess");
-                                break;
-                        case NETWORK:
-                                if (extras != null && extras.length >= 0)
-                                        topLabelText = R("SNetworkAccess", extras[0]);
-                                else
-                                        topLabelText = R("SNetworkAccess", "(address here)");
-                }
-
-                ImageIcon icon = new ImageIcon((new sun.misc.Launcher()).getClassLoader().getResource("net/sourceforge/jnlp/resources/warning.png"));
-                JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.LEFT);
-                topLabel.setFont(new Font(topLabel.getFont().toString(),
-                        Font.BOLD, 12));
-                JPanel topPanel = new JPanel(new BorderLayout());
-                topPanel.setBackground(Color.WHITE);
-                topPanel.add(topLabel, BorderLayout.CENTER);
-                topPanel.setPreferredSize(new Dimension(400,60));
-                topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                //application info
-                JLabel nameLabel = new JLabel("Name:   " + name);
-                nameLabel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-                JLabel publisherLabel = new JLabel("Publisher: " + publisher);
-                publisherLabel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-                JLabel fromLabel = new JLabel("From:   " + from);
-                fromLabel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-
-                alwaysAllow = new JCheckBox("Always allow this action");
-                alwaysAllow.setEnabled(false);
-
-                JPanel infoPanel = new JPanel(new GridLayout(4,1));
-                infoPanel.add(nameLabel);
-                infoPanel.add(publisherLabel);
-                infoPanel.add(fromLabel);
-                infoPanel.add(alwaysAllow);
-                infoPanel.setBorder(BorderFactory.createEmptyBorder(25,25,25,25));
-
-                //run and cancel buttons
-                JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
-
-                JButton run = new JButton("Allow");
-                JButton cancel = new JButton("Cancel");
-                run.addActionListener(createSetValueListener(parent,0));
-                run.addActionListener(new CheckBoxListener());
-                cancel.addActionListener(createSetValueListener(parent, 1));
-                initialFocusComponent = cancel;
-                buttonPanel.add(run);
-                buttonPanel.add(cancel);
-                buttonPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                //all of the above
-                setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-                add(topPanel);
-                add(infoPanel);
-                add(buttonPanel);
-
-        }
-
-
-        private class CheckBoxListener implements ActionListener {
-                public void actionPerformed(ActionEvent e) {
-                        if (alwaysAllow != null && alwaysAllow.isSelected()) {
-                                // TODO: somehow tell the ApplicationInstance
-                                // to stop asking for permission
-                        }
-                }
-        }
-
-}
--- a/netx/net/sourceforge/jnlp/security/AppletWarningPane.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/* AppletWarningPane.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-
-import javax.swing.BorderFactory;
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-
-public class AppletWarningPane extends SecurityDialogPanel {
-
-        public AppletWarningPane(SecurityWarningDialog x, CertVerifier certVerifier) {
-                super(x, certVerifier);
-                addComponents();
-        }
-
-        protected void addComponents() {
-
-                //Top label
-                String topLabelText = "While support for verifying signed code" +
-                                " has not been implemented yet, some applets will not run " +
-                                "properly under the default restricted security level.";
-                String bottomLabelText = "Do you want to run this applet under the " +
-                                "restricted security level? (clicking No will run this applet " +
-                                "without any security checking, and should only be done if you " +
-                                "trust the applet!)";
-
-                JLabel topLabel = new JLabel(htmlWrap(topLabelText));
-                topLabel.setFont(new Font(topLabel.getFont().toString(),
-                        Font.BOLD, 12));
-                JPanel topPanel = new JPanel(new BorderLayout());
-                topPanel.setBackground(Color.WHITE);
-                topPanel.add(topLabel, BorderLayout.CENTER);
-                topPanel.setPreferredSize(new Dimension(400,80));
-                topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                JLabel bottomLabel = new JLabel(htmlWrap(bottomLabelText));
-                JPanel infoPanel = new JPanel(new BorderLayout());
-                infoPanel.add(bottomLabel, BorderLayout.CENTER);
-                infoPanel.setPreferredSize(new Dimension(400,80));
-                infoPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                //run and cancel buttons
-                JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
-
-                JButton yes = new JButton("Yes");
-                JButton no = new JButton("No");
-                JButton cancel = new JButton("Cancel");
-                int buttonWidth = cancel.getMinimumSize().width;
-                int buttonHeight = cancel.getMinimumSize().height;
-                Dimension d = new Dimension(buttonWidth, buttonHeight);
-                yes.setPreferredSize(d);
-                no.setPreferredSize(d);
-                cancel.setPreferredSize(d);
-                yes.addActionListener(createSetValueListener(parent, 0));
-                no.addActionListener(createSetValueListener(parent, 1));
-                cancel.addActionListener(createSetValueListener(parent, 2));
-                initialFocusComponent = cancel;
-                buttonPanel.add(yes);
-                buttonPanel.add(no);
-                buttonPanel.add(cancel);
-                buttonPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                //all of the above
-                setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-                add(topPanel);
-                add(infoPanel);
-                add(buttonPanel);
-
-        }
-
-}
--- a/netx/net/sourceforge/jnlp/security/CertVerifier.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/* CertVerifier.java
-   Copyright (C) 2009 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.security.cert.CertPath;
-import java.security.cert.Certificate;
-import java.util.ArrayList;
-
-/**
- * An interface that provides various details about a certificate
- */
-
-public interface CertVerifier {
-
-    /**
-     * Return if the publisher is already trusted
-     */
-    public boolean getAlreadyTrustPublisher();
-
-    /**
-     * Return if the root is in CA certs
-     */
-    public boolean getRootInCacerts();
-
-    /**
-     * Return if there are signing issues with the certificate(s) being veried
-     */
-    public boolean hasSigningIssues();
-
-    /**
-     * Return if there are no signing issues with this cert (!hasSigningIssues())
-     */
-    public boolean noSigningIssues();
-
-    /**
-     * Get the details regarding issue(s) with this certificate
-     */
-    public ArrayList<String> getDetails();
-
-    /**
-     * Return a valid certificate path to this certificate(s) being verified
-     * @return The CertPath
-     */
-    public ArrayList<CertPath> getCerts();
-
-    /**
-     * Returns the application's publisher's certificate.
-     */
-    public abstract Certificate getPublisher();
-
-    /**
-     * Returns the application's root's certificate. This
-     * may return the same certificate as getPublisher() in
-     * the event that the application is self signed.
-     */
-    public abstract Certificate getRoot();
-}
--- a/netx/net/sourceforge/jnlp/security/CertWarningPane.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,254 +0,0 @@
-/* CertWarningPane.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-
-import javax.swing.BorderFactory;
-import javax.swing.BoxLayout;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.PluginBridge;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.tools.KeyTool;
-
-/**
- * Provides the panel for using inside a SecurityWarningDialog. These dialogs are
- * used to warn the user when either signed code (with or without signing
- * issues) is going to be run, or when service permission (file, clipboard,
- * printer, etc) is needed with unsigned code.
- *
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- */
-public class CertWarningPane extends SecurityDialogPanel {
-
-        JCheckBox alwaysTrust;
-        CertVerifier certVerifier;
-
-        public CertWarningPane(SecurityWarningDialog x, CertVerifier certVerifier) {
-                super(x, certVerifier);
-                this.certVerifier = certVerifier;
-                addComponents();
-        }
-
-        /**
-         * Creates the actual GUI components, and adds it to this panel
-         */
-        private void addComponents() {
-                SecurityWarningDialog.AccessType type = parent.getAccessType();
-                JNLPFile file = parent.getFile();
-                Certificate c = parent.getJarSigner().getPublisher();
-
-                String name = "";
-                String publisher = "";
-                String from = "";
-
-                //We don't worry about exceptions when trying to fill in
-                //these strings -- we just want to fill in as many as possible.
-                try {
-                        if ((certVerifier instanceof HttpsCertVerifier) &&
-                             (c instanceof X509Certificate))
-                           name = SecurityUtil.getCN(((X509Certificate)c)
-                                        .getSubjectX500Principal().getName());
-                        else if (file instanceof PluginBridge)
-                                name = file.getTitle();
-                        else
-                                name = file.getInformation().getTitle();
-                } catch (Exception e) {
-                }
-
-                try {
-                        if (c instanceof X509Certificate) {
-                                publisher = SecurityUtil.getCN(((X509Certificate)c)
-                                        .getSubjectX500Principal().getName());
-                        }
-                } catch (Exception e) {
-                }
-
-                try {
-                        if (file instanceof PluginBridge)
-                                from = file.getCodeBase().getHost();
-                        else
-                                from = file.getInformation().getHomepage().toString();
-                } catch (Exception e) {
-                }
-
-                //Top label
-                String topLabelText = "";
-                String propertyName = "";
-                if (certVerifier instanceof HttpsCertVerifier)
-                {
-                  topLabelText = "The website's certificate cannot be verified. " +
-                                 "Do you want to continue?";
-                  propertyName = "OptionPane.warningIcon";
-                }
-                else
-                  switch (type) {
-                  case VERIFIED:
-                        topLabelText = R("SSigVerified");
-                        propertyName = "OptionPane.informationIcon";
-                        break;
-                  case UNVERIFIED:
-                        topLabelText = R("SSigUnverified");
-                        propertyName = "OptionPane.warningIcon";
-                        break;
-                  case SIGNING_ERROR:
-                        topLabelText = R("SSignatureError");
-                        propertyName = "OptionPane.warningIcon";
-                        break;
-                  }
-                ImageIcon icon = new ImageIcon((new sun.misc.Launcher())
-                                .getClassLoader().getResource("net/sourceforge/jnlp/resources/warning.png"));
-                JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.LEFT);
-                topLabel.setFont(new Font(topLabel.getFont().toString(),
-                                Font.BOLD, 12));
-                JPanel topPanel = new JPanel(new BorderLayout());
-                topPanel.setBackground(Color.WHITE);
-                topPanel.add(topLabel, BorderLayout.CENTER);
-                topPanel.setPreferredSize(new Dimension(400,60));
-                topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                //application info
-                JLabel nameLabel = new JLabel("Name:   " + name);
-                nameLabel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-                JLabel publisherLabel = new JLabel("Publisher: " + publisher);
-                publisherLabel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-                JLabel fromLabel = new JLabel("From:   " + from);
-                fromLabel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-
-                alwaysTrust = new JCheckBox(
-                "Always trust content from this publisher");
-                alwaysTrust.setEnabled(true);
-
-                JPanel infoPanel = new JPanel(new GridLayout(4,1));
-                infoPanel.add(nameLabel);
-                infoPanel.add(publisherLabel);
-
-                if (!(certVerifier instanceof HttpsCertVerifier))
-                  infoPanel.add(fromLabel);
-
-                infoPanel.add(alwaysTrust);
-                infoPanel.setBorder(BorderFactory.createEmptyBorder(25,25,25,25));
-
-                //run and cancel buttons
-                JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
-                JButton run = new JButton("Run");
-                JButton cancel = new JButton("Cancel");
-                int buttonWidth = Math.max(run.getMinimumSize().width,
-                        cancel.getMinimumSize().width);
-                int buttonHeight = run.getMinimumSize().height;
-                Dimension d = new Dimension(buttonWidth, buttonHeight);
-                run.setPreferredSize(d);
-                cancel.setPreferredSize(d);
-                run.addActionListener(createSetValueListener(parent, 0));
-                run.addActionListener(new CheckBoxListener());
-                cancel.addActionListener(createSetValueListener(parent, 1));
-                initialFocusComponent = cancel;
-                buttonPanel.add(run);
-                buttonPanel.add(cancel);
-                buttonPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                //all of the above
-                setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-                add(topPanel);
-                add(infoPanel);
-                add(buttonPanel);
-
-                JLabel bottomLabel;
-                JButton moreInfo = new JButton("More information...");
-                moreInfo.addActionListener(new MoreInfoButtonListener());
-
-                if (parent.getJarSigner().getRootInCacerts())
-                        bottomLabel = new JLabel(htmlWrap(R("STrustedSource")));
-                else
-                        bottomLabel = new JLabel(htmlWrap(R("SUntrustedSource")));
-
-                JPanel bottomPanel = new JPanel();
-                bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.X_AXIS));
-                bottomPanel.add(bottomLabel);
-                bottomPanel.add(moreInfo);
-                bottomPanel.setPreferredSize(new Dimension(500,100));
-                bottomPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-                add(bottomPanel);
-
-        }
-
-        private class MoreInfoButtonListener implements ActionListener {
-                public void actionPerformed(ActionEvent e) {
-                        SecurityWarningDialog.showMoreInfoDialog(parent.getJarSigner(),
-                                parent);
-                }
-        }
-
-        /**
-         * Updates the user's KeyStore of trusted Certificates.
-         */
-        private class CheckBoxListener implements ActionListener {
-                public void actionPerformed(ActionEvent e) {
-                        if (alwaysTrust != null && alwaysTrust.isSelected()) {
-                                try {
-                                        KeyTool kt = new KeyTool();
-                                        Certificate c = parent.getJarSigner().getPublisher();
-                                        kt.importCert(c);
-                                        if (JNLPRuntime.isDebug()) {
-                                            System.out.println("certificate is now permanently trusted");
-                                        }
-                                } catch (Exception ex) {
-                                        //TODO: Let NetX show a dialog here notifying user
-                                        //about being unable to add cert to keystore
-                                }
-                        }
-                }
-        }
-
-}
--- a/netx/net/sourceforge/jnlp/security/CertsInfoPane.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,341 +0,0 @@
-/* CertsInfoPane.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.security.cert.CertPath;
-import java.security.cert.X509Certificate;
-import java.security.MessageDigest;
-import java.math.BigInteger;
-import javax.security.auth.x500.X500Principal;
-import sun.security.x509.*;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.table.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.datatransfer.Clipboard;
-import java.awt.datatransfer.StringSelection;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeSelectionModel;
-
-import net.sourceforge.jnlp.tools.*;
-
-/**
- * Provides the panel for the Certificate Info dialog. This dialog displays data from
- * X509Certificate(s) used in jar signing.
- *
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- */
-public class CertsInfoPane extends SecurityDialogPanel {
-
-        private ArrayList<CertPath> certs;
-    private JList list;
-        protected JTree tree;
-    private JTable table;
-    private JTextArea output;
-    private ListSelectionModel listSelectionModel;
-    private ListSelectionModel tableSelectionModel;
-    protected String[] certNames;
-    private String[] columnNames = { "Field", "Value" };
-        protected ArrayList<String[][]> certsData;
-
-        public CertsInfoPane(SecurityWarningDialog x, CertVerifier certVerifier) {
-                super(x, certVerifier);
-                addComponents();
-        }
-
-        /**
-         * Builds the JTree out of CertPaths.
-         */
-        void buildTree() {
-                certs = parent.getJarSigner().getCerts();
-                //for now, we're only going to display the first signer, even though
-                //jars can be signed by multiple people.
-                CertPath firstPath = certs.get(0);
-                X509Certificate firstCert =
-                        ((X509Certificate)firstPath.getCertificates().get(0));
-                String subjectString =
-                        SecurityUtil.getCN(firstCert.getSubjectX500Principal().getName());
-                String issuerString =
-                        SecurityUtil.getCN(firstCert.getIssuerX500Principal().getName());
-
-                DefaultMutableTreeNode top =
-                        new DefaultMutableTreeNode(subjectString
-                                + " (" + issuerString + ")");
-
-                //not self signed
-                if (!firstCert.getSubjectDN().equals(firstCert.getIssuerDN())
-                        && (firstPath.getCertificates().size() > 1)) {
-                        X509Certificate secondCert =
-                                ((X509Certificate)firstPath.getCertificates().get(1));
-                        subjectString =
-                                SecurityUtil.getCN(secondCert.getSubjectX500Principal().getName());
-                        issuerString =
-                                SecurityUtil.getCN(secondCert.getIssuerX500Principal().getName());
-                        top.add(new DefaultMutableTreeNode(subjectString
-                                + " (" + issuerString + ")"));
-                }
-
-                tree = new JTree(top);
-                tree.getSelectionModel().setSelectionMode
-                                (TreeSelectionModel.SINGLE_TREE_SELECTION);
-                tree.addTreeSelectionListener(new TreeSelectionHandler());
-        }
-
-        /**
-         * Fills in certsNames, certsData with data from the certificates.
-         */
-        protected void populateTable() {
-                certNames = new String[certs.get(0).getCertificates().size()];
-                certsData = new ArrayList<String[][]>();
-
-        for (int i = 0; i < certs.get(0).getCertificates().size(); i++) {
-
-            X509Certificate c = (X509Certificate) certs.get(0).getCertificates().get(i);
-            certsData.add(parseCert(c));
-            certNames[i] = SecurityUtil.getCN(c.getSubjectX500Principal().getName())
-                                + " (" + SecurityUtil.getCN(c.getIssuerX500Principal().getName()) + ")";
-        }
-        }
-
-        protected String[][] parseCert(X509Certificate c) {
-
-        String version = ""+c.getVersion();
-        String serialNumber = c.getSerialNumber().toString();
-        String signatureAlg = c.getSigAlgName();
-        String issuer = c.getIssuerX500Principal().toString();
-        String validity = new CertificateValidity(c.getNotBefore(),
-                            c.getNotAfter()).toString();
-        String subject = c.getSubjectX500Principal().toString();
-
-        //convert our signature into a nice human-readable form.
-        HexDumpEncoder encoder = new HexDumpEncoder();
-        String signature = encoder.encodeBuffer(c.getSignature());
-
-                String md5Hash = "";
-                String sha1Hash = "";
-                try {
-                        MessageDigest digest = MessageDigest.getInstance("MD5");
-                        digest.update(c.getEncoded());
-                        md5Hash = makeFingerprint(digest.digest());
-
-                        digest = MessageDigest.getInstance("SHA-1");
-                        digest.update(c.getEncoded());
-                        sha1Hash = makeFingerprint(digest.digest());
-                } catch (Exception e) {
-                        //fail quietly
-                }
-
-        String[][] cert = { {"Version", version},
-                            {"Serial", serialNumber},
-                            {"Signature Algorithm", signatureAlg},
-                            {"Issuer", issuer},
-                            {"Validity", validity},
-                            {"Subject", subject},
-                            {"Signature", signature},
-                                                        {"MD5 Fingerprint", md5Hash},
-                                                        {"SHA1 Fingerprint", sha1Hash}
-                                                        };
-        return cert;
-        }
-
-        /**
-         * Constructs the GUI components of this panel
-         */
-        protected void addComponents() {
-                buildTree();
-                populateTable();
-                /**
-                //List of Certs
-        list = new JList(certNames);
-                list.setSelectedIndex(0); //assuming there's at least 1 cert
-        listSelectionModel = list.getSelectionModel();
-        listSelectionModel.addListSelectionListener(new ListSelectionHandler());
-        JScrollPane listPane = new JScrollPane(list);
-                */
-                JScrollPane listPane = new JScrollPane(tree);
-
-        //Table of field-value pairs
-        DefaultTableModel tableModel = new DefaultTableModel(certsData.get(0),
-                                                            columnNames);
-        table = new JTable(tableModel);
-                table.getTableHeader().setReorderingAllowed(false);
-        tableSelectionModel = table.getSelectionModel();
-        tableSelectionModel.addListSelectionListener(new TableSelectionHandler());
-        table.setFillsViewportHeight(true);
-        JScrollPane tablePane = new JScrollPane(table);
-                tablePane.setPreferredSize(new Dimension(500,200));
-
-        //Text area to display the larger values
-        output = new JTextArea();
-        output.setEditable(false);
-        JScrollPane outputPane = new JScrollPane(output,
-            ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
-            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-                outputPane.setPreferredSize(new Dimension(500,200));
-
-                //split pane of the field-value pairs and textbox
-                JSplitPane rightSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
-                        tablePane, outputPane);
-                rightSplitPane.setDividerLocation(0.50);
-                rightSplitPane.setResizeWeight(0.50);
-
-                JSplitPane mainPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
-                        listPane, rightSplitPane);
-                mainPane.setDividerLocation(0.30);
-                mainPane.setResizeWeight(0.30);
-
-                JPanel buttonPane = new JPanel(new BorderLayout());
-                JButton close = new JButton("Close");
-                JButton copyToClipboard = new JButton("Copy to Clipboard");
-                close.addActionListener(createSetValueListener(parent, 0));
-                copyToClipboard.addActionListener(new CopyToClipboardHandler());
-                buttonPane.add(close, BorderLayout.EAST);
-                buttonPane.add(copyToClipboard, BorderLayout.WEST);
-                buttonPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-
-                add(mainPane, BorderLayout.CENTER);
-                add(buttonPane, BorderLayout.SOUTH);
-        }
-
-        /**
-         * Copies the currently selected certificate to the system Clipboard.
-         */
-        private class CopyToClipboardHandler implements ActionListener {
-                public void actionPerformed(ActionEvent e) {
-                        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
-                        int certIndex = 0;
-                        DefaultMutableTreeNode node = (DefaultMutableTreeNode)
-                tree.getLastSelectedPathComponent();
-            if (node == null) return;
-            if (node.isRoot())
-                                certIndex = 0;
-            else if (node.isLeaf())
-                                certIndex = 1;
-
-                        String[][] cert = certsData.get(certIndex);
-                        int rows = cert.length;
-                        int cols = cert[0].length;
-
-                        String certString = "";
-                        for (int i = 0; i < rows; i++) {
-                                for (int j = 0; j < cols; j++) {
-                                        certString += cert[i][j];
-                                        certString += " ";
-                                }
-                                certString += "\n";
-                        }
-
-                        clipboard.setContents(new StringSelection(certString), null);
-                }
-        }
-
-        /**
-         * Updates the JTable when the JTree selection has changed.
-         */
-        protected class TreeSelectionHandler implements TreeSelectionListener {
-                public void valueChanged(TreeSelectionEvent e) {
-                        DefaultMutableTreeNode node = (DefaultMutableTreeNode)
-                                tree.getLastSelectedPathComponent();
-
-                        if (node == null) return;
-                        if (node.isRoot()) {
-                                table.setModel(new DefaultTableModel(certsData.get(0),
-                                        columnNames));
-                        } else if (node.isLeaf()) {
-                                table.setModel(new DefaultTableModel(certsData.get(1),
-                                        columnNames));
-                        }
-                }
-        }
-
-        /**
-     * Updates the JTable when the selection on the list has changed.
-     */
-    private class ListSelectionHandler implements ListSelectionListener {
-        public void valueChanged(ListSelectionEvent e) {
-            ListSelectionModel lsm = (ListSelectionModel) e.getSource();
-
-            int minIndex = lsm.getMinSelectionIndex();
-            int maxIndex = lsm.getMaxSelectionIndex();
-
-            for (int i = minIndex; i <= maxIndex; i++) {
-                if (lsm.isSelectedIndex(i)) {
-                    table.setModel(new DefaultTableModel(certsData.get(i),
-                                                            columnNames));
-                }
-            }
-        }
-    }
-
-    /**
-     * Updates the JTextArea output when the selection on the JTable
-     * has changed.
-     */
-    private class TableSelectionHandler implements ListSelectionListener {
-        public void valueChanged(ListSelectionEvent e) {
-            ListSelectionModel lsm = (ListSelectionModel) e.getSource();
-
-            int minIndex = lsm.getMinSelectionIndex();
-            int maxIndex = lsm.getMaxSelectionIndex();
-
-            for (int i = minIndex; i <= maxIndex; i++) {
-                if (lsm.isSelectedIndex(i)) {
-                    output.setText((String) table.getValueAt(i,1));
-                }
-            }
-        }
-    }
-
-        /**
-         * Makes a human readable hash fingerprint.
-         * For example: 11:22:33:44:AA:BB:CC:DD:EE:FF.
-         */
-        private String makeFingerprint(byte[] hash) {
-                String fingerprint = "";
-                for (int i = 0; i < hash.length; i++) {
-                        if (!fingerprint.equals(""))
-                                fingerprint += ":";
-                        fingerprint += Integer.toHexString(
-                                ((hash[i] & 0xFF)|0x100)).substring(1,3);
-                }
-                return fingerprint.toUpperCase();
-        }
-}
--- a/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,238 +0,0 @@
-/* HttpsCertVerifier.java
-   Copyright (C) 2009 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.io.IOException;
-import java.security.cert.CertPath;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateExpiredException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.CertificateNotYetValidException;
-import java.security.cert.CertificateParsingException;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.tools.KeyTool;
-import sun.security.util.DerValue;
-import sun.security.util.HostnameChecker;
-import sun.security.x509.X500Name;
-
-public class HttpsCertVerifier implements CertVerifier {
-
-    private VariableX509TrustManager tm;
-    private X509Certificate[] chain;
-    private String authType;
-    private String hostName;
-    private boolean isTrusted;
-    private boolean hostMatched;
-    private ArrayList<String> details = new ArrayList<String>();
-
-    public HttpsCertVerifier(VariableX509TrustManager tm,
-                             X509Certificate[] chain, String authType,
-                             boolean isTrusted, boolean hostMatched,
-                             String hostName) {
-        this.tm = tm;
-        this.chain = chain;
-        this.authType = authType;
-        this.hostName = hostName;
-        this.isTrusted = isTrusted;
-        this.hostMatched = hostMatched;
-    }
-
-    public boolean getAlreadyTrustPublisher() {
-        return isTrusted;
-    }
-
-    public ArrayList<CertPath> getCerts() {
-
-        ArrayList<X509Certificate> list = new ArrayList<X509Certificate>();
-        for (int i=0; i < chain.length; i++)
-            list.add(chain[i]);
-
-        ArrayList<CertPath> certPaths = new ArrayList<CertPath>();
-
-        try {
-            certPaths.add(CertificateFactory.getInstance("X.509").generateCertPath(list));
-        } catch (CertificateException ce) {
-            ce.printStackTrace();
-
-            // carry on
-        }
-
-        return certPaths;
-    }
-
-    public ArrayList<String> getDetails() {
-
-        boolean hasExpiredCert=false;
-        boolean hasExpiringCert=false;
-        boolean notYetValidCert=false;
-        boolean isUntrusted=false;
-        boolean CNMisMatch = !hostMatched;
-
-        if (! getAlreadyTrustPublisher())
-              isUntrusted = true;
-
-        for (int i=0; i < chain.length; i++)
-        {
-           X509Certificate cert = chain[i];
-
-           long now = System.currentTimeMillis();
-           long SIX_MONTHS = 180*24*60*60*1000L;
-           long notAfter = cert.getNotAfter().getTime();
-           if (notAfter < now) {
-             hasExpiredCert = true;
-           } else if (notAfter < now + SIX_MONTHS) {
-             hasExpiringCert = true;
-           }
-
-           try {
-             cert.checkValidity();
-           } catch (CertificateNotYetValidException cnyve) {
-             notYetValidCert = true;
-           } catch (CertificateExpiredException cee) {
-             hasExpiredCert = true;
-           }
-        }
-
-        String altNames = getNamesForCert(chain[0]);
-
-        if (isUntrusted || hasExpiredCert || hasExpiringCert || notYetValidCert || CNMisMatch) {
-              if (isUntrusted)
-                addToDetails(R("SUntrustedCertificate"));
-              if (hasExpiredCert)
-                addToDetails(R("SHasExpiredCert"));
-              if (hasExpiringCert)
-                addToDetails(R("SHasExpiringCert"));
-              if (notYetValidCert)
-                addToDetails(R("SNotYetValidCert"));
-              if (CNMisMatch)
-                  addToDetails(R("SCNMisMatch", altNames, this.hostName));
-        }
-
-
-        return details;
-    }
-
-    private String getNamesForCert(X509Certificate c) {
-
-        String names = "";
-
-
-        // We use the specification from
-        // http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/X509Certificate.html#getSubjectAlternativeNames()
-        // to determine the type of address
-        int ALTNAME_DNS = 2;
-        int ALTNAME_IP = 7;
-
-        try {
-            Collection<List<?>> subjAltNames = c.getSubjectAlternativeNames();
-            X500Name subjectName = HostnameChecker.getSubjectX500Name(c);
-            DerValue derValue = subjectName.findMostSpecificAttribute
-                                                        (X500Name.commonName_oid);
-            names += derValue.getAsString();
-
-            if (subjAltNames != null) {
-                for (List<?> next : subjAltNames) {
-                    if ( ((Integer)next.get(0)).intValue() == ALTNAME_IP ||
-                            ((Integer)next.get(0)).intValue() == ALTNAME_DNS
-                    ) {
-                        names += ", " + (String)next.get(1);
-                    }
-                }
-            }
-
-            if (subjAltNames != null)
-                names = names.substring(2); // remove proceeding ", "
-
-        } catch (CertificateParsingException cpe) {
-            cpe.printStackTrace();
-        } catch (IOException ioe) {
-            ioe.printStackTrace();
-        }
-
-        return names;
-    }
-
-    private void addToDetails(String detail) {
-      if (!details.contains(detail))
-        details.add(detail);
-    }
-
-    private static String R(String key) {
-      return JNLPRuntime.getMessage(key);
-    }
-
-    private static String R(String key, String arg1, String arg2) {
-        return JNLPRuntime.getMessage(key, new Object[] { arg1, arg2 });
-    }
-
-    public Certificate getPublisher() {
-      if (chain.length > 0)
-        return (Certificate)chain[0];
-      return null;
-    }
-
-    public Certificate getRoot() {
-      if (chain.length > 0)
-        return (Certificate)chain[chain.length - 1];
-      return null;
-    }
-
-    public boolean getRootInCacerts() {
-        try {
-          KeyTool kt = new KeyTool();
-          return kt.checkCacertsForCertificate(getRoot());
-        } catch (Exception e) {
-        }
-        return false;
-    }
-
-    public boolean hasSigningIssues() {
-        return false;
-    }
-
-    public boolean noSigningIssues() {
-        return false;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/security/MoreInfoPane.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/* MoreInfoPane.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.ArrayList;
-
-import javax.swing.BorderFactory;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-
-/**
- * Provides the panel for the More Info dialog. This dialog shows details about an
- * application's signing status.
- *
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- */
-public class MoreInfoPane extends SecurityDialogPanel {
-
-        public MoreInfoPane(SecurityWarningDialog x, CertVerifier certVerifier) {
-                super(x, certVerifier);
-                addComponents();
-        }
-
-        /**
-         * Constructs the GUI components of this panel
-         */
-        private void addComponents() {
-                ArrayList<String> details = certVerifier.getDetails();
-
-                int numLabels = details.size();
-                JPanel errorPanel = new JPanel(new GridLayout(numLabels,1));
-                errorPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-                errorPanel.setPreferredSize(new Dimension(400, 70*(numLabels)));
-
-                for (int i = 0; i < numLabels; i++) {
-                        ImageIcon icon = null;
-                        if (details.get(i).equals(R("STrustedCertificate")))
-                                icon = new ImageIcon((new sun.misc.Launcher())
-                                                .getClassLoader().getResource("net/sourceforge/jnlp/resources/info-small.png"));
-                        else
-                                icon = new ImageIcon((new sun.misc.Launcher())
-                                                .getClassLoader().getResource("net/sourceforge/jnlp/resources/warning-small.png"));
-
-                        errorPanel.add(new JLabel(htmlWrap(details.get(i)), icon, SwingConstants.LEFT));
-                }
-
-                JPanel buttonsPanel = new JPanel(new BorderLayout());
-                JButton certDetails = new JButton("Certificate Details");
-                certDetails.addActionListener(new CertInfoButtonListener());
-                JButton close = new JButton("Close");
-                close.addActionListener(createSetValueListener(parent, 0));
-        buttonsPanel.add(certDetails, BorderLayout.WEST);
-        buttonsPanel.add(close, BorderLayout.EAST);
-                buttonsPanel.setBorder(BorderFactory.createEmptyBorder(15,15,15,15));
-
-        add(errorPanel, BorderLayout.NORTH);
-        add(buttonsPanel, BorderLayout.SOUTH);
-
-        }
-
-        private class CertInfoButtonListener implements ActionListener {
-        public void actionPerformed(ActionEvent e) {
-            SecurityWarningDialog.showCertInfoDialog(parent.getJarSigner(),
-                                parent);
-        }
-    }
-}
--- a/netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/* NotAllSignedWarningPane.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-
-import javax.swing.BorderFactory;
-import javax.swing.BoxLayout;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-
-import net.sourceforge.jnlp.JNLPFile;
-
-
-public class NotAllSignedWarningPane extends SecurityDialogPanel {
-
-        public NotAllSignedWarningPane(SecurityWarningDialog x) {
-                super(x);
-                addComponents();
-        }
-
-        /**
-         * Creates the actual GUI components, and adds it to this panel
-         */
-        private void addComponents() {
-                JNLPFile file = parent.getFile();
-
-                String topLabelText = "Only parts of this application code are signed.";
-                String infoLabelText = "This application contains both signed and" +
-                " unsigned code. While signed code is safe if you trust the " +
-                "provider, unsigned code may imply code outside of the trusted " +
-                "provider's control.";
-                String questionLabelText = "Do you wish to proceed and run this " +
-                "application anyway?";
-
-                ImageIcon icon = new ImageIcon((new sun.misc.Launcher()).getClassLoader().getResource("net/sourceforge/jnlp/resources/warning.png"));
-                JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.LEFT);
-                topLabel.setFont(new Font(topLabel.getFont().toString(),
-                        Font.BOLD, 12));
-                JPanel topPanel = new JPanel(new BorderLayout());
-                topPanel.setBackground(Color.WHITE);
-                topPanel.add(topLabel, BorderLayout.CENTER);
-                topPanel.setPreferredSize(new Dimension(500,80));
-                topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                JLabel infoLabel = new JLabel(htmlWrap(infoLabelText));
-                JPanel infoPanel = new JPanel(new BorderLayout());
-                infoPanel.add(infoLabel, BorderLayout.CENTER);
-                infoPanel.setPreferredSize(new Dimension(500,100));
-                infoPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                JLabel questionLabel = new JLabel(htmlWrap(questionLabelText));
-                JPanel questionPanel = new JPanel(new BorderLayout());
-                questionPanel.add(questionLabel, BorderLayout.CENTER);
-                questionPanel.setPreferredSize(new Dimension(500,100));
-                questionPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                //run and cancel buttons
-                JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
-
-                JButton run = new JButton("Proceed");
-                JButton cancel = new JButton("Cancel");
-                run.addActionListener(createSetValueListener(parent,0));
-                cancel.addActionListener(createSetValueListener(parent, 1));
-                initialFocusComponent = cancel;
-                buttonPanel.add(run);
-                buttonPanel.add(cancel);
-                buttonPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                //all of the above
-                setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-                add(topPanel);
-                add(infoPanel);
-                add(questionPanel);
-                add(buttonPanel);
-
-        }
-}
--- a/netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-    /* SecurityDialogPanel.java
-   Copyright (C) 2008-2010 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-/**
- * Provides a JPanel for use in JNLP warning dialogs.
- */
-public abstract class SecurityDialogPanel extends JPanel {
-
-        protected SecurityWarningDialog parent;
-
-        JComponent initialFocusComponent = null;
-
-        CertVerifier certVerifier = null;
-
-        public SecurityDialogPanel(SecurityWarningDialog dialog, CertVerifier certVerifier){
-                this.parent = dialog;
-                this.certVerifier = certVerifier;
-                this.setLayout(new BorderLayout());
-        }
-
-        public SecurityDialogPanel(SecurityWarningDialog dialog) {
-                this.parent = dialog;
-                this.setLayout(new BorderLayout());
-        }
-
-        /*
-         * String translation functions
-         */
-
-        protected static String R(String key) {
-                return JNLPRuntime.getMessage(key);
-        }
-
-    protected static String R(String key, Object param) {
-        return JNLPRuntime.getMessage(key, new Object[] {param});
-    }
-
-        /**
-         * Needed to get word wrap working in JLabels.
-         */
-        protected String htmlWrap (String s) {
-                return "<html>"+s+"</html>";
-        }
-
-        /**
-         * Create an ActionListener suitable for use with buttons. When this {@link ActionListener}
-         * is invoked, it will set the value of the {@link SecurityWarningDialog} and then dispossed.
-         *
-         * @param buttonIndex the index of the button. By convention 0 = Yes. 1 = No, 2 = Cancel
-         * @return
-         */
-        protected ActionListener createSetValueListener(SecurityWarningDialog dialog, int buttonIndex) {
-            return new SetValueHandler(dialog, buttonIndex);
-        }
-
-        @Override
-        public void setVisible(boolean aFlag) {
-            super.setVisible(aFlag);
-            requestFocusOnDefaultButton();
-        }
-
-        public void requestFocusOnDefaultButton() {
-               if (initialFocusComponent != null) {
-                    initialFocusComponent.requestFocusInWindow();
-                }
-        }
-
-        /**
-         * Creates a handler that sets a dialog's value and then disposes it when activated
-         *
-         */
-        private class SetValueHandler implements ActionListener {
-
-            Integer buttonIndex;
-            SecurityWarningDialog dialog;
-
-            public SetValueHandler(SecurityWarningDialog dialog, int buttonIndex) {
-                this.dialog = dialog;
-                this.buttonIndex = buttonIndex;
-            }
-
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            dialog.setValue(buttonIndex);
-            dialog.dispose();
-        }
-        }
-}
--- a/netx/net/sourceforge/jnlp/security/SecurityUtil.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,285 +0,0 @@
-/* SecurityUtil.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.security.KeyStore;
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-public class SecurityUtil {
-
-        private static final char[] password = "changeit".toCharArray();
-
-        public static String getTrustedCertsFilename() throws Exception{
-
-                String homeDir = JNLPRuntime.HOME_DIR;
-
-                if (homeDir == null) {
-                        throw new Exception("Could not access home directory");
-                } else {
-                        return JNLPRuntime.CERTIFICATES_FILE;
-                }
-        }
-
-        public static char[] getTrustedCertsPassword() {
-                return password;
-        }
-
-    /**
-     * Extracts the CN field from a Certificate principal string. Or, if it
-     * can't find that, return the principal unmodified.
-     *
-     * This is a simple (and hence 'wrong') version. See
-     * http://www.ietf.org/rfc/rfc2253.txt for all the gory details.
-     */
-    public static String getCN(String principal) {
-
-        /*
-         * FIXME Incomplete
-         *
-         * This does not implement RFC 2253 completely
-         *
-         * Issues:
-         * - rfc2253 talks about utf8, java uses utf16.
-         * - theoretically, java should have dealt with all byte encodings
-         *   so we shouldnt even see cases like \FF
-         * - if the above is wrong, then we need to deal with cases like
-         *   \FF\FF
-         */
-
-        int start = principal.indexOf("CN=");
-        if (start == -1) {
-            return principal;
-        }
-
-        StringBuilder commonName = new StringBuilder();
-
-        boolean inQuotes = false;
-        boolean escaped = false;
-
-        /*
-         * bit 0 = high order bit. bit 1 = low order bit
-         */
-        char[] hexBits = null;
-
-        for (int i = start + 3; i < principal.length(); i++) {
-            char ch = principal.charAt(i);
-            switch (ch) {
-            case '"':
-                if (escaped) {
-                    commonName.append(ch);
-                    escaped = false;
-                } else {
-                    inQuotes = !inQuotes;
-                }
-                break;
-
-            case '\\':
-                if (escaped) {
-                    commonName.append(ch);
-                    escaped = false;
-                } else {
-                    escaped = true;
-                }
-                break;
-
-            case ',':
-                /* fall through */
-            case ';':
-                /* fall through */
-            case '+':
-                if (escaped || inQuotes) {
-                    commonName.append(ch);
-                    if (escaped) {
-                        escaped = false;
-                    }
-                } else {
-                    return commonName.toString();
-                }
-                break;
-
-            default:
-                if (escaped && isHexDigit(ch)) {
-                    hexBits = new char[2];
-                    hexBits[0] = ch;
-                } else if (hexBits != null) {
-                    if (!isHexDigit(ch)) {
-                        /* error parsing */
-                        return "";
-                    }
-                    hexBits[1] = ch;
-                    commonName.append((char) Integer.parseInt(new String(hexBits), 16));
-                    hexBits = null;
-                } else {
-                    commonName.append(ch);
-                }
-                escaped = false;
-            }
-        }
-
-        return commonName.toString();
-
-    }
-
-    private static boolean isHexDigit(char ch) {
-        return ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f'));
-    }
-
-        /**
-         * Checks the user's home directory to see if the trusted.certs file exists.
-         * If it does not exist, it tries to create an empty keystore.
-         * @return true if the trusted.certs file exists or a new trusted.certs
-         * was created successfully, otherwise false.
-         */
-        public static boolean checkTrustedCertsFile() throws Exception {
-
-                File certFile = new File(getTrustedCertsFilename());
-
-                //file does not exist
-                if (!certFile.isFile()) {
-                        File dir = certFile.getAbsoluteFile().getParentFile();
-                        boolean madeDir = false;
-                        if (!dir.isDirectory()) {
-                                madeDir = dir.mkdirs();
-                        }
-
-                        //made directory, or directory exists
-                        if (madeDir || dir.isDirectory()) {
-                                KeyStore ks = KeyStore.getInstance("JKS");
-                                ks.load(null, password);
-                                FileOutputStream fos = new FileOutputStream(certFile);
-                                ks.store(fos, password);
-                                fos.close();
-                                return true;
-                        } else {
-                                return false;
-                        }
-                } else {
-                        return true;
-                }
-        }
-
-        /**
-         * Returns the keystore associated with the user's trusted.certs file,
-         * or null otherwise.
-         */
-        public static KeyStore getUserKeyStore() throws Exception {
-
-                KeyStore ks = null;
-                FileInputStream fis = null;
-
-                if (checkTrustedCertsFile()) {
-
-                        try {
-                                File file = new File(getTrustedCertsFilename());
-                                if (file.exists()) {
-                                        fis = new FileInputStream(file);
-                                        ks = KeyStore.getInstance("JKS");
-                                        ks.load(fis, password);
-                                }
-                        } catch (Exception e) {
-                                e.printStackTrace();
-                                throw e;
-                        } finally {
-                                if (fis != null)
-                                        fis.close();
-                        }
-                }
-                return ks;
-        }
-
-    /**
-     * Returns the keystore associated with the JDK cacerts file,
-         * or null otherwise.
-     */
-    public static KeyStore getCacertsKeyStore() throws Exception {
-
-                KeyStore caks = null;
-                FileInputStream fis = null;
-
-                try {
-                File file = new File(System.getProperty("java.home")
-                                + "/lib/security/cacerts");
-                if (file.exists()) {
-                        fis = new FileInputStream(file);
-                        caks = KeyStore.getInstance("JKS");
-                        caks.load(fis, null);
-                }
-                } catch (Exception e) {
-                        caks = null;
-                } finally {
-                        if (fis != null)
-                                fis.close();
-                }
-
-                return caks;
-    }
-
-        /**
-         * Returns the keystore associated with the system certs file,
-         * or null otherwise.
-         */
-        public static KeyStore getSystemCertStore() throws Exception {
-
-                KeyStore caks = null;
-                FileInputStream fis = null;
-
-                try {
-                        File file = new File(System.getProperty("javax.net.ssl.trustStore"));
-                        String type = System.getProperty("javax.net.ssl.trustStoreType");
-                        //String provider = "SUN";
-                        char[] password = System.getProperty(
-                                "javax.net.ssl.trustStorePassword").toCharArray();
-                        if (file.exists()) {
-                                fis = new FileInputStream(file);
-                                caks = KeyStore.getInstance(type);
-                                caks.load(fis, password);
-                        }
-                } catch (Exception e) {
-                        caks = null;
-                } finally {
-                        if (fis != null)
-                                fis.close();
-                }
-
-                return caks;
-        }
-}
--- a/netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,474 +0,0 @@
-/* SecurityWarningDialog.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-import java.awt.*;
-
-import javax.swing.*;
-
-import java.awt.event.*;
-
-import java.security.cert.X509Certificate;
-
-/**
- * Provides methods for showing security warning dialogs
- * for a wide range of JNLP security issues.
- *
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- */
-public class SecurityWarningDialog extends JDialog {
-
-        /** Types of dialogs we can create */
-        public static enum DialogType {
-                CERT_WARNING,
-                MORE_INFO,
-                CERT_INFO,
-                SINGLE_CERT_INFO,
-                ACCESS_WARNING,
-                NOTALLSIGNED_WARNING,
-                APPLET_WARNING
-        }
-
-        /** The types of access which may need user permission. */
-        public static enum AccessType {
-        READ_FILE,
-        WRITE_FILE,
-        CREATE_DESTKOP_SHORTCUT,
-        CLIPBOARD_READ,
-        CLIPBOARD_WRITE,
-        PRINTER,
-        NETWORK,
-        VERIFIED,
-        UNVERIFIED,
-        NOTALLSIGNED,
-        SIGNING_ERROR
-    }
-
-        /** The type of dialog we want to show */
-        private DialogType dialogType;
-
-        /** The type of access that this dialog is for */
-        private AccessType accessType;
-
-        private SecurityDialogPanel panel;
-
-        /** The application file associated with this security warning */
-        private JNLPFile file;
-
-        private CertVerifier certVerifier;
-
-        private X509Certificate cert;
-
-        /** An optional String array that's only necessary when a dialog
-         * label requires some parameters (e.g. showing which address an application
-         * is trying to connect to).
-         */
-        private Object[] extras;
-
-        /** Whether or not this object has been fully initialized */
-        private boolean initialized = false;
-
-    /**
-     * the return value of this dialog. result: 0 = Yes, 1 = No, 2 = Cancel,
-     * null = Window closed.
-     */
-        private Object value;
-
-        public SecurityWarningDialog(DialogType dialogType, AccessType accessType,
-                        JNLPFile file) {
-            super();
-                this.dialogType = dialogType;
-                this.accessType = accessType;
-                this.file = file;
-                this.certVerifier = null;
-                initialized = true;
-                initDialog();
-        }
-
-        public SecurityWarningDialog(DialogType dialogType, AccessType accessType,
-                        JNLPFile file, CertVerifier jarSigner) {
-            super();
-                this.dialogType = dialogType;
-                this.accessType = accessType;
-                this.file = file;
-                this.certVerifier = jarSigner;
-                initialized = true;
-                initDialog();
-        }
-
-        public SecurityWarningDialog(DialogType dialogType, AccessType accessType,
-                CertVerifier certVerifier) {
-            super();
-            this.dialogType = dialogType;
-            this.accessType = accessType;
-            this.file = null;
-            this.certVerifier = certVerifier;
-            initialized = true;
-            initDialog();
-        }
-
-        public SecurityWarningDialog(DialogType dialogType, AccessType accessType,
-                        JNLPFile file, Object[] extras) {
-            super();
-                this.dialogType = dialogType;
-                this.accessType = accessType;
-                this.file = file;
-                this.certVerifier = null;
-                initialized = true;
-                this.extras = extras;
-                initDialog();
-        }
-
-        //for displaying a single certificate
-        public SecurityWarningDialog(DialogType dialogType, X509Certificate c) {
-            super();
-                this.dialogType = dialogType;
-                this.accessType = null;
-                this.file = null;
-                this.certVerifier = null;
-                this.cert = c;
-                initialized = true;
-                initDialog();
-        }
-
-        /**
-         * Returns if this dialog has been fully initialized yet.
-         * @return true if this dialog has been initialized, and false otherwise.
-         */
-        public boolean isInitialized(){
-                return initialized;
-        }
-
-        /**
-         * Shows a warning dialog for different types of system access (i.e. file
-         * open/save, clipboard read/write, printing, etc).
-         *
-         * @param accessType the type of system access requested.
-         * @param file the jnlp file associated with the requesting application.
-         * @return true if permission was granted by the user, false otherwise.
-         */
-        public static boolean showAccessWarningDialog(AccessType accessType,
-                JNLPFile file) {
-                return showAccessWarningDialog(accessType, file, null);
-        }
-
-        /**
-         * Shows a warning dialog for different types of system access (i.e. file
-         * open/save, clipboard read/write, printing, etc).
-         *
-         * @param accessType the type of system access requested.
-         * @param file the jnlp file associated with the requesting application.
-         * @param extras an optional array of Strings (typically) that gets
-         * passed to the dialog labels.
-         * @return true if permission was granted by the user, false otherwise.
-         */
-        public static boolean showAccessWarningDialog(AccessType accessType,
-                        JNLPFile file, Object[] extras) {
-                        SecurityWarningDialog dialog = new SecurityWarningDialog(
-                                        DialogType.ACCESS_WARNING, accessType, file, extras);
-                        dialog.setVisible(true);
-                        dialog.dispose();
-
-                        Object selectedValue = dialog.getValue();
-                        if (selectedValue == null) {
-                                return false;
-                        } else if (selectedValue instanceof Integer) {
-                                if (((Integer)selectedValue).intValue() == 0)
-                                        return true;
-                                else
-                                        return false;
-                        } else {
-                                return false;
-                        }
-                }
-
-        /**
-         * Shows a warning dialog for when the main application jars are signed,
-         * but extensions aren't
-         *
-         * @return true if permission was granted by the user, false otherwise.
-         */
-        public static boolean showNotAllSignedWarningDialog(JNLPFile file) {
-                        SecurityWarningDialog dialog = new SecurityWarningDialog(
-                                        DialogType.NOTALLSIGNED_WARNING, AccessType.NOTALLSIGNED, file, (new Object[0]));
-                        dialog.setVisible(true);
-                        dialog.dispose();
-
-                        Object selectedValue = dialog.getValue();
-                        if (selectedValue == null) {
-                                return false;
-                        } else if (selectedValue instanceof Integer) {
-                                if (((Integer)selectedValue).intValue() == 0)
-                                        return true;
-                                else
-                                        return false;
-                        } else {
-                                return false;
-                        }
-                }
-
-        /**
-         * Shows a security warning dialog according to the specified type of
-         * access. If <code>type</code> is one of AccessType.VERIFIED or
-         * AccessType.UNVERIFIED, extra details will be available with regards
-         * to code signing and signing certificates.
-         *
-         * @param accessType the type of warning dialog to show
-         * @param file the JNLPFile associated with this warning
-         * @param jarSigner the JarSigner used to verify this application
-         */
-        public static boolean showCertWarningDialog(AccessType accessType,
-                        JNLPFile file, CertVerifier jarSigner) {
-                SecurityWarningDialog dialog =
-                        new SecurityWarningDialog(DialogType.CERT_WARNING, accessType, file,
-                        jarSigner);
-                dialog.setVisible(true);
-                dialog.dispose();
-
-                Object selectedValue = dialog.getValue();
-                if (selectedValue == null) {
-                        return false;
-                } else if (selectedValue instanceof Integer) {
-                        if (((Integer)selectedValue).intValue() == 0)
-                                return true;
-                        else
-                                return false;
-                } else {
-                        return false;
-                }
-        }
-
-        /**
-         * Shows more information regarding jar code signing
-         *
-         * @param jarSigner the JarSigner used to verify this application
-         * @param parent the parent option pane
-         */
-        public static void showMoreInfoDialog(
-                CertVerifier jarSigner, SecurityWarningDialog parent) {
-
-                SecurityWarningDialog dialog =
-                        new SecurityWarningDialog(DialogType.MORE_INFO, null, null,
-                        jarSigner);
-                dialog.setVisible(true);
-                dialog.dispose();
-        }
-
-        /**
-         * Displays CertPath information in a readable table format.
-         *
-         * @param certs the certificates used in signing.
-         */
-        public static void showCertInfoDialog(CertVerifier jarSigner,
-                SecurityWarningDialog parent) {
-                SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.CERT_INFO,
-                        null, null, jarSigner);
-                dialog.setLocationRelativeTo(parent);
-                dialog.setVisible(true);
-                dialog.dispose();
-        }
-
-        /**
-         * Displays a single certificate's information.
-         *
-         * @param c
-         * @param optionPane
-         */
-        public static void showSingleCertInfoDialog(X509Certificate c,
-                        JDialog parent) {
-                SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.SINGLE_CERT_INFO, c);
-                        dialog.setLocationRelativeTo(parent);
-                        dialog.setVisible(true);
-                        dialog.dispose();
-        }
-
-        public static int showAppletWarning() {
-                SecurityWarningDialog dialog = new SecurityWarningDialog(DialogType.APPLET_WARNING,
-                        null, null, (CertVerifier) null);
-                dialog.setVisible(true);
-                dialog.dispose();
-
-                Object selectedValue = dialog.getValue();
-
-                //result 0 = Yes, 1 = No, 2 = Cancel
-                if (selectedValue == null) {
-                        return 2;
-                } else if (selectedValue instanceof Integer) {
-                        return ((Integer)selectedValue).intValue();
-                } else {
-                        return 2;
-                }
-        }
-
-        private void initDialog() {
-            setSystemLookAndFeel();
-
-                String dialogTitle = "";
-                if (dialogType == DialogType.CERT_WARNING)
-                        dialogTitle = "Warning - Security";
-                else if (dialogType == DialogType.MORE_INFO)
-                        dialogTitle = "More Information";
-                else if (dialogType == DialogType.CERT_INFO)
-                        dialogTitle = "Details - Certificate";
-                else if (dialogType == DialogType.ACCESS_WARNING)
-                        dialogTitle = "Security Warning";
-                else if (dialogType == DialogType.APPLET_WARNING)
-                        dialogTitle = "Applet Warning";
-                else if (dialogType == DialogType.NOTALLSIGNED_WARNING)
-                        dialogTitle = "Security Warning";
-
-                setTitle(dialogTitle);
-                setModal(true);
-
-                setDefaultCloseOperation(DISPOSE_ON_CLOSE);
-
-                installPanel();
-
-                pack();
-
-                WindowAdapter adapter = new WindowAdapter() {
-            private boolean gotFocus = false;
-            @Override
-            public void windowClosing(WindowEvent we) {
-                setValue(null);
-            }
-            @Override
-            public void windowGainedFocus(WindowEvent we) {
-                // Once window gets focus, set initial focus
-                if (!gotFocus) {
-                    selectDefaultButton();
-                    gotFocus = true;
-                }
-            }
-            @Override
-            public void windowOpened(WindowEvent e) {
-                if (e.getSource() instanceof SecurityWarningDialog) {
-                    SecurityWarningDialog dialog = (SecurityWarningDialog) e.getSource();
-                    dialog.setResizable(true);
-                    centerDialog(dialog);
-                    dialog.setValue(null);
-                }
-            }
-        };
-                addWindowListener(adapter);
-                addWindowFocusListener(adapter);
-
-        }
-
-        public AccessType getAccessType() {
-                return accessType;
-        }
-
-        public JNLPFile getFile() {
-                return file;
-        }
-
-        public CertVerifier getJarSigner() {
-                return certVerifier;
-        }
-
-        public X509Certificate getCert() {
-                return cert;
-        }
-
-        /**
-         * Adds the appropriate JPanel to this Dialog, based on {@link DialogType}.
-         */
-        private void installPanel() {
-
-                if (dialogType == DialogType.CERT_WARNING)
-                        panel = new CertWarningPane(this, this.certVerifier);
-                else if (dialogType == DialogType.MORE_INFO)
-                        panel = new MoreInfoPane(this, this.certVerifier);
-                else if (dialogType == DialogType.CERT_INFO)
-                        panel = new CertsInfoPane(this, this.certVerifier);
-                else if (dialogType == DialogType.SINGLE_CERT_INFO)
-                        panel = new SingleCertInfoPane(this, this.certVerifier);
-                else if (dialogType == DialogType.ACCESS_WARNING)
-                        panel = new AccessWarningPane(this, extras, this.certVerifier);
-                else if (dialogType == DialogType.APPLET_WARNING)
-                        panel = new AppletWarningPane(this, this.certVerifier);
-                else if (dialogType == DialogType.NOTALLSIGNED_WARNING)
-                        panel = new NotAllSignedWarningPane(this);
-
-                add(panel, BorderLayout.CENTER);
-        }
-
-        private static void centerDialog(JDialog dialog) {
-                Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
-                Dimension dialogSize = dialog.getSize();
-
-                dialog.setLocation((screen.width - dialogSize.width)/2,
-                        (screen.height - dialogSize.height)/2);
-        }
-
-    private void selectDefaultButton() {
-        if (panel == null) {
-            System.out.println("initial value panel is null");
-        }
-        panel.requestFocusOnDefaultButton();
-    }
-
-    protected void setValue(Object value) {
-        if (JNLPRuntime.isDebug()) {
-            System.out.println("Setting value:" + value);
-        }
-        this.value = value;
-    }
-
-    protected Object getValue() {
-        if (JNLPRuntime.isDebug()) {
-            System.out.println("Returning value:" + value);
-        }
-        return value;
-    }
-
-    /**
-     * Updates the look and feel of the window to be the system look and feel
-     */
-    protected void setSystemLookAndFeel() {
-        try {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Exception e) {
-            //don't worry if we can't.
-        }
-    }
-}
--- a/netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/* SingleCertInfoPane.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-
-import javax.swing.JTree;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeSelectionModel;
-
-
-public class SingleCertInfoPane extends CertsInfoPane {
-
-        public SingleCertInfoPane(SecurityWarningDialog x, CertVerifier certVerifier) {
-                super(x, certVerifier);
-        }
-
-        protected void buildTree() {
-                X509Certificate cert = parent.getCert();
-                String subjectString =
-                        SecurityUtil.getCN(cert.getSubjectX500Principal().getName());
-                String issuerString =
-                        SecurityUtil.getCN(cert.getIssuerX500Principal().getName());
-
-                DefaultMutableTreeNode top = new DefaultMutableTreeNode(subjectString
-                                + " (" + issuerString + ")");
-
-                tree = new JTree(top);
-                tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
-                tree.addTreeSelectionListener(new TreeSelectionHandler());
-        }
-
-        protected void populateTable() {
-                X509Certificate c = parent.getCert();
-                certNames = new String[1];
-                certsData = new ArrayList<String[][]>();
-                certsData.add(parseCert(c));
-                certNames[0] = SecurityUtil.getCN(c.getSubjectX500Principal().getName())
-                + " (" + SecurityUtil.getCN(c.getIssuerX500Principal().getName()) + ")";
-        }
-}
--- a/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,286 +0,0 @@
-/* VariableX509TrustManager.java
-   Copyright (C) 2009 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security;
-
-import java.security.KeyStore;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.X509TrustManager;
-
-import sun.security.util.HostnameChecker;
-import sun.security.validator.ValidatorException;
-
-import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager;
-
-/**
- * This class implements an X509 Trust Manager. The certificates it trusts are
- * "variable", in the sense that it can dynamically, and temporarily support
- * different certificates that are not in the keystore.
- */
-
-public class VariableX509TrustManager extends X509ExtendedTrustManager {
-
-    KeyStore userKeyStore = null;
-    KeyStore caKeyStore = null;
-
-    X509TrustManager userTrustManager = null;
-    X509TrustManager caTrustManager = null;
-
-    ArrayList<Certificate> temporarilyTrusted = new ArrayList();
-
-    static VariableX509TrustManager instance = null;
-
-    /**
-     * Constructor initializes the system, user and custom stores
-     */
-    public VariableX509TrustManager() {
-
-        try {
-            userKeyStore = SecurityUtil.getUserKeyStore();
-            TrustManagerFactory tmFactory = TrustManagerFactory.getInstance("SunX509", "SunJSSE");
-            tmFactory.init(userKeyStore);
-
-            // tm factory initialized, now get the managers so we can assign the X509 one
-            TrustManager[] trustManagers = tmFactory.getTrustManagers();
-
-            for (int i=0; i < trustManagers.length; i++) {
-                if (trustManagers[i] instanceof X509TrustManager) {
-                    userTrustManager = (X509TrustManager) trustManagers[i];
-                }
-            }
-
-        } catch (Exception e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-
-        try {
-            caKeyStore = SecurityUtil.getCacertsKeyStore();
-            TrustManagerFactory tmFactory = TrustManagerFactory.getInstance("SunX509", "SunJSSE");
-            tmFactory.init(caKeyStore);
-
-            // tm factory initialized, now get the managers so we can extract the X509 one
-            TrustManager[] trustManagers = tmFactory.getTrustManagers();
-
-            for (int i=0; i < trustManagers.length; i++) {
-                if (trustManagers[i] instanceof X509TrustManager) {
-                    caTrustManager = (X509TrustManager) trustManagers[i];
-                }
-            }
-
-        } catch (Exception e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Check if client is trusted (no support for custom here, only system/user)
-     */
-    public void checkClientTrusted(X509Certificate[] chain, String authType,
-                                   String hostName, String algorithm)
-            throws CertificateException {
-        // First try catrustmanager, then try usertrustmanager
-        try {
-            caTrustManager.checkClientTrusted(chain, authType);
-        } catch (Exception caex) {
-            try {
-                userTrustManager.checkClientTrusted(chain, authType);
-            } catch (Exception userex) {
-                // Do nothing here. This trust manager is intended to be used
-                // only in the plugin instance vm, which does not act as a
-                // server
-            }
-        }
-    }
-
-    public void checkClientTrusted(X509Certificate[] chain, String authType)
-            throws CertificateException {
-        checkClientTrusted(chain, authType, null, null);
-    }
-
-    public void checkServerTrusted(X509Certificate[] chain, String authType,
-                                   String hostName, String algorithm)
-            throws CertificateException {
-        checkServerTrusted(chain, authType, hostName, false);
-    }
-
-    public void checkServerTrusted(X509Certificate[] chain, String authType)
-            throws CertificateException {
-        checkServerTrusted(chain, authType, null, null);
-    }
-
-    /**
-     * Check if the server is trusted
-     *
-     * @param chain The cert chain
-     * @param authType The auth type algorithm
-     * @param checkOnly Whether to "check only" i.e. no user prompt, or to prompt for permission
-     */
-    public synchronized void checkServerTrusted(X509Certificate[] chain,
-                             String authType, String hostName,
-                             boolean checkOnly) throws CertificateException {
-        CertificateException ce = null;
-        boolean trusted = true;
-        boolean CNMatched = true;
-
-        try {
-            checkAllManagers(chain, authType);
-        } catch (CertificateException e) {
-            trusted = false;
-            ce = e;
-        }
-
-        // If the certificate is not explicitly trusted, we
-        // need to prompt the user
-        if (!isExplicitlyTrusted(chain, authType)) {
-
-            try {
-                HostnameChecker checker = HostnameChecker
-                        .getInstance(HostnameChecker.TYPE_TLS);
-
-                checker.match(hostName, chain[0]); // only need to match @ 0 for
-                                                   // CN
-
-            } catch (CertificateException e) {
-                CNMatched = false;
-                ce = e;
-            }
-        }
-
-        if (!trusted || !CNMatched) {
-            if (checkOnly) {
-                throw ce;
-            } else {
-
-                boolean b = askUser(chain, authType, trusted, CNMatched, hostName);
-
-                if (b) {
-                    temporarilyTrust(chain[0]);
-                }
-
-                checkAllManagers(chain, authType);
-            }
-        }
-    }
-
-    /**
-     * Check system, user and custom trust manager
-     */
-    private void checkAllManagers(X509Certificate[] chain, String authType) throws CertificateException {
-        // First try catrustmanager, then try usertrustmanager, and finally, check temp trusted certs
-        try {
-            caTrustManager.checkServerTrusted(chain, authType);
-        } catch (ValidatorException caex) {
-            try {
-                userTrustManager.checkServerTrusted(chain, authType);
-            } catch (ValidatorException uex) {
-                if (!temporarilyTrusted.contains(chain[0]))
-                    throw (CertificateException) uex;
-            }
-        }
-    }
-
-    /**
-     * Return if the user explicitly trusted this i.e. in userTrustManager or temporarilyTrusted
-     */
-    private boolean isExplicitlyTrusted(X509Certificate[] chain, String authType) {
-        boolean explicitlyTrusted = false;
-
-        try {
-            userTrustManager.checkServerTrusted(chain, authType);
-            explicitlyTrusted = true;
-        } catch (ValidatorException uex) {
-            if (temporarilyTrusted.contains(chain[0]))
-                explicitlyTrusted = true;
-        } catch (CertificateException ce) {
-            // do nothing, this means that the cert is not explicitly trusted
-        }
-
-        return explicitlyTrusted;
-
-    }
-
-    public X509Certificate[] getAcceptedIssuers() {
-        // delegate to default
-        return caTrustManager.getAcceptedIssuers();
-    }
-
-    /**
-     * Temporarily trust the given cert (runtime)
-     *
-     * @param c The certificate to trust
-     */
-    private void temporarilyTrust(Certificate c) {
-        temporarilyTrusted.add(c);
-    }
-
-    /**
-     * Ask user if the certificate should be trusted
-     *
-     * @param chain The certificate chain
-     * @param authType The authentication algorithm
-     * @return user's response
-     */
-    private boolean askUser(X509Certificate[] chain, String authType,
-                            boolean isTrusted, boolean hostMatched,
-                            String hostName) {
-        return SecurityWarningDialog.showCertWarningDialog(
-                        SecurityWarningDialog.AccessType.UNVERIFIED, null,
-                        new HttpsCertVerifier(this, chain, authType,
-                                              isTrusted, hostMatched,
-                                              hostName));
-    }
-
-    /**
-     * Return an instance of this singleton
-     *
-     * @return The instance
-     */
-    public static VariableX509TrustManager getInstance() {
-        if (instance == null)
-            instance = new VariableX509TrustManager();
-
-        return instance;
-    }
-}
--- a/netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,335 +0,0 @@
-/* CertificatePane.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security.viewer;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-import java.io.FileOutputStream;
-import java.io.PrintStream;
-import java.security.KeyStore;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.Enumeration;
-
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTabbedPane;
-import javax.swing.JTable;
-import javax.swing.table.DefaultTableModel;
-
-import net.sourceforge.jnlp.security.SecurityUtil;
-import net.sourceforge.jnlp.security.SecurityWarningDialog;
-import net.sourceforge.jnlp.tools.KeyTool;
-
-public class CertificatePane extends JPanel {
-
-        /**
-         * The certificates stored in the user's trusted.certs file.
-         */
-        private ArrayList<X509Certificate> certs = null;
-
-        /**
-         * "Issued To" and "Issued By" string pairs for certs.
-         */
-        private String[][] issuedToAndBy = null;
-        private final String[] columnNames = { "Issued To", "Issued By" };
-
-        private JTable table;
-
-        private JDialog parent;
-
-        private JComponent defaultFocusComponent = null;
-
-        /**
-         * The KeyStore associated with the user's trusted.certs file.
-         */
-        private KeyStore keyStore = null;
-
-        public CertificatePane(JDialog parent) {
-                super();
-                this.parent = parent;
-                initializeKeyStore();
-                addComponents();
-        }
-
-        /**
-         * Reads the user's trusted.cacerts keystore.
-         */
-        private void initializeKeyStore() {
-                try {
-                        keyStore = SecurityUtil.getUserKeyStore();
-                } catch (Exception e) {
-                        // TODO Auto-generated catch block
-                        e.printStackTrace();
-                }
-        }
-
-        //create the GUI here.
-        protected void addComponents() {
-                readKeyStore();
-
-                JPanel main = new JPanel(new BorderLayout());
-
-                JPanel tablePanel = new JPanel(new BorderLayout());
-
-                //Table
-                DefaultTableModel tableModel
-                        = new DefaultTableModel(issuedToAndBy, columnNames);
-                table = new JTable(tableModel);
-                table.getTableHeader().setReorderingAllowed(false);
-                table.setFillsViewportHeight(true);
-                JScrollPane tablePane = new JScrollPane(table);
-                tablePane.setPreferredSize(new Dimension(500,200));
-                tablePane.setSize(new Dimension(500,200));
-                tablePane.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
-
-                JTabbedPane tabbedPane = new JTabbedPane();
-                tabbedPane.addTab("User", tablePane);
-                JPanel buttonPanel = new JPanel(new FlowLayout());
-
-                String[] buttonNames = {"Import", "Export", "Remove", "Details"};
-                char[] buttonMnemonics = {      KeyEvent.VK_I,
-                                                                        KeyEvent.VK_E,
-                                                                        KeyEvent.VK_M,
-                                                                        KeyEvent.VK_D};
-                ActionListener[] listeners = {  new ImportButtonListener(),
-                                                                                new ExportButtonListener(),
-                                                                                new RemoveButtonListener(),
-                                                                                new DetailsButtonListener() };
-                JButton button;
-
-                //get the max width
-                int maxWidth = 0;
-                for (int i = 0; i < buttonNames.length; i++) {
-                        button = new JButton(buttonNames[i]);
-                        maxWidth = Math.max(maxWidth, button.getMinimumSize().width);
-                }
-
-                for (int i = 0; i < buttonNames.length; i++) {
-                        button = new JButton(buttonNames[i]);
-                        button.setMnemonic(buttonMnemonics[i]);
-                        button.addActionListener(listeners[i]);
-                        button.setSize(maxWidth, button.getSize().height);
-                        buttonPanel.add(button);
-                }
-
-                tablePanel.add(tabbedPane, BorderLayout.CENTER);
-                tablePanel.add(buttonPanel, BorderLayout.SOUTH);
-
-                JPanel closePanel = new JPanel(new BorderLayout());
-                closePanel.setBorder(BorderFactory.createEmptyBorder(7,7,7,7));
-                JButton closeButton = new JButton("Close");
-                closeButton.addActionListener(new CloseButtonListener());
-                defaultFocusComponent = closeButton;
-                closePanel.add(closeButton, BorderLayout.EAST);
-
-                main.add(tablePanel, BorderLayout.CENTER);
-                main.add(closePanel, BorderLayout.SOUTH);
-
-                add(main);
-
-        }
-
-        /**
-         * Read in the optionPane's keystore to issuedToAndBy.
-         */
-        private void readKeyStore() {
-
-                Enumeration<String> aliases = null;
-                certs = new ArrayList<X509Certificate>();
-                try {
-
-                        //Get all of the X509Certificates and put them into an ArrayList
-                        aliases = keyStore.aliases();
-                        while (aliases.hasMoreElements()) {
-                                Certificate c = keyStore.getCertificate(aliases.nextElement());
-                                if (c instanceof X509Certificate)
-                                        certs.add((X509Certificate)c);
-                        }
-
-                        //get the publisher and root information
-                        issuedToAndBy = new String[certs.size()][2];
-                        for (int i = 0; i < certs.size(); i++) {
-                    X509Certificate c = certs.get(i);
-                                issuedToAndBy[i][0] =
-                                        SecurityUtil.getCN(c.getSubjectX500Principal().getName());
-                                issuedToAndBy[i][1] =
-                                        SecurityUtil.getCN(c.getIssuerX500Principal().getName());
-                }
-                } catch (Exception e) {
-                        //TODO
-                }
-        }
-
-        /**
-         * Re-reads the certs file and repopulates the JTable. This is typically
-         * called after a certificate was deleted from the keystore.
-         */
-        private void repopulateTable() {
-                initializeKeyStore();
-                readKeyStore();
-                DefaultTableModel tableModel
-                        = new DefaultTableModel(issuedToAndBy, columnNames);
-
-                table.setModel(tableModel);
-                repaint();
-        }
-
-        public void focusOnDefaultButton() {
-            if (defaultFocusComponent != null) {
-                defaultFocusComponent.requestFocusInWindow();
-            }
-        }
-
-        private class ImportButtonListener implements ActionListener {
-        public void actionPerformed(ActionEvent e) {
-
-                JFileChooser chooser = new JFileChooser();
-                int returnVal = chooser.showOpenDialog(parent);
-                if(returnVal == JFileChooser.APPROVE_OPTION) {
-                        try {
-                                KeyTool kt = new KeyTool();
-                                kt.importCert(chooser.getSelectedFile());
-                                repopulateTable();
-                        } catch (Exception ex) {
-                                // TODO: handle exception
-                                ex.printStackTrace();
-                        }
-                }
-        }
-    }
-
-        private class ExportButtonListener implements ActionListener {
-                public void actionPerformed(ActionEvent e) {
-                        //For now, let's just export in -rfc mode as keytool does.
-                        //we'll write to a file the exported certificate.
-
-
-                        try {
-                                int selectedRow = table.getSelectedRow();
-                                if (selectedRow != -1) {
-                                JFileChooser chooser = new JFileChooser();
-                                int returnVal = chooser.showOpenDialog(parent);
-                                if(returnVal == JFileChooser.APPROVE_OPTION) {
-                                        String alias = keyStore.getCertificateAlias(certs
-                                                        .get(selectedRow));
-                                        if (alias != null) {
-                                                Certificate c = keyStore.getCertificate(alias);
-                                                PrintStream ps = new PrintStream(chooser.getSelectedFile().getAbsolutePath());
-                                                KeyTool.dumpCert(c, ps);
-                                                repopulateTable();
-                                        }
-                                }
-                                }
-                        } catch (Exception ex) {
-                                // TODO
-                                ex.printStackTrace();
-                        }
-                }
-        }
-
-        private class RemoveButtonListener implements ActionListener {
-
-                /**
-                 * Removes a certificate from the keyStore and writes changes to disk.
-                 */
-        public void actionPerformed(ActionEvent e) {
-
-                try {
-                        int selectedRow = table.getSelectedRow();
-
-                        if (selectedRow != -1){
-                                String alias = keyStore.getCertificateAlias(certs.get(selectedRow));
-                                if (alias != null) {
-
-                                        int i = JOptionPane.showConfirmDialog(parent,
-                                                        "Are you sure you want to remove the selected certificate?",
-                                                        "Confirmation - Remove Certificate?",
-                                                        JOptionPane.YES_NO_OPTION);
-                                        if (i == 0) {
-                                                keyStore.deleteEntry(alias);
-                                                FileOutputStream fos = new FileOutputStream(
-                                                        SecurityUtil.getTrustedCertsFilename());
-                                                keyStore.store(fos, SecurityUtil.getTrustedCertsPassword());
-                                                fos.close();
-                                        }
-                                }
-                                repopulateTable();
-                        }
-                } catch (Exception ex) {
-                        // TODO
-                                ex.printStackTrace();
-                }
-
-        }
-    }
-
-        private class DetailsButtonListener implements ActionListener {
-
-                /**
-                 * Shows the details of a trusted certificate.
-                 */
-        public void actionPerformed(ActionEvent e) {
-
-                int selectedRow = table.getSelectedRow();
-                if (selectedRow != -1 && selectedRow >= 0) {
-                        X509Certificate c = certs.get(selectedRow);
-                        SecurityWarningDialog.showSingleCertInfoDialog(c, parent);
-                }
-        }
-    }
-
-        private class CloseButtonListener implements ActionListener {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                parent.dispose();
-            }
-        }
-
-}
--- a/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/* CertificateViewer.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.security.viewer;
-
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Toolkit;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import javax.swing.JDialog;
-import javax.swing.UIManager;
-
-public class CertificateViewer extends JDialog {
-
-    private boolean initialized = false;
-    private static final String dialogTitle = "Certificates";
-
-    CertificatePane panel;
-
-        public CertificateViewer() {
-            super((Frame)null, dialogTitle, true);
-
-        Container contentPane = getContentPane();
-        contentPane.setLayout(new BorderLayout());
-
-        panel = new CertificatePane(this);
-
-        add(panel);
-
-        pack();
-
-        WindowAdapter adapter = new WindowAdapter() {
-            private boolean gotFocus = false;
-
-            public void windowGainedFocus(WindowEvent we) {
-                // Once window gets focus, set initial focus
-                if (!gotFocus) {
-                    panel.focusOnDefaultButton();
-                    gotFocus = true;
-                }
-            }
-        };
-        addWindowFocusListener(adapter);
-
-                initialized = true;
-        }
-
-        public boolean isInitialized(){
-                return initialized;
-        }
-
-        private void centerDialog() {
-                Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
-                Dimension dialogSize = getSize();
-
-                setLocation((screen.width - dialogSize.width)/2,
-                        (screen.height - dialogSize.height)/2);
-        }
-
-
-        public static void showCertificateViewer() throws Exception {
-            setSystemLookAndFeel();
-
-                CertificateViewer cv = new CertificateViewer();
-                cv.setResizable(true);
-                cv.centerDialog();
-                cv.setVisible(true);
-                cv.dispose();
-        }
-
-    private static void setSystemLookAndFeel() {
-        try {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Exception e) {
-            // don't worry if we can't.
-        }
-    }
-
-        public static void main(String[] args) throws Exception {
-                CertificateViewer.showCertificateViewer();
-        }
-}
--- a/netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.services;
-
-import javax.jnlp.SingleInstanceService;
-
-import net.sourceforge.jnlp.JNLPFile;
-
-/**
- * Extends SingleInstanceService to provide a few additional methods that are
- * required to initialize SingleInstanceService and check things. These methods
- * are not exposed publicly
- *
- * @author <a href="mailto:omajid@redhat.com">Omair Majid</a>
- *
- */
-interface ExtendedSingleInstanceService extends SingleInstanceService {
-
-    /**
-     * Check if the instance identified by this jnlp file is already running
-     *
-     * @param jnlpFile The JNLPFile that specifies the application
-     *
-     * @throws InstanceExistsException if an instance of this application
-     *         already exists
-     *
-     */
-    void checkSingleInstanceRunning(JNLPFile jnlpFile);
-
-    /**
-     * Start a single instance service based on the current application
-     */
-    void initializeSingleInstance();
-
-}
--- a/netx/net/sourceforge/jnlp/services/InstanceExistsException.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.services;
-
-/**
- *
- * This class represents an exception indicating that an application instance
- * already exists for this jnlp file
- *
- * @author <a href="mailto:omajid@redhat.com">Omair Majid</a>
- *
- */
-public class InstanceExistsException extends RuntimeException {
-
-    private static final long serialVersionUID = 7950552292795498272L;
-
-    public InstanceExistsException(String message) {
-        super(message);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/ServiceUtil.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.services;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import javax.jnlp.BasicService;
-import javax.jnlp.ClipboardService;
-import javax.jnlp.DownloadService;
-import javax.jnlp.ExtensionInstallerService;
-import javax.jnlp.FileOpenService;
-import javax.jnlp.FileSaveService;
-import javax.jnlp.PersistenceService;
-import javax.jnlp.PrintService;
-import javax.jnlp.ServiceManager;
-import javax.jnlp.SingleInstanceService;
-import javax.jnlp.UnavailableServiceException;
-
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.runtime.ApplicationInstance;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.security.SecurityWarningDialog;
-
-/**
- * Provides static methods to interact useful for using the JNLP
- * services.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- * @version $Revision: 1.8 $
- */
-public class ServiceUtil {
-
-    private static String R(String key) {
-        return JNLPRuntime.getMessage(key);
-    }
-
-    /**
-     * Returns the BasicService reference, or null if the service is
-     * unavailable.
-     */
-    public static BasicService getBasicService() {
-        return (BasicService) getService("javax.jnlp.BasicService");
-    }
-
-    /**
-     * Returns the ClipboardService reference, or null if the service is
-     * unavailable.
-     */
-    public static ClipboardService getClipboardService() {
-        return (ClipboardService) getService("javax.jnlp.ClipboardService");
-    }
-
-    /**
-     * Returns the DownloadService reference, or null if the service is
-     * unavailable.
-     */
-    public static DownloadService getDownloadService() {
-        return (DownloadService) getService("javax.jnlp.DownloadService");
-    }
-
-    /**
-     * Returns the ExtensionInstallerService reference, or null if the service is
-     * unavailable.
-     */
-    public static ExtensionInstallerService getExtensionInstallerService() {
-        return (ExtensionInstallerService) getService("javax.jnlp.ExtensionInstallerService");
-    }
-
-    /**
-     * Returns the FileOpenService reference, or null if the service is
-     * unavailable.
-     */
-    public static FileOpenService getFileOpenService() {
-        return (FileOpenService) getService("javax.jnlp.FileOpenService");
-    }
-
-    /**
-     * Returns the FileSaveService reference, or null if the service is
-     * unavailable.
-     */
-    public static FileSaveService getFileSaveService() {
-        return (FileSaveService) getService("javax.jnlp.FileSaveService");
-    }
-
-    /**
-     * Returns the PersistenceService reference, or null if the service is
-     * unavailable.
-     */
-    public static PersistenceService getPersistenceService() {
-        return (PersistenceService) getService("javax.jnlp.PersistenceService");
-    }
-
-    /**
-     * Returns the PrintService reference, or null if the service is
-     * unavailable.
-     */
-    public static PrintService getPrintService() {
-        return (PrintService) getService("javax.jnlp.PrintService");
-    }
-
-    /**
-     * Returns the SingleInstanceService reference, or null if the service is
-     * unavailable.
-     */
-    public static SingleInstanceService getSingleInstanceService() {
-        return (SingleInstanceService) getService("javax.jnlp.SingleInstanceService");
-    }
-
-    /**
-     * Checks that this application (represented by the jnlp) isnt already running
-     * @param jnlpFile the {@link JNLPFile} that specifies the application
-     *
-     * @throws InstanceExistsException if an instance of this application already exists
-     */
-    public static void checkExistingSingleInstance(JNLPFile jnlpFile) {
-        ExtendedSingleInstanceService esis = (ExtendedSingleInstanceService) getSingleInstanceService();
-        esis.checkSingleInstanceRunning(jnlpFile);
-    }
-
-    /**
-     * Returns the service, or null instead of an UnavailableServiceException
-     */
-    private static Object getService(String name) {
-        try {
-            return ServiceManager.lookup(name);
-        }
-        catch (UnavailableServiceException ex) {
-            return null;
-        }
-    }
-
-    /**
-     * Creates a Proxy object implementing the specified interface
-     * when makes all calls in the security context of the system
-     * classes (ie, AllPermissions).  This means that the services
-     * must be more than extremely careful in the operations they
-     * perform.
-     */
-    static Object createPrivilegedProxy(Class iface, final Object receiver) {
-        return java.lang.reflect.Proxy.newProxyInstance(XServiceManagerStub.class.getClassLoader(),
-                new Class[] { iface },
-                new PrivilegedHandler(receiver));
-    }
-
-    /**
-     * calls the object's method using privileged access
-     */
-    private static class PrivilegedHandler implements InvocationHandler {
-        private final Object receiver;
-
-        PrivilegedHandler(Object receiver) {
-            this.receiver = receiver;
-        }
-
-        public Object invoke(Object proxy, final Method method, final Object[] args) throws Throwable {
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("call privileged method: "+method.getName());
-                if (args != null)
-                    for (int i=0; i < args.length; i++)
-                        System.err.println("           arg: "+args[i]);
-            }
-
-            PrivilegedExceptionAction invoker = new PrivilegedExceptionAction() {
-                public Object run() throws Exception {
-                    return method.invoke(receiver, args);
-                }
-            };
-
-            try {
-                Object result = AccessController.doPrivileged(invoker);
-
-                if (JNLPRuntime.isDebug())
-                    System.err.println("        result: "+result);
-
-                return result;
-            } catch (PrivilegedActionException e) {
-                // Any exceptions thrown by the actual methods are wrapped by a
-                // InvocationTargetException, which is further wrapped by the
-                // PrivilegedActionException. Lets unwrap them to make the
-                // proxy transparent to the callers
-                if (e.getCause() instanceof InvocationTargetException) {
-                    throw e.getCause().getCause();
-                } else {
-                    throw e.getCause();
-                }
-            }
-
-        }
-    };
-
-    /**
-     * Returns whether the app requesting a service is signed. If the app is
-     * unsigned, the user is prompted with a dialog asking if the action
-     * should be allowed.
-     * @param type the type of access being requested
-     * @param extras extra Strings (usually) that are passed to the dialog for
-     * message formatting.
-     * @return true if the access was granted, false otherwise.
-     */
-    public static boolean checkAccess(SecurityWarningDialog.AccessType type,
-            Object... extras) {
-        return checkAccess(null, type, extras);
-    }
-
-    /**
-     * Returns whether the app requesting a service has the right permissions.
-     * If it doesn't, user is prompted for permissions.
-     *
-     * @param app the application which is requesting the check. If null, the current
-     * application is used.
-     * @param type the type of access being requested
-     * @param extras extra Strings (usually) that are passed to the dialog for
-     * message formatting.
-     * @return true if the access was granted, false otherwise.
-     */
-    public static boolean checkAccess(ApplicationInstance app,
-            SecurityWarningDialog.AccessType type,
-                Object... extras) {
-
-        if (app == null)
-                app = JNLPRuntime.getApplication();
-
-        boolean codeTrusted = true;
-
-        StackTraceElement[] stack =  Thread.currentThread().getStackTrace();
-
-        for (int i=0; i < stack.length; i++) {
-
-                Class c = null;
-
-                try {
-                        c = Class.forName(stack[i].getClassName());
-                } catch (Exception e1) {
-                        try {
-                                c = Class.forName(stack[i].getClassName(), false, app.getClassLoader());
-                        } catch (Exception e2) {
-                                System.err.println(e2.getMessage());
-                        }
-                }
-
-            // Everything up to the desired class/method must be trusted
-            if (c == null || // class not found
-                        ( c.getProtectionDomain().getCodeSource() != null && // class is not in bootclasspath
-                          c.getProtectionDomain().getCodeSource().getCodeSigners() == null) // class is trusted
-                        ) {
-                codeTrusted = false;
-            }
-        }
-
-        if (!codeTrusted) {
-                final SecurityWarningDialog.AccessType tmpType = type;
-                final Object[] tmpExtras = extras;
-                final ApplicationInstance tmpApp = app;
-
-                //We need to do this to allow proper icon loading for unsigned
-                //applets, otherwise permissions won't be granted to load icons
-                //from resources.jar.
-                Boolean b = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
-                    public Boolean run() {
-                        boolean b = SecurityWarningDialog.showAccessWarningDialog(tmpType,
-                                tmpApp.getJNLPFile(), tmpExtras);
-                        return new Boolean(b);
-                    }
-                });
-
-                return b.booleanValue();
-        }
-
-        return true; //allow
-    }
-}
--- a/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.services;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.BindException;
-import java.net.ServerSocket;
-
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.util.FileUtils;
-
-/**
- * This class represents a Lock for single instance jnlp applications
- *
- * The lock is per-session, per user.
- *
- * @author <a href="mailto:omajid@redhat.com">Omair Majid</a>
- */
-class SingleInstanceLock {
-
-    JNLPFile jnlpFile;
-    File lockFile = null;
-
-    public static final int INVALID_PORT = Integer.MIN_VALUE;
-
-    int port = INVALID_PORT;
-
-    /**
-     * Create an object to manage the instance lock for the specified JNLP file.
-     *
-     * @param jnlpFile the jnlpfile to create the lock for
-     */
-    public SingleInstanceLock(JNLPFile jnlpFile) {
-        this.jnlpFile = jnlpFile;
-        lockFile = getLockFile();
-
-    }
-
-    /**
-     * Create/overwrite the instance lock for the jnlp file.
-     *
-     * @param localPort the network port for the lock
-     * @throws IOException on any io problems
-     */
-    public void createWithPort(int localPort) throws IOException {
-
-        BufferedWriter lockFileWriter = new BufferedWriter(new FileWriter(lockFile, false));
-        lockFileWriter.write(String.valueOf(localPort));
-        lockFileWriter.newLine();
-        lockFileWriter.flush();
-        lockFileWriter.close();
-
-    }
-
-    /**
-     * Returns true if the lock if valid. That is, the lock exists, and port it
-     * points to is listening for incoming messages.
-     */
-    public boolean isValid() {
-        return (exists() && getPort() != INVALID_PORT && !isPortFree(getPort()));
-    }
-
-    /**
-     * Returns the port in this lock file.
-     */
-    public int getPort() {
-        if (!exists()) {
-            return INVALID_PORT;
-        }
-
-        try {
-            parseFile();
-        } catch (NumberFormatException e) {
-            port = INVALID_PORT;
-        } catch (IOException e) {
-            port = INVALID_PORT;
-        }
-        return port;
-
-    }
-
-    /**
-     * Returns true if the lock file already exists.
-     */
-    private boolean exists() {
-        return lockFile.exists();
-    }
-
-    /**
-     * Returns true if the port is free.
-     */
-    private boolean isPortFree(int port) {
-        try {
-            ServerSocket socket = new ServerSocket(port);
-            socket.close();
-            return true;
-        } catch (BindException e) {
-            return false;
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Return a file object that represents the lock file. The lock file itself
-     * may or may not exist.
-     */
-    private File getLockFile() {
-        File baseDir = new File(JNLPRuntime.LOCKS_DIR);
-
-        if (!baseDir.isDirectory() && !baseDir.mkdirs()) {
-            throw new RuntimeException(R("RNoLockDir", baseDir));
-        }
-        String lockFileName = getLockFileName();
-        File applicationLockFile = new File(baseDir, lockFileName);
-        return applicationLockFile;
-    }
-
-    /**
-     * Returns the name of the lock file.
-     */
-    private String getLockFileName() {
-        String initialName = "";
-
-        if (jnlpFile.getSourceLocation() != null) {
-            initialName = initialName + jnlpFile.getSourceLocation();
-        } else {
-            initialName = initialName + jnlpFile.getFileLocation();
-        }
-
-        if (jnlpFile.getFileVersion() != null) {
-            initialName = initialName + jnlpFile.getFileVersion().toString();
-        }
-
-        initialName = initialName + getCurrentDisplay();
-        return FileUtils.sanitizeFileName(initialName);
-
-    }
-
-    /**
-     * Parse the lock file.
-     *
-     * @throws NumberFormatException
-     * @throws IOException
-     */
-    private void parseFile() throws NumberFormatException, IOException {
-        BufferedReader lockFileReader = new BufferedReader(new FileReader(lockFile));
-        int port = Integer.valueOf(lockFileReader.readLine());
-        lockFileReader.close();
-        this.port = port;
-    }
-
-    /**
-     * Returns a string identifying this display.
-     *
-     * Implementation note: On systems with X support, this is the DISPLAY
-     * variable
-     *
-     * @return a string that is guaranteed to be not null.
-     */
-    private String getCurrentDisplay() {
-        String display = System.getenv("DISPLAY");
-        return (display == null) ? "" : display;
-    }
-
-    private static String R(String key) {
-        return JNLPRuntime.getMessage(key);
-    }
-
-    private static String R(String key, Object param) {
-        return JNLPRuntime.getMessage(key, new Object[] { param });
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XBasicService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-// Copyright (C) 2001 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.services;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.jnlp.BasicService;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-
-import net.sourceforge.jnlp.InformationDesc;
-import net.sourceforge.jnlp.JARDesc;
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.Launcher;
-import net.sourceforge.jnlp.runtime.ApplicationInstance;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import net.sourceforge.jnlp.util.PropertiesFile;
-
-/**
- * The BasicService JNLP service.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.10 $
- */
-class XBasicService implements BasicService {
-
-    /** command used to exec the native browser */
-    private String command = null;
-
-    /** whether the command was loaded / prompted for */
-    private boolean initialized = false;
-
-
-    protected XBasicService() {
-    }
-
-    /**
-     * Returns the codebase of the application, applet, or
-     * installer.  If the codebase was not specified in the JNLP
-     * element then the main JAR's location is returned.  If no main
-     * JAR was specified then the location of the JAR containing the
-     * main class is returned.
-     */
-    public URL getCodeBase() {
-        ApplicationInstance app = JNLPRuntime.getApplication();
-
-        if (app != null) {
-            JNLPFile file = app.getJNLPFile();
-
-            // return the codebase.
-            if (file.getCodeBase() != null)
-                return file.getCodeBase();
-
-            // else return the main JAR's URL.
-            JARDesc mainJar = file.getResources().getMainJAR();
-            if (mainJar != null)
-                return mainJar.getLocation();
-
-            // else find JAR where main class was defined.
-            //
-            // JNLPFile file = app.getJNLPFile();
-            // String mainClass = file.getLaunchInfo().getMainClass()+".class";
-            // URL jarUrl = app.getClassLoader().getResource(mainClass);
-            // go through list of JARDesc to find one matching jarUrl
-        }
-
-        return null;
-    }
-
-    /**
-     * Return true if the Environment is Offline
-     */
-    public boolean isOffline() {
-
-        URL url = findFirstURLFromJNLPFile();
-
-        try {
-            url.openConnection().getInputStream().close();
-            return false;
-        } catch (IOException exception) {
-            return true;
-        }
-    }
-
-    /**
-     * Return the first URL from the jnlp file
-     * Or a default URL if no url found in JNLP file
-     */
-    private URL findFirstURLFromJNLPFile() {
-
-        ApplicationInstance app = JNLPRuntime.getApplication();
-
-        if (app != null) {
-            JNLPFile jnlpFile = app.getJNLPFile();
-
-            URL sourceURL = jnlpFile.getSourceLocation();
-            if (sourceURL != null) {
-                return sourceURL;
-            }
-
-            URL codeBaseURL = jnlpFile.getCodeBase();
-            if (codeBaseURL != null) {
-                return codeBaseURL;
-            }
-
-            InformationDesc informationDesc = jnlpFile.getInformation();
-            URL homePage = informationDesc.getHomepage();
-            if (homePage != null) {
-                return homePage;
-            }
-
-            JARDesc[] jarDescs = jnlpFile.getResources().getJARs();
-            for (JARDesc jarDesc: jarDescs) {
-                return jarDesc.getLocation();
-            }
-        }
-
-        // this section is only reached if the jnlp file has no jars.
-        // that doesnt seem very likely.
-        URL arbitraryURL;
-        try {
-            arbitraryURL = new URL("http://icedtea.classpath.org");
-        } catch (MalformedURLException malformedURL) {
-            throw new RuntimeException(malformedURL);
-        }
-
-        return arbitraryURL;
-    }
-
-    /**
-     * Return true if a Web Browser is Supported
-     */
-    public boolean isWebBrowserSupported() {
-        initialize();
-
-        return command != null;
-    }
-
-    /**
-     * Show a document.
-     *
-     * @return whether the document was opened
-     */
-    public boolean showDocument(URL url)  {
-        initialize();
-
-        if (url.toString().endsWith(".jnlp")) {
-            try {
-                new Launcher().launchExternal(url);
-                return true;
-            }
-            catch (Exception ex) {
-                return false;
-            }
-        }
-
-        if (command != null) {
-            try {
-                // this is bogus because the command may require options;
-                // should use a StreamTokenizer or similar to get tokens
-                // outside of quotes.
-                Runtime.getRuntime().exec(command + url.toString());
-                //Runtime.getRuntime().exec(new String[]{command,url.toString()});
-
-                return true;
-            }
-            catch(IOException ex){
-                if (JNLPRuntime.isDebug())
-                    ex.printStackTrace();
-            }
-        }
-
-        return false;
-    }
-
-    private void initialize() {
-        if (initialized)
-            return;
-        initialized = true;
-
-        if(isWindows()) {
-            command = "rundll32 url.dll,FileProtocolHandler ";
-        }
-        else {
-            PropertiesFile props = JNLPRuntime.getProperties();
-            command = props.getProperty("browser.command");
-
-            if(command == null) { // prompt & store
-                command = promptForCommand(null);
-
-                if(command != null) {
-                    props.setProperty("browser.command", command);
-                    props.store();
-                }
-            }
-        }
-    }
-
-    private boolean isWindows() {
-        String os = System.getProperty("os.name");
-        if(os != null && os.startsWith("Windows"))
-            return true;
-        else
-            return false;
-    }
-
-    private String promptForCommand(String cmd) {
-        return JOptionPane.showInputDialog(new JPanel(),
-                                           "Browser Location:",
-                                           "Specify Browser Location",
-                                           JOptionPane.PLAIN_MESSAGE
-                                          );
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XClipboardService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/* XClipboardService.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.services;
-
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.security.SecurityWarningDialog;
-
-import java.awt.datatransfer.Transferable;
-import java.awt.Toolkit;
-
-/**
- * The ClipboardService JNLP service.
- *
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- */
-class XClipboardService implements ClipboardService {
-
-        protected XClipboardService() {
-        }
-
-        /**
-         * Returns the contents of the system clipboard.
-         */
-        public java.awt.datatransfer.Transferable getContents(){
-
-                if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.CLIPBOARD_READ)) {
-                        Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
-                        return (Transferable) ServiceUtil.createPrivilegedProxy(
-                                Transferable.class, t);
-                } else {
-                        return null;
-                }
-        }
-
-        /**
-         * Sets the contents of the system clipboard.
-         */
-        public void setContents(java.awt.datatransfer.Transferable contents) {
-                if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.CLIPBOARD_WRITE)) {
-                        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
-                                contents, null);
-                }
-        }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XDownloadService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.services;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.ref.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-
-/**
- * The DownloadService JNLP service.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.7 $
- */
-class XDownloadService implements DownloadService {
-
-    protected XDownloadService() {
-    }
-
-    // comments copied from DownloadService interface
-
-    /**
-     * Returns a listener that will automatically display download
-     * progress to the user.
-     */
-    public DownloadServiceListener getDefaultProgressWindow() {
-        return null;
-    }
-
-    /**
-     * Returns whether the part in an extension (specified by the
-     * url and version) is cached locally.
-     */
-    public boolean isExtensionPartCached(URL ref, String version, String part) {
-        return true;
-    }
-
-    /**
-     * Returns whether the parts in an extension (specified by the
-     * url and version) are cached locally.
-     */
-    public boolean isExtensionPartCached(URL ref, String version, String[] parts) {
-        return true;
-    }
-
-    /**
-     * Returns whether the part of the calling application is cached
-     * locally.  If called by code specified by an extension
-     * descriptor, the specified part refers to the extension not
-     * the application.
-     */
-    public boolean isPartCached(String part) {
-        return true;
-    }
-
-    /**
-     * Returns whether all of the parts of the calling application
-     * are cached locally.  If called by code in an extension, the
-     * part refers the the part of the extension not the
-     * application.
-     */
-    public boolean isPartCached(String[] parts) {
-        return true;
-    }
-
-    /**
-     * Returns whether the resource is cached locally.  This method
-     * only returns true if the resource is specified by the calling
-     * application or extension.
-     */
-    public boolean isResourceCached(URL ref, String version) {
-        return true;
-    }
-
-    /**
-     * Downloads the parts of an extension.
-     *
-     * @throws IOException
-     */
-    public void loadExtensionPart(URL ref, String version, String[] parts, DownloadServiceListener progress) throws IOException {
-    }
-
-    /**
-     * Downloads a part of an extension.
-     *
-     * @throws IOException
-     */
-    public void loadExtensionPart(URL ref, String version, String part, DownloadServiceListener progress) throws IOException {
-    }
-
-    /**
-     * Downloads the parts.
-     *
-     * @throws IOException
-     */
-    public void loadPart(String[] parts, DownloadServiceListener progress) throws IOException {
-    }
-
-    /**
-     * Downloads the part.
-     *
-     * @throws IOException
-     */
-    public void loadPart(String part, DownloadServiceListener progress) throws IOException {
-    }
-
-    /**
-     * Downloads a resource.
-     *
-     * @throws IOException
-     */
-    public void loadResource(URL ref, String version, DownloadServiceListener progress) throws IOException {
-    }
-
-    /**
-     * Notify the system that an extension's part is no longer
-     * important to cache.
-     *
-     * @throws IOException
-     */
-    public void removeExtensionPart(URL ref, String version, String part) throws IOException {
-    }
-
-    /**
-     * Notify the system that an extension's parts are no longer
-     * important to cache.
-     *
-     * @throws IOException
-     */
-    public void removeExtensionPart(URL ref, String version, String[] parts) throws IOException {
-    }
-
-    /**
-     * Notifies the system that a part  is no longer important to
-     * cache.
-     *
-     * @throws IOException
-     */
-    public void removePart(String part) throws IOException {
-    }
-
-    /**
-     * Notifies the system that the parts  is no longer important to
-     * cache.
-     *
-     * @throws IOException
-     */
-    public void removePart(String[] parts) throws IOException {
-    }
-
-    /**
-     * Notifies the system that the resource is no longer important
-     * to cache.
-     *
-     * @throws IOException
-     */
-    public void removeResource(URL ref, String version) throws IOException {
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XExtendedService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.services;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.jnlp.ExtendedService;
-import javax.jnlp.FileContents;
-
-import net.sourceforge.jnlp.security.SecurityWarningDialog;
-
-/**
- * Implementation of ExtendedService
- *
- * @author <a href="mailto:omajid@redhat.com">Omair Majid</a>
- *
- */
-public class XExtendedService implements ExtendedService {
-
-    public FileContents openFile(File file) throws IOException {
-
-        if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.READ_FILE)) {
-            return (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class,
-                    new XFileContents(file));
-        } else {
-            return null;
-        }
-
-    }
-
-    public FileContents[] openFiles(File[] files) throws IOException {
-        FileContents[] contents = new FileContents[files.length];
-        for (int i = 0; i < files.length; i++) {
-            contents[i] = openFile(files[i]);
-        }
-        return contents;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.services;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.ref.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-
-/**
- * The ExtensionInstallerService JNLP service.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.6 $
- */
-class XExtensionInstallerService implements ExtensionInstallerService {
-
-    protected XExtensionInstallerService() {
-    }
-
-    /**
-     *
-     */
-    public URL getExtensionLocation() {
-        return null;
-    }
-
-    /**
-     *
-     */
-    public String getExtensionVersion() {
-        return null;
-    }
-
-    /**
-     *
-     */
-    public String getInstalledJRE(java.net.URL url, java.lang.String version) {
-        return null;
-    }
-
-    /**
-     *
-     */
-    public String getInstallPath() {
-        return null;
-    }
-
-    /**
-     *
-     */
-    public void hideProgressBar() {
-    }
-
-    /**
-     *
-     */
-    public void hideStatusWindow() {
-    }
-
-    /**
-     *
-     */
-    public void installFailed() {
-    }
-
-    /**
-     *
-     */
-    public void installSucceeded(boolean needsReboot) {
-    }
-
-    /**
-     *
-     */
-    public void setHeading(java.lang.String heading) {
-    }
-
-    /**
-     *
-     */
-    public void setJREInfo(java.lang.String platformVersion, java.lang.String jrePath) {
-    }
-
-    /**
-     *
-     */
-    public void setNativeLibraryInfo(java.lang.String path) {
-    }
-
-    /**
-     *
-     */
-    public void setStatus(java.lang.String status) {
-    }
-
-    /**
-     *
-     */
-    public void updateProgress(int value) {
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XFileContents.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.services;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.ref.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-/**
- * File contents.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.6 $
- */
-class XFileContents implements FileContents {
-
-    /** the file */
-    private File file;
-
-    /**
-     * Create a file contents implementation for the file.
-     */
-    protected XFileContents(File file) {
-        this.file = file;
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public boolean canRead() throws IOException {
-        return file.canRead();
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public boolean canWrite() throws IOException {
-        return file.canWrite();
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public InputStream getInputStream() throws IOException {
-        return new FileInputStream(file);
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public long getLength() throws IOException {
-        return file.length();
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public long getMaxLength() throws IOException {
-        return Long.MAX_VALUE;
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public String getName() throws IOException {
-        return file.getName();
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public OutputStream getOutputStream(boolean overwrite) throws IOException {
-        // file.getPath compatible with pre-1.4 JREs
-        return new FileOutputStream(file.getPath(), !overwrite);
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public JNLPRandomAccessFile getRandomAccessFile(String mode) throws IOException {
-        return new XJNLPRandomAccessFile(file, mode);
-    }
-
-    /**
-     *
-     * @throws IOException if an I/O exception occurs.
-     */
-    public long setMaxLength(long maxlength) throws IOException {
-        return maxlength;
-    }
-
-
-}
--- a/netx/net/sourceforge/jnlp/services/XFileOpenService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/* XFileOpenService.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.services;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.ref.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.runtime.*;
-import net.sourceforge.jnlp.security.SecurityWarningDialog;
-
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import java.security.*;
-
-/**
- * The FileOpenService JNLP service.
- *
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- */
-class XFileOpenService implements FileOpenService {
-
-    protected XFileOpenService() {
-    }
-
-    /**
-     * Prompts the user to select a single file.
-     */
-    public FileContents openFileDialog (java.lang.String pathHint,
-        java.lang.String[] extensions) throws java.io.IOException {
-
-        if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.READ_FILE)) {
-
-            //open a file dialog here, let the user choose the file.
-            JFileChooser chooser = new JFileChooser();
-            int chosen = chooser.showOpenDialog(null);
-            if (chosen == JFileChooser.APPROVE_OPTION) {
-                return (FileContents) ServiceUtil.createPrivilegedProxy(
-                           FileContents.class,
-                           new XFileContents(chooser.getSelectedFile()));
-            } else {
-                return null;
-            }
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Prompts the user to select one or more files.
-     */
-    public FileContents[] openMultiFileDialog (java.lang.String pathHint,
-            java.lang.String[] extensions) throws java.io.IOException {
-
-        if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.WRITE_FILE)) {
-            JFileChooser chooser = new JFileChooser();
-            chooser.setMultiSelectionEnabled(true);
-            int chosen = chooser.showOpenDialog(null);
-
-            if (chosen == JFileChooser.APPROVE_OPTION) {
-                File[] files = chooser.getSelectedFiles();
-                int length = files.length;
-                XFileContents[] xfiles = new XFileContents[length];
-                for (int i = 0; i < length; i++)
-                    xfiles[i] = new XFileContents(files[i]);
-                return (FileContents[]) ServiceUtil.createPrivilegedProxy(
-                           FileContents.class, xfiles);
-            } else {
-                return null;
-            }
-        } else {
-            return null;
-        }
-    }
-}
--- a/netx/net/sourceforge/jnlp/services/XFileSaveService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/* XFileSaveService.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
-*/
-
-package net.sourceforge.jnlp.services;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.ref.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.security.*;
-
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import java.security.*;
-
-/**
- * The FileSaveService JNLP service.
- *
- * @author <a href="mailto:jsumali@redhat.com">Joshua Sumali</a>
- */
-class XFileSaveService implements FileSaveService {
-
-    protected XFileSaveService() {
-    }
-
-    /**
-     * Prompts the user to save a file.
-     */
-    public FileContents saveFileDialog(java.lang.String pathHint,
-        java.lang.String[] extensions, java.io.InputStream stream,
-        java.lang.String name) throws java.io.IOException {
-
-        if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.WRITE_FILE)) {
-            JFileChooser chooser = new JFileChooser();
-            int chosen = chooser.showSaveDialog(null);
-
-            if (chosen == JFileChooser.APPROVE_OPTION) {
-                writeToFile(stream, chooser.getSelectedFile());
-                return (FileContents) ServiceUtil.createPrivilegedProxy(
-                           FileContents.class,
-                           new XFileContents(chooser.getSelectedFile()));
-            } else {
-                return null;
-            }
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Prompts the user to save a file, with an optional pre-set filename.
-     */
-    public FileContents saveAsFileDialog(java.lang.String pathHint,
-        java.lang.String[] extensions, FileContents contents) throws java.io.IOException {
-
-        if (ServiceUtil.checkAccess(SecurityWarningDialog.AccessType.WRITE_FILE)) {
-            JFileChooser chooser = new JFileChooser();
-            chooser.setSelectedFile(new File(contents.getName()));
-            int chosen = chooser.showSaveDialog(null);
-
-            if (chosen == JFileChooser.APPROVE_OPTION) {
-                writeToFile(contents.getInputStream(),
-                            chooser.getSelectedFile());
-
-                return (FileContents) ServiceUtil.createPrivilegedProxy(
-                           FileContents.class,
-                           new XFileContents(chooser.getSelectedFile()));
-            } else {
-                return null;
-            }
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Writes actual file to disk.
-     */
-    private void writeToFile(InputStream stream, File file) throws IOException {
-        if (!file.createNewFile()) { //file exists
-            boolean replace = (JOptionPane.showConfirmDialog(null,
-                                file.getAbsolutePath() + " already exists.\n"
-                +"Do you want to replace it?",
-                                "Warning - File Exists", JOptionPane.YES_NO_OPTION) == 0);
-            if (!replace)
-                return;
-        } else {
-            file.createNewFile();
-        }
-
-        if (file.canWrite()) {
-            FileOutputStream out = new FileOutputStream(file);
-            byte[] b = new byte[256];
-            int read = 0;
-            while ((read = stream.read(b)) > 0)
-                out.write(b, 0, read);
-            out.flush();
-            out.close();
-        } else {
-            throw new IOException("Unable to open file for writing");
-        }
-    }
-}
--- a/netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-/* XJNLPRandomAccessFile.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
- */
-package net.sourceforge.jnlp.services;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-
-import javax.jnlp.JNLPRandomAccessFile;
-
-public class XJNLPRandomAccessFile implements JNLPRandomAccessFile {
-
-        private RandomAccessFile raf;
-
-        public XJNLPRandomAccessFile(File file, String mode) {
-                try {
-                        raf = new RandomAccessFile(file, mode);
-                } catch (FileNotFoundException e) {
-                        // TODO Auto-generated catch block
-                        e.printStackTrace();
-                }
-        }
-
-        public void close() throws IOException {
-                raf.close();
-        }
-
-        public long getFilePointer() throws IOException {
-                return raf.getFilePointer();
-        }
-
-        public long length() throws IOException {
-                return raf.length();
-        }
-
-        public int read() throws IOException {
-                return raf.read();
-        }
-
-        public int read(byte[] b, int off, int len) throws IOException {
-                return raf.read(b, off, len);
-        }
-
-        public int read(byte[] b) throws IOException {
-                return raf.read(b);
-        }
-
-        public boolean readBoolean() throws IOException {
-                return raf.readBoolean();
-        }
-
-        public byte readByte() throws IOException {
-                return raf.readByte();
-        }
-
-        public char readChar() throws IOException {
-                return raf.readChar();
-        }
-
-        public double readDouble() throws IOException {
-                return raf.readDouble();
-        }
-
-        public float readFloat() throws IOException {
-                return raf.readFloat();
-        }
-
-        public void readFully(byte[] b) throws IOException {
-                raf.readFully(b);
-        }
-
-        public void readFully(byte[] b, int off, int len) throws IOException {
-                raf.readFully(b, off, len);
-        }
-
-        public int readInt() throws IOException {
-                return raf.readInt();
-        }
-
-        public String readLine() throws IOException {
-                return raf.readLine();
-        }
-
-        public long readLong() throws IOException {
-                return raf.readLong();
-        }
-
-        public short readShort() throws IOException {
-                return raf.readShort();
-        }
-
-        public String readUTF() throws IOException {
-                return raf.readUTF();
-        }
-
-        public int readUnsignedByte() throws IOException {
-                return raf.readUnsignedByte();
-        }
-
-        public int readUnsignedShort() throws IOException {
-                return raf.readUnsignedShort();
-        }
-
-        public void seek(long pos) throws IOException {
-                raf.seek(pos);
-        }
-
-        public void setLength(long newLength) throws IOException {
-                raf.setLength(newLength);
-        }
-
-        public int skipBytes(int n) throws IOException {
-                return raf.skipBytes(n);
-        }
-
-        public void write(int b) throws IOException {
-                raf.write(b);
-
-        }
-
-        public void write(byte[] b) throws IOException {
-                raf.write(b);
-        }
-
-        public void write(byte[] b, int off, int len) throws IOException {
-                raf.write(b, off, len);
-        }
-
-        public void writeBoolean(boolean v) throws IOException {
-                raf.writeBoolean(v);
-        }
-
-        public void writeByte(int v) throws IOException {
-                raf.writeByte(v);
-        }
-
-        public void writeBytes(String s) throws IOException {
-                raf.writeBytes(s);
-        }
-
-        public void writeChar(int v) throws IOException {
-                raf.writeChar(v);
-        }
-
-        public void writeChars(String s) throws IOException {
-                raf.writeChars(s);
-        }
-
-        public void writeDouble(double v) throws IOException {
-                raf.writeDouble(v);
-        }
-
-        public void writeFloat(float v) throws IOException {
-                raf.writeFloat(v);
-        }
-
-        public void writeInt(int v) throws IOException {
-                raf.writeInt(v);
-        }
-
-        public void writeLong(long v) throws IOException {
-                raf.writeLong(v);
-        }
-
-        public void writeShort(int v) throws IOException {
-                raf.writeShort(v);
-        }
-
-        public void writeUTF(String str) throws IOException {
-                raf.writeUTF(str);
-        }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XPersistenceService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.services;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.ref.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.cache.*;
-import net.sourceforge.jnlp.runtime.*;
-
-/**
- * The BasicService JNLP service.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.7 $
- */
-class XPersistenceService implements PersistenceService {
-
-    // todo: recheck delete, etc to make sure security is tight
-
-    protected XPersistenceService() {
-    }
-
-    /**
-     * Checks whether the application has access to URL area
-     * requested.  If the method returns normally then the specified
-     * location can be accessed by the current application.
-     *
-     * @throws MalformedURLException if the application cannot access the location
-     */
-    protected void checkLocation(URL location) throws MalformedURLException {
-        ApplicationInstance app = JNLPRuntime.getApplication();
-        if (app == null)
-            throw new MalformedURLException("Cannot determine the current application.");
-
-        URL source = app.getJNLPFile().getCodeBase();
-
-        if (!source.getHost().equalsIgnoreCase(location.getHost()))
-            throw new MalformedURLException("Cannot access data from a different host.");
-
-        // test for above codebase, not perfect but works for now
-
-        String requestPath = location.getFile();
-        if (-1 != requestPath.lastIndexOf("/"))
-            requestPath = requestPath.substring(0, requestPath.lastIndexOf("/"));
-        else
-            requestPath = "";
-
-        if (JNLPRuntime.isDebug()) {
-            System.out.println("codebase path: "+source.getFile());
-            System.out.println("request path: "+requestPath);
-        }
-
-        if (!source.getFile().startsWith(requestPath))
-            throw new MalformedURLException("Cannot access data below source URL path.");
-    }
-
-    /**
-     * Converts a URL into a file in the persistence store.
-     *
-     * @return the file
-     */
-    protected File toCacheFile(URL location) throws MalformedURLException {
-        return CacheUtil.urlToPath(location, "pcache");
-    }
-
-    /**
-     *
-     * @return the maximum size of storage that got granted, in bytes
-     * @throws MalformedURLException if the application cannot access the location
-     */
-    public long create(URL location, long maxsize) throws MalformedURLException, IOException {
-        checkLocation(location);
-
-        File file = toCacheFile(location);
-        file.getParentFile().mkdirs();
-
-        if (!file.createNewFile())
-            throw new IOException("File already exists.");
-
-        return maxsize;
-    }
-
-    /**
-     *
-     * @throws MalformedURLException if the application cannot access the location
-     */
-    public void delete(URL location) throws MalformedURLException, IOException {
-        checkLocation(location);
-
-        toCacheFile(location).delete();
-    }
-
-    /**
-     *
-     * @throws MalformedURLException if the application cannot access the location
-     */
-    public FileContents get(URL location) throws MalformedURLException, IOException, FileNotFoundException {
-        checkLocation(location);
-
-        File file = toCacheFile(location);
-        if (!file.exists())
-            throw new FileNotFoundException("Persistence store for "
-              + location.toString() + " is not found.");
-        file.getParentFile().mkdirs();
-
-        return (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class, new XFileContents(file));
-    }
-
-    /**
-     *
-     * @throws MalformedURLException if the application cannot access the location
-     */
-    public String[] getNames(URL location) throws MalformedURLException, IOException {
-        checkLocation(location);
-
-
-        File file = toCacheFile(location);
-        if (!file.isDirectory())
-            return new String[0];
-
-        List result = new ArrayList();
-
-        // check whether this is right: only add files and not directories.
-        File entries[] = file.listFiles();
-        for (int i=0; i < entries.length; i++)
-            if (entries[i].isFile())
-                result.add(entries[i].getName());
-
-        return (String[]) result.toArray(new String[result.size()]);
-    }
-
-    /**
-     *
-     * @throws MalformedURLException if the application cannot access the location
-     */
-    public int getTag(URL location) throws MalformedURLException, IOException {
-        checkLocation(location);
-
-        // todo: actually implement tags
-
-        if (toCacheFile(location).exists())
-            return PersistenceService.CACHED;
-
-        return PersistenceService.CACHED;
-    }
-
-    /**
-     *
-     * @throws MalformedURLException if the application cannot access the location
-     */
-    public void setTag(URL location, int tag) throws MalformedURLException, IOException {
-        checkLocation(location);
-
-        // todo: actually implement tags
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XPrintService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/* XPrintService.java
-   Copyright (C) 2008 Red Hat, Inc.
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
-
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
- */
-
-package net.sourceforge.jnlp.services;
-
-import java.awt.print.PageFormat;
-import java.awt.print.Pageable;
-import java.awt.print.Printable;
-import java.awt.print.PrinterException;
-import java.awt.print.PrinterJob;
-
-import javax.jnlp.*;
-import javax.swing.JOptionPane;
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-public class XPrintService implements PrintService {
-
-        // If pj is null, then we do not have a printer to use.
-        private PrinterJob pj;
-
-        public XPrintService() {
-                pj = PrinterJob.getPrinterJob();
-        }
-
-        public PageFormat getDefaultPage() {
-                if (pj != null)
-                        return pj.defaultPage();
-                else {
-                        showWarning();
-                        return new PageFormat(); // might not have default settings.
-                }
-        }
-
-        public PageFormat showPageFormatDialog(PageFormat page) {
-                if (pj != null)
-                        return pj.pageDialog(page);
-                else {
-                        showWarning();
-                        return page;
-                }
-
-        }
-
-        public boolean print(Pageable document) {
-                if (pj != null) {
-                        pj.setPageable(document);
-                        if (pj.printDialog()) {
-                                try {
-                                        pj.print();
-                                        return true;
-                                } catch(PrinterException pe) {
-                                        System.err.println("Could not print: " + pe);
-                                        return false;
-                                }
-                        }
-                } else
-                        showWarning();
-
-                return false;
-        }
-
-        public boolean print(Printable painter) {
-                if (pj != null) {
-                        pj.setPrintable(painter);
-                        if (pj.printDialog()) {
-                                try {
-                                        pj.print();
-                                        return true;
-                                } catch(PrinterException pe) {
-                                        System.err.println("Could not print: " + pe);
-                                        return false;
-                                }
-
-                        }
-                } else
-                        showWarning();
-
-                return false;
-        }
-
-        private void showWarning() {
-                JOptionPane.showMessageDialog(null,
-                                "Unable to find a default printer.",
-                                "Warning",
-                                JOptionPane.WARNING_MESSAGE);
-                System.err.println("Unable to print: Unable to find default printer.");
-        }
-}
--- a/netx/net/sourceforge/jnlp/services/XServiceManagerStub.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.services;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.lang.ref.*;
-import java.lang.reflect.*;
-import java.security.*;
-import javax.jnlp.*;
-
-import net.sourceforge.jnlp.*;
-
-/**
- * Lookup table for services.
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.6 $
- */
-public class XServiceManagerStub implements ServiceManagerStub {
-
-    // todo: only include ExtensionInstallerService if an installer
-    // is getting the service, otherwise return null.
-
-    // todo: fix services to do their own privileged actions that
-    // run less code in the secure environment (or avoid privileged
-    // actions by giving permission to the code source).
-
-        private static String serviceNames[] = {
-        "javax.jnlp.BasicService", // required
-        "javax.jnlp.DownloadService", // required
-        "javax.jnlp.ExtendedService",
-        "javax.jnlp.ExtensionInstallerService", // required
-        "javax.jnlp.PersistenceService",
-        "javax.jnlp.FileOpenService",
-        "javax.jnlp.FileSaveService",
-        "javax.jnlp.ClipboardService",
-        "javax.jnlp.PrintService",
-        "javax.jnlp.SingleInstanceService"
-    };
-
-    private static Object services[] = {
-        ServiceUtil.createPrivilegedProxy(BasicService.class, new XBasicService()),
-        ServiceUtil.createPrivilegedProxy(DownloadService.class, new XDownloadService()),
-        ServiceUtil.createPrivilegedProxy(ExtendedService.class, new XExtendedService()),
-        ServiceUtil.createPrivilegedProxy(ExtensionInstallerService.class, new XExtensionInstallerService()),
-        ServiceUtil.createPrivilegedProxy(PersistenceService.class, new XPersistenceService()),
-        ServiceUtil.createPrivilegedProxy(FileOpenService.class, new XFileOpenService()),
-        ServiceUtil.createPrivilegedProxy(FileSaveService.class, new XFileSaveService()),
-        ServiceUtil.createPrivilegedProxy(ClipboardService.class, new XClipboardService()),
-        ServiceUtil.createPrivilegedProxy(PrintService.class, new XPrintService()),
-        ServiceUtil.createPrivilegedProxy(ExtendedSingleInstanceService.class, new XSingleInstanceService())
-    };
-
-
-    public XServiceManagerStub() {
-    }
-
-    /**
-     * Returns the service names.
-     */
-    public String[] getServiceNames() {
-        // make sure it is a copy because we might be returning to
-        // code we don't own.
-        String result[] = new String[serviceNames.length];
-        System.arraycopy(serviceNames, 0, result, 0, serviceNames.length);
-
-        return result;
-    }
-
-    /**
-     * Returns the service.
-     *
-     * @throws UnavailableServiceException if service is not available
-     */
-    public Object lookup(String name) throws UnavailableServiceException {
-        // exact match
-        for (int i=0; i < serviceNames.length; i++)
-            if (serviceNames[i].equals(name))
-                return services[i];
-
-        // substring match
-        for (int i=0; i < serviceNames.length; i++)
-            if (-1 != serviceNames[i].indexOf(name))
-                return services[i];
-
-        throw new UnavailableServiceException(""+name);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/XSingleInstanceService.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.services;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.jnlp.SingleInstanceListener;
-import javax.management.InstanceAlreadyExistsException;
-
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-/**
- * This class implements SingleInstanceService
- *
- * @author <a href="mailto:omajid@redhat.com">Omair Majid</a>
- */
-public class XSingleInstanceService implements ExtendedSingleInstanceService {
-
-    boolean initialized = false;
-    List<SingleInstanceListener> listeners = new LinkedList<SingleInstanceListener>();
-
-    /**
-     * Implements a server that listens for arguments from new instances of this
-     * application
-     *
-     */
-    class SingleInstanceServer implements Runnable {
-
-        SingleInstanceLock lockFile = null;
-
-        public SingleInstanceServer(SingleInstanceLock lockFile) {
-            this.lockFile = lockFile;
-        }
-
-        public void run() {
-            ServerSocket listeningSocket = null;
-            try {
-                listeningSocket = new ServerSocket(0);
-                lockFile.createWithPort(listeningSocket.getLocalPort());
-
-                if (JNLPRuntime.isDebug()) {
-                    System.out.println("Starting SingleInstanceServer on port" + listeningSocket);
-                }
-
-                while (true) {
-                    try {
-                        Socket communicationSocket = listeningSocket.accept();
-                        ObjectInputStream ois = new ObjectInputStream(communicationSocket
-                                .getInputStream());
-                        String[] arguments = (String[]) ois.readObject();
-                        notifySingleInstanceListeners(arguments);
-                    } catch (Exception exception) {
-                        // not much to do here...
-                        exception.printStackTrace();
-                    }
-
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            } finally {
-                if (listeningSocket != null) {
-                    try {
-                        listeningSocket.close();
-                    } catch (IOException e) {
-                        // Give up.
-                        e.printStackTrace();
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Create a new XSingleInstanceService
-     */
-    protected XSingleInstanceService() {
-    }
-
-    /**
-     * Initialize the new SingleInstanceService
-     *
-     * @throws InstanceAlreadyExistsException if the instance already exists
-     */
-    public void initializeSingleInstance() {
-        if (!initialized) {
-            // this is called after the application has started. so safe to use
-            // JNLPRuntime.getApplication()
-            checkSingleInstanceRunning(JNLPRuntime.getApplication().getJNLPFile());
-            initialized = true;
-            SingleInstanceLock lockFile;
-            JNLPFile jnlpFile = JNLPRuntime.getApplication().getJNLPFile();
-            lockFile = new SingleInstanceLock(jnlpFile);
-            if (!lockFile.isValid()) {
-                startListeningServer(lockFile);
-            }
-        }
-
-    }
-
-    /**
-     * Check if another instance of this application is already running
-     *
-     * @param jnlpFile The {@link JNLPFile} that specifies the application
-     *
-     * @throws InstanceExistsException if an instance of this application
-     *         already exists
-     */
-    public void checkSingleInstanceRunning(JNLPFile jnlpFile) {
-        SingleInstanceLock lockFile = new SingleInstanceLock(jnlpFile);
-        if (lockFile.isValid()) {
-            int port = lockFile.getPort();
-            if (JNLPRuntime.isDebug()) {
-                System.out.println("Lock file is valid (port=" + port + "). Exiting.");
-            }
-            try {
-                sendProgramArgumentsToExistingApplication(port, jnlpFile.getApplication()
-                        .getArguments());
-                throw new InstanceExistsException(String.valueOf(port));
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    /**
-     * Start the listening server to accept arguments from new instances of
-     * applications
-     *
-     * @param lockFile
-     *            the {@link SingleInstanceLock} that the server should use
-     */
-    private void startListeningServer(SingleInstanceLock lockFile) {
-        SingleInstanceServer server = new SingleInstanceServer(lockFile);
-        Thread serverThread = new Thread(server);
-        /*
-         * mark as daemon so the JVM can shutdown if the server is the only
-         * thread running
-         */
-        serverThread.setDaemon(true);
-        serverThread.start();
-    }
-
-    /**
-     * Send the arguments for this application to the main instance
-     *
-     * @param port the port at which the SingleInstanceServer is listening at
-     * @param arguments the new arguments
-     * @throws IOException on any io exception
-     */
-    private void sendProgramArgumentsToExistingApplication(int port, String[] arguments)
-            throws IOException {
-        try {
-            Socket serverCommunicationSocket = new Socket((String) null, port);
-            ObjectOutputStream argumentStream = new ObjectOutputStream(serverCommunicationSocket
-                    .getOutputStream());
-            argumentStream.writeObject(arguments);
-            argumentStream.close();
-            serverCommunicationSocket.close();
-
-        } catch (UnknownHostException unknownHost) {
-            if (JNLPRuntime.isDebug()) {
-                System.out.println("Unable to find localhost");
-            }
-            throw new RuntimeException(unknownHost);
-        }
-    }
-
-    /**
-     * Notify any SingleInstanceListener with new arguments
-     *
-     * @param arguments the new arguments to the application
-     */
-    private void notifySingleInstanceListeners(String[] arguments) {
-        for (SingleInstanceListener listener : listeners) {
-            // TODO this proxy is privileged. should i worry about security in
-            // methods being called?
-            listener.newActivation(arguments);
-        }
-    }
-
-    /**
-     * Add the specified SingleInstanceListener
-     *
-     * @throws InstanceExistsException, which is likely to terminate the
-     *         application but not guaranteed to
-     */
-    public void addSingleInstanceListener(SingleInstanceListener sil) {
-        initializeSingleInstance();
-
-        if (sil == null) {
-            return;
-        }
-
-        listeners.add(sil);
-    }
-
-    /**
-     * Remove the specified SingleInstanceListener
-     *
-     * @throws InstanceExistsException if an instance of this single instance
-     *         application already exists
-     *
-     */
-    public void removeSingleInstanceListener(SingleInstanceListener sil) {
-        initializeSingleInstance();
-
-        if (sil == null) {
-            return;
-        }
-
-        listeners.remove(sil);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/services/package.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-This package contains the classes that implement the standard
-services defined by the JNLP specification.
-
-<h2>Package Specification</h2>
-
-<ul>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/download-spec.html">JNLP specification</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-<li><a target="_top" href="http://jnlp.sourceforge.net/netx/">Netx JNLP Client</a>
-<li><a target="_top" href="http://java.sun.com/products/javawebstart/">Java Web Start JNLP Client</a>
-</ul>
-
-<!-- Put @see and @since tags down here. -->
-
-</body>
-</html>
-
-
--- a/netx/net/sourceforge/jnlp/tools/CharacterEncoder.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-/*
- * Copyright 1995-2005 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package net.sourceforge.jnlp.tools;
-
-import java.io.InputStream;
-import java.io.ByteArrayInputStream;
-import java.io.OutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-
-/**
- * This class defines the encoding half of character encoders.
- * A character encoder is an algorithim for transforming 8 bit binary
- * data into text (generally 7 bit ASCII or 8 bit ISO-Latin-1 text)
- * for transmition over text channels such as e-mail and network news.
- *
- * The character encoders have been structured around a central theme
- * that, in general, the encoded text has the form:
- *
- * <pre>
- *      [Buffer Prefix]
- *      [Line Prefix][encoded data atoms][Line Suffix]
- *      [Buffer Suffix]
- * </pre>
- *
- * In the CharacterEncoder and CharacterDecoder classes, one complete
- * chunk of data is referred to as a <i>buffer</i>. Encoded buffers
- * are all text, and decoded buffers (sometimes just referred to as
- * buffers) are binary octets.
- *
- * To create a custom encoder, you must, at a minimum,  overide three
- * abstract methods in this class.
- * <DL>
- * <DD>bytesPerAtom which tells the encoder how many bytes to
- * send to encodeAtom
- * <DD>encodeAtom which encodes the bytes sent to it as text.
- * <DD>bytesPerLine which tells the encoder the maximum number of
- * bytes per line.
- * </DL>
- *
- * Several useful encoders have already been written and are
- * referenced in the See Also list below.
- *
- * @author      Chuck McManis
- * @see         CharacterDecoder;
- * @see         UCEncoder
- * @see         UUEncoder
- * @see         BASE64Encoder
- */
-public abstract class CharacterEncoder {
-
-    /** Stream that understands "printing" */
-    protected PrintStream pStream;
-
-    /** Return the number of bytes per atom of encoding */
-    abstract protected int bytesPerAtom();
-
-    /** Return the number of bytes that can be encoded per line */
-    abstract protected int bytesPerLine();
-
-    /**
-     * Encode the prefix for the entire buffer. By default is simply
-     * opens the PrintStream for use by the other functions.
-     */
-    protected void encodeBufferPrefix(OutputStream aStream) throws IOException {
-        pStream = new PrintStream(aStream);
-    }
-
-    /**
-     * Encode the suffix for the entire buffer.
-     */
-    protected void encodeBufferSuffix(OutputStream aStream) throws IOException {
-    }
-
-    /**
-     * Encode the prefix that starts every output line.
-     */
-    protected void encodeLinePrefix(OutputStream aStream, int aLength)
-    throws IOException {
-    }
-
-    /**
-     * Encode the suffix that ends every output line. By default
-     * this method just prints a <newline> into the output stream.
-     */
-    protected void encodeLineSuffix(OutputStream aStream) throws IOException {
-        pStream.println();
-    }
-
-    /** Encode one "atom" of information into characters. */
-    abstract protected void encodeAtom(OutputStream aStream, byte someBytes[],
-                int anOffset, int aLength) throws IOException;
-
-    /**
-     * This method works around the bizarre semantics of BufferedInputStream's
-     * read method.
-     */
-    protected int readFully(InputStream in, byte buffer[])
-        throws java.io.IOException {
-        for (int i = 0; i < buffer.length; i++) {
-            int q = in.read();
-            if (q == -1)
-                return i;
-            buffer[i] = (byte)q;
-        }
-        return buffer.length;
-    }
-
-    /**
-     * Encode bytes from the input stream, and write them as text characters
-     * to the output stream. This method will run until it exhausts the
-     * input stream, but does not print the line suffix for a final
-     * line that is shorter than bytesPerLine().
-     */
-    public void encode(InputStream inStream, OutputStream outStream)
-        throws IOException {
-        int     j;
-        int     numBytes;
-        byte    tmpbuffer[] = new byte[bytesPerLine()];
-
-        encodeBufferPrefix(outStream);
-
-        while (true) {
-            numBytes = readFully(inStream, tmpbuffer);
-            if (numBytes == 0) {
-                break;
-            }
-            encodeLinePrefix(outStream, numBytes);
-            for (j = 0; j < numBytes; j += bytesPerAtom()) {
-
-                if ((j + bytesPerAtom()) <= numBytes) {
-                    encodeAtom(outStream, tmpbuffer, j, bytesPerAtom());
-                } else {
-                    encodeAtom(outStream, tmpbuffer, j, (numBytes)- j);
-                }
-            }
-            if (numBytes < bytesPerLine()) {
-                break;
-            } else {
-                encodeLineSuffix(outStream);
-            }
-        }
-        encodeBufferSuffix(outStream);
-    }
-
-    /**
-     * Encode the buffer in <i>aBuffer</i> and write the encoded
-     * result to the OutputStream <i>aStream</i>.
-     */
-    public void encode(byte aBuffer[], OutputStream aStream)
-    throws IOException {
-        ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
-        encode(inStream, aStream);
-    }
-
-    /**
-     * A 'streamless' version of encode that simply takes a buffer of
-     * bytes and returns a string containing the encoded buffer.
-     */
-    public String encode(byte aBuffer[]) {
-        ByteArrayOutputStream   outStream = new ByteArrayOutputStream();
-        ByteArrayInputStream    inStream = new ByteArrayInputStream(aBuffer);
-        String retVal = null;
-        try {
-            encode(inStream, outStream);
-            // explicit ascii->unicode conversion
-            retVal = outStream.toString("8859_1");
-        } catch (Exception IOException) {
-            // This should never happen.
-            throw new Error("CharacterEncoder.encode internal error");
-        }
-        return (retVal);
-    }
-
-    /**
-     * Return a byte array from the remaining bytes in this ByteBuffer.
-     * <P>
-     * The ByteBuffer's position will be advanced to ByteBuffer's limit.
-     * <P>
-     * To avoid an extra copy, the implementation will attempt to return the
-     * byte array backing the ByteBuffer.  If this is not possible, a
-     * new byte array will be created.
-     */
-    private byte [] getBytes(ByteBuffer bb) {
-        /*
-         * This should never return a BufferOverflowException, as we're
-         * careful to allocate just the right amount.
-         */
-        byte [] buf = null;
-
-        /*
-         * If it has a usable backing byte buffer, use it.  Use only
-         * if the array exactly represents the current ByteBuffer.
-         */
-        if (bb.hasArray()) {
-            byte [] tmp = bb.array();
-            if ((tmp.length == bb.capacity()) &&
-                    (tmp.length == bb.remaining())) {
-                buf = tmp;
-                bb.position(bb.limit());
-            }
-        }
-
-        if (buf == null) {
-            /*
-             * This class doesn't have a concept of encode(buf, len, off),
-             * so if we have a partial buffer, we must reallocate
-             * space.
-             */
-            buf = new byte[bb.remaining()];
-
-            /*
-             * position() automatically updated
-             */
-            bb.get(buf);
-        }
-
-        return buf;
-    }
-
-    /**
-     * Encode the <i>aBuffer</i> ByteBuffer and write the encoded
-     * result to the OutputStream <i>aStream</i>.
-     * <P>
-     * The ByteBuffer's position will be advanced to ByteBuffer's limit.
-     */
-    public void encode(ByteBuffer aBuffer, OutputStream aStream)
-        throws IOException {
-        byte [] buf = getBytes(aBuffer);
-        encode(buf, aStream);
-    }
-
-    /**
-     * A 'streamless' version of encode that simply takes a ByteBuffer
-     * and returns a string containing the encoded buffer.
-     * <P>
-     * The ByteBuffer's position will be advanced to ByteBuffer's limit.
-     */
-    public String encode(ByteBuffer aBuffer) {
-        byte [] buf = getBytes(aBuffer);
-        return encode(buf);
-    }
-
-    /**
-     * Encode bytes from the input stream, and write them as text characters
-     * to the output stream. This method will run until it exhausts the
-     * input stream. It differs from encode in that it will add the
-     * line at the end of a final line that is shorter than bytesPerLine().
-     */
-    public void encodeBuffer(InputStream inStream, OutputStream outStream)
-        throws IOException {
-        int     j;
-        int     numBytes;
-        byte    tmpbuffer[] = new byte[bytesPerLine()];
-
-        encodeBufferPrefix(outStream);
-
-        while (true) {
-            numBytes = readFully(inStream, tmpbuffer);
-            if (numBytes == 0) {
-                break;
-            }
-            encodeLinePrefix(outStream, numBytes);
-            for (j = 0; j < numBytes; j += bytesPerAtom()) {
-                if ((j + bytesPerAtom()) <= numBytes) {
-                    encodeAtom(outStream, tmpbuffer, j, bytesPerAtom());
-                } else {
-                    encodeAtom(outStream, tmpbuffer, j, (numBytes)- j);
-                }
-            }
-            encodeLineSuffix(outStream);
-            if (numBytes < bytesPerLine()) {
-                break;
-            }
-        }
-        encodeBufferSuffix(outStream);
-    }
-
-    /**
-     * Encode the buffer in <i>aBuffer</i> and write the encoded
-     * result to the OutputStream <i>aStream</i>.
-     */
-    public void encodeBuffer(byte aBuffer[], OutputStream aStream)
-    throws IOException {
-        ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
-        encodeBuffer(inStream, aStream);
-    }
-
-    /**
-     * A 'streamless' version of encode that simply takes a buffer of
-     * bytes and returns a string containing the encoded buffer.
-     */
-    public String encodeBuffer(byte aBuffer[]) {
-        ByteArrayOutputStream   outStream = new ByteArrayOutputStream();
-        ByteArrayInputStream    inStream = new ByteArrayInputStream(aBuffer);
-        try {
-            encodeBuffer(inStream, outStream);
-        } catch (Exception IOException) {
-            // This should never happen.
-            throw new Error("CharacterEncoder.encodeBuffer internal error");
-        }
-        return (outStream.toString());
-    }
-
-    /**
-     * Encode the <i>aBuffer</i> ByteBuffer and write the encoded
-     * result to the OutputStream <i>aStream</i>.
-     * <P>
-     * The ByteBuffer's position will be advanced to ByteBuffer's limit.
-     */
-    public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream)
-        throws IOException {
-        byte [] buf = getBytes(aBuffer);
-        encodeBuffer(buf, aStream);
-    }
-
-    /**
-     * A 'streamless' version of encode that simply takes a ByteBuffer
-     * and returns a string containing the encoded buffer.
-     * <P>
-     * The ByteBuffer's position will be advanced to ByteBuffer's limit.
-     */
-    public String encodeBuffer(ByteBuffer aBuffer) {
-        byte [] buf = getBytes(aBuffer);
-        return encodeBuffer(buf);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Copyright 1995-1997 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package net.sourceforge.jnlp.tools;
-
-import java.io.PrintStream;
-import java.io.OutputStream;
-import java.io.IOException;
-
-/**
- * This class encodes a buffer into the classic: "Hexadecimal Dump" format of
- * the past. It is useful for analyzing the contents of binary buffers.
- * The format produced is as follows:
- * <pre>
- * xxxx: 00 11 22 33 44 55 66 77   88 99 aa bb cc dd ee ff ................
- * </pre>
- * Where xxxx is the offset into the buffer in 16 byte chunks, followed
- * by ascii coded hexadecimal bytes followed by the ASCII representation of
- * the bytes or '.' if they are not valid bytes.
- *
- * @author      Chuck McManis
- */
-
-public class HexDumpEncoder extends CharacterEncoder {
-
-    private int offset;
-    private int thisLineLength;
-    private int currentByte;
-    private byte thisLine[] = new byte[16];
-
-    static void hexDigit(PrintStream p, byte x) {
-        char c;
-
-        c = (char) ((x >> 4) & 0xf);
-        if (c > 9)
-            c = (char) ((c-10) + 'A');
-        else
-            c = (char)(c + '0');
-        p.write(c);
-        c = (char) (x & 0xf);
-        if (c > 9)
-            c = (char)((c-10) + 'A');
-        else
-            c = (char)(c + '0');
-        p.write(c);
-    }
-
-    protected int bytesPerAtom() {
-        return (1);
-    }
-
-    protected int bytesPerLine() {
-        return (16);
-    }
-
-    protected void encodeBufferPrefix(OutputStream o) throws IOException {
-        offset = 0;
-        super.encodeBufferPrefix(o);
-    }
-
-    protected void encodeLinePrefix(OutputStream o, int len) throws IOException {
-        hexDigit(pStream, (byte)((offset >>> 8) & 0xff));
-        hexDigit(pStream, (byte)(offset & 0xff));
-        pStream.print(": ");
-        currentByte = 0;
-        thisLineLength = len;
-    }
-
-    protected void encodeAtom(OutputStream o, byte buf[], int off, int len) throws IOException {
-        thisLine[currentByte] = buf[off];
-        hexDigit(pStream, buf[off]);
-        pStream.print(" ");
-        currentByte++;
-        if (currentByte == 8)
-            pStream.print("  ");
-    }
-
-    protected void encodeLineSuffix(OutputStream o) throws IOException {
-        if (thisLineLength < 16) {
-            for (int i = thisLineLength; i < 16; i++) {
-                pStream.print("   ");
-                if (i == 7)
-                    pStream.print("  ");
-            }
-        }
-        pStream.print(" ");
-        for (int i = 0; i < thisLineLength; i++) {
-            if ((thisLine[i] < ' ') || (thisLine[i] > 'z')) {
-                pStream.print(".");
-            } else {
-                pStream.write(thisLine[i]);
-            }
-        }
-        pStream.println();
-        offset += thisLineLength;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/tools/JarRunner.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-package net.sourceforge.jnlp.tools;
-
-import net.sourceforge.jnlp.tools.JarSigner;
-public class JarRunner {
-
-
-        public static void main(String[] args) throws Exception{
-
-
-                //JarSigner.main(args);
-                JarSigner js = new JarSigner();
-                js.verifyJar(args[0]);
-        }
-
-}
--- a/netx/net/sourceforge/jnlp/tools/JarSigner.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,553 +0,0 @@
-/*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package net.sourceforge.jnlp.tools;
-
-import java.io.*;
-import java.util.*;
-import java.util.zip.*;
-import java.util.jar.*;
-import java.text.Collator;
-import java.text.MessageFormat;
-import java.security.cert.Certificate;
-import java.security.cert.X509Certificate;
-import java.security.cert.CertPath;
-import java.security.*;
-import sun.security.x509.*;
-import sun.security.util.*;
-
-import net.sourceforge.jnlp.*;
-import net.sourceforge.jnlp.cache.*;
-import net.sourceforge.jnlp.runtime.*;
-import net.sourceforge.jnlp.security.*;
-
-/**
- * <p>The jarsigner utility.
- *
- * @author Roland Schemers
- * @author Jan Luehe
- */
-
-public class JarSigner implements CertVerifier {
-
-    private static String R(String key) {
-        return JNLPRuntime.getMessage(key);
-    }
-
-    private static final Collator collator = Collator.getInstance();
-    static {
-        // this is for case insensitive string comparisions
-        collator.setStrength(Collator.PRIMARY);
-    }
-
-    private static final String META_INF = "META-INF/";
-
-    // prefix for new signature-related files in META-INF directory
-    private static final String SIG_PREFIX = META_INF + "SIG-";
-
-
-    private static final long SIX_MONTHS = 180*24*60*60*1000L; //milliseconds
-
-    static final String VERSION = "1.0";
-
-    static final int IN_KEYSTORE = 0x01;
-    static final int IN_SCOPE = 0x02;
-
-    static enum verifyResult {UNSIGNED, SIGNED_OK, SIGNED_NOT_OK}
-
-    // signer's certificate chain (when composing)
-    X509Certificate[] certChain;
-
-    /*
-     * private key
-     */
-    PrivateKey privateKey;
-    KeyStore store;
-
-    IdentityScope scope;
-
-    String keystore; // key store file
-    boolean nullStream = false; // null keystore input stream (NONE)
-    boolean token = false; // token-based keystore
-    String jarfile;  // jar file to sign
-    String alias;    // alias to sign jar with
-    char[] storepass; // keystore password
-    boolean protectedPath; // protected authentication path
-    String storetype; // keystore type
-    String providerName; // provider name
-    Vector<String> providers = null; // list of providers
-    HashMap<String,String> providerArgs = new HashMap<String, String>(); // arguments for provider constructors
-    char[] keypass; // private key password
-    String sigfile; // name of .SF file
-    String sigalg; // name of signature algorithm
-    String digestalg = "SHA1"; // name of digest algorithm
-    String signedjar; // output filename
-    String tsaUrl; // location of the Timestamping Authority
-    String tsaAlias; // alias for the Timestamping Authority's certificate
-    boolean verify = false; // verify the jar
-    boolean verbose = false; // verbose output when signing/verifying
-    boolean showcerts = false; // show certs when verifying
-    boolean debug = false; // debug
-    boolean signManifest = true; // "sign" the whole manifest
-    boolean externalSF = true; // leave the .SF out of the PKCS7 block
-
-    private boolean hasExpiredCert = false;
-    private boolean hasExpiringCert = false;
-    private boolean notYetValidCert = false;
-
-    private boolean badKeyUsage = false;
-    private boolean badExtendedKeyUsage = false;
-    private boolean badNetscapeCertType = false;
-
-    private boolean alreadyTrustPublisher = false;
-    private boolean rootInCacerts = false;
-
-    /**
-     * The single certPath used in this JarSiging. We're only keeping
-     * track of one here, since in practice there's only one signer
-     * for a JNLP Application.
-     */
-    private CertPath certPath = null;
-
-    private boolean noSigningIssues = true;
-
-    private boolean anyJarsSigned = false;
-
-    /** all of the jar files that were verified */
-    private ArrayList<String> verifiedJars = null;
-
-    /** all of the jar files that were not verified */
-    private ArrayList<String> unverifiedJars = null;
-
-    /** the certificates used for jar verification */
-    private ArrayList<CertPath> certs = null;
-
-    /** details of this signing */
-    private ArrayList<String> details = new ArrayList<String>();
-
-    /* (non-Javadoc)
-     * @see net.sourceforge.jnlp.tools.CertVerifier2#getAlreadyTrustPublisher()
-     */
-    public boolean getAlreadyTrustPublisher() {
-        return alreadyTrustPublisher;
-    }
-
-    /* (non-Javadoc)
-     * @see net.sourceforge.jnlp.tools.CertVerifier2#getRootInCacerts()
-     */
-    public boolean getRootInCacerts() {
-        return rootInCacerts;
-    }
-
-    public CertPath getCertPath() {
-        return certPath;
-    }
-
-    /* (non-Javadoc)
-     * @see net.sourceforge.jnlp.tools.CertVerifier2#hasSigningIssues()
-     */
-    public boolean hasSigningIssues() {
-        return hasExpiredCert || notYetValidCert || badKeyUsage
-               || badExtendedKeyUsage || badNetscapeCertType;
-    }
-
-    /* (non-Javadoc)
-     * @see net.sourceforge.jnlp.tools.CertVerifier2#noSigningIssues()
-     */
-    public boolean noSigningIssues() {
-        return noSigningIssues;
-    }
-
-    public boolean anyJarsSigned() {
-        return anyJarsSigned;
-    }
-
-    /* (non-Javadoc)
-     * @see net.sourceforge.jnlp.tools.CertVerifier2#getDetails()
-     */
-    public ArrayList<String> getDetails() {
-        return details;
-    }
-
-    /* (non-Javadoc)
-     * @see net.sourceforge.jnlp.tools.CertVerifier2#getCerts()
-     */
-    public ArrayList<CertPath> getCerts() {
-        return certs;
-    }
-
-    public void verifyJars(List<JARDesc> jars, ResourceTracker tracker)
-    throws Exception {
-
-        certs = new ArrayList<CertPath>();
-        for (int i = 0; i < jars.size(); i++) {
-
-            JARDesc jar = (JARDesc) jars.get(i);
-            verifiedJars = new ArrayList<String>();
-            unverifiedJars = new ArrayList<String>();
-
-            try {
-
-                File jarFile = tracker.getCacheFile(jar.getLocation());
-
-                // some sort of resource download/cache error. Nothing to add
-                // in that case ... but don't fail here
-                if (jarFile == null) {
-                    return;
-                }
-
-                String localFile = jarFile.getAbsolutePath();
-                verifyResult result = verifyJar(localFile);
-
-                if (result == verifyResult.UNSIGNED) {
-                    unverifiedJars.add(localFile);
-                } else if (result == verifyResult.SIGNED_NOT_OK) {
-                    noSigningIssues = false;
-                    verifiedJars.add(localFile);
-                } else if (result == verifyResult.SIGNED_OK) {
-                    verifiedJars.add(localFile);
-                }
-            } catch (Exception e){
-                // We may catch exceptions from using verifyJar()
-                // or from checkTrustedCerts
-                throw e;
-            }
-        }
-    }
-
-    public verifyResult verifyJar(String jarName) throws Exception {
-        boolean anySigned = false;
-        boolean hasUnsignedEntry = false;
-        JarFile jarFile = null;
-
-        // certs could be uninitialized if one calls this method directly
-        if (certs == null)
-            certs = new ArrayList<CertPath>();
-
-        try {
-            jarFile = new JarFile(jarName, true);
-            Vector<JarEntry> entriesVec = new Vector<JarEntry>();
-            byte[] buffer = new byte[8192];
-
-            JarEntry je;
-            Enumeration<JarEntry> entries = jarFile.entries();
-            while (entries.hasMoreElements()) {
-                je = entries.nextElement();
-                entriesVec.addElement(je);
-
-                InputStream is = jarFile.getInputStream(je);
-                try {
-                    int n;
-                    while ((n = is.read(buffer, 0, buffer.length)) != -1) {
-                        // we just read. this will throw a SecurityException
-                        // if  a signature/digest check fails.
-                    }
-                } finally {
-                    if (is != null) {
-                        is.close();
-                    }
-                }
-            }
-
-            if (jarFile.getManifest() != null) {
-                if (verbose) System.out.println();
-                Enumeration<JarEntry> e = entriesVec.elements();
-
-                long now = System.currentTimeMillis();
-
-                while (e.hasMoreElements()) {
-                    je = e.nextElement();
-                    String name = je.getName();
-                    CodeSigner[] signers = je.getCodeSigners();
-                    boolean isSigned = (signers != null);
-                    anySigned |= isSigned;
-                    hasUnsignedEntry |= !je.isDirectory() && !isSigned
-                                        && !signatureRelated(name);
-                    if (isSigned) {
-                        // TODO: Perhaps we should check here that
-                        // signers.length is only of size 1, and throw an
-                        // exception if it's not?
-                        for (int i = 0; i < signers.length; i++) {
-                            CertPath certPath = signers[i].getSignerCertPath();
-                            if (!certs.contains(certPath))
-                                certs.add(certPath);
-
-                            //we really only want the first certPath
-                            if (!certPath.equals(this.certPath)){
-                                this.certPath = certPath;
-                            }
-
-                            Certificate cert = signers[i].getSignerCertPath()
-                                .getCertificates().get(0);
-                            if (cert instanceof X509Certificate) {
-                                checkCertUsage((X509Certificate)cert, null);
-                                if (!showcerts) {
-                                    long notAfter = ((X509Certificate)cert)
-                                                    .getNotAfter().getTime();
-
-                                    if (notAfter < now) {
-                                        hasExpiredCert = true;
-                                    } else if (notAfter < now + SIX_MONTHS) {
-                                        hasExpiringCert = true;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                } //while e has more elements
-            } //if man not null
-
-            //Alert the user if any of the following are true.
-            if (!anySigned) {
-                return verifyResult.UNSIGNED;
-            } else {
-                anyJarsSigned = true;
-
-                //warnings
-                if (hasUnsignedEntry || hasExpiredCert || hasExpiringCert ||
-                        badKeyUsage || badExtendedKeyUsage || badNetscapeCertType ||
-                        notYetValidCert) {
-
-                    addToDetails(R("SRunWithoutRestrictions"));
-
-                    if (badKeyUsage)
-                        addToDetails(R("SBadKeyUsage"));
-                    if (badExtendedKeyUsage)
-                        addToDetails(R("SBadExtendedKeyUsage"));
-                    if (badNetscapeCertType)
-                        addToDetails(R("SBadNetscapeCertType"));
-                    if (hasUnsignedEntry)
-                        addToDetails(R("SHasUnsignedEntry"));
-                    if (hasExpiredCert)
-                        addToDetails(R("SHasExpiredCert"));
-                    if (hasExpiringCert)
-                        addToDetails(R("SHasExpiringCert"));
-                    if (notYetValidCert)
-                        addToDetails(R("SNotYetValidCert"));
-                }
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw e;
-        } finally { // close the resource
-            if (jarFile != null) {
-                jarFile.close();
-            }
-        }
-
-        // check if the certs added above are in the trusted path
-        checkTrustedCerts();
-
-        //anySigned does not guarantee that all files were signed.
-        return (anySigned && !(hasUnsignedEntry || hasExpiredCert
-                              || badKeyUsage || badExtendedKeyUsage || badNetscapeCertType
-                              || notYetValidCert)) ? verifyResult.SIGNED_OK : verifyResult.SIGNED_NOT_OK;
-    }
-
-    /**
-     * Checks the user's trusted.certs file and the cacerts file to see
-     * if a publisher's and/or CA's certificate exists there.
-     */
-    private void checkTrustedCerts() throws Exception {
-        if (certPath != null) {
-                try {
-                        KeyTool kt = new KeyTool();
-                        alreadyTrustPublisher = kt.isTrusted(getPublisher());
-                                rootInCacerts = kt.checkCacertsForCertificate(getRoot());
-                } catch (Exception e) {
-                        // TODO: Warn user about not being able to
-                        // look through their cacerts/trusted.certs
-                        // file depending on exception.
-                        throw e;
-                }
-
-                if (!rootInCacerts)
-                        addToDetails(R("SUntrustedCertificate"));
-                else
-                        addToDetails(R("STrustedCertificate"));
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see net.sourceforge.jnlp.tools.CertVerifier2#getPublisher()
-     */
-    public Certificate getPublisher() {
-        if (certPath != null) {
-                List<? extends Certificate> certList
-                        = certPath.getCertificates();
-                if (certList.size() > 0) {
-                        return (Certificate)certList.get(0);
-                } else {
-                        return null;
-                }
-        } else {
-                return null;
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see net.sourceforge.jnlp.tools.CertVerifier2#getRoot()
-     */
-    public Certificate getRoot() {
-        if (certPath != null) {
-                List<? extends Certificate> certList
-                        = certPath.getCertificates();
-                if (certList.size() > 0) {
-                        return (Certificate)certList.get(
-                                certList.size() - 1);
-                } else {
-                        return null;
-                }
-        } else {
-                return null;
-        }
-    }
-
-        private void addToDetails(String detail) {
-                if (!details.contains(detail))
-                        details.add(detail);
-        }
-
-    Hashtable<Certificate, String> storeHash =
-        new Hashtable<Certificate, String>();
-
-    /**
-     * signature-related files include:
-     * . META-INF/MANIFEST.MF
-     * . META-INF/SIG-*
-     * . META-INF/*.SF
-     * . META-INF/*.DSA
-     * . META-INF/*.RSA
-     *
-     * Required for verifyJar()
-     */
-    private boolean signatureRelated(String name) {
-        String ucName = name.toUpperCase();
-        if (ucName.equals(JarFile.MANIFEST_NAME) ||
-                ucName.equals(META_INF) ||
-                (ucName.startsWith(SIG_PREFIX) &&
-                 ucName.indexOf("/") == ucName.lastIndexOf("/"))) {
-            return true;
-        }
-
-        if (ucName.startsWith(META_INF) &&
-                SignatureFileVerifier.isBlockOrSF(ucName)) {
-            // .SF/.DSA/.RSA files in META-INF subdirs
-            // are not considered signature-related
-            return (ucName.indexOf("/") == ucName.lastIndexOf("/"));
-        }
-
-        return false;
-    }
-
-    /**
-     * Check if userCert is designed to be a code signer
-     * @param userCert the certificate to be examined
-     * @param bad 3 booleans to show if the KeyUsage, ExtendedKeyUsage,
-     *            NetscapeCertType has codeSigning flag turned on.
-     *            If null, the class field badKeyUsage, badExtendedKeyUsage,
-     *            badNetscapeCertType will be set.
-     *
-     * Required for verifyJar()
-     */
-    void checkCertUsage(X509Certificate userCert, boolean[] bad) {
-
-        // Can act as a signer?
-        // 1. if KeyUsage, then [0] should be true
-        // 2. if ExtendedKeyUsage, then should contains ANY or CODE_SIGNING
-        // 3. if NetscapeCertType, then should contains OBJECT_SIGNING
-        // 1,2,3 must be true
-
-        if (bad != null) {
-            bad[0] = bad[1] = bad[2] = false;
-        }
-
-        boolean[] keyUsage = userCert.getKeyUsage();
-        if (keyUsage != null) {
-            if (keyUsage.length < 1 || !keyUsage[0]) {
-                if (bad != null) {
-                    bad[0] = true;
-                } else {
-                    badKeyUsage = true;
-                }
-            }
-        }
-
-        try {
-            List<String> xKeyUsage = userCert.getExtendedKeyUsage();
-            if (xKeyUsage != null) {
-                if (!xKeyUsage.contains("2.5.29.37.0") // anyExtendedKeyUsage
-                        && !xKeyUsage.contains("1.3.6.1.5.5.7.3.3")) {  // codeSigning
-                    if (bad != null) {
-                        bad[1] = true;
-                    } else {
-                        badExtendedKeyUsage = true;
-                    }
-                }
-            }
-        } catch (java.security.cert.CertificateParsingException e) {
-            // shouldn't happen
-        }
-
-        try {
-            // OID_NETSCAPE_CERT_TYPE
-            byte[] netscapeEx = userCert.getExtensionValue
-                                ("2.16.840.1.113730.1.1");
-            if (netscapeEx != null) {
-                DerInputStream in = new DerInputStream(netscapeEx);
-                byte[] encoded = in.getOctetString();
-                encoded = new DerValue(encoded).getUnalignedBitString()
-                .toByteArray();
-
-                NetscapeCertTypeExtension extn =
-                    new NetscapeCertTypeExtension(encoded);
-
-                Boolean val = (Boolean)extn.get(
-                                  NetscapeCertTypeExtension.OBJECT_SIGNING);
-                if (!val) {
-                    if (bad != null) {
-                        bad[2] = true;
-                    } else {
-                        badNetscapeCertType = true;
-                    }
-                }
-            }
-        } catch (IOException e) {
-            //
-        }
-    }
-
-
-    /**
-     * Returns if all jars are signed.
-     *
-     * @return True if all jars are signed, false if there are one or more unsigned jars
-     */
-    public boolean allJarsSigned() {
-       return this.unverifiedJars.size() == 0;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/tools/JarSignerResources.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-/*
- * Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package net.sourceforge.jnlp.tools;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for JarSigner.
- *
- */
-public class JarSignerResources extends java.util.ListResourceBundle {
-
-    private static final Object[][] contents = {
-
-        // shared (from jarsigner)
-        {" ", " "},
-        {"  ", "  "},
-        {"      ", "      "},
-        {", ", ", "},
-
-        {"provName not a provider", "{0} not a provider"},
-        {"signerClass is not a signing mechanism", "{0} is not a signing mechanism"},
-        {"jarsigner error: ", "jarsigner error: "},
-        {"Illegal option: ", "Illegal option: "},
-        {"-keystore must be NONE if -storetype is {0}",
-                "-keystore must be NONE if -storetype is {0}"},
-        {"-keypass can not be specified if -storetype is {0}",
-                "-keypass can not be specified if -storetype is {0}"},
-        {"If -protected is specified, then -storepass and -keypass must not be specified",
-                "If -protected is specified, then -storepass and -keypass must not be specified"},
-        {"If keystore is not password protected, then -storepass and -keypass must not be specified",
-                 "If keystore is not password protected, then -storepass and -keypass must not be specified"},
-        {"Usage: jarsigner [options] jar-file alias",
-                "Usage: jarsigner [options] jar-file alias"},
-        {"       jarsigner -verify [options] jar-file",
-                "       jarsigner -verify [options] jar-file"},
-        {"[-keystore <url>]           keystore location",
-                "[-keystore <url>]           keystore location"},
-        {"[-storepass <password>]     password for keystore integrity",
-            "[-storepass <password>]     password for keystore integrity"},
-        {"[-storetype <type>]         keystore type",
-                "[-storetype <type>]         keystore type"},
-        {"[-keypass <password>]       password for private key (if different)",
-                "[-keypass <password>]       password for private key (if different)"},
-        {"[-sigfile <file>]           name of .SF/.DSA file",
-                "[-sigfile <file>]           name of .SF/.DSA file"},
-        {"[-signedjar <file>]         name of signed JAR file",
-                "[-signedjar <file>]         name of signed JAR file"},
-        {"[-digestalg <algorithm>]    name of digest algorithm",
-                "[-digestalg <algorithm>]    name of digest algorithm"},
-        {"[-sigalg <algorithm>]       name of signature algorithm",
-                "[-sigalg <algorithm>]       name of signature algorithm"},
-        {"[-verify]                   verify a signed JAR file",
-                "[-verify]                   verify a signed JAR file"},
-        {"[-verbose]                  verbose output when signing/verifying",
-                "[-verbose]                  verbose output when signing/verifying"},
-        {"[-certs]                    display certificates when verbose and verifying",
-                "[-certs]                    display certificates when verbose and verifying"},
-        {"[-tsa <url>]                location of the Timestamping Authority",
-                "[-tsa <url>]                location of the Timestamping Authority"},
-        {"[-tsacert <alias>]          public key certificate for Timestamping Authority",
-                "[-tsacert <alias>]          public key certificate for Timestamping Authority"},
-        {"[-altsigner <class>]        class name of an alternative signing mechanism",
-                "[-altsigner <class>]        class name of an alternative signing mechanism"},
-        {"[-altsignerpath <pathlist>] location of an alternative signing mechanism",
-                "[-altsignerpath <pathlist>] location of an alternative signing mechanism"},
-        {"[-internalsf]               include the .SF file inside the signature block",
-                "[-internalsf]               include the .SF file inside the signature block"},
-        {"[-sectionsonly]             don't compute hash of entire manifest",
-                "[-sectionsonly]             don't compute hash of entire manifest"},
-        {"[-protected]                keystore has protected authentication path",
-                "[-protected]                keystore has protected authentication path"},
-        {"[-providerName <name>]      provider name",
-                "[-providerName <name>]      provider name"},
-        {"[-providerClass <class>     name of cryptographic service provider's",
-                "[-providerClass <class>     name of cryptographic service provider's"},
-        {"  [-providerArg <arg>]] ... master class file and constructor argument",
-                "  [-providerArg <arg>]] ... master class file and constructor argument"},
-        {"s", "s"},
-        {"m", "m"},
-        {"k", "k"},
-        {"i", "i"},
-        {"  s = signature was verified ",
-                "  s = signature was verified "},
-        {"  m = entry is listed in manifest",
-                "  m = entry is listed in manifest"},
-        {"  k = at least one certificate was found in keystore",
-                "  k = at least one certificate was found in keystore"},
-        {"  i = at least one certificate was found in identity scope",
-                "  i = at least one certificate was found in identity scope"},
-        {"no manifest.", "no manifest."},
-        {"jar is unsigned. (signatures missing or not parsable)",
-                "jar is unsigned. (signatures missing or not parsable)"},
-        {"jar verified.", "jar verified."},
-        {"jarsigner: ", "jarsigner: "},
-        {"signature filename must consist of the following characters: A-Z, 0-9, _ or -",
-                "signature filename must consist of the following characters: A-Z, 0-9, _ or -"},
-        {"unable to open jar file: ", "unable to open jar file: "},
-        {"unable to create: ", "unable to create: "},
-        {"   adding: ", "   adding: "},
-        {" updating: ", " updating: "},
-        {"  signing: ", "  signing: "},
-        {"attempt to rename signedJarFile to jarFile failed",
-                "attempt to rename {0} to {1} failed"},
-        {"attempt to rename jarFile to origJar failed",
-                "attempt to rename {0} to {1} failed"},
-        {"unable to sign jar: ", "unable to sign jar: "},
-        {"Enter Passphrase for keystore: ", "Enter Passphrase for keystore: "},
-        {"keystore load: ", "keystore load: "},
-        {"certificate exception: ", "certificate exception: "},
-        {"unable to instantiate keystore class: ",
-                "unable to instantiate keystore class: "},
-        {"Certificate chain not found for: alias.  alias must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.",
-                "Certificate chain not found for: {0}.  {1} must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain."},
-        {"found non-X.509 certificate in signer's chain",
-                "found non-X.509 certificate in signer's chain"},
-        {"incomplete certificate chain", "incomplete certificate chain"},
-        {"Enter key password for alias: ", "Enter key password for {0}: "},
-        {"unable to recover key from keystore",
-                "unable to recover key from keystore"},
-        {"key associated with alias not a private key",
-                "key associated with {0} not a private key"},
-        {"you must enter key password", "you must enter key password"},
-        {"unable to read password: ", "unable to read password: "},
-        {"certificate is valid from", "certificate is valid from {0} to {1}"},
-        {"certificate expired on", "certificate expired on {0}"},
-        {"certificate is not valid until",
-                "certificate is not valid until {0}"},
-        {"certificate will expire on", "certificate will expire on {0}"},
-        {"requesting a signature timestamp",
-                "requesting a signature timestamp"},
-        {"TSA location: ", "TSA location: "},
-        {"TSA certificate: ", "TSA certificate: "},
-        {"no response from the Timestamping Authority. ",
-                "no response from the Timestamping Authority. "},
-        {"When connecting from behind a firewall then an HTTP proxy may need to be specified. ",
-                "When connecting from behind a firewall then an HTTP proxy may need to be specified. "},
-        {"Supply the following options to jarsigner: ",
-                "Supply the following options to jarsigner: "},
-        {"Certificate not found for: alias.  alias must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority.",
-                "Certificate not found for: {0}.  {1} must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority."},
-        {"using an alternative signing mechanism",
-                "using an alternative signing mechanism"},
-        {"entry was signed on", "entry was signed on {0}"},
-        {"Warning: ", "Warning: "},
-        {"This jar contains unsigned entries which have not been integrity-checked. ",
-                "This jar contains unsigned entries which have not been integrity-checked. "},
-        {"This jar contains entries whose signer certificate has expired. ",
-                "This jar contains entries whose signer certificate has expired. "},
-        {"This jar contains entries whose signer certificate will expire within six months. ",
-                "This jar contains entries whose signer certificate will expire within six months. "},
-        {"This jar contains entries whose signer certificate is not yet valid. ",
-                "This jar contains entries whose signer certificate is not yet valid. "},
-        {"Re-run with the -verbose option for more details.",
-                "Re-run with the -verbose option for more details."},
-        {"Re-run with the -verbose and -certs options for more details.",
-                "Re-run with the -verbose and -certs options for more details."},
-        {"The signer certificate has expired.",
-                "The signer certificate has expired."},
-        {"The signer certificate will expire within six months.",
-                "The signer certificate will expire within six months."},
-        {"The signer certificate is not yet valid.",
-                "The signer certificate is not yet valid."},
-        {"The signer certificate's KeyUsage extension doesn't allow code signing.",
-                 "The signer certificate's KeyUsage extension doesn't allow code signing."},
-        {"The signer certificate's ExtendedKeyUsage extension doesn't allow code signing.",
-                 "The signer certificate's ExtendedKeyUsage extension doesn't allow code signing."},
-        {"The signer certificate's NetscapeCertType extension doesn't allow code signing.",
-                 "The signer certificate's NetscapeCertType extension doesn't allow code signing."},
-         {"This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing.",
-                  "This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing."},
-         {"This jar contains entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing.",
-                  "This jar contains entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing."},
-         {"This jar contains entries whose signer certificate's NetscapeCertType extension doesn't allow code signing.",
-                  "This jar contains entries whose signer certificate's NetscapeCertType extension doesn't allow code signing."},
-        {"[{0} extension does not support code signing]",
-                 "[{0} extension does not support code signing]"},
-    };
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    public Object[][] getContents() {
-        return contents;
-    }
-}
--- a/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package net.sourceforge.jnlp.tools;
-
-/**
- * <p> This class provides several utilities to <code>KeyStore</code>.
- *
- * @since 1.6.0
- */
-public class KeyStoreUtil {
-
-    // Class and methods marked as public so that they can be
-    // accessed by JarSigner, which although lies in a package
-    // with the same name, but bundled in tools.jar and loaded
-    // by another class loader, hence in a different *runtime*
-    // package.
-    //
-    // See JVM Spec, 5.3 and 5.4.4
-
-    private KeyStoreUtil() {
-        // this class is not meant to be instantiated
-    }
-
-
-    /**
-     * Returns true if KeyStore has a password. This is true except for
-     * MSCAPI KeyStores
-     */
-    public static boolean isWindowsKeyStore(String storetype) {
-        return storetype.equalsIgnoreCase("Windows-MY")
-                || storetype.equalsIgnoreCase("Windows-ROOT");
-    }
-
-    /**
-     * Returns standard-looking names for storetype
-     */
-    public static String niceStoreTypeName(String storetype) {
-        if (storetype.equalsIgnoreCase("Windows-MY")) {
-            return "Windows-MY";
-        } else if(storetype.equalsIgnoreCase("Windows-ROOT")) {
-            return "Windows-ROOT";
-        } else {
-            return storetype.toUpperCase();
-        }
-    }
-}
--- a/netx/net/sourceforge/jnlp/tools/KeyTool.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,461 +0,0 @@
-/*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package net.sourceforge.jnlp.tools;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.security.KeyStore;
-import java.security.MessageDigest;
-import java.security.PublicKey;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.Random;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import net.sourceforge.jnlp.security.SecurityUtil;
-
-import sun.misc.BASE64Encoder;
-import sun.security.provider.X509Factory;
-
-/**
- * This tool manages the user's trusted certificates
- *
- * @author Jan Luehe
- * @author Joshua Sumali
- */
-public class KeyTool {
-
-        // The user's keystore.
-        private KeyStore usercerts = null;
-        // JDK cacerts
-        private KeyStore cacerts = null;
-        // System ca-bundle.crt
-        private KeyStore systemcerts = null;
-
-        private String fullCertPath = SecurityUtil.getTrustedCertsFilename();
-
-        private FileOutputStream fos = null;
-
-        /**
-         * Whether we trust the system cacerts file.
-         */
-        private boolean trustcacerts = true;
-
-        /**
-         * Whether we print certificates in rfc, base64 encoding.
-         */
-        private boolean rfc = true;
-
-        private final char[] password = "changeit".toCharArray();
-
-        /**
-         * Whether we prompt for user input.
-         */
-        private boolean noprompt = true;
-
-        public KeyTool() throws Exception {
-
-                // Initialize all the keystores.
-                usercerts = SecurityUtil.getUserKeyStore();
-                cacerts = SecurityUtil.getCacertsKeyStore();
-                systemcerts = SecurityUtil.getSystemCertStore();
-        }
-
-        /**
-         * Adds a trusted certificate to the user's keystore.
-         * @return true if the add was successful, false otherwise.
-         */
-        public boolean importCert(File file) throws Exception {
-
-                BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
-                CertificateFactory cf = CertificateFactory.getInstance("X509");
-                X509Certificate cert = null;
-
-                if (bis.available() >= 1) {
-                        try {
-                        cert = (X509Certificate)cf.generateCertificate(bis);
-                        } catch (ClassCastException cce) {
-                                throw new Exception("Input file is not an X509 Certificate");
-                        } catch (CertificateException ce) {
-                                throw new Exception("Input file is not an X509 Certificate");
-                        }
-                }
-
-                return importCert((Certificate)cert);
-        }
-
-        /**
-         * Adds a trusted certificate to the user's keystore.
-         * @return true if the add was successful, false otherwise.
-         */
-        public boolean importCert(Certificate cert) throws Exception {
-
-                String alias = usercerts.getCertificateAlias(cert);
-
-                if (alias != null) { //cert already exists
-                        return true;
-                } else {
-                        String newAlias = getRandomAlias();
-                        //check to make sure this alias doesn't exist
-                        while (usercerts.getCertificate(newAlias) != null)
-                                newAlias = getRandomAlias();
-                        return addTrustedCert(newAlias, cert);
-                }
-        }
-
-        /**
-         * Generates a random alias for storing a trusted Certificate.
-         */
-        private String getRandomAlias() {
-                Random r = new Random();
-                String token = Long.toString(Math.abs(r.nextLong()), 36);
-                return "trustedCert-" + token;
-        }
-
-        /**
-     * Prints all keystore entries.
-     */
-        private void doPrintEntries(PrintStream out) throws Exception {
-
-                out.println("KeyStore type: " + usercerts.getType());
-                out.println("KeyStore provider: " + usercerts.getProvider().toString());
-                out.println();
-
-                for (Enumeration<String> e = usercerts.aliases(); e.hasMoreElements();) {
-                        String alias = e.nextElement();
-                        doPrintEntry(alias, out, false);
-                }
-        }
-
-    /**
-     * Prints a single keystore entry.
-     */
-        private void doPrintEntry(String alias, PrintStream out,
-                        boolean printWarning) throws Exception {
-
-                if (usercerts.containsAlias(alias) == false) {
-                        throw new Exception("Alias does not exist");
-                }
-
-                if (usercerts.entryInstanceOf(alias,
-                                KeyStore.TrustedCertificateEntry.class)) {
-                        Certificate cert = usercerts.getCertificate(alias);
-
-                        out.println("Alias: " + alias);
-                        out.println("Date Created: " + usercerts.getCreationDate(alias));
-                        out.println("Subject: " + SecurityUtil.getCN(((X509Certificate)usercerts
-                                .getCertificate(alias)).getSubjectX500Principal().getName()));
-                        out.println("Certificate fingerprint (MD5): "
-                                        + getCertFingerPrint("MD5", cert));
-                        out.println();
-                }
-        }
-
-    /**
-     * Gets the requested finger print of the certificate.
-     */
-        private String getCertFingerPrint(String mdAlg, Certificate cert)
-                throws Exception {
-                byte[] encCertInfo = cert.getEncoded();
-                MessageDigest md = MessageDigest.getInstance(mdAlg);
-                byte[] digest = md.digest(encCertInfo);
-                return toHexString(digest);
-        }
-
-    /**
-     * Converts a byte to hex digit and writes to the supplied buffer
-     */
-    private void byte2hex(byte b, StringBuffer buf) {
-        char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
-                            '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-        int high = ((b & 0xf0) >> 4);
-        int low = (b & 0x0f);
-        buf.append(hexChars[high]);
-        buf.append(hexChars[low]);
-    }
-
-    /**
-     * Converts a byte array to hex string
-     */
-    private String toHexString(byte[] block) {
-        StringBuffer buf = new StringBuffer();
-        int len = block.length;
-        for (int i = 0; i < len; i++) {
-             byte2hex(block[i], buf);
-             if (i < len-1) {
-                 buf.append(":");
-             }
-        }
-        return buf.toString();
-    }
-
-        /**
-         * Adds a certificate to the keystore, and writes new keystore to disk.
-         */
-    private boolean addTrustedCert(String alias, Certificate cert)
-        throws Exception {
-
-        if (isSelfSigned((X509Certificate)cert)) {
-                        //will throw exception if this fails
-                cert.verify(cert.getPublicKey());
-                }
-
-        if (noprompt) {
-                usercerts.setCertificateEntry(alias, cert);
-                        fos = new FileOutputStream(fullCertPath);
-                        usercerts.store(fos, password);
-                        fos.close();
-                return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns true if the given certificate is trusted, false otherwise.
-     */
-    public boolean isTrusted(Certificate cert) throws Exception {
-        if (cert != null) {
-                if (usercerts.getCertificateAlias(cert) != null) {
-                        return true; // found in own keystore
-                }
-                return false;
-        } else {
-                return false;
-        }
-    }
-
-    /**
-     * Returns true if the certificate is self-signed, false otherwise.
-     */
-    private boolean isSelfSigned(X509Certificate cert) {
-        return cert.getSubjectDN().equals(cert.getIssuerDN());
-    }
-
-    /**
-     * Checks if a given certificate is part of the user's cacerts
-     * keystore.
-     * @param c the certificate to check
-     * @returns true if the certificate is in the user's cacerts and
-     * false otherwise
-     */
-    public boolean checkCacertsForCertificate(Certificate c) throws Exception {
-        if (c != null) {
-
-                        String alias = null;
-
-                        //first try jdk cacerts.
-                        if (cacerts != null) {
-                        alias = cacerts.getCertificateAlias(c);
-
-                                //if we can't find it here, try the system certs.
-                                if (alias == null && systemcerts != null)
-                                        alias = systemcerts.getCertificateAlias(c);
-                        }
-                        //otherwise try the system certs if you can't use the jdk certs.
-                        else if (systemcerts != null)
-                                alias = systemcerts.getCertificateAlias(c);
-
-                return (alias != null);
-        } else
-                return false;
-    }
-
-    /**
-     * Establishes a certificate chain (using trusted certificates in the
-     * keystore), starting with the user certificate
-     * and ending at a self-signed certificate found in the keystore.
-     *
-     * @param userCert the user certificate of the alias
-     * @param certToVerify the single certificate provided in the reply
-     */
-    public boolean establishCertChain(Certificate userCert,
-                                             Certificate certToVerify)
-        throws Exception
-    {
-        if (userCert != null) {
-            // Make sure that the public key of the certificate reply matches
-            // the original public key in the keystore
-            PublicKey origPubKey = userCert.getPublicKey();
-            PublicKey replyPubKey = certToVerify.getPublicKey();
-            if (!origPubKey.equals(replyPubKey)) {
-                // TODO: something went wrong -- throw exception
-                throw new Exception(
-                        "Public keys in reply and keystore don't match");
-            }
-
-            // If the two certs are identical, we're done: no need to import
-            // anything
-            if (certToVerify.equals(userCert)) {
-                throw new Exception(
-                        "Certificate reply and certificate in keystore are identical");
-            }
-        }
-
-        // Build a hash table of all certificates in the keystore.
-        // Use the subject distinguished name as the key into the hash table.
-        // All certificates associated with the same subject distinguished
-        // name are stored in the same hash table entry as a vector.
-        Hashtable<Principal, Vector<Certificate>> certs = null;
-        if (usercerts.size() > 0) {
-            certs = new Hashtable<Principal, Vector<Certificate>>(11);
-            keystorecerts2Hashtable(usercerts, certs);
-        }
-        if (trustcacerts) { //if we're trusting the cacerts
-                KeyStore caks = SecurityUtil.getCacertsKeyStore();
-            if (caks!=null && caks.size()>0) {
-                if (certs == null) {
-                    certs = new Hashtable<Principal, Vector<Certificate>>(11);
-                }
-                keystorecerts2Hashtable(caks, certs);
-            }
-        }
-
-        // start building chain
-        Vector<Certificate> chain = new Vector<Certificate>(2);
-        if (buildChain((X509Certificate)certToVerify, chain, certs)) {
-            Certificate[] newChain = new Certificate[chain.size()];
-            // buildChain() returns chain with self-signed root-cert first and
-            // user-cert last, so we need to invert the chain before we store
-            // it
-            int j=0;
-            for (int i=chain.size()-1; i>=0; i--) {
-                newChain[j] = chain.elementAt(i);
-                j++;
-            }
-            //return newChain;
-            return newChain != null;
-        } else {
-            throw new Exception("Failed to establish chain from reply");
-        }
-    }
-
-    /**
-     * Stores the (leaf) certificates of a keystore in a hashtable.
-     * All certs belonging to the same CA are stored in a vector that
-     * in turn is stored in the hashtable, keyed by the CA's subject DN
-     */
-    private void keystorecerts2Hashtable(KeyStore ks,
-                Hashtable<Principal, Vector<Certificate>> hash)
-        throws Exception {
-
-        for (Enumeration<String> aliases = ks.aliases();
-                                        aliases.hasMoreElements(); ) {
-            String alias = aliases.nextElement();
-            Certificate cert = ks.getCertificate(alias);
-            if (cert != null) {
-                Principal subjectDN = ((X509Certificate)cert).getSubjectDN();
-                Vector<Certificate> vec = hash.get(subjectDN);
-                if (vec == null) {
-                    vec = new Vector<Certificate>();
-                    vec.addElement(cert);
-                } else {
-                    if (!vec.contains(cert)) {
-                        vec.addElement(cert);
-                    }
-                }
-                hash.put(subjectDN, vec);
-            }
-        }
-    }
-
-    /**
-     * Recursively tries to establish chain from pool of trusted certs.
-     *
-     * @param certToVerify the cert that needs to be verified.
-     * @param chain the chain that's being built.
-     * @param certs the pool of trusted certs
-     *
-     * @return true if successful, false otherwise.
-     */
-    private boolean buildChain(X509Certificate certToVerify,
-                        Vector<Certificate> chain,
-                        Hashtable<Principal, Vector<Certificate>> certs) {
-        Principal subject = certToVerify.getSubjectDN();
-        Principal issuer = certToVerify.getIssuerDN();
-        if (subject.equals(issuer)) {
-            // reached self-signed root cert;
-            // no verification needed because it's trusted.
-            chain.addElement(certToVerify);
-            return true;
-        }
-
-        // Get the issuer's certificate(s)
-        Vector<Certificate> vec = certs.get(issuer);
-        if (vec == null) {
-            return false;
-        }
-
-        // Try out each certificate in the vector, until we find one
-        // whose public key verifies the signature of the certificate
-        // in question.
-        for (Enumeration<Certificate> issuerCerts = vec.elements();
-             issuerCerts.hasMoreElements(); ) {
-            X509Certificate issuerCert
-                = (X509Certificate)issuerCerts.nextElement();
-            PublicKey issuerPubKey = issuerCert.getPublicKey();
-            try {
-                certToVerify.verify(issuerPubKey);
-            } catch (Exception e) {
-                continue;
-            }
-            if (buildChain(issuerCert, chain, certs)) {
-                chain.addElement(certToVerify);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static void dumpCert(Certificate cert, PrintStream out)
-        throws IOException, CertificateException {
-
-        boolean printRfc = true;
-        if (printRfc) {
-            BASE64Encoder encoder = new BASE64Encoder();
-            out.println(X509Factory.BEGIN_CERT);
-            encoder.encodeBuffer(cert.getEncoded(), out);
-            out.println(X509Factory.END_CERT);
-        } else {
-            out.write(cert.getEncoded()); // binary
-        }
-    }
-
-        public static void main(String[] args) throws Exception {
-                KeyTool kt = new KeyTool();
-                kt.doPrintEntries(System.out);
-        }
-}
--- a/netx/net/sourceforge/jnlp/util/FileUtils.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.util;
-
-import java.io.File;
-
-/**
- * This class contains a few file-related utility functions.
- *
- * @author Omair Majid
- */
-
-public final class FileUtils {
-
-    /**
-     * list of characters not allowed in filenames
-     */
-    private static final char INVALID_CHARS[] = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' };
-
-    private static final char SANITIZED_CHAR = '_';
-
-    /**
-     * Clean up a string by removing characters that can't appear in a local
-     * file name.
-     *
-     * @param path
-     *        the path to sanitize
-     * @return a sanitized version of the input which is suitable for using as a
-     *         file path
-     */
-    public static String sanitizePath(String path) {
-
-        for (int i = 0; i < INVALID_CHARS.length; i++)
-            if (INVALID_CHARS[i] != File.separatorChar)
-                if (-1 != path.indexOf(INVALID_CHARS[i]))
-                    path = path.replace(INVALID_CHARS[i], SANITIZED_CHAR);
-
-        return path;
-    }
-
-    /**
-     * Given an input, return a sanitized form of the input suitable for use as
-     * a file/directory name
-     *
-     * @param input
-     * @return a sanitized version of the input
-     */
-    public static String sanitizeFileName(String filename) {
-
-        for (int i = 0; i < INVALID_CHARS.length; i++)
-            if (-1 != filename.indexOf(INVALID_CHARS[i]))
-                filename = filename.replace(INVALID_CHARS[i], SANITIZED_CHAR);
-
-        return filename;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/util/PropertiesFile.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.util;
-
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-import net.sourceforge.jnlp.*;
-
-/**
- * A properties object backed by a specified file without throwing
- * exceptions.  The properties are automatically loaded from the
- * file when the first property is requested, but the save method
- * must be called before changes are saved to the file.<p>
- *
- * This class does not report IO exceptions.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.4 $
- */
-public class PropertiesFile extends Properties {
-
-    /** the file to save to */
-    File file;
-
-    /** the header string */
-    String header = "netx file";
-
-    /** lazy loaded on getProperty */
-    boolean loaded = false;
-
-
-    /**
-     * Create a properties object backed by the specified file.
-     *
-     * @param file the file to save and load to
-     */
-    public PropertiesFile(File file) {
-        this.file = file;
-    }
-
-    /**
-     * Create a properties object backed by the specified file.
-     *
-     * @param file the file to save and load to
-     * @param header the file header
-     */
-    public PropertiesFile(File file, String header) {
-        this.file = file;
-        this.header = header;
-    }
-
-    /**
-     * Returns the value of the specified key, or null if the key
-     * does not exist.
-     */
-    public String getProperty(String key) {
-        if (!loaded)
-            load();
-
-        return super.getProperty(key);
-    }
-
-    /**
-     * Returns the value of the specified key, or the default value
-     * if the key does not exist.
-     */
-    public String getProperty(String key, String defaultValue) {
-        if (!loaded)
-            load();
-
-        return super.getProperty(key, defaultValue);
-    }
-
-    /**
-     * Sets the value for the specified key.
-     *
-     * @return the previous value
-     */
-    public Object setProperty(String key, String value) {
-        if (!loaded)
-            load();
-
-        return super.setProperty(key, value);
-    }
-
-    /**
-     * Returns the file backing this properties object.
-     */
-    public File getStoreFile() {
-        return file;
-    }
-
-    /**
-     * Ensures that the file backing these properties has been
-     * loaded; call this method before calling any method defined by
-     * a superclass.
-     */
-    public void load() {
-        loaded = true;
-
-        try {
-            if (!file.exists())
-                return;
-
-            InputStream s = new FileInputStream(file);
-            load(s);
-        }
-        catch (IOException ex) {
-            // eat
-        }
-    }
-
-    /**
-     * Saves the properties to the file.
-     */
-    public void store() {
-        if (!loaded)
-            return; // nothing could have changed so save unnecessary load/save
-
-        try {
-            OutputStream s = new FileOutputStream(file);
-            store(s, header);
-        }
-        catch (IOException ex) {
-            // eat
-        }
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/util/Reflect.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-// Copyright (C) 2003 Jon A. Maxwell (JAM)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.util;
-
-import java.util.*;
-import java.lang.reflect.*;
-
-
-/**
- * Provides simply, convenient methods to invoke methods by
- * name.  This class is used to consolidate reflection needed to
- * access methods specific to Sun's JVM or to remain backward
- * compatible while supporting method in newer JVMs.<p>
- *
- * Most methods of this class invoke the first method on the
- * specified object that matches the name and number of
- * parameters.  The type of the parameters are not considered, so
- * do not attempt to use this class to invoke overloaded
- * methods.<p>
- *
- * Instances of this class are not synchronized.<p>
- *
- * @author <a href="mailto:jon.maxwell@acm.org">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.1 $
- */
-public class Reflect {
-
-    // todo: check non-null parameter types, try to send to proper
-    // method if overloaded ones exist on the target object
-
-    // todo: optimize slightly using hashtable of Methods
-
-    private boolean accessible;
-
-    private static Object zero[] = new Object[0];
-
-
-    /**
-     * Create a new Reflect instance.
-     */
-    public Reflect() {
-        //
-    }
-
-    /**
-     * Create a new Reflect instance.
-     *
-     * @param accessible whether to bypass access permissions
-     */
-    public Reflect(boolean accessible) {
-        this.accessible = accessible;
-    }
-
-    /**
-     * Invoke a zero-parameter static method by name.
-     */
-    public Object invokeStatic(String className, String method) {
-        return invokeStatic(className, method, zero);
-    }
-
-    /**
-     * Invoke the static method using the specified parameters.
-     */
-    public Object invokeStatic(String className, String method, Object args[]) {
-        try {
-            Class c = Class.forName(className, true, Reflect.class.getClassLoader());
-
-            Method m = getMethod(c, method, args);
-            if (m.isAccessible() != accessible)
-                m.setAccessible(accessible);
-
-            return m.invoke(null, args);
-        }
-        catch (Exception ex) { // eat
-            return null;
-        }
-    }
-
-    /**
-     * Invoke a zero-parameter method by name on the specified
-     * object.
-     */
-    public Object invoke(Object object, String method) {
-        return invoke(object, method, zero);
-    }
-
-    /**
-     * Invoke a method by name with the specified parameters.
-     *
-     * @return the result of the method, or null on exception.
-     */
-    public Object invoke(Object object, String method, Object args[]) {
-        try {
-            Method m = getMethod(object.getClass(), method, args);
-            if (m.isAccessible() != accessible)
-                m.setAccessible(accessible);
-
-            return m.invoke(object, args);
-        }
-        catch (Exception ex) { // eat
-            ex.printStackTrace();
-            return null;
-        }
-    }
-
-    /**
-     * Return the Method matching the specified name and number of
-     * arguments.
-     */
-    public Method getMethod(Class type, String method, Object args[]) {
-        try {
-            for (Class c = type; c != null; c = c.getSuperclass()) {
-                Method methods[] = c.getMethods();
-
-                for (int i=0; i < methods.length; i++) {
-                    if (methods[i].getName().equals(method)) {
-                        Class parameters[] = methods[i].getParameterTypes();
-
-                        if (parameters.length == args.length)
-                            return methods[i];
-                    }
-                }
-            }
-        }
-        catch (Exception ex) { // eat
-            ex.printStackTrace();
-        }
-
-        return null;
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/util/WeakList.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-// Copyright (C) 2002-2003 Jon A. Maxwell (JAM)
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-
-package net.sourceforge.jnlp.util;
-
-import java.lang.ref.*;
-import java.util.*;
-
-
-/**
- * This list stores objects automatically using weak references.
- * Objects are added and removed from the list as normal, but may
- * turn to null at any point (ie, indexOf(x) followed by get(x)
- * may return null).  The weak references are only removed when
- * the trimToSize method is called so that the indices remain
- * constant otherwise.<p>
- *
- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
- * @version $Revision: 1.3 $
- */
-public class WeakList extends AbstractList {
-
-    /* list of weak references */
-    private ArrayList refs = new ArrayList();
-
-
-    /**
-     * Create a weak random-access list.
-     */
-    public WeakList() {
-    }
-
-    /**
-     * Extract the hard reference out of a weak reference.
-     */
-    private Object deref(Object o) {
-        if (o != null && o instanceof WeakReference)
-            return ((WeakReference)o).get();
-        else
-            return null;
-    }
-
-    /**
-     * Returns the object at the specified index, or null if the
-     * object has been collected.
-     */
-    public Object get(int index) {
-        return deref(refs.get(index));
-    }
-
-    /**
-     * Returns the size of the list, including already collected
-     * objects.
-     */
-    public int size() {
-        return refs.size();
-    }
-
-    /**
-     * Sets the object at the specified position and returns the
-     * previous object at that position or null if it was already
-     * collected.
-     */
-    public Object set(int index, Object element) {
-        return deref(refs.set(index, new WeakReference(element)));
-    }
-
-    /**
-     * Inserts the object at the specified position in the list.
-     * Automatically creates a weak reference to the object.
-     */
-    public void add(int index, Object element) {
-        refs.add(index, new WeakReference(element));
-    }
-
-    /**
-     * Removes the object at the specified position and returns it
-     * or returns null if it was already collected.
-     */
-    public Object remove(int index) {
-        return deref(refs.remove(index));
-    }
-
-    /**
-     * Returns a list of hard references to the objects.  The
-     * returned list does not include the collected elements, so its
-     * indices do not necessarily correlate with those of this list.
-     */
-    public List hardList() {
-        List result = new ArrayList();
-
-        for (int i=0; i < size(); i++) {
-            Object tmp = get(i);
-
-            if (tmp != null)
-                result.add(tmp);
-        }
-
-        return result;
-    }
-
-    /**
-     * Compacts the list by removing references to collected
-     * objects.
-     */
-    public void trimToSize() {
-        for (int i=size(); i-->0;)
-            if (get(i)==null)
-                remove(i);
-    }
-
-}
--- a/netx/net/sourceforge/jnlp/util/XDesktopEntry.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-// Copyright (C) 2009 Red Hat, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-package net.sourceforge.jnlp.util;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.StringReader;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.Arrays;
-
-import net.sourceforge.jnlp.IconDesc;
-import net.sourceforge.jnlp.JNLPFile;
-import net.sourceforge.jnlp.StreamEater;
-import net.sourceforge.jnlp.cache.CacheUtil;
-import net.sourceforge.jnlp.cache.UpdatePolicy;
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-/**
- * This class builds a (freedesktop.org) desktop entry out of a {@link JNLPFile}
- * . This entry can be used to install desktop shortcuts. See xdg-desktop-icon
- * (1) and http://standards.freedesktop.org/desktop-entry-spec/latest/ for more
- * information
- *
- * @author Omair Majid
- *
- */
-public class XDesktopEntry {
-
-    public static final String JAVA_ICON_NAME = "java.png";
-
-    private JNLPFile file = null;
-    private int iconSize = -1;
-    private String iconLocation = null;
-
-    private int[] VALID_ICON_SIZES = new int[] { 16, 22, 32, 48, 64, 128 };
-
-    /**
-     * Create a XDesktopEntry for the given JNLP file
-     *
-     * @param file a {@link JNLPFile} that indicates the application to launch
-     */
-    public XDesktopEntry(JNLPFile file) {
-        this.file = file;
-
-        /* looks like a good initial value */
-        iconSize = VALID_ICON_SIZES[2];
-    }
-
-    /**
-     * Returns the contents of the {@link XDesktopEntry} through the
-     * {@link Reader} interface.
-     */
-    public Reader getContentsAsReader() {
-
-        String pathToJavaws = System.getProperty("java.home") + File.separator + "bin"
-                + File.separator + "javaws";
-        File cacheFile = CacheUtil.urlToPath(file.getSourceLocation(), "cache");
-
-        String fileContents = "[Desktop Entry]\n";
-        fileContents += "Version=1.0\n";
-        fileContents += "Name=" + file.getTitle() + "\n";
-        fileContents += "GenericName=Java Web Start Application\n";
-        fileContents += "Comment=" + file.getInformation().getDescription() + "\n";
-        fileContents += "Type=Application\n";
-        if (iconLocation != null) {
-            fileContents += "Icon=" + iconLocation + "\n";
-        } else {
-            fileContents += "Icon=" + JAVA_ICON_NAME + "\n";
-
-        }
-        if (file.getInformation().getVendor() != null) {
-            fileContents += "Vendor=" + file.getInformation().getVendor() + "\n";
-        }
-
-        //Shortcut executes the jnlp from cache and system preferred java..
-        fileContents += "Exec=" + "javaws" + " \"" + cacheFile.getAbsolutePath() + "\"\n";
-
-        return new StringReader(fileContents);
-
-    }
-
-    /**
-     * Get the size of the icon (in pixels) for the desktop shortcut
-     */
-    public int getIconSize() {
-        return iconSize;
-    }
-
-    /**
-     * Set the icon size to use for the desktop shortcut
-     *
-     * @param size the size (in pixels) of the icon to use. Commonly used sizes
-     *        are of 16, 22, 32, 48, 64 and 128
-     */
-    public void setIconSize(int size) {
-        iconSize = size;
-    }
-
-    /**
-     * Create a desktop shortcut for this desktop entry
-     */
-    public void createDesktopShortcut() {
-        try {
-            cacheIcon();
-            installDesktopLauncher();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Install this XDesktopEntry into the user's desktop as a launcher
-     */
-    private void installDesktopLauncher() {
-        File shortcutFile = new File(JNLPRuntime.TMP_DIR + File.separator
-                + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop");
-        try {
-
-            /*
-             * Write out a Java String (UTF-16) as a UTF-8 file
-             */
-
-            OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(shortcutFile),
-                    Charset.forName("UTF-8"));
-            Reader reader = getContentsAsReader();
-
-            char[] buffer = new char[1024];
-            int ret = 0;
-            while (-1 != (ret = reader.read(buffer))) {
-                writer.write(buffer, 0, ret);
-            }
-
-            reader.close();
-            writer.close();
-
-            /*
-             * Install the desktop entry
-             */
-
-            String[] execString = new String[] { "xdg-desktop-icon", "install", "--novendor",
-                    shortcutFile.getCanonicalPath() };
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("Execing: " + Arrays.toString(execString));
-            }
-            Process installer = Runtime.getRuntime().exec(execString);
-            new StreamEater(installer.getInputStream()).start();
-            new StreamEater(installer.getErrorStream()).start();
-
-            try {
-                installer.waitFor();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-
-            if (!shortcutFile.delete()) {
-                throw new IOException("Unable to delete temporary file:" + shortcutFile);
-            }
-
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Cache the icon for the desktop entry
-     */
-    private void cacheIcon() {
-
-        URL iconLocation = file.getInformation().getIconLocation(IconDesc.SHORTCUT, iconSize,
-                iconSize);
-
-        if (iconLocation == null) {
-            iconLocation = file.getInformation().getIconLocation(IconDesc.DEFAULT, iconSize,
-                    iconSize);
-        }
-
-        if (iconLocation != null) {
-            String location = CacheUtil.getCachedResource(iconLocation, null, UpdatePolicy.SESSION)
-                    .toString();
-            if (!location.startsWith("file:")) {
-                throw new RuntimeException("Unable to cache icon");
-            }
-
-            this.iconLocation = location.substring("file:".length());
-
-            if (JNLPRuntime.isDebug()) {
-                System.err.println("Cached desktop shortcut icon: " + this.iconLocation);
-            }
-        }
-    }
-
-}
--- a/netx/net/sourceforge/nanoxml/XMLElement.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1334 +0,0 @@
-/* XMLElement.java
- *
- * $Revision: 1.2 $
- * $Date: 2002/08/03 04:36:34 $
- * $Name:  $
- *
- * This file is part of NanoXML 2 Lite.
- * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved.
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- *  1. The origin of this software must not be misrepresented; you must not
- *     claim that you wrote the original software. If you use this software in
- *     a product, an acknowledgment in the product documentation would be
- *     appreciated but is not required.
- *
- *  2. Altered source versions must be plainly marked as such, and must not be
- *     misrepresented as being the original software.
- *
- *  3. This notice may not be removed or altered from any source distribution.
- *****************************************************************************/
-
-/* JAM: hacked the source to remove unneeded methods and comments. */
-
-package net.sourceforge.nanoxml;
-
-import java.io.*;
-import java.util.*;
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-
-
-/**
- * XMLElement is a representation of an XML object. The object is able to parse
- * XML code.
- * <P><DL>
- * <DT><B>Parsing XML Data</B></DT>
- * <DD>
- * You can parse XML data using the following code:
- * <UL><CODE>
- * XMLElement xml = new XMLElement();<BR>
- * FileReader reader = new FileReader("filename.xml");<BR>
- * xml.parseFromReader(reader);
- * </CODE></UL></DD></DL>
- * <DL><DT><B>Retrieving Attributes</B></DT>
- * <DD>
- * You can enumerate the attributes of an element using the method
- * {@link #enumerateAttributeNames() enumerateAttributeNames}.
- * The attribute values can be retrieved using the method
- * {@link #getStringAttribute(java.lang.String) getStringAttribute}.
- * The following example shows how to list the attributes of an element:
- * <UL><CODE>
- * XMLElement element = ...;<BR>
- * Enumeration enum = element.getAttributeNames();<BR>
- * while (enum.hasMoreElements()) {<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp;String key = (String) enum.nextElement();<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp;String value = element.getStringAttribute(key);<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp;System.out.println(key + " = " + value);<BR>
- * }
- * </CODE></UL></DD></DL>
- * <DL><DT><B>Retrieving Child Elements</B></DT>
- * <DD>
- * You can enumerate the children of an element using
- * {@link #enumerateChildren() enumerateChildren}.
- * The number of child elements can be retrieved using
- * {@link #countChildren() countChildren}.
- * </DD></DL>
- * <DL><DT><B>Elements Containing Character Data</B></DT>
- * <DD>
- * If an elements contains character data, like in the following example:
- * <UL><CODE>
- * &lt;title&gt;The Title&lt;/title&gt;
- * </CODE></UL>
- * you can retrieve that data using the method
- * {@link #getContent() getContent}.
- * </DD></DL>
- * <DL><DT><B>Subclassing XMLElement</B></DT>
- * <DD>
- * When subclassing XMLElement, you need to override the method
- * {@link #createAnotherElement() createAnotherElement}
- * which has to return a new copy of the receiver.
- * </DD></DL>
- * <P>
- *
- * @see net.sourceforge.nanoxml.XMLParseException
- *
- * @author Marc De Scheemaecker
- *         &lt;<A href="mailto:cyberelf@mac.com">cyberelf@mac.com</A>&gt;
- * @version $Name:  $, $Revision: 1.2 $
- */
-public class XMLElement
-{
-
-    /**
-     * The attributes given to the element.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li>The field can be empty.
-     *     <li>The field is never <code>null</code>.
-     *     <li>The keys and the values are strings.
-     * </ul></dd></dl>
-     */
-    private Hashtable attributes;
-
-
-    /**
-     * Child elements of the element.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li>The field can be empty.
-     *     <li>The field is never <code>null</code>.
-     *     <li>The elements are instances of <code>XMLElement</code>
-     *         or a subclass of <code>XMLElement</code>.
-     * </ul></dd></dl>
-     */
-    private Vector children;
-
-
-    /**
-     * The name of the element.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li>The field is <code>null</code> iff the element is not
-     *         initialized by either parse or setName.
-     *     <li>If the field is not <code>null</code>, it's not empty.
-     *     <li>If the field is not <code>null</code>, it contains a valid
-     *         XML identifier.
-     * </ul></dd></dl>
-     */
-    private String name;
-
-
-    /**
-     * The #PCDATA content of the object.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li>The field is <code>null</code> iff the element is not a
-     *         #PCDATA element.
-     *     <li>The field can be any string, including the empty string.
-     * </ul></dd></dl>
-     */
-    private String contents;
-
-
-    /**
-     * Conversion table for &amp;...; entities. The keys are the entity names
-     * without the &amp; and ; delimiters.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li>The field is never <code>null</code>.
-     *     <li>The field always contains the following associations:
-     *         "lt"&nbsp;=&gt;&nbsp;"&lt;", "gt"&nbsp;=&gt;&nbsp;"&gt;",
-     *         "quot"&nbsp;=&gt;&nbsp;"\"", "apos"&nbsp;=&gt;&nbsp;"'",
-     *         "amp"&nbsp;=&gt;&nbsp;"&amp;"
-     *     <li>The keys are strings
-     *     <li>The values are char arrays
-     * </ul></dd></dl>
-     */
-    private Hashtable entities;
-
-
-    /**
-     * The line number where the element starts.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li><code>lineNr &gt= 0</code>
-     * </ul></dd></dl>
-     */
-    private int lineNr;
-
-
-    /**
-     * <code>true</code> if the case of the element and attribute names
-     * are case insensitive.
-     */
-    private boolean ignoreCase;
-
-
-    /**
-     * <code>true</code> if the leading and trailing whitespace of #PCDATA
-     * sections have to be ignored.
-     */
-    private boolean ignoreWhitespace;
-
-
-    /**
-     * Character read too much.
-     * This character provides push-back functionality to the input reader
-     * without having to use a PushbackReader.
-     * If there is no such character, this field is '\0'.
-     */
-    private char charReadTooMuch;
-
-    /**
-     * Character read too much for the comment remover.
-     */
-    private char sanitizeCharReadTooMuch;
-
-    /**
-     * The reader provided by the caller of the parse method.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li>The field is not <code>null</code> while the parse method
-     *         is running.
-     * </ul></dd></dl>
-     */
-    private Reader reader;
-
-
-    /**
-     * The current line number in the source content.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li>parserLineNr &gt; 0 while the parse method is running.
-     * </ul></dd></dl>
-     */
-    private int parserLineNr;
-
-
-    /**
-     * Creates and initializes a new XML element.
-     * Calling the construction is equivalent to:
-     * <ul><code>new XMLElement(new Hashtable(), false, true)
-     * </code></ul>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>countChildren() => 0
-     *     <li>enumerateChildren() => empty enumeration
-     *     <li>enumeratePropertyNames() => empty enumeration
-     *     <li>getChildren() => empty vector
-     *     <li>getContent() => ""
-     *     <li>getLineNr() => 0
-     *     <li>getName() => null
-     * </ul></dd></dl>
-     *
-     */
-    public XMLElement()
-    {
-        this(new Hashtable(), false, true, true);
-    }
-
-
-    /**
-     * Creates and initializes a new XML element.
-     * <P>
-     * This constructor should <I>only</I> be called from
-     * {@link #createAnotherElement() createAnotherElement}
-     * to create child elements.
-     *
-     * @param entities
-     *     The entity conversion table.
-     * @param skipLeadingWhitespace
-     *     <code>true</code> if leading and trailing whitespace in PCDATA
-     *     content has to be removed.
-     * @param fillBasicConversionTable
-     *     <code>true</code> if the basic entities need to be added to
-     *     the entity list (client code calling this constructor).
-     * @param ignoreCase
-     *     <code>true</code> if the case of element and attribute names have
-     *     to be ignored.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>entities != null</code>
-     *     <li>if <code>fillBasicConversionTable == false</code>
-     *         then <code>entities</code> contains at least the following
-     *         entries: <code>amp</code>, <code>lt</code>, <code>gt</code>,
-     *         <code>apos</code> and <code>quot</code>
-     * </ul></dd></dl>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>countChildren() => 0
-     *     <li>enumerateChildren() => empty enumeration
-     *     <li>enumeratePropertyNames() => empty enumeration
-     *     <li>getChildren() => empty vector
-     *     <li>getContent() => ""
-     *     <li>getLineNr() => 0
-     *     <li>getName() => null
-     * </ul></dd></dl><dl>
-     *
-     */
-    protected XMLElement(Hashtable entities,
-                         boolean   skipLeadingWhitespace,
-                         boolean   fillBasicConversionTable,
-                         boolean   ignoreCase)
-    {
-        this.ignoreWhitespace = skipLeadingWhitespace;
-        this.ignoreCase = ignoreCase;
-        this.name = null;
-        this.contents = "";
-        this.attributes = new Hashtable();
-        this.children = new Vector();
-        this.entities = entities;
-        this.lineNr = 0;
-        Enumeration e = this.entities.keys();
-        while (e.hasMoreElements()) {
-            Object key = e.nextElement();
-            Object value = this.entities.get(key);
-            if (value instanceof String) {
-                value = ((String) value).toCharArray();
-                this.entities.put(key, value);
-            }
-        }
-        if (fillBasicConversionTable) {
-            this.entities.put("amp", new char[] { '&' });
-            this.entities.put("quot", new char[] { '"' });
-            this.entities.put("apos", new char[] { '\'' });
-            this.entities.put("lt", new char[] { '<' });
-            this.entities.put("gt", new char[] { '>' });
-        }
-    }
-
-
-    /**
-     * Adds a child element.
-     *
-     * @param child
-     *     The child element to add.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>child != null</code>
-     *     <li><code>child.getName() != null</code>
-     *     <li><code>child</code> does not have a parent element
-     * </ul></dd></dl>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>countChildren() => old.countChildren() + 1
-     *     <li>enumerateChildren() => old.enumerateChildren() + child
-     *     <li>getChildren() => old.enumerateChildren() + child
-     * </ul></dd></dl><dl>
-     *
-     */
-    public void addChild(XMLElement child)
-    {
-        this.children.addElement(child);
-    }
-
-
-    /**
-     * Adds or modifies an attribute.
-     *
-     * @param name
-     *     The name of the attribute.
-     * @param value
-     *     The value of the attribute.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>name != null</code>
-     *     <li><code>name</code> is a valid XML identifier
-     *     <li><code>value != null</code>
-     * </ul></dd></dl>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>enumerateAttributeNames()
-     *         => old.enumerateAttributeNames() + name
-     *     <li>getAttribute(name) => value
-     * </ul></dd></dl><dl>
-     *
-     */
-    public void setAttribute(String name,
-                             Object value)
-    {
-        if (this.ignoreCase) {
-            name = name.toUpperCase();
-        }
-        this.attributes.put(name, value.toString());
-    }
-
-
-    /**
-     * Returns the number of child elements of the element.
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li><code>result >= 0</code>
-     * </ul></dd></dl>
-     *
-     */
-    public int countChildren()
-    {
-        return this.children.size();
-    }
-
-
-    /**
-     * Enumerates the attribute names.
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li><code>result != null</code>
-     * </ul></dd></dl>
-     *
-     */
-    public Enumeration enumerateAttributeNames()
-    {
-        return this.attributes.keys();
-    }
-
-
-    /**
-     * Enumerates the child elements.
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li><code>result != null</code>
-     * </ul></dd></dl>
-     *
-     */
-    public Enumeration enumerateChildren()
-    {
-        return this.children.elements();
-    }
-
-
-    /**
-     * Returns the PCDATA content of the object. If there is no such content,
-     * <CODE>null</CODE> is returned.
-     *
-     */
-    public String getContent()
-    {
-        return this.contents;
-    }
-
-
-    /**
-     * Returns the line nr in the source data on which the element is found.
-     * This method returns <code>0</code> there is no associated source data.
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li><code>result >= 0</code>
-     * </ul></dd></dl>
-     */
-    public int getLineNr()
-    {
-        return this.lineNr;
-    }
-
-
-    /**
-     * Returns an attribute of the element.
-     * If the attribute doesn't exist, <code>null</code> is returned.
-     *
-     * @param name The name of the attribute.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>name != null</code>
-     *     <li><code>name</code> is a valid XML identifier
-     * </ul></dd></dl><dl>
-     *
-     */
-    public Object getAttribute(String name)
-    {
-        if (this.ignoreCase) {
-            name = name.toUpperCase();
-        }
-        Object value = this.attributes.get(name);
-        return value;
-    }
-
-
-    /**
-     * Returns the name of the element.
-     *
-     */
-    public String getName()
-    {
-        return this.name;
-    }
-
-
-    /**
-     * Reads one XML element from a java.io.Reader and parses it.
-     *
-     * @param reader
-     *     The reader from which to retrieve the XML data.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>reader != null</code>
-     *     <li><code>reader</code> is not closed
-     * </ul></dd></dl>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>the state of the receiver is updated to reflect the XML element
-     *         parsed from the reader
-     *     <li>the reader points to the first character following the last
-     *         '&gt;' character of the XML element
-     * </ul></dd></dl><dl>
-     *
-     * @throws java.io.IOException
-     *     If an error occured while reading the input.
-     * @throws net.sourceforge.nanoxml.XMLParseException
-     *     If an error occured while parsing the read data.
-     */
-    public void parseFromReader(Reader reader)
-    throws IOException, XMLParseException
-    {
-        this.parseFromReader(reader, /*startingLineNr*/ 1);
-    }
-
-
-    /**
-     * Reads one XML element from a java.io.Reader and parses it.
-     *
-     * @param reader
-     *     The reader from which to retrieve the XML data.
-     * @param startingLineNr
-     *     The line number of the first line in the data.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>reader != null</code>
-     *     <li><code>reader</code> is not closed
-     * </ul></dd></dl>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>the state of the receiver is updated to reflect the XML element
-     *         parsed from the reader
-     *     <li>the reader points to the first character following the last
-     *         '&gt;' character of the XML element
-     * </ul></dd></dl><dl>
-     *
-     * @throws java.io.IOException
-     *     If an error occured while reading the input.
-     * @throws net.sourceforge.nanoxml.XMLParseException
-     *     If an error occured while parsing the read data.
-     */
-    public void parseFromReader(Reader reader,
-                                int    startingLineNr)
-        throws IOException, XMLParseException
-    {
-        this.charReadTooMuch = '\0';
-        this.reader = reader;
-        this.parserLineNr = startingLineNr;
-
-        for (;;) {
-            char ch = this.scanWhitespace();
-
-            if (ch != '<') {
-                throw this.expectedInput("<", ch);
-            }
-
-            ch = this.readChar();
-
-            if ((ch == '!') || (ch == '?')) {
-                this.skipSpecialTag(0);
-            } else {
-                this.unreadChar(ch);
-                this.scanElement(this);
-                return;
-            }
-        }
-    }
-
-
-    /**
-     * Creates a new similar XML element.
-     * <P>
-     * You should override this method when subclassing XMLElement.
-     */
-    protected XMLElement createAnotherElement()
-    {
-        return new XMLElement(this.entities,
-                              this.ignoreWhitespace,
-                              false,
-                              this.ignoreCase);
-    }
-
-
-    /**
-     * Changes the content string.
-     *
-     * @param content
-     *     The new content string.
-     */
-    public void setContent(String content)
-    {
-        this.contents = content;
-    }
-
-
-    /**
-     * Changes the name of the element.
-     *
-     * @param name
-     *     The new name.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>name != null</code>
-     *     <li><code>name</code> is a valid XML identifier
-     * </ul></dd></dl>
-     *
-     */
-    public void setName(String name)
-    {
-        this.name = name;
-    }
-
-
-    /**
-     * Scans an identifier from the current reader.
-     * The scanned identifier is appended to <code>result</code>.
-     *
-     * @param result
-     *     The buffer in which the scanned identifier will be put.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>result != null</code>
-     *     <li>The next character read from the reader is a valid first
-     *         character of an XML identifier.
-     * </ul></dd></dl>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>The next character read from the reader won't be an identifier
-     *         character.
-     * </ul></dd></dl><dl>
-     */
-    protected void scanIdentifier(StringBuffer result)
-        throws IOException
-    {
-        for (;;) {
-            char ch = this.readChar();
-            if (((ch < 'A') || (ch > 'Z')) && ((ch < 'a') || (ch > 'z'))
-                && ((ch < '0') || (ch > '9')) && (ch != '_') && (ch != '.')
-                && (ch != ':') && (ch != '-') && (ch <= '\u007E')) {
-                this.unreadChar(ch);
-                return;
-            }
-            result.append(ch);
-        }
-    }
-
-
-    /**
-     * This method scans an identifier from the current reader.
-     *
-     * @return the next character following the whitespace.
-     */
-    protected char scanWhitespace()
-        throws IOException
-    {
-        for (;;) {
-            char ch = this.readChar();
-            switch (ch) {
-                case ' ':
-                case '\t':
-                case '\n':
-                case '\r':
-                    break;
-                default:
-                    return ch;
-            }
-        }
-    }
-
-
-    /**
-     * This method scans an identifier from the current reader.
-     * The scanned whitespace is appended to <code>result</code>.
-     *
-     * @return the next character following the whitespace.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>result != null</code>
-     * </ul></dd></dl>
-     */
-    protected char scanWhitespace(StringBuffer result)
-        throws IOException
-    {
-        for (;;) {
-            char ch = this.readChar();
-            switch (ch) {
-                case ' ':
-                case '\t':
-                case '\n':
-                    result.append(ch);
-                case '\r':
-                    break;
-                default:
-                    return ch;
-            }
-        }
-    }
-
-
-    /**
-     * This method scans a delimited string from the current reader.
-     * The scanned string without delimiters is appended to
-     * <code>string</code>.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>string != null</code>
-     *     <li>the next char read is the string delimiter
-     * </ul></dd></dl>
-     */
-    protected void scanString(StringBuffer string)
-        throws IOException
-    {
-        char delimiter = this.readChar();
-        if ((delimiter != '\'') && (delimiter != '"')) {
-            throw this.expectedInput("' or \"");
-        }
-        for (;;) {
-            char ch = this.readChar();
-            if (ch == delimiter) {
-                return;
-            } else if (ch == '&') {
-                this.resolveEntity(string);
-            } else {
-                string.append(ch);
-            }
-        }
-    }
-
-
-    /**
-     * Scans a #PCDATA element. CDATA sections and entities are resolved.
-     * The next &lt; char is skipped.
-     * The scanned data is appended to <code>data</code>.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>data != null</code>
-     * </ul></dd></dl>
-     */
-    protected void scanPCData(StringBuffer data)
-        throws IOException
-    {
-        for (;;) {
-            char ch = this.readChar();
-            if (ch == '<') {
-                ch = this.readChar();
-                if (ch == '!') {
-                    this.checkCDATA(data);
-                } else {
-                    this.unreadChar(ch);
-                    return;
-                }
-            } else if (ch == '&') {
-                this.resolveEntity(data);
-            } else {
-                data.append(ch);
-            }
-        }
-    }
-
-
-    /**
-     * Scans a special tag and if the tag is a CDATA section, append its
-     * content to <code>buf</code>.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>buf != null</code>
-     *     <li>The first &lt; has already been read.
-     * </ul></dd></dl>
-     */
-    protected boolean checkCDATA(StringBuffer buf)
-        throws IOException
-    {
-        char ch = this.readChar();
-        if (ch != '[') {
-            this.unreadChar(ch);
-            this.skipSpecialTag(0);
-            return false;
-        } else if (! this.checkLiteral("CDATA[")) {
-            this.skipSpecialTag(1); // one [ has already been read
-            return false;
-        } else {
-            int delimiterCharsSkipped = 0;
-            while (delimiterCharsSkipped < 3) {
-                ch = this.readChar();
-                switch (ch) {
-                    case ']':
-                        if (delimiterCharsSkipped < 2) {
-                            delimiterCharsSkipped += 1;
-                        } else {
-                            buf.append(']');
-                            buf.append(']');
-                            delimiterCharsSkipped = 0;
-                        }
-                        break;
-                    case '>':
-                        if (delimiterCharsSkipped < 2) {
-                            for (int i = 0; i < delimiterCharsSkipped; i++) {
-                                buf.append(']');
-                            }
-                            delimiterCharsSkipped = 0;
-                            buf.append('>');
-                        } else {
-                            delimiterCharsSkipped = 3;
-                        }
-                        break;
-                    default:
-                        for (int i = 0; i < delimiterCharsSkipped; i += 1) {
-                            buf.append(']');
-                        }
-                        buf.append(ch);
-                        delimiterCharsSkipped = 0;
-                }
-            }
-            return true;
-        }
-    }
-
-
-    /**
-     * Skips a comment.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li>The first &lt;!-- has already been read.
-     * </ul></dd></dl>
-     */
-    protected void skipComment()
-        throws IOException
-    {
-        int dashesToRead = 2;
-        while (dashesToRead > 0) {
-            char ch = this.readChar();
-            if (ch == '-') {
-                dashesToRead -= 1;
-            } else {
-                dashesToRead = 2;
-            }
-
-            // Be more tolerant of extra -- (double dashes)
-            // in comments.
-            if (dashesToRead == 0) {
-                ch = this.readChar();
-                if (ch == '>') {
-                    return;
-                } else {
-                    dashesToRead = 2;
-                    this.unreadChar(ch);
-                }
-            }
-        }
-        /*
-        if (this.readChar() != '>') {
-            throw this.expectedInput(">");
-        }
-        */
-    }
-
-
-    /**
-     * Skips a special tag or comment.
-     *
-     * @param bracketLevel The number of open square brackets ([) that have
-     *                     already been read.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li>The first &lt;! has already been read.
-     *     <li><code>bracketLevel >= 0</code>
-     * </ul></dd></dl>
-     */
-    protected void skipSpecialTag(int bracketLevel)
-        throws IOException
-    {
-        int tagLevel = 1; // <
-        char stringDelimiter = '\0';
-        if (bracketLevel == 0) {
-            char ch = this.readChar();
-            if (ch == '[') {
-                bracketLevel += 1;
-            } else if (ch == '-') {
-                ch = this.readChar();
-                if (ch == '[') {
-                    bracketLevel += 1;
-                } else if (ch == ']') {
-                    bracketLevel -= 1;
-                } else if (ch == '-') {
-                    this.skipComment();
-                    return;
-                }
-            }
-        }
-        while (tagLevel > 0) {
-            char ch = this.readChar();
-            if (stringDelimiter == '\0') {
-                if ((ch == '"') || (ch == '\'')) {
-                    stringDelimiter = ch;
-                } else if (bracketLevel <= 0) {
-                    if (ch == '<') {
-                        tagLevel += 1;
-                    } else if (ch == '>') {
-                        tagLevel -= 1;
-                    }
-                }
-                if (ch == '[') {
-                    bracketLevel += 1;
-                } else if (ch == ']') {
-                    bracketLevel -= 1;
-                }
-            } else {
-                if (ch == stringDelimiter) {
-                    stringDelimiter = '\0';
-                }
-            }
-        }
-    }
-
-
-    /**
-     * Scans the data for literal text.
-     * Scanning stops when a character does not match or after the complete
-     * text has been checked, whichever comes first.
-     *
-     * @param literal the literal to check.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>literal != null</code>
-     * </ul></dd></dl>
-     */
-    protected boolean checkLiteral(String literal)
-        throws IOException
-    {
-        int length = literal.length();
-        for (int i = 0; i < length; i += 1) {
-            if (this.readChar() != literal.charAt(i)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-
-    /**
-     * Reads a character from a reader.
-     */
-    protected char readChar()
-        throws IOException
-    {
-        if (this.charReadTooMuch != '\0') {
-            char ch = this.charReadTooMuch;
-            this.charReadTooMuch = '\0';
-            return ch;
-        } else {
-            int i = this.reader.read();
-            if (i < 0) {
-                throw this.unexpectedEndOfData();
-            } else if (i == 10) {
-                this.parserLineNr += 1;
-                return '\n';
-            } else {
-                return (char) i;
-            }
-        }
-    }
-
-
-    /**
-     * Scans an XML element.
-     *
-     * @param elt The element that will contain the result.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li>The first &lt; has already been read.
-     *     <li><code>elt != null</code>
-     * </ul></dd></dl>
-     */
-    protected void scanElement(XMLElement elt)
-        throws IOException
-    {
-        StringBuffer buf = new StringBuffer();
-        this.scanIdentifier(buf);
-        String name = buf.toString();
-        elt.setName(name);
-        char ch = this.scanWhitespace();
-        while ((ch != '>') && (ch != '/')) {
-            buf.setLength(0);
-            this.unreadChar(ch);
-            this.scanIdentifier(buf);
-            String key = buf.toString();
-            ch = this.scanWhitespace();
-            if (ch != '=') {
-                throw this.expectedInput("=");
-            }
-            this.unreadChar(this.scanWhitespace());
-            buf.setLength(0);
-            this.scanString(buf);
-            elt.setAttribute(key, buf);
-            ch = this.scanWhitespace();
-        }
-        if (ch == '/') {
-            ch = this.readChar();
-            if (ch != '>') {
-                throw this.expectedInput(">");
-            }
-            return;
-        }
-        buf.setLength(0);
-        ch = this.scanWhitespace(buf);
-        if (ch != '<') {
-            this.unreadChar(ch);
-            this.scanPCData(buf);
-        } else {
-            for (;;) {
-                ch = this.readChar();
-                if (ch == '!') {
-                    if (this.checkCDATA(buf)) {
-                        this.scanPCData(buf);
-                        break;
-                    } else {
-                        ch = this.scanWhitespace(buf);
-                        if (ch != '<') {
-                            this.unreadChar(ch);
-                            this.scanPCData(buf);
-                            break;
-                        }
-                    }
-                } else {
-                    buf.setLength(0);
-                    break;
-                }
-            }
-        }
-        if (buf.length() == 0) {
-            while (ch != '/') {
-                if (ch == '!') {
-                    ch = this.readChar();
-                    if (ch != '-') {
-                        throw this.expectedInput("Comment or Element");
-                    }
-                    ch = this.readChar();
-                    if (ch != '-') {
-                        throw this.expectedInput("Comment or Element");
-                    }
-                    this.skipComment();
-                } else {
-                    this.unreadChar(ch);
-                    XMLElement child = this.createAnotherElement();
-                    this.scanElement(child);
-                    elt.addChild(child);
-                }
-                ch = this.scanWhitespace();
-                if (ch != '<') {
-                    throw this.expectedInput("<");
-                }
-                ch = this.readChar();
-            }
-            this.unreadChar(ch);
-        } else {
-            if (this.ignoreWhitespace) {
-                elt.setContent(buf.toString().trim());
-            } else {
-                elt.setContent(buf.toString());
-            }
-        }
-        ch = this.readChar();
-        if (ch != '/') {
-            throw this.expectedInput("/");
-        }
-        this.unreadChar(this.scanWhitespace());
-        if (! this.checkLiteral(name)) {
-            throw this.expectedInput(name);
-        }
-        if (this.scanWhitespace() != '>') {
-            throw this.expectedInput(">");
-        }
-    }
-
-
-    /**
-     * Resolves an entity. The name of the entity is read from the reader.
-     * The value of the entity is appended to <code>buf</code>.
-     *
-     * @param buf Where to put the entity value.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li>The first &amp; has already been read.
-     *     <li><code>buf != null</code>
-     * </ul></dd></dl>
-     */
-    protected void resolveEntity(StringBuffer buf)
-        throws IOException
-    {
-        char ch = '\0';
-        StringBuffer keyBuf = new StringBuffer();
-        for (;;) {
-            ch = this.readChar();
-            if (ch == ';') {
-                break;
-            }
-            keyBuf.append(ch);
-        }
-        String key = keyBuf.toString();
-        if (key.charAt(0) == '#') {
-            try {
-                if (key.charAt(1) == 'x') {
-                    ch = (char) Integer.parseInt(key.substring(2), 16);
-                } else {
-                    ch = (char) Integer.parseInt(key.substring(1), 10);
-                }
-            } catch (NumberFormatException e) {
-                throw this.unknownEntity(key);
-            }
-            buf.append(ch);
-        } else {
-            char[] value = (char[]) this.entities.get(key);
-            if (value == null) {
-                throw this.unknownEntity(key);
-            }
-            buf.append(value);
-        }
-    }
-
-
-    /**
-     * Pushes a character back to the read-back buffer.
-     *
-     * @param ch The character to push back.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li>The read-back buffer is empty.
-     *     <li><code>ch != '\0'</code>
-     * </ul></dd></dl>
-     */
-    protected void unreadChar(char ch)
-    {
-        this.charReadTooMuch = ch;
-    }
-
-
-    /**
-     * Creates a parse exception for when an invalid valueset is given to
-     * a method.
-     *
-     * @param name The name of the entity.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>name != null</code>
-     * </ul></dd></dl>
-     */
-    protected XMLParseException invalidValueSet(String name)
-    {
-        String msg = "Invalid value set (entity name = \"" + name + "\")";
-        return new XMLParseException(this.getName(), this.parserLineNr, msg);
-    }
-
-
-    /**
-     * Creates a parse exception for when an invalid value is given to a
-     * method.
-     *
-     * @param name  The name of the entity.
-     * @param value The value of the entity.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>name != null</code>
-     *     <li><code>value != null</code>
-     * </ul></dd></dl>
-     */
-    protected XMLParseException invalidValue(String name,
-                                             String value)
-    {
-        String msg = "Attribute \"" + name + "\" does not contain a valid "
-                   + "value (\"" + value + "\")";
-        return new XMLParseException(this.getName(), this.parserLineNr, msg);
-    }
-
-
-    /**
-     * Creates a parse exception for when the end of the data input has been
-     * reached.
-     */
-    protected XMLParseException unexpectedEndOfData()
-    {
-        String msg = "Unexpected end of data reached";
-        return new XMLParseException(this.getName(), this.parserLineNr, msg);
-    }
-
-
-    /**
-     * Creates a parse exception for when a syntax error occured.
-     *
-     * @param context The context in which the error occured.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>context != null</code>
-     *     <li><code>context.length() &gt; 0</code>
-     * </ul></dd></dl>
-     */
-    protected XMLParseException syntaxError(String context)
-    {
-        String msg = "Syntax error while parsing " + context;
-        return new XMLParseException(this.getName(), this.parserLineNr, msg);
-    }
-
-
-    /**
-     * Creates a parse exception for when the next character read is not
-     * the character that was expected.
-     *
-     * @param charSet The set of characters (in human readable form) that was
-     *                expected.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>charSet != null</code>
-     *     <li><code>charSet.length() &gt; 0</code>
-     * </ul></dd></dl>
-     */
-    protected XMLParseException expectedInput(String charSet)
-    {
-        String msg = "Expected: " + charSet;
-        return new XMLParseException(this.getName(), this.parserLineNr, msg);
-    }
-
-    /**
-     * Creates a parse exception for when the next character read is not
-     * the character that was expected.
-     *
-     * @param charSet The set of characters (in human readable form) that was
-     *                expected.
-     * @param ch The character that was received instead.
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>charSet != null</code>
-     *     <li><code>charSet.length() &gt; 0</code>
-     * </ul></dd></dl>
-     */
-    protected XMLParseException expectedInput(String charSet, char ch)
-    {
-        String msg = "Expected: '" + charSet +"'" + " but got: '" + ch + "'";
-        return new XMLParseException(this.getName(), this.parserLineNr, msg);
-    }
-
-    /**
-     * Creates a parse exception for when an entity could not be resolved.
-     *
-     * @param name The name of the entity.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>name != null</code>
-     *     <li><code>name.length() &gt; 0</code>
-     * </ul></dd></dl>
-     */
-    protected XMLParseException unknownEntity(String name)
-    {
-        String msg = "Unknown or invalid entity: &" + name + ";";
-        return new XMLParseException(this.getName(), this.parserLineNr, msg);
-    }
-
-    /**
-     * Reads an xml file and removes the comments, leaving only relevant
-     * xml code.
-     *
-     * @param isr The reader of the InputStream containing the xml.
-     * @param pout The PipedOutputStream that will be receiving the filtered
-     *             xml file.
-     */
-    public void sanitizeInput(InputStreamReader isr, PipedOutputStream pout) {
-        try {
-            PrintStream out = new PrintStream(pout);
-
-            this.sanitizeCharReadTooMuch = '\0';
-            this.reader = isr;
-            this.parserLineNr = 0;
-            int newline = 2;
-            char prev = ' ';
-
-            while(true) {
-                char ch;
-                if (this.sanitizeCharReadTooMuch != '\0') {
-                    ch = this.sanitizeCharReadTooMuch;
-                    this.sanitizeCharReadTooMuch = '\0';
-                } else {
-
-                    int i = this.reader.read();
-                    if (i == -1) {
-                        // no character in buffer, and nothing read
-                        out.flush();
-                        break;
-                    } else if (i == 10) {
-                        ch = '\n';
-                    } else {
-                        ch = (char) i;
-                    }
-                }
-
-                char next;
-                int i = this.reader.read();
-                if (i == -1) {
-                    // character in buffer and nothing read. write out
-                    // what's in the buffer
-                    out.print(ch);
-                    out.flush();
-                    if (JNLPRuntime.isDebug()) {
-                        if (ch == 10) {
-                            System.out.println();
-                            System.out.print("line: " + newline + " ");
-                            newline++;
-                        } else {
-                            System.out.print(ch);
-                        }
-                    }
-                    break;
-                } else if (i == 10) {
-                    next = '\n';
-                } else {
-                    next = (char) i;
-                }
-
-                this.sanitizeCharReadTooMuch = next;
-
-                // If the next char is a ? or !, then we've hit a special tag,
-                // and should skip it.
-                if (prev == '<' && (next == '!' || next == '?')) {
-                    this.skipSpecialTag(0);
-                    this.sanitizeCharReadTooMuch = '\0';
-                }
-                // Otherwise we haven't hit a comment, and we should write ch.
-                else {
-                    out.print(ch);
-                    if (JNLPRuntime.isDebug()) {
-                        if (ch == 10) {
-                            System.out.println();
-                            System.out.print("line: " + newline + " ");
-                            newline++;
-                        } else {
-                            System.out.print(ch);
-                        }
-                    }
-                }
-                prev = next;
-            }
-
-            out.close();
-            isr.close();
-        } catch (Exception e) {
-            // Print the stack trace here -- xml.parseFromReader() will
-            // throw the ParseException if something goes wrong.
-            e.printStackTrace();
-        }
-    }
-}
--- a/netx/net/sourceforge/nanoxml/XMLParseException.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/* XMLParseException.java
- *
- * $Revision: 1.1 $
- * $Date: 2002/08/03 04:05:32 $
- * $Name:  $
- *
- * This file is part of NanoXML 2 Lite.
- * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved.
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- *  1. The origin of this software must not be misrepresented; you must not
- *     claim that you wrote the original software. If you use this software in
- *     a product, an acknowledgment in the product documentation would be
- *     appreciated but is not required.
- *
- *  2. Altered source versions must be plainly marked as such, and must not be
- *     misrepresented as being the original software.
- *
- *  3. This notice may not be removed or altered from any source distribution.
- *****************************************************************************/
-
-
-package net.sourceforge.nanoxml;
-
-
-/**
- * An XMLParseException is thrown when an error occures while parsing an XML
- * string.
- * <P>
- * $Revision: 1.1 $<BR>
- * $Date: 2002/08/03 04:05:32 $<P>
- *
- * @see net.sourceforge.nanoxml.XMLElement
- *
- * @author Marc De Scheemaecker
- * @version $Name:  $, $Revision: 1.1 $
- */
-public class XMLParseException
-    extends RuntimeException
-{
-
-    /**
-     * Indicates that no line number has been associated with this exception.
-     */
-    public static final int NO_LINE = -1;
-
-
-    /**
-     * The line number in the source code where the error occurred, or
-     * <code>NO_LINE</code> if the line number is unknown.
-     *
-     * <dl><dt><b>Invariants:</b></dt><dd>
-     * <ul><li><code>lineNr &gt 0 || lineNr == NO_LINE</code>
-     * </ul></dd></dl>
-     */
-    private int lineNr;
-
-
-    /**
-     * Creates an exception.
-     *
-     * @param name    The name of the element where the error is located.
-     * @param message A message describing what went wrong.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>message != null</code>
-     * </ul></dd></dl>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>getLineNr() => NO_LINE
-     * </ul></dd></dl><dl>
-     */
-    public XMLParseException(String name,
-                             String message)
-    {
-        super("XML Parse Exception during parsing of "
-              + ((name == null) ? "the XML definition"
-                                : ("a " + name + " element"))
-              + ": " + message);
-        this.lineNr = XMLParseException.NO_LINE;
-    }
-
-
-    /**
-     * Creates an exception.
-     *
-     * @param name    The name of the element where the error is located.
-     * @param lineNr  The number of the line in the input.
-     * @param message A message describing what went wrong.
-     *
-     * </dl><dl><dt><b>Preconditions:</b></dt><dd>
-     * <ul><li><code>message != null</code>
-     *     <li><code>lineNr &gt; 0</code>
-     * </ul></dd></dl>
-     *
-     * <dl><dt><b>Postconditions:</b></dt><dd>
-     * <ul><li>getLineNr() => lineNr
-     * </ul></dd></dl><dl>
-     */
-    public XMLParseException(String name,
-                             int    lineNr,
-                             String message)
-    {
-        super("XML Parse Exception during parsing of "
-              + ((name == null) ? "the XML definition"
-                                : ("a " + name + " element"))
-              + " at line " + lineNr + ": " + message);
-        this.lineNr = lineNr;
-    }
-
-
-    /**
-     * Where the error occurred, or <code>NO_LINE</code> if the line number is
-     * unknown.
-     *
-     * @see net.sourceforge.nanoxml.XMLParseException#NO_LINE
-     */
-    public int getLineNr()
-    {
-        return this.lineNr;
-    }
-
-}
--- a/patches/extensions/liveconnect-dist.patch	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/common/internal/Defs-liveconnect.gmk openjdk/jdk/make/common/internal/Defs-liveconnect.gmk
---- openjdk.orig/jdk/make/common/internal/Defs-liveconnect.gmk	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/make/common/internal/Defs-liveconnect.gmk	2009-11-11 02:53:36.000000000 +0000
-@@ -0,0 +1,28 @@
-+#
-+# Copyright 2009 Red Hat, Inc.  All Rights Reserved.
-+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+#
-+# This code is free software; you can redistribute it and/or modify it
-+# under the terms of the GNU General Public License version 2 only, as
-+# published by the Free Software Foundation.  Red Hat designates this
-+# particular file as subject to the "Classpath" exception as provided
-+# by Sun in the LICENSE file that accompanied this code.
-+#
-+# This code is distributed in the hope that it will be useful, but WITHOUT
-+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+# version 2 for more details (a copy is included in the LICENSE file that
-+# accompanied this code).
-+#
-+# You should have received a copy of the GNU General Public License version
-+# 2 along with this work; if not, write to the Free Software Foundation,
-+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+#
-+
-+# The specific packages that come from or go to rt.jar and tools.jar
-+IMPORT_RT_PACKAGES += \
-+     netscape/javascript \
-+     sun/applet
-+
-+IMPORT_TOOLS_PACKAGES +=
-+
-diff -Nru openjdk.orig/jdk/make/common/internal/ImportComponents.gmk openjdk/jdk/make/common/internal/ImportComponents.gmk
---- openjdk.orig/jdk/make/common/internal/ImportComponents.gmk	2009-11-11 02:52:44.000000000 +0000
-+++ openjdk/jdk/make/common/internal/ImportComponents.gmk	2009-11-11 02:57:32.000000000 +0000
-@@ -49,6 +49,9 @@
- ifndef NETX_DIST
-   include $(BUILDDIR)/common/internal/Defs-netx.gmk
- endif
-+ifndef LIVECONNECT_DIST
-+  include $(BUILDDIR)/common/internal/Defs-liveconnect.gmk
-+endif
- 
- # Clean up these lists so empty lists are empty
- IMPORT_TOOLS_PACKAGES := $(strip $(IMPORT_TOOLS_PACKAGES))
-@@ -123,6 +126,7 @@
- $(call import-one-sources,JAXP_DIST,$1)
- $(call import-one-sources,JAXWS_DIST,$1)
- $(call import-one-sources,NETX_DIST,$1)
-+$(call import-one-sources,LIVECONNECT_DIST,$1)
- endef
- 
- # Import all component docs into directory $1 (optional)
-@@ -162,6 +166,7 @@
- $(call import-one-classes,JAXP_DIST,$1)
- $(call import-one-classes,JAXWS_DIST,$1)
- $(call import-one-classes,NETX_DIST,$1)
-+$(call import-one-classes,LIVECONNECT_DIST,$1)
- endef
- 
- # Clean up import files
-diff -Nru openjdk.orig/jdk/make/common/shared/Defs.gmk openjdk/jdk/make/common/shared/Defs.gmk
---- openjdk.orig/jdk/make/common/shared/Defs.gmk	2009-11-11 02:52:44.000000000 +0000
-+++ openjdk/jdk/make/common/shared/Defs.gmk	2009-11-11 02:13:22.000000000 +0000
-@@ -365,6 +365,11 @@
- else
-   NETX_DIST =
- endif
-+ifdef ALT_LIVECONNECT_DIST
-+  LIVECONNECT_DIST := $(call FullPath,$(ALT_LIVECONNECT_DIST))
-+else
-+  LIVECONNECT_DIST =
-+endif
- 
- # HOTSPOT_DOCS_IMPORT_PATH: Path to hotspot docs files to import into the docs generation
- ifdef ALT_HOTSPOT_DOCS_IMPORT_PATH
--- a/patches/extensions/liveconnect.patch	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/docs/NON_CORE_PKGS.gmk openjdk/jdk/make/docs/NON_CORE_PKGS.gmk
---- openjdk.orig/jdk/make/docs/NON_CORE_PKGS.gmk	2009-12-04 23:26:19.000000000 +0000
-+++ openjdk/jdk/make/docs/NON_CORE_PKGS.gmk	2010-05-04 12:02:43.000000000 +0100
-@@ -84,6 +84,8 @@
- TREEAPI_PKGS 	 = com.sun.source.tree \
- 		   com.sun.source.util
- 
-+JAVASCRIPT_PKGS  = netscape.javascript
-+
- SMARTCARDIO_PKGS = javax.smartcardio
- 
- SCTPAPI_PKGS     = com.sun.nio.sctp
-@@ -94,6 +96,7 @@
- # non-core packages in rt.jar
- NON_CORE_PKGS    = $(DOMAPI_PKGS) \
-                    $(MGMT_PKGS) \
-+                   $(JAVASCRIPT_PKGS) \
-                    $(JAAS_PKGS) \
-                    $(JGSS_PKGS) \
-                    $(NIO_PKGS) \
-diff -Nru openjdk.orig/jdk/make/sun/Makefile openjdk/jdk/make/sun/Makefile
---- openjdk.orig/jdk/make/sun/Makefile	2010-04-28 22:05:28.000000000 +0100
-+++ openjdk/jdk/make/sun/Makefile	2010-05-04 12:06:20.000000000 +0100
-@@ -64,7 +64,7 @@
- SUBDIRS_desktop    = audio $(RENDER_SUBDIR) image \
-                      awt splashscreen $(XAWT_SUBDIR) \
-                      $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
--                     jawt font jpeg cmm applet beans
-+                     jawt font jpeg cmm applet beans plugin
- SUBDIRS_management = management
- SUBDIRS_misc       = jkernel $(ORG_SUBDIR) \
-                      rmi $(JDBC_SUBDIR) tracing
-diff -Nru openjdk.orig/jdk/make/sun/plugin/Makefile openjdk/jdk/make/sun/plugin/Makefile
---- openjdk.orig/jdk/make/sun/plugin/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/make/sun/plugin/Makefile	2010-05-04 12:02:43.000000000 +0100
-@@ -0,0 +1,53 @@
-+#
-+# Copyright 1995-2005 Sun Microsystems, Inc.  All Rights Reserved.
-+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+#
-+# This code is free software; you can redistribute it and/or modify it
-+# under the terms of the GNU General Public License version 2 only, as
-+# published by the Free Software Foundation.  Sun designates this
-+# particular file as subject to the "Classpath" exception as provided
-+# by Sun in the LICENSE file that accompanied this code.
-+#
-+# This code is distributed in the hope that it will be useful, but WITHOUT
-+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+# version 2 for more details (a copy is included in the LICENSE file that
-+# accompanied this code).
-+#
-+# You should have received a copy of the GNU General Public License version
-+# 2 along with this work; if not, write to the Free Software Foundation,
-+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+#
-+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-+# CA 95054 USA or visit www.sun.com if you need additional information or
-+# have any questions.
-+#
-+
-+#
-+# Makefile for pluginappletviewer wrapper.
-+#
-+
-+BUILDDIR = ../..
-+PACKAGE = sun.applet
-+PRODUCT = sun
-+PROGRAM = pluginappletviewer
-+include $(BUILDDIR)/common/Defs.gmk
-+
-+#
-+# Files to compile.
-+#
-+AUTO_FILES_JAVA_DIRS = sun/applet
-+
-+ifneq ($(PLATFORM), windows)
-+  #
-+  # Anything with a GUI needs X11 to be linked in.
-+  #
-+  OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 
-+endif # PLATFORM
-+
-+#
-+# Rules
-+#
-+JAVA_ARGS = { "sun.applet.PluginMain" }
-+include $(BUILDDIR)/common/Program.gmk
-+
--- a/patches/extensions/netx-dist.patch	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/common/internal/Defs-netx.gmk openjdk/jdk/make/common/internal/Defs-netx.gmk
---- openjdk.orig/jdk/make/common/internal/Defs-netx.gmk	1970-01-01 01:00:00.000000000 +0100
-+++ openjdk/jdk/make/common/internal/Defs-netx.gmk	2009-05-28 09:18:45.000000000 +0100
-@@ -0,0 +1,38 @@
-+#
-+# Copyright 2009 Red Hat, Inc.  All Rights Reserved.
-+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+#
-+# This code is free software; you can redistribute it and/or modify it
-+# under the terms of the GNU General Public License version 2 only, as
-+# published by the Free Software Foundation.  Red Hat designates this
-+# particular file as subject to the "Classpath" exception as provided
-+# by Sun in the LICENSE file that accompanied this code.
-+#
-+# This code is distributed in the hope that it will be useful, but WITHOUT
-+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+# version 2 for more details (a copy is included in the LICENSE file that
-+# accompanied this code).
-+#
-+# You should have received a copy of the GNU General Public License version
-+# 2 along with this work; if not, write to the Free Software Foundation,
-+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+#
-+
-+# The specific packages that come from or go to rt.jar and tools.jar
-+IMPORT_RT_PACKAGES += \
-+     net/sourceforge/jnlp \
-+     net/sourceforge/jnlp/tools \
-+     net/sourceforge/jnlp/runtime \
-+     net/sourceforge/jnlp/util \
-+     net/sourceforge/jnlp/services \
-+     net/sourceforge/jnlp/security \
-+     net/sourceforge/jnlp/security/viewer \
-+     net/sourceforge/jnlp/cache \
-+     net/sourceforge/jnlp/event \
-+     net/sourceforge/jnlp/resources \
-+     net/sourceforge/nanoxml \
-+     javax/jnlp
-+
-+IMPORT_TOOLS_PACKAGES +=
-+
-diff -Nru openjdk.orig/jdk/make/common/internal/ImportComponents.gmk openjdk/jdk/make/common/internal/ImportComponents.gmk
---- openjdk.orig/jdk/make/common/internal/ImportComponents.gmk	2009-05-29 02:09:27.000000000 +0100
-+++ openjdk/jdk/make/common/internal/ImportComponents.gmk	2009-05-29 02:10:56.000000000 +0100
-@@ -46,6 +46,9 @@
- ifndef JAXWS_DIST
-   include $(BUILDDIR)/common/internal/Defs-jaxws.gmk
- endif
-+ifndef NETX_DIST
-+  include $(BUILDDIR)/common/internal/Defs-netx.gmk
-+endif
- 
- # Clean up these lists so empty lists are empty
- IMPORT_TOOLS_PACKAGES := $(strip $(IMPORT_TOOLS_PACKAGES))
-@@ -119,6 +122,7 @@
- $(call import-one-sources,CORBA_DIST,$1)
- $(call import-one-sources,JAXP_DIST,$1)
- $(call import-one-sources,JAXWS_DIST,$1)
-+$(call import-one-sources,NETX_DIST,$1)
- endef
- 
- # Import all component docs into directory $1 (optional)
-@@ -157,6 +161,7 @@
- $(call import-one-classes,CORBA_DIST,$1)
- $(call import-one-classes,JAXP_DIST,$1)
- $(call import-one-classes,JAXWS_DIST,$1)
-+$(call import-one-classes,NETX_DIST,$1)
- endef
- 
- # Clean up import files
-diff -Nru openjdk.orig/jdk/make/common/shared/Defs.gmk openjdk/jdk/make/common/shared/Defs.gmk
---- openjdk.orig/jdk/make/common/shared/Defs.gmk	2009-05-29 02:09:27.000000000 +0100
-+++ openjdk/jdk/make/common/shared/Defs.gmk	2009-05-29 02:11:18.000000000 +0100
-@@ -344,6 +344,11 @@
- else
-   JAXWS_DIST =
- endif
-+ifdef ALT_NETX_DIST
-+  NETX_DIST := $(call FullPath,$(ALT_NETX_DIST))
-+else
-+  NETX_DIST =
-+endif
- 
- # HOTSPOT_DOCS_IMPORT_PATH: Path to hotspot docs files to import into the docs generation
- ifdef ALT_HOTSPOT_DOCS_IMPORT_PATH
--- a/patches/extensions/netx-umask.patch	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/launchers/Makefile.launcher openjdk/jdk/make/launchers/Makefile.launcher
---- openjdk.orig/jdk/make/launchers/Makefile.launcher	2008-07-03 08:42:32.000000000 +0100
-+++ openjdk/jdk/make/launchers/Makefile.launcher	2008-07-21 02:49:53.000000000 +0100
-@@ -153,6 +153,16 @@
-   endif
- endif
- 
-+# pluginappletviewer only
-+ifeq ($(PROGRAM), pluginappletviewer)
-+  OTHER_CPPFLAGS += -DUSE_UMASK=\"077\"
-+endif
-+
-+# javaws only
-+ifeq ($(PROGRAM), javaws)
-+  OTHER_CPPFLAGS += -DUSE_UMASK=\"077\"
-+endif
-+
- # GUI tools
- ifeq ($(GUI_TOOL),true)
-   ifneq ($(PLATFORM), windows)
-diff -Nru openjdk.orig/jdk/src/share/bin/java.c openjdk/jdk/src/share/bin/java.c
---- openjdk.orig/jdk/src/share/bin/java.c	2008-07-03 08:42:35.000000000 +0100
-+++ openjdk/jdk/src/share/bin/java.c	2008-07-21 02:53:15.000000000 +0100
-@@ -76,6 +76,8 @@
- static jboolean _wc_enabled = JNI_FALSE;
- static jint _ergo_policy = DEFAULT_POLICY;
- 
-+#define MAXMASK 4095 /* Same as octal 07777 */
-+
- /*
-  * Entries for splash screen environment variables.
-  * putenv is performed in SelectVersion. We need
-@@ -162,6 +164,10 @@
- 
- int JNICALL JavaMain(void * args); /* entry point                  */
- 
-+/* umask things */
-+static int FindUMask(int *, char ***, int *);
-+static int VerifyMask(char *, int*);
-+ 
- typedef struct {
-   int     argc;
-   char ** argv;
-@@ -272,6 +278,26 @@
-         SetClassPath(cpath);
-     }
- 
-+#ifdef USE_UMASK
-+	/* Set umask */
-+	int mask;
-+    // Check to see if we can find a umask on the command line.
-+    if (FindUMask(&argc, &argv, &mask) < 0)
-+    {
-+        // We didn't find a umask, so fall back to the default one.
-+        char * defaultMask = (char *) JLI_MemAlloc(5 * sizeof(char));
-+        strcpy(defaultMask, USE_UMASK);
-+        int converted;
-+        VerifyMask(defaultMask, &converted);
-+        JLI_MemFree(defaultMask);
-+		umask(converted); /* from sys/stat.h */
-+    }
-+    else
-+    {
-+		umask(mask);
-+    }
-+#endif
-+
-     /*
-      *  Parse command line options; if the return value of
-      *  ParseArguments is false, the program should exit.
-@@ -2027,3 +2053,87 @@
-     fprintf(stderr, "\n");
-     va_end(vl);
- }
-+
-+/**
-+ * Searches argv to find any parameters that start with "-umask=".
-+ * Sets maskToSet with the mask if a -umask is found, and if the mask
-+ * supplied is valid. Returns 1 if a valid mask was found and set,
-+ * -1 otherwise.
-+ */
-+int FindUMask(int *pargc, char *** pargv, int *maskToSet)
-+{
-+    int found_mask = -1;
-+
-+    // our handles to the original list
-+    int argc = *pargc;
-+    char **argv = *pargv;
-+
-+    // the new set
-+    int nargc = argc;
-+    char ** nargv = (char **) JLI_MemAlloc((nargc + 1) * sizeof(char *));
-+
-+    // set the original set to the new set
-+    *pargv = nargv;
-+    *pargc = nargc;
-+
-+    char *maskString = (char *) JLI_MemAlloc(6 * sizeof(char *));
-+	int i;
-+    for (i = 0; i < argc; i++)
-+    {
-+        char *arg = argv[i];
-+        if (strncmp(arg, "-umask=",7) == 0)
-+        {
-+            strncpy(maskString, arg+7, 5);
-+
-+            if (VerifyMask(maskString, maskToSet) < 0)
-+            {
-+                printf("Invalid umask %s, application stopped.\n", maskString);
-+                exit(1);
-+            }
-+
-+            found_mask = 1;
-+            nargc--;
-+            (*pargc)--;
-+        }
-+        else
-+        {
-+            *nargv++ = arg;
-+        }
-+    }
-+
-+    JLI_MemFree(maskString);
-+
-+    return found_mask;
-+}
-+
-+/**
-+ * Takes an octal mask in string form, and converts it to
-+ * decimal form in convertedMask. The decimal form can then be
-+ * easily passed to umask(). Returns 1 if the mask is valid, -1 otherwise.
-+ */
-+int VerifyMask(char * maskString, int * convertedMask)
-+{
-+    // Borrowed from coreutils modechange.c
-+    if ('0' <= *maskString && *maskString < '8')
-+    {
-+        unsigned int decimal_mode = 0;
-+
-+        do {
-+            decimal_mode = 8 * decimal_mode + *maskString++ - '0';
-+        } while ('0' <= *maskString && *maskString < '8');
-+
-+        if (decimal_mode > MAXMASK)
-+            return -1;
-+        else if (*maskString)
-+            return -1;
-+        else
-+            *convertedMask = decimal_mode;
-+
-+        return 1;
-+    }
-+    else
-+    {
-+        return -1;
-+    }
-+
-+}
-diff -Nru openjdk.orig/jdk/src/share/bin/java.h openjdk/jdk/src/share/bin/java.h
---- openjdk.orig/jdk/src/share/bin/java.h	2008-07-21 02:51:54.000000000 +0100
-+++ openjdk/jdk/src/share/bin/java.h	2008-07-21 02:53:18.000000000 +0100
-@@ -29,6 +29,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <sys/stat.h>
- #include <limits.h>
- 
- #include <jni.h>
--- a/patches/extensions/netx.patch	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-diff -Nru openjdk.orig/jdk/make/docs/NON_CORE_PKGS.gmk openjdk/jdk/make/docs/NON_CORE_PKGS.gmk
---- openjdk.orig/jdk/make/docs/NON_CORE_PKGS.gmk	2010-11-12 01:20:48.000000000 +0000
-+++ openjdk/jdk/make/docs/NON_CORE_PKGS.gmk	2010-11-19 15:52:19.339315874 +0000
-@@ -93,6 +93,8 @@
- 
- ORACLENET_PKGS   = com.oracle.net
- 
-+JNLP_PKGS        = javax.jnlp
-+
- # non-core packages in rt.jar
- NON_CORE_PKGS    = $(DOMAPI_PKGS) \
-                    $(MGMT_PKGS) \
-@@ -102,6 +104,7 @@
-                    $(OLD_JSSE_PKGS) \
-                    $(HTTPSERVER_PKGS) \
-                    $(SMARTCARDIO_PKGS) \
-+                   $(JNLP_PKGS) \
-                    $(TRACING_PKGS) \
-                    $(SCTPAPI_PKGS) \
-                    $(ORACLENET_PKGS)
-diff -Nru openjdk.orig/jdk/make/launchers/Makefile openjdk/jdk/make/launchers/Makefile
---- openjdk.orig/jdk/make/launchers/Makefile	2010-07-29 21:55:27.000000000 +0100
-+++ openjdk/jdk/make/launchers/Makefile	2010-11-19 15:52:19.339315874 +0000
-@@ -57,6 +57,7 @@
- $(call make-launcher, javadoc, com.sun.tools.javadoc.Main, , )
- $(call make-launcher, javah, com.sun.tools.javah.Main, , )
- $(call make-launcher, javap, com.sun.tools.javap.Main, , )
-+$(call make-launcher, javaws, net.sourceforge.jnlp.runtime.Boot, , )
- $(call make-launcher, jconsole, sun.tools.jconsole.JConsole, \
-   -J-Djconsole.showOutputViewer, )
- $(call make-launcher, jdb, com.sun.tools.example.debug.tty.TTY, , )
-diff -Nru openjdk.orig/jdk/src/share/classes/sun/applet/AppletPanel.java openjdk/jdk/src/share/classes/sun/applet/AppletPanel.java
---- openjdk.orig/jdk/src/share/classes/sun/applet/AppletPanel.java	2010-07-29 21:55:50.000000000 +0100
-+++ openjdk/jdk/src/share/classes/sun/applet/AppletPanel.java	2010-11-19 15:52:19.339315874 +0000
-@@ -67,7 +67,7 @@
-     /**
-      * The applet (if loaded).
-      */
--    Applet applet;
-+    protected Applet applet;
- 
-     /**
-      * Applet will allow initialization.  Should be
-@@ -161,7 +161,8 @@
-      * Creates a thread to run the applet. This method is called
-      * each time an applet is loaded and reloaded.
-      */
--    synchronized void createAppletThread() {
-+	//Overridden by NetxPanel.
-+    protected synchronized void createAppletThread() {
-         // Create a thread group for the applet, and start a new
-         // thread to load the applet.
-         String nm = "applet-" + getCode();
-@@ -305,7 +306,7 @@
-     /**
-      * Get an event from the queue.
-      */
--    synchronized AppletEvent getNextEvent() throws InterruptedException {
-+    protected synchronized AppletEvent getNextEvent() throws InterruptedException {
-         while (queue == null || queue.isEmpty()) {
-             wait();
-         }
-@@ -694,7 +695,8 @@
-      * applet event processing so that it can be gracefully interrupted from
-      * things like HotJava.
-      */
--    private void runLoader() {
-+	//Overridden by NetxPanel.
-+    protected void runLoader() {
-         if (status != APPLET_DISPOSE) {
-             showAppletStatus("notdisposed");
-             return;
-diff -Nru openjdk.orig/jdk/src/share/classes/sun/applet/AppletViewerPanel.java openjdk/jdk/src/share/classes/sun/applet/AppletViewerPanel.java
---- openjdk.orig/jdk/src/share/classes/sun/applet/AppletViewerPanel.java	2010-07-29 21:55:50.000000000 +0100
-+++ openjdk/jdk/src/share/classes/sun/applet/AppletViewerPanel.java	2010-11-19 15:52:19.359315121 +0000
-@@ -42,25 +42,25 @@
-  *
-  * @author      Arthur van Hoff
-  */
--class AppletViewerPanel extends AppletPanel {
-+public class AppletViewerPanel extends AppletPanel {
- 
-     /* Are we debugging? */
--    static boolean debug = false;
-+    protected static boolean debug = false;
- 
-     /**
-      * The document url.
-      */
--    URL documentURL;
-+    protected URL documentURL;
- 
-     /**
-      * The base url.
-      */
--    URL baseURL;
-+    protected URL baseURL;
- 
-     /**
-      * The attributes of the applet.
-      */
--    Hashtable atts;
-+    protected Hashtable atts;
- 
-     /*
-      * JDK 1.1 serialVersionUID
-@@ -70,7 +70,7 @@
-     /**
-      * Construct an applet viewer and start the applet.
-      */
--    AppletViewerPanel(URL documentURL, Hashtable atts) {
-+    protected AppletViewerPanel(URL documentURL, Hashtable atts) {
-         this.documentURL = documentURL;
-         this.atts = atts;
- 
-@@ -202,12 +202,12 @@
-         return (AppletContext)getParent();
-     }
- 
--    static void debug(String s) {
-+    protected static void debug(String s) {
-         if(debug)
-             System.err.println("AppletViewerPanel:::" + s);
-     }
- 
--    static void debug(String s, Throwable t) {
-+    protected static void debug(String s, Throwable t) {
-         if(debug) {
-             t.printStackTrace();
-             debug(s);
--- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1392 +0,0 @@
-/* IcedTeaJavaRequestProcessor.cc
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include <typeinfo>
-
-#include "IcedTeaJavaRequestProcessor.h"
-#include "IcedTeaScriptablePluginObject.h"
-
-/*
- * This class processes LiveConnect requests from JavaScript to Java.
- *
- * It sends the requests to Java, gets the return information, and sends it
- * back to the browser/JavaScript
- */
-
-/**
- * Processes return information from JavaSide (return messages of requests)
- *
- * @param message The message request to process
- * @return boolean indicating whether the message is serviceable by this object
- */
-
-bool
-JavaRequestProcessor::newMessageOnBus(const char* message)
-{
-
-	// Anything we are waiting for _MUST_ have and instance id and reference #
-	std::vector<std::string*>* message_parts = IcedTeaPluginUtilities::strSplit(message, " ");
-
-	IcedTeaPluginUtilities::printStringPtrVector("JavaRequest::newMessageOnBus:", message_parts);
-
-	if (*(message_parts->at(0)) == "context" && *(message_parts->at(2)) == "reference")
-		if (atoi(message_parts->at(1)->c_str()) == this->instance && atoi(message_parts->at(3)->c_str()) == this->reference)
-		{
-			// Gather the results
-
-			// Let's get errors out of the way first
-			if (!message_parts->at(4)->find("Error"))
-			{
-				for (int i=5; i < message_parts->size(); i++)
-				{
-					result->error_msg->append(*(message_parts->at(i)));
-					result->error_msg->append(" ");
-				}
-
-				printf("Error on Java side: %s\n", result->error_msg->c_str());
-
-				result->error_occurred = true;
-				result_ready = true;
-			}
-			else if (!message_parts->at(4)->find("GetStringUTFChars") ||
-			         !message_parts->at(4)->find("GetToStringValue"))
-			{
-				// first item is length, and it is radix 10
-				int length = strtol(message_parts->at(5)->c_str(), NULL, 10);
-
-				IcedTeaPluginUtilities::getUTF8String(length, 6 /* start at */, message_parts, result->return_string);
-				result_ready = true;
-			}
-			else if (!message_parts->at(4)->find("GetStringChars")) // GetStringChars (UTF-16LE/UCS-2)
-			{
-				// first item is length, and it is radix 10
-				int length = strtol(message_parts->at(5)->c_str(), NULL, 10);
-
-				IcedTeaPluginUtilities::getUTF16LEString(length, 6 /* start at */, message_parts, result->return_wstring);
-				result_ready = true;
-			} else if (!message_parts->at(4)->find("FindClass") ||
-			           !message_parts->at(4)->find("GetClassName") ||
-			           !message_parts->at(4)->find("GetClassID") ||
-			           !message_parts->at(4)->find("GetMethodID") ||
-			           !message_parts->at(4)->find("GetStaticMethodID") ||
-			           !message_parts->at(4)->find("GetObjectClass") ||
-			           !message_parts->at(4)->find("NewObject") ||
-			           !message_parts->at(4)->find("NewStringUTF") ||
-			           !message_parts->at(4)->find("HasPackage") ||
-			           !message_parts->at(4)->find("HasMethod") ||
-			           !message_parts->at(4)->find("HasField") ||
-			           !message_parts->at(4)->find("GetStaticFieldID") ||
-			           !message_parts->at(4)->find("GetFieldID") ||
-			           !message_parts->at(4)->find("GetJavaObject") ||
-			           !message_parts->at(4)->find("IsInstanceOf") ||
-			           !message_parts->at(4)->find("NewArray"))
-			{
-				result->return_identifier = atoi(message_parts->at(5)->c_str());
-				result->return_string->append(*(message_parts->at(5))); // store it as a string as well, for easy access
-				result_ready = true;
-			}  else if (!message_parts->at(4)->find("DeleteLocalRef") ||
-			            !message_parts->at(4)->find("NewGlobalRef"))
-			{
-			    result_ready = true; // nothing else to do
-			} else if (!message_parts->at(4)->find("CallMethod") ||
-			           !message_parts->at(4)->find("CallStaticMethod") ||
-			           !message_parts->at(4)->find("GetField") ||
-			           !message_parts->at(4)->find("GetStaticField") ||
-			           !message_parts->at(4)->find("GetValue") ||
-			           !message_parts->at(4)->find("GetObjectArrayElement"))
-			{
-
-			    if (!message_parts->at(5)->find("literalreturn"))
-                {
-			        // literal returns don't have a corresponding jni id
-			        result->return_identifier = 0;
-			        result->return_string->append(*(message_parts->at(5)));
-			        result->return_string->append(" ");
-			        result->return_string->append(*(message_parts->at(6)));
-
-                } else
-			    {
-                    // Else it is a complex object
-
-			        result->return_identifier = atoi(message_parts->at(5)->c_str());
-			        result->return_string->append(*(message_parts->at(5))); // store it as a string as well, for easy access
-			    }
-
-				result_ready = true;
-			} else if (!message_parts->at(4)->find("GetArrayLength"))
-            {
-			    result->return_identifier = 0; // length is not an "identifier"
-			    result->return_string->append(*(message_parts->at(5)));
-			    result_ready = true;
-            } else if (!message_parts->at(4)->find("SetField") ||
-                       !message_parts->at(4)->find("SetObjectArrayElement"))
-            {
-
-                // nothing to do
-
-                result->return_identifier = 0;
-                result_ready = true;
-            }
-
-            IcedTeaPluginUtilities::freeStringPtrVector(message_parts);
-			return true;
-		}
-
-    IcedTeaPluginUtilities::freeStringPtrVector(message_parts);
-	return false;
-}
-
-/**
- * Constructor.
- *
- * Initializes the result data structure (heap)
- */
-
-JavaRequestProcessor::JavaRequestProcessor()
-{
-    PLUGIN_DEBUG("JavaRequestProcessor constructor\n");
-
-	// caller frees this
-	result = new JavaResultData();
-	result->error_msg = new std::string();
-	result->return_identifier = 0;
-	result->return_string = new std::string();
-	result->return_wstring = new std::wstring();
-	result->error_occurred = false;
-
-	result_ready = false;
-}
-
-/**
- * Destructor
- *
- * Frees memory used by the result struct
- */
-
-JavaRequestProcessor::~JavaRequestProcessor()
-{
-    PLUGIN_DEBUG("JavaRequestProcessor::~JavaRequestProcessor\n");
-
-	if (result)
-	{
-		if (result->error_msg)
-			delete result->error_msg;
-
-		if (result->return_string)
-			delete result->return_string;
-
-		if (result->return_wstring)
-			delete result->return_wstring;
-
-		delete result;
-	}
-}
-
-/**
- * Resets the results
- */
-void
-JavaRequestProcessor::resetResult()
-{
-	// caller frees this
-	result->error_msg->clear();
-	result->return_identifier = 0;
-	result->return_string->clear();
-	result->return_wstring->clear();
-	result->error_occurred = false;
-
-	result_ready = false;
-}
-
-void
-JavaRequestProcessor::postAndWaitForResponse(std::string message)
-{
-    struct timespec t;
-    clock_gettime(CLOCK_REALTIME, &t);
-    t.tv_sec += REQUESTTIMEOUT; // 1 minute timeout
-
-    // Clear the result
-    resetResult();
-
-    java_to_plugin_bus->subscribe(this);
-    plugin_to_java_bus->post(message.c_str());
-
-    // Wait for result to be filled in.
-	struct timespec curr_t;
-
-    do
-    {
-    	clock_gettime(CLOCK_REALTIME, &curr_t);
-
-		if (!result_ready && (curr_t.tv_sec < t.tv_sec))
-		{
-			if (g_main_context_pending(NULL))
-				g_main_context_iteration(NULL, false);
-			else
-				usleep(200);
-		}
-		else
-			break;
-
-    } while (1);
-
-    if (curr_t.tv_sec >= t.tv_sec)
-    {
-    	result->error_occurred = true;
-    	result->error_msg->append("Error: Timed out when waiting for response");
-
-    	// Report error
-    	PLUGIN_DEBUG("Error: Timed out when waiting for response to %s\n", message.c_str());
-    }
-
-    java_to_plugin_bus->unSubscribe(this);
-}
-
-/**
- * Given an object id, fetches the toString() value from Java
- *
- * @param object_id The ID of the object
- * @return A JavaResultData struct containing the result of the request
- */
-
-JavaResultData*
-JavaRequestProcessor::getToStringValue(std::string object_id)
-{
-	std::string message = std::string();
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" GetToStringValue "); // get it in UTF8
-    message.append(object_id);
-
-    postAndWaitForResponse(message);
-
-	IcedTeaPluginUtilities::releaseReference();
-
-	return result;
-}
-
-/**
- * Given an object id, fetches the value of that ID from Java
- *
- * @param object_id The ID of the object
- * @return A JavaResultData struct containing the result of the request
- */
-
-JavaResultData*
-JavaRequestProcessor::getValue(std::string object_id)
-{
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" GetValue "); // get it in UTF8
-    message.append(object_id);
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-/**
- * Given a string id, fetches the actual string from Java side
- *
- * @param string_id The ID of the string
- * @return A JavaResultData struct containing the result of the request
- */
-
-JavaResultData*
-JavaRequestProcessor::getString(std::string string_id)
-{
-    std::string message = std::string();
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" GetStringUTFChars "); // get it in UTF8
-    message.append(string_id);
-
-    postAndWaitForResponse(message);
-
-	IcedTeaPluginUtilities::releaseReference();
-
-	return result;
-}
-
-/**
- * Decrements reference count by 1
- *
- * @param object_id The ID of the object
- */
-
-void
-JavaRequestProcessor::deleteReference(std::string object_id)
-{
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" DeleteLocalRef ");
-    message.append(object_id);
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-}
-
-/**
- * Increments reference count by 1
- *
- * @param object_id The ID of the object
- */
-
-void
-JavaRequestProcessor::addReference(std::string object_id)
-{
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" NewGlobalRef ");
-    message.append(object_id);
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-}
-
-JavaResultData*
-JavaRequestProcessor::findClass(int plugin_instance_id,
-                                std::string name)
-{
-    std::string message = std::string();
-    std::string plugin_instance_id_str = std::string();
-
-    IcedTeaPluginUtilities::itoa(plugin_instance_id, &plugin_instance_id_str);
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" FindClass ");
-    message.append(plugin_instance_id_str);
-    message.append(" ");
-    message.append(name);
-
-    postAndWaitForResponse(message);
-
-	return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getClassName(std::string objectID)
-{
-    std::string message = std::string();
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" GetClassName ");
-    message.append(objectID);
-
-    postAndWaitForResponse(message);
-
-	return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getClassID(std::string objectID)
-{
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" GetClassID ");
-    message.append(objectID);
-
-    postAndWaitForResponse(message);
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getArrayLength(std::string objectID)
-{
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" GetArrayLength ");
-    message.append(objectID);
-
-    postAndWaitForResponse(message);
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getSlot(std::string objectID, std::string index)
-{
-    std::string message = std::string();
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" GetObjectArrayElement ");
-    message.append(objectID);
-    message.append(" ");
-    message.append(index);
-
-    postAndWaitForResponse(message);
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::setSlot(std::string objectID,
-                              std::string index,
-                              std::string value_id)
-{
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" SetObjectArrayElement ");
-    message.append(objectID);
-    message.append(" ");
-    message.append(index);
-    message.append(" ");
-    message.append(value_id);
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::newArray(std::string array_class,
-                               std::string length)
-{
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-
-    message.append(" NewArray ");
-    message.append(array_class);
-    message.append(" ");
-    message.append(length);
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getFieldID(std::string classID, std::string fieldName)
-{
-	JavaResultData* java_result;
-	JavaRequestProcessor* java_request = new JavaRequestProcessor();
-	std::string message = std::string();
-
-	java_result = java_request->newString(fieldName);
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-	message.append(" GetFieldID ");
-	message.append(classID);
-	message.append(" ");
-	message.append(java_result->return_string->c_str());
-
-	postAndWaitForResponse(message);
-
-	IcedTeaPluginUtilities::releaseReference();
-
-	delete java_request;
-
-	return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getStaticFieldID(std::string classID, std::string fieldName)
-{
-    JavaResultData* java_result;
-    JavaRequestProcessor* java_request = new JavaRequestProcessor();
-    std::string message = std::string();
-
-    java_result = java_request->newString(fieldName);
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-    message.append(" GetStaticFieldID ");
-    message.append(classID);
-    message.append(" ");
-    message.append(java_result->return_string->c_str());
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    delete java_request;
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getField(std::string source,
-                               std::string classID,
-                               std::string objectID,
-                               std::string fieldName)
-{
-    JavaResultData* java_result;
-    JavaRequestProcessor* java_request = new JavaRequestProcessor();
-    std::string message = std::string();
-
-    java_result = java_request->getFieldID(classID, fieldName);
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message);
-    message.append(" GetField ");
-    message.append(objectID);
-    message.append(" ");
-    message.append(java_result->return_string->c_str());
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    delete java_request;
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getStaticField(std::string source, std::string classID,
-                                     std::string fieldName)
-{
-    JavaResultData* java_result;
-    JavaRequestProcessor* java_request = new JavaRequestProcessor();
-    std::string message = std::string();
-
-    java_result = java_request->getStaticFieldID(classID, fieldName);
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message);
-    message.append(" GetStaticField ");
-    message.append(classID);
-    message.append(" ");
-    message.append(java_result->return_string->c_str());
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    delete java_request;
-
-    return result;
-}
-
-
-JavaResultData*
-JavaRequestProcessor::set(std::string source,
-                          bool isStatic,
-                          std::string classID,
-                          std::string objectID,
-                          std::string fieldName,
-                          std::string value_id)
-{
-    JavaResultData* java_result;
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-    std::string message = std::string();
-
-    java_result = java_request.getFieldID(classID, fieldName);
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message);
-
-    if (isStatic)
-    {
-        message.append(" SetStaticField ");
-        message.append(classID);
-    } else
-    {
-        message.append(" SetField ");
-        message.append(objectID);
-    }
-
-    message.append(" ");
-    message.append(java_result->return_string->c_str());
-    message.append(" ");
-    message.append(value_id);
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::setStaticField(std::string source,
-                                     std::string classID,
-                                     std::string fieldName,
-                                     std::string value_id)
-{
-    return set(source, true, classID, "", fieldName, value_id);
-}
-
-JavaResultData*
-JavaRequestProcessor::setField(std::string source,
-                               std::string classID,
-                               std::string objectID,
-                               std::string fieldName,
-                               std::string value_id)
-{
-    return set(source, false, classID, objectID, fieldName, value_id);
-}
-
-JavaResultData*
-JavaRequestProcessor::getMethodID(std::string classID, NPIdentifier methodName,
-                                  std::vector<std::string> args)
-{
-	JavaRequestProcessor* java_request;
-	std::string message = std::string();
-    std::string* signature;
-
-    signature = new std::string();
-    *signature += "(";
-
-    // FIXME: Need to determine how to extract array types and complex java objects
-    for (int i=0; i < args.size(); i++)
-    {
-    	*signature += args[i];
-    }
-
-    *signature += ")";
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-	message += " GetMethodID ";
-	message += classID;
-	message += " ";
-	message += browser_functions.utf8fromidentifier(methodName);
-	message += " ";
-	message += *signature;
-
-	postAndWaitForResponse(message);
-
-	IcedTeaPluginUtilities::releaseReference();
-	delete signature;
-
-	return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getStaticMethodID(std::string classID, NPIdentifier methodName,
-                                  std::vector<std::string> args)
-{
-    JavaRequestProcessor* java_request;
-    std::string message = std::string();
-    std::string* signature;
-
-    signature = new std::string();
-    *signature += "(";
-
-    // FIXME: Need to determine how to extract array types and complex java objects
-    for (int i=0; i < args.size(); i++)
-    {
-        *signature += args[i];
-    }
-
-    *signature += ")";
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-    message += " GetStaticMethodID ";
-    message += classID;
-    message += " ";
-    message += browser_functions.utf8fromidentifier(methodName);
-    message += " ";
-    message += *signature;
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-    delete signature;
-
-    return result;
-}
-
-void
-getArrayTypeForJava(NPP instance, NPVariant element, std::string* type)
-{
-
-    if (NPVARIANT_IS_BOOLEAN(element)) {
-        type->append("string");
-    } else if (NPVARIANT_IS_INT32(element)) {
-        type->append("string");
-    } else if (NPVARIANT_IS_DOUBLE(element)) {
-        type->append("string");
-    } else if (NPVARIANT_IS_STRING(element)) {
-        type->append("string");
-    } else if (NPVARIANT_IS_OBJECT(element)) {
-
-        NPObject* first_element_obj = NPVARIANT_TO_OBJECT(element);
-        if (IcedTeaScriptableJavaPackageObject::is_valid_java_object(first_element_obj))
-        {
-            std::string class_id = std::string(((IcedTeaScriptableJavaObject*) first_element_obj)->getClassID());
-            type->append(class_id);
-        } else
-        {
-            type->append("jsobject");
-        }
-    } else {
-        type->append("jsobject"); // Else it is a string
-    }
-}
-
-void
-createJavaObjectFromVariant(NPP instance, NPVariant variant, std::string* id)
-{
-	JavaResultData* java_result;
-
-	std::string className;
-	std::string jsObjectClassID = std::string();
-	std::string jsObjectConstructorID = std::string();
-
-	std::string stringArg = std::string();
-	std::vector<std::string> args = std::vector<std::string>();
-
-	JavaRequestProcessor java_request = JavaRequestProcessor();
-	bool alreadyCreated = false;
-
-    if (NPVARIANT_IS_VOID(variant))
-    {
-    	PLUGIN_DEBUG("VOID %d\n", variant);
-    	id->append("0");
-    	return; // no need to go further
-    } else if (NPVARIANT_IS_NULL(variant))
-    {
-    	PLUGIN_DEBUG("NULL\n", variant);
-    	id->append("0");
-    	return; // no need to go further
-    } else if (NPVARIANT_IS_BOOLEAN(variant))
-    {
-    	className = "java.lang.Boolean";
-
-    	if (NPVARIANT_TO_BOOLEAN(variant))
-    		stringArg = "true";
-    	else
-    		stringArg = "false";
-
-    } else if (NPVARIANT_IS_INT32(variant))
-    {
-    	className = "java.lang.Integer";
-
-    	char* valueStr = (char*) malloc(sizeof(char)*32);
-    	sprintf(valueStr, "%d", NPVARIANT_TO_INT32(variant));
-    	stringArg += valueStr;
-    	free(valueStr);
-    } else if (NPVARIANT_IS_DOUBLE(variant))
-    {
-    	className = "java.lang.Double";
-
-    	char* valueStr = (char*) malloc(sizeof(char)*1024);
-    	sprintf(valueStr, "%f", NPVARIANT_TO_DOUBLE(variant));
-    	stringArg += valueStr;
-    	free(valueStr);
-    } else if (NPVARIANT_IS_STRING(variant))
-    {
-    	className = "java.lang.String";
-#if MOZILLA_VERSION_COLLAPSED < 1090200
-    	stringArg += NPVARIANT_TO_STRING(variant).utf8characters;
-#else
-    	stringArg += NPVARIANT_TO_STRING(variant).UTF8Characters;
-#endif
-    } else if (NPVARIANT_IS_OBJECT(variant))
-    {
-
-        NPObject* obj = NPVARIANT_TO_OBJECT(variant);
-        if (IcedTeaScriptableJavaPackageObject::is_valid_java_object(obj))
-        {
-            PLUGIN_DEBUG("NPObject is a Java object\n");
-            alreadyCreated = true;
-        } else
-        {
-            PLUGIN_DEBUG("NPObject is not a Java object\n");
-            NPIdentifier length_id = browser_functions.getstringidentifier("length");
-
-            // FIXME: We currently only handle <= 2 dim arrays. Do we really need more though?
-
-            // Is it an array?
-            if (IcedTeaPluginUtilities::isObjectJSArray(instance, obj)) {
-                PLUGIN_DEBUG("NPObject is an array\n");
-
-                std::string array_id = std::string();
-                std::string java_array_type = std::string();
-                NPVariant length = NPVariant();
-                browser_functions.getproperty(instance, obj, length_id, &length);
-
-                std::string length_str = std::string();
-                IcedTeaPluginUtilities::itoa(NPVARIANT_TO_INT32(length), &length_str);
-
-                if (NPVARIANT_TO_INT32(length) > 0)
-                {
-                    NPIdentifier id_0 = browser_functions.getintidentifier(0);
-                    NPVariant first_element = NPVariant();
-                    browser_functions.getproperty(instance, obj, id_0, &first_element);
-
-                    // Check for multi-dim array
-                    if (NPVARIANT_IS_OBJECT(first_element) &&
-                        IcedTeaPluginUtilities::isObjectJSArray(instance, NPVARIANT_TO_OBJECT(first_element))) {
-
-                        NPVariant first_nested_element = NPVariant();
-                        browser_functions.getproperty(instance, NPVARIANT_TO_OBJECT(first_element), id_0, &first_nested_element);
-
-                        getArrayTypeForJava(instance, first_nested_element, &java_array_type);
-
-                        length_str.append(" 0"); // secondary array is created on the fly
-                    } else
-                    {
-                        getArrayTypeForJava(instance, first_element, &java_array_type);
-                    }
-                } else
-                    java_array_type.append("jsobject");
-
-                java_result = java_request.newArray(java_array_type, length_str);
-
-                if (java_result->error_occurred) {
-                    printf("Unable to create array\n");
-                    id->append("-1");
-                    return;
-                }
-
-                id->append(*(java_result->return_string));
-
-                NPIdentifier index_id = NPIdentifier();
-                for (int i=0; i < NPVARIANT_TO_INT32(length); i++)
-                {
-                    NPVariant value = NPVariant();
-
-                    index_id = browser_functions.getintidentifier(i);
-                    browser_functions.getproperty(instance, obj, index_id, &value);
-
-                    std::string value_id = std::string();
-                    createJavaObjectFromVariant(instance, value, &value_id);
-
-                    if (value_id == "-1") {
-                        printf("Unable to populate array\n");
-                        id->clear();
-                        id->append("-1");
-                        return;
-                    }
-
-                    std::string value_str = std::string();
-                    IcedTeaPluginUtilities::itoa(i, &value_str);
-                    java_result = java_request.setSlot(*id, value_str, value_id);
-
-                }
-
-                // Got here => no errors above. We're good to return!
-                return;
-            } else // Else it is not an array
-            {
-
-                NPVariant* variant_copy = new NPVariant();
-                OBJECT_TO_NPVARIANT(NPVARIANT_TO_OBJECT(variant), *variant_copy);
-
-                className = "netscape.javascript.JSObject";
-                IcedTeaPluginUtilities::JSIDToString(variant_copy, &stringArg);
-                browser_functions.retainobject(NPVARIANT_TO_OBJECT(variant));
-
-                std::string jsObjectClassID = std::string();
-                std::string jsObjectConstructorID = std::string();
-                std::vector<std::string> args = std::vector<std::string>();
-
-                java_result = java_request.findClass(0, "netscape.javascript.JSObject");
-
-                // the result we want is in result_string (assuming there was no error)
-                if (java_result->error_occurred)
-                {
-                    printf("Unable to get JSObject class id\n");
-                    id->clear();
-                    id->append("-1");
-                    return;
-                }
-
-                jsObjectClassID.append(*(java_result->return_string));
-                args.push_back("J");
-
-                java_result = java_request.getMethodID(jsObjectClassID,
-                                                       browser_functions.getstringidentifier("<init>"),
-                                                       args);
-
-                // the result we want is in result_string (assuming there was no error)
-                if (java_result->error_occurred)
-                {
-                    printf("Unable to get JSObject constructor id\n");
-                    id->clear();
-                    id->append("-1");
-                    return;
-                }
-
-                jsObjectConstructorID.append(*(java_result->return_string));
-
-                // We have the method id. Now create a new object.
-
-                args.clear();
-                args.push_back(stringArg);
-                java_result = java_request.newObjectWithConstructor("",
-                                                     jsObjectClassID,
-                                                     jsObjectConstructorID,
-                                                     args);
-
-                // Store the instance ID for future reference
-                IcedTeaPluginUtilities::storeInstanceID(variant_copy, instance);
-
-                // the result we want is in result_string (assuming there was no error)
-                // the result we want is in result_string (assuming there was no error)
-                if (java_result->error_occurred)
-                {
-                    printf("Unable to create JSObject\n");
-                    id->clear();
-                    id->append("-1");
-                    return;
-                }
-
-                id->append(*(java_result->return_string));
-                return;
-            }
-        }
-    }
-
-    if (!alreadyCreated) {
-		java_result = java_request.findClass(0, className);
-
-		// the result we want is in result_string (assuming there was no error)
-		if (java_result->error_occurred) {
-			printf("Unable to find classid for %s\n", className.c_str());
-			id->append("-1");
-			return;
-		}
-
-		jsObjectClassID.append(*(java_result->return_string));
-
-		std::string stringClassName = "Ljava/lang/String;";
-		args.push_back(stringClassName);
-
-		java_result = java_request.getMethodID(jsObjectClassID,
-				      browser_functions.getstringidentifier("<init>"), args);
-
-		// the result we want is in result_string (assuming there was no error)
-		if (java_result->error_occurred) {
-			printf("Unable to find string constructor for %s\n", className.c_str());
-			id->append("-1");
-            return;
-		}
-
-		jsObjectConstructorID.append(*(java_result->return_string));
-
-		// We have class id and constructor ID. So we know we can create the
-		// object.. now create the string that will be provided as the arg
-		java_result = java_request.newString(stringArg);
-
-		if (java_result->error_occurred) {
-			printf("Unable to create requested object\n");
-			id->append("-1");
-            return;
-		}
-
-		// Create the object
-		args.clear();
-		std::string arg = std::string();
-		arg.append(*(java_result->return_string));
-		args.push_back(arg);
-		java_result = java_request.newObjectWithConstructor("[System]", jsObjectClassID, jsObjectConstructorID, args);
-
-        if (java_result->error_occurred) {
-            printf("Unable to create requested object\n");
-            id->append("-1");
-            return;
-        }
-
-
-		id->append(*(java_result->return_string));
-
-	} else {
-	    // Else already created
-
-	    std::string classId = std::string(((IcedTeaScriptableJavaObject*) NPVARIANT_TO_OBJECT(variant))->getClassID());
-	    std::string instanceId = std::string(((IcedTeaScriptableJavaObject*) NPVARIANT_TO_OBJECT(variant))->getInstanceID());
-
-	    if (instanceId.length() == 0)
-	        id->append(classId.c_str());
-	    else
-	        id->append(instanceId.c_str());
-	}
-
-}
-
-JavaResultData*
-JavaRequestProcessor::callStaticMethod(std::string source, std::string classID,
-                                       std::string methodName,
-                                       std::vector<std::string> args)
-{
-    return call(source, true, classID, methodName, args);
-}
-
-JavaResultData*
-JavaRequestProcessor::callMethod(std::string source,
-                                 std::string objectID, std::string methodName,
-                                 std::vector<std::string> args)
-{
-    return call(source, false, objectID, methodName, args);
-}
-
-JavaResultData*
-JavaRequestProcessor::call(std::string source,
-                           bool isStatic, std::string objectID,
-                           std::string methodName,
-                           std::vector<std::string> args)
-{
-    std::string message = std::string();
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message);
-
-    if (isStatic)
-        message += " CallStaticMethod ";
-    else
-        message += " CallMethod ";
-
-    message += objectID;
-    message += " ";
-    message += methodName;
-    message += " ";
-
-    for (int i=0; i < args.size(); i++)
-    {
-        message += args[i];
-        message += " ";
-    }
-
-	postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getObjectClass(std::string objectID)
-{
-    JavaRequestProcessor* java_request;
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-    message += " GetObjectClass ";
-    message += objectID;
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::newObject(std::string source, std::string classID,
-                                std::vector<std::string> args)
-{
-    JavaRequestProcessor* java_request;
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message);
-    message += " NewObject ";
-    message += classID;
-    message += " ";
-
-    for (int i=0; i < args.size(); i++)
-    {
-        message += args[i];
-        message += " ";
-    }
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::newObjectWithConstructor(std::string source, std::string classID,
-                                std::string methodID,
-                                std::vector<std::string> args)
-{
-	JavaRequestProcessor* java_request;
-	std::string message = std::string();
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message);
-	message += " NewObjectWithConstructor ";
-	message += classID;
-	message += " ";
-	message += methodID;
-	message += " ";
-
-	for (int i=0; i < args.size(); i++)
-	{
-		message += args[i];
-		message += " ";
-	}
-
-	postAndWaitForResponse(message);
-
-	IcedTeaPluginUtilities::releaseReference();
-
-	return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::newString(std::string str)
-{
-	std::string utf_string = std::string();
-	std::string message = std::string();
-
-	IcedTeaPluginUtilities::convertStringToUTF8(&str, &utf_string);
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-	message.append(" NewStringUTF ");
-	message.append(utf_string);
-
-	postAndWaitForResponse(message);
-
-	IcedTeaPluginUtilities::releaseReference();
-
-	return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::hasPackage(int plugin_instance_id,
-                                 std::string package_name)
-{
-	JavaResultData* java_result;
-	JavaRequestProcessor* java_request = new JavaRequestProcessor();
-	std::string message = std::string();
-	std::string plugin_instance_id_str = std::string();
-	IcedTeaPluginUtilities::itoa(plugin_instance_id, &plugin_instance_id_str);
-
-	java_result = java_request->newString(package_name);
-
-	this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-	this->reference = IcedTeaPluginUtilities::getReference();
-
-	IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-	message.append(" HasPackage ");
-    message.append(plugin_instance_id_str);
-    message.append(" ");
-	message.append(java_result->return_string->c_str());
-
-	postAndWaitForResponse(message);
-
-	IcedTeaPluginUtilities::releaseReference();
-
-	delete java_request;
-
-	return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::hasMethod(std::string classID, std::string method_name)
-{
-    JavaResultData* java_result;
-    JavaRequestProcessor* java_request = new JavaRequestProcessor();
-    std::string message = std::string();
-
-    java_result = java_request->newString(method_name);
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-    message.append(" HasMethod ");
-    message.append(classID);
-    message.append(" ");
-    message.append(java_result->return_string->c_str());
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    delete java_request;
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::hasField(std::string classID, std::string method_name)
-{
-    JavaResultData* java_result;
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-    std::string message = std::string();
-
-    java_result = java_request.newString(method_name);
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-    message.append(" HasField ");
-    message.append(classID);
-    message.append(" ");
-    message.append(java_result->return_string->c_str());
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::isInstanceOf(std::string objectID, std::string classID)
-{
-    std::string message = std::string();
-
-    this->instance = 0; // context is always 0 (needed for java-side backwards compat.)
-    this->reference = IcedTeaPluginUtilities::getReference();
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message);
-    message.append(" IsInstanceOf ");
-    message.append(objectID);
-    message.append(" ");
-    message.append(classID);
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
-JavaResultData*
-JavaRequestProcessor::getAppletObjectInstance(std::string instanceID)
-{
-    std::string message = std::string();
-    std::string ref_str = std::string();
-
-    this->instance = 0;
-    this->reference = IcedTeaPluginUtilities::getReference();
-    IcedTeaPluginUtilities::itoa(reference, &ref_str);
-
-    message = "instance ";
-    message += instanceID;
-    message += " reference ";
-    message += ref_str;
-    message += " GetJavaObject";
-
-    postAndWaitForResponse(message);
-
-    IcedTeaPluginUtilities::releaseReference();
-
-    return result;
-}
-
--- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.h	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/* IcedTeaJavaRequestProcessor.h
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#ifndef ICEDTEAJAVAREQUEST_H_
-#define ICEDTEAJAVAREQUEST_H_
-
-#include <errno.h>
-#include <stdlib.h>
-#include <vector>
-
-#include "IcedTeaNPPlugin.h"
-#include "IcedTeaPluginUtils.h"
-
-#define REQUESTTIMEOUT 120
-
-/*
- * This struct holds data specific to a Java operation requested by the plugin
- */
-typedef struct java_request
-{
-    // Instance id  (if applicable)
-    int instance;
-
-    // Context id (if applicable)
-    int context;
-
-    // request specific data
-    std::vector<std::string>* data;
-
-    // source of the request
-    std::string* source;
-
-} JavaRequest;
-
-/* Creates a argument on java-side with appropriate type */
-void createJavaObjectFromVariant(NPP instance, NPVariant variant, std::string* id);
-
-/* Returns the type of array based on the given element */
-void getArrayTypeForJava(NPP instance, NPVariant element, std::string* type);
-
-class JavaRequestProcessor : BusSubscriber
-{
-    private:
-    	// instance and references are constant throughout this objects
-    	// lifecycle
-    	int instance;
-    	int reference;
-    	bool result_ready;
-    	JavaResultData* result;
-
-    	/* Post message on bus and wait */
-    	void postAndWaitForResponse(std::string message);
-
-    	// Call a method, static or otherwise, depending on supplied arg
-        JavaResultData* call(std::string source, bool isStatic,
-                             std::string objectID, std::string methodName,
-                             std::vector<std::string> args);
-
-        // Set a static/non-static field to given value
-        JavaResultData* set(std::string source,
-                            bool isStatic,
-                            std::string classID,
-                            std::string objectID,
-                            std::string fieldName,
-                            std::string value_id);
-
-        /* Resets the results */
-        void resetResult();
-
-    public:
-    	JavaRequestProcessor();
-    	~JavaRequestProcessor();
-    	virtual bool newMessageOnBus(const char* message);
-
-    	/* Increments reference count by 1 */
-    	void addReference(std::string object_id);
-
-    	/* Decrements reference count by 1 */
-    	void deleteReference(std::string object_id);
-
-    	/* Returns the toString() value, given an object identifier */
-    	JavaResultData* getToStringValue(std::string object_id);
-
-        /* Returns the value, given an object identifier */
-        JavaResultData* getValue(std::string object_id);
-
-    	/* Returns the string, given the identifier */
-    	JavaResultData* getString(std::string string_id);
-
-    	/* Returns the field object */
-        JavaResultData* getField(std::string source,
-                                 std::string classID,
-                                 std::string objectID,
-                                 std::string fieldName);
-
-        /* Returns the static field object */
-        JavaResultData* getStaticField(std::string source,
-                                       std::string classID,
-                                       std::string fieldName);
-
-        /* Sets the field object */
-        JavaResultData* setField(std::string source,
-                                 std::string classID,
-                                 std::string objectID,
-                                 std::string fieldName,
-                                 std::string value_id);
-
-        /* Sets the static field object */
-        JavaResultData* setStaticField(std::string source,
-                                       std::string classID,
-                                       std::string fieldName,
-                                       std::string value_id);
-
-        /* Returns the field id */
-        JavaResultData* getFieldID(std::string classID, std::string fieldName);
-
-        /* Returns the static field id */
-    	JavaResultData* getStaticFieldID(std::string classID, std::string fieldName);
-
-    	/* Returns the method id */
-    	JavaResultData* getMethodID(std::string classID, NPIdentifier methodName,
-                                    std::vector<std::string> args);
-
-        /* Returns the static method id */
-        JavaResultData* getStaticMethodID(std::string classID, NPIdentifier methodName,
-                                     std::vector<std::string> args);
-
-        /* Calls a static method */
-        JavaResultData* callStaticMethod(std::string source,
-                                         std::string classID,
-                                         std::string methodName,
-                                         std::vector<std::string> args);
-
-        /* Calls a method on an instance */
-        JavaResultData* callMethod(std::string source,
-                                   std::string objectID,
-                                   std::string methodName,
-                                   std::vector<std::string> args);
-
-        /* Returns the class of the given object */
-        JavaResultData* getObjectClass(std::string objectID);
-
-    	/* Creates a new object with choosable constructor */
-    	JavaResultData* newObject(std::string source,
-                                  std::string classID,
-                                  std::vector<std::string> args);
-
-    	/* Creates a new object when constructor is undetermined */
-    	JavaResultData* newObjectWithConstructor(std::string source, std::string classID,
-                                  std::string methodID,
-                                  std::vector<std::string> args);
-
-    	/* Returns the class ID */
-    	JavaResultData* findClass(int plugin_instance_id,
-                                  std::string name);
-
-    	/* Returns the type class name */
-    	JavaResultData* getClassName(std::string objectID);
-
-    	/* Returns the type class id */
-    	JavaResultData* getClassID(std::string objectID);
-
-    	/* Returns the length of the array object. -1 if not found */
-    	JavaResultData* getArrayLength(std::string objectID);
-
-    	/* Returns the item at the given index for the array */
-    	JavaResultData* getSlot(std::string objectID, std::string index);
-
-        /* Sets the item at the given index to the given value */
-        JavaResultData* setSlot(std::string objectID,
-                                std::string index,
-                                std::string value_id);
-
-        /* Creates a new array of given length */
-        JavaResultData* newArray(std::string component_class,
-                                 std::string length);
-
-    	/* Creates a new string in the Java store */
-    	JavaResultData* newString(std::string str);
-
-    	/* Check if package exists */
-    	JavaResultData* hasPackage(int plugin_instance_id,
-                                   std::string package_name);
-
-        /* Check if method exists */
-        JavaResultData* hasMethod(std::string classID, std::string method_name);
-
-        /* Check if field exists */
-        JavaResultData* hasField(std::string classID, std::string method_name);
-
-        /* Check if given object is instance of given class */
-        JavaResultData* isInstanceOf(std::string objectID, std::string classID);
-
-        /* Returns the instance ID of the java applet */
-        JavaResultData* getAppletObjectInstance(std::string instanceID);
-};
-
-#endif /* ICEDTEAJAVAREQUESTPROCESSOR_H_ */
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2439 +0,0 @@
-/* IcedTeaNPPlugin.cc -- web browser plugin to execute Java applets
-   Copyright (C) 2003, 2004, 2006, 2007  Free Software Foundation, Inc.
-   Copyright (C) 2009 Red Hat
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-// System includes.
-#include <dlfcn.h>
-#include <errno.h>
-#include <libgen.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-// Liveconnect extension
-#include "IcedTeaScriptablePluginObject.h"
-#include "IcedTeaNPPlugin.h"
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-// Documentbase retrieval includes.
-#include <nsIPluginInstance.h>
-#include <nsIPluginInstancePeer.h>
-#include <nsIPluginTagInfo2.h>
-
-// API's into Mozilla
-#include <nsCOMPtr.h>
-#include <nsICookieService.h>
-#include <nsIDNSRecord.h>
-#include <nsIDNSService.h>
-#include <nsINetUtil.h>
-#include <nsIProxyInfo.h>
-#include <nsIProtocolProxyService.h>
-#include <nsIScriptSecurityManager.h>
-#include <nsIIOService.h>
-#include <nsIURI.h>
-#include <nsNetCID.h>
-#include <nsStringAPI.h>
-#include <nsServiceManagerUtils.h>
-#endif
-
-// Error reporting macros.
-#define PLUGIN_ERROR(message)                                       \
-  g_printerr ("%s:%d: thread %p: Error: %s\n", __FILE__, __LINE__,  \
-              g_thread_self (), message)
-
-#define PLUGIN_ERROR_TWO(first, second)                                 \
-  g_printerr ("%s:%d: thread %p: Error: %s: %s\n", __FILE__, __LINE__,  \
-              g_thread_self (), first, second)
-
-#define PLUGIN_ERROR_THREE(first, second, third)                        \
-  g_printerr ("%s:%d: thread %p: Error: %s: %s: %s\n", __FILE__,        \
-              __LINE__, g_thread_self (), first, second, third)
-
-// Plugin information passed to about:plugins.
-#define PLUGIN_NAME "IcedTea NPR Web Browser Plugin (using " PLUGIN_VERSION ")"
-#define PLUGIN_DESC "The " PLUGIN_NAME " executes Java applets."
-
-#define PLUGIN_MIME_DESC                                               \
-  "application/x-java-vm:class,jar:IcedTea;"                           \
-  "application/x-java-applet:class,jar:IcedTea;"                       \
-  "application/x-java-applet;version=1.1:class,jar:IcedTea;"           \
-  "application/x-java-applet;version=1.1.1:class,jar:IcedTea;"         \
-  "application/x-java-applet;version=1.1.2:class,jar:IcedTea;"         \
-  "application/x-java-applet;version=1.1.3:class,jar:IcedTea;"         \
-  "application/x-java-applet;version=1.2:class,jar:IcedTea;"           \
-  "application/x-java-applet;version=1.2.1:class,jar:IcedTea;"         \
-  "application/x-java-applet;version=1.2.2:class,jar:IcedTea;"         \
-  "application/x-java-applet;version=1.3:class,jar:IcedTea;"           \
-  "application/x-java-applet;version=1.3.1:class,jar:IcedTea;"         \
-  "application/x-java-applet;version=1.4:class,jar:IcedTea;"           \
-  "application/x-java-applet;version=1.4.1:class,jar:IcedTea;"         \
-  "application/x-java-applet;version=1.4.2:class,jar:IcedTea;"         \
-  "application/x-java-applet;version=1.5:class,jar:IcedTea;"           \
-  "application/x-java-applet;version=1.6:class,jar:IcedTea;"           \
-  "application/x-java-applet;jpi-version=1.6.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;"  \
-  "application/x-java-bean:class,jar:IcedTea;"                         \
-  "application/x-java-bean;version=1.1:class,jar:IcedTea;"             \
-  "application/x-java-bean;version=1.1.1:class,jar:IcedTea;"           \
-  "application/x-java-bean;version=1.1.2:class,jar:IcedTea;"           \
-  "application/x-java-bean;version=1.1.3:class,jar:IcedTea;"           \
-  "application/x-java-bean;version=1.2:class,jar:IcedTea;"             \
-  "application/x-java-bean;version=1.2.1:class,jar:IcedTea;"           \
-  "application/x-java-bean;version=1.2.2:class,jar:IcedTea;"           \
-  "application/x-java-bean;version=1.3:class,jar:IcedTea;"             \
-  "application/x-java-bean;version=1.3.1:class,jar:IcedTea;"           \
-  "application/x-java-bean;version=1.4:class,jar:IcedTea;"             \
-  "application/x-java-bean;version=1.4.1:class,jar:IcedTea;"           \
-  "application/x-java-bean;version=1.4.2:class,jar:IcedTea;"           \
-  "application/x-java-bean;version=1.5:class,jar:IcedTea;"             \
-  "application/x-java-bean;version=1.6:class,jar:IcedTea;"             \
-  "application/x-java-bean;jpi-version=1.6.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;"    \
-  "application/x-java-vm-npruntime::IcedTea;"
-
-#define PLUGIN_URL NS_INLINE_PLUGIN_CONTRACTID_PREFIX NS_JVM_MIME_TYPE
-#define PLUGIN_MIME_TYPE "application/x-java-vm"
-#define PLUGIN_FILE_EXTS "class,jar,zip"
-#define PLUGIN_MIME_COUNT 1
-
-#define FAILURE_MESSAGE "icedteanp plugin error: Failed to run %s." \
-  "  For more detail rerun \"firefox -g\" in a terminal window."
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-// Documentbase retrieval required definition.
-static NS_DEFINE_IID (kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID);
-#endif
-
-// Data directory for plugin.
-static gchar* data_directory = NULL;
-
-// Fully-qualified appletviewer executable.
-static gchar* appletviewer_executable = NULL;
-
-// Applet viewer input channel (needs to be static because it is used in plugin_in_pipe_callback)
-static GIOChannel* in_from_appletviewer = NULL;
-
-// Applet viewer input pipe name.
-gchar* in_pipe_name;
-
-// Applet viewer input watch source.
-gint in_watch_source;
-
-// Applet viewer output pipe name.
-gchar* out_pipe_name;
-
-// Applet viewer output watch source.
-gint out_watch_source;
-
-// Applet viewer output channel.
-GIOChannel* out_to_appletviewer;
-
-// Tracks jvm status
-gboolean jvm_up = FALSE;
-
-// Keeps track of initialization. NP_Initialize should only be
-// called once.
-gboolean initialized = false;
-
-// browser functions into mozilla
-NPNetscapeFuncs browser_functions;
-
-// Various message buses carrying information to/from Java, and internally
-MessageBus* plugin_to_java_bus;
-MessageBus* java_to_plugin_bus;
-//MessageBus* internal_bus = new MessageBus();
-
-// Processor for plugin requests
-PluginRequestProcessor* plugin_req_proc;
-
-// Sends messages to Java over the bus
-JavaMessageSender* java_req_proc;
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-// Documentbase retrieval type-punning union.
-typedef union
-{
-  void** void_field;
-  nsIPluginTagInfo2** info_field;
-} info_union;
-#endif
-
-// Static instance helper functions.
-// Have the browser allocate a new ITNPPluginData structure.
-static void plugin_data_new (ITNPPluginData** data);
-// Retrieve the current document's documentbase.
-static gchar* plugin_get_documentbase (NPP instance);
-// Notify the user that the appletviewer is not installed correctly.
-static void plugin_display_failure_dialog ();
-// Callback used to monitor input pipe status.
-static gboolean plugin_in_pipe_callback (GIOChannel* source,
-                                         GIOCondition condition,
-                                         gpointer plugin_data);
-// Callback used to monitor output pipe status.
-static gboolean plugin_out_pipe_callback (GIOChannel* source,
-                                          GIOCondition condition,
-                                          gpointer plugin_data);
-static NPError plugin_start_appletviewer (ITNPPluginData* data);
-static gchar* plugin_create_applet_tag (int16_t argc, char* argn[],
-                                        char* argv[]);
-static void plugin_stop_appletviewer ();
-// Uninitialize ITNPPluginData structure
-static void plugin_data_destroy (NPP instance);
-
-NPError get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len);
-NPError get_proxy_info(const char* siteAddr, char** proxy, uint32_t* len);
-void consume_message(gchar* message);
-void start_jvm_if_needed();
-static void appletviewer_monitor(GPid pid, gint status, gpointer data);
-
-// Global instance counter.
-// Mutex to protect plugin_instance_counter.
-static GMutex* plugin_instance_mutex = NULL;
-// A global variable for reporting GLib errors.  This must be free'd
-// and set to NULL after each use.
-static GError* channel_error = NULL;
-
-static GHashTable* instance_to_id_map = g_hash_table_new(NULL, NULL);
-static GHashTable* id_to_instance_map = g_hash_table_new(NULL, NULL);
-static gint instance_counter = 1;
-static GPid appletviewer_pid = -1;
-static guint appletviewer_watch_id = -1;
-
-int plugin_debug = getenv ("ICEDTEAPLUGIN_DEBUG") != NULL;
-
-pthread_cond_t cond_message_available = PTHREAD_COND_INITIALIZER;
-
-// Functions prefixed by ITNP_ are instance functions.  They are called
-// by the browser and operate on instances of ITNPPluginData.
-// Functions prefixed by plugin_ are static helper functions.
-// Functions prefixed by NP_ are factory functions.  They are called
-// by the browser and provide functionality needed to create plugin
-// instances.
-
-// INSTANCE FUNCTIONS
-
-// Creates a new icedtea np plugin instance.  This function creates a
-// ITNPPluginData* and stores it in instance->pdata.  The following
-// ITNPPluginData fiels are initialized: instance_string, in_pipe_name,
-// in_from_appletviewer, in_watch_source, out_pipe_name,
-// out_to_appletviewer, out_watch_source, appletviewer_mutex, owner,
-// appletviewer_alive.  In addition two pipe files are created.  All
-// of those fields must be properly destroyed, and the pipes deleted,
-// by ITNP_Destroy.  If an error occurs during initialization then this
-// function will free anything that's been allocated so far, set
-// instance->pdata to NULL and return an error code.
-NPError
-ITNP_New (NPMIMEType pluginType, NPP instance, uint16_t mode,
-         int16_t argc, char* argn[], char* argv[],
-         NPSavedData* saved)
-{
-  PLUGIN_DEBUG("ITNP_New\n");
-
-  static NPObject *window_ptr;
-  NPIdentifier identifier;
-  NPVariant member_ptr;
-  browser_functions.getvalue(instance, NPNVWindowNPObject, &window_ptr);
-  identifier = browser_functions.getstringidentifier("document");
-  if (!browser_functions.hasproperty(instance, window_ptr, identifier))
-  {
-	printf("%s not found!\n", "document");
-  }
-  browser_functions.getproperty(instance, window_ptr, identifier, &member_ptr);
-
-  PLUGIN_DEBUG("Got variant %p\n", &member_ptr);
-
-
-  NPError np_error = NPERR_NO_ERROR;
-  ITNPPluginData* data = NULL;
-
-  gchar* documentbase = NULL;
-  gchar* read_message = NULL;
-  gchar* applet_tag = NULL;
-  gchar* tag_message = NULL;
-  gchar* cookie_info = NULL;
-
-  NPObject* npPluginObj = NULL;
-
-  if (!instance)
-    {
-      PLUGIN_ERROR ("Browser-provided instance pointer is NULL.");
-      np_error = NPERR_INVALID_INSTANCE_ERROR;
-      goto cleanup_done;
-    }
-
-  // data
-  plugin_data_new (&data);
-  if (data == NULL)
-    {
-      PLUGIN_ERROR ("Failed to allocate plugin data.");
-      np_error = NPERR_OUT_OF_MEMORY_ERROR;
-      goto cleanup_done;
-    }
-
-  // start the jvm if needed
-  start_jvm_if_needed();
-
-  // Initialize data->instance_string.
-  //
-  // instance_string should be unique for this process so we use a
-  // combination of getpid and plugin_instance_counter.
-  //
-  // Critical region.  Reference and increment plugin_instance_counter
-  // global.
-  g_mutex_lock (plugin_instance_mutex);
-
-  // data->instance_string
-  data->instance_string = g_strdup_printf ("%d",
-                                           instance_counter);
-
-  g_mutex_unlock (plugin_instance_mutex);
-
-  // data->appletviewer_mutex
-  data->appletviewer_mutex = g_mutex_new ();
-
-  g_mutex_lock (data->appletviewer_mutex);
-
-  // Documentbase retrieval.
-  documentbase = plugin_get_documentbase (instance);
-  if (documentbase && argc != 0)
-    {
-      // Send applet tag message to appletviewer.
-      applet_tag = plugin_create_applet_tag (argc, argn, argv);
-
-      tag_message = (gchar*) malloc(strlen(applet_tag)*sizeof(gchar) + strlen(documentbase)*sizeof(gchar) + 32);
-      g_sprintf(tag_message, "instance %d tag %s %s", instance_counter, documentbase, applet_tag);
-
-      //plugin_send_message_to_appletviewer (data, data->instance_string);
-      plugin_send_message_to_appletviewer (tag_message);
-
-      data->is_applet_instance = true;
-    }
-
-  if (argc == 0)
-    {
-      data->is_applet_instance = false;
-    }
-
-  g_mutex_unlock (data->appletviewer_mutex);
-
-  // If initialization succeeded entirely then we store the plugin
-  // data in the instance structure and return.  Otherwise we free the
-  // data we've allocated so far and set instance->pdata to NULL.
-
-  // Set back-pointer to owner instance.
-  data->owner = instance;
-
-  // source of this instance
-  // don't use documentbase, it is cleared later
-  data->source = plugin_get_documentbase(instance);
-
-  instance->pdata = data;
-
-  goto cleanup_done;
-
- cleanup_appletviewer_mutex:
-  g_free (data->appletviewer_mutex);
-  data->appletviewer_mutex = NULL;
-
-  // cleanup_instance_string:
-  g_free (data->instance_string);
-  data->instance_string = NULL;
-
-  // cleanup_data:
-  // Eliminate back-pointer to plugin instance.
-  data->owner = NULL;
-  (*browser_functions.memfree) (data);
-  data = NULL;
-
-  // Initialization failed so return a NULL pointer for the browser
-  // data.
-  instance->pdata = NULL;
-
- cleanup_done:
-  g_free (tag_message);
-  tag_message = NULL;
-  g_free (applet_tag);
-  applet_tag = NULL;
-  g_free (read_message);
-  read_message = NULL;
-  g_free (documentbase);
-  documentbase = NULL;
-
-  // store an identifier for this plugin
-  PLUGIN_DEBUG("Mapping id %d and instance %p\n", instance_counter, instance);
-  g_hash_table_insert(instance_to_id_map, instance, GINT_TO_POINTER(instance_counter));
-  g_hash_table_insert(id_to_instance_map, GINT_TO_POINTER(instance_counter), instance);
-  instance_counter++;
-
-  PLUGIN_DEBUG ("ITNP_New return\n");
-
-  return np_error;
-}
-
-// Starts the JVM if it is not already running
-void start_jvm_if_needed()
-{
-
-  // This is asynchronized function. It must
-  // have exclusivity when running.
-
-  GMutex *vm_start_mutex = g_mutex_new();
-  g_mutex_lock(vm_start_mutex);
-
-  PLUGIN_DEBUG("Checking JVM status...\n");
-
-  // If the jvm is already up, do nothing
-  if (jvm_up)
-  {
-      PLUGIN_DEBUG("JVM is up. Returning.\n");
-      return;
-  }
-
-  PLUGIN_DEBUG("No JVM is running. Attempting to start one...\n");
-
-  NPError np_error = NPERR_NO_ERROR;
-  ITNPPluginData* data = NULL;
-
-  // Create appletviewer-to-plugin pipe which we refer to as the input
-  // pipe.
-
-  // in_pipe_name
-  in_pipe_name = g_strdup_printf ("%s/%d-icedteanp-appletviewer-to-plugin",
-                                         data_directory, getpid());
-  if (!in_pipe_name)
-    {
-      PLUGIN_ERROR ("Failed to create input pipe name.");
-      np_error = NPERR_OUT_OF_MEMORY_ERROR;
-      // If in_pipe_name is NULL then the g_free at
-      // cleanup_in_pipe_name will simply return.
-      goto cleanup_in_pipe_name;
-    }
-
-  // clean up any older pip
-  unlink (in_pipe_name);
-
-  PLUGIN_DEBUG ("ITNP_New: creating input fifo: %s\n", in_pipe_name);
-  if (mkfifo (in_pipe_name, 0600) == -1 && errno != EEXIST)
-    {
-      PLUGIN_ERROR_TWO ("Failed to create input pipe", strerror (errno));
-      np_error = NPERR_GENERIC_ERROR;
-      goto cleanup_in_pipe_name;
-    }
-  PLUGIN_DEBUG ("ITNP_New: created input fifo: %s\n", in_pipe_name);
-
-  // Create plugin-to-appletviewer pipe which we refer to as the
-  // output pipe.
-
-  // out_pipe_name
-  out_pipe_name = g_strdup_printf ("%s/%d-icedteanp-plugin-to-appletviewer",
-                                         data_directory, getpid());
-
-  if (!out_pipe_name)
-    {
-      PLUGIN_ERROR ("Failed to create output pipe name.");
-      np_error = NPERR_OUT_OF_MEMORY_ERROR;
-      goto cleanup_out_pipe_name;
-    }
-
-  // clean up any older pip
-  unlink (out_pipe_name);
-
-  PLUGIN_DEBUG ("ITNP_New: creating output fifo: %s\n", out_pipe_name);
-  if (mkfifo (out_pipe_name, 0600) == -1 && errno != EEXIST)
-    {
-      PLUGIN_ERROR_TWO ("Failed to create output pipe", strerror (errno));
-      np_error = NPERR_GENERIC_ERROR;
-      goto cleanup_out_pipe_name;
-    }
-  PLUGIN_DEBUG ("ITNP_New: created output fifo: %s\n", out_pipe_name);
-
-  // Start a separate appletviewer process for each applet, even if
-  // there are multiple applets in the same page.  We may need to
-  // change this behaviour if we find pages with multiple applets that
-  // rely on being run in the same VM.
-
-  np_error = plugin_start_appletviewer (data);
-
-  // Create plugin-to-appletviewer channel.  The default encoding for
-  // the file is UTF-8.
-  // out_to_appletviewer
-  out_to_appletviewer = g_io_channel_new_file (out_pipe_name,
-                                               "w", &channel_error);
-  if (!out_to_appletviewer)
-    {
-      if (channel_error)
-        {
-          PLUGIN_ERROR_TWO ("Failed to create output channel",
-                            channel_error->message);
-          g_error_free (channel_error);
-          channel_error = NULL;
-        }
-      else
-        PLUGIN_ERROR ("Failed to create output channel");
-
-      np_error = NPERR_GENERIC_ERROR;
-      goto cleanup_out_to_appletviewer;
-    }
-
-  // Watch for hangup and error signals on the output pipe.
-  out_watch_source =
-    g_io_add_watch (out_to_appletviewer,
-                    (GIOCondition) (G_IO_ERR | G_IO_HUP),
-                    plugin_out_pipe_callback, (gpointer) out_to_appletviewer);
-
-  // Create appletviewer-to-plugin channel.  The default encoding for
-  // the file is UTF-8.
-  // in_from_appletviewer
-  in_from_appletviewer = g_io_channel_new_file (in_pipe_name,
-                                                      "r", &channel_error);
-  if (!in_from_appletviewer)
-    {
-      if (channel_error)
-        {
-          PLUGIN_ERROR_TWO ("Failed to create input channel",
-                            channel_error->message);
-          g_error_free (channel_error);
-          channel_error = NULL;
-        }
-      else
-        PLUGIN_ERROR ("Failed to create input channel");
-
-      np_error = NPERR_GENERIC_ERROR;
-      goto cleanup_in_from_appletviewer;
-    }
-
-  // Watch for hangup and error signals on the input pipe.
-  in_watch_source =
-    g_io_add_watch (in_from_appletviewer,
-                    (GIOCondition) (G_IO_IN | G_IO_ERR | G_IO_HUP),
-                    plugin_in_pipe_callback, (gpointer) in_from_appletviewer);
-
-  jvm_up = TRUE;
-
-  goto done;
-
-  // Free allocated data
-
- cleanup_in_watch_source:
-  // Removing a source is harmless if it fails since it just means the
-  // source has already been removed.
-  g_source_remove (in_watch_source);
-  in_watch_source = 0;
-
- cleanup_in_from_appletviewer:
-  if (in_from_appletviewer)
-    g_io_channel_unref (in_from_appletviewer);
-  in_from_appletviewer = NULL;
-
-  // cleanup_out_watch_source:
-  g_source_remove (out_watch_source);
-  out_watch_source = 0;
-
- cleanup_out_to_appletviewer:
-  if (out_to_appletviewer)
-    g_io_channel_unref (out_to_appletviewer);
-  out_to_appletviewer = NULL;
-
-  // cleanup_out_pipe:
-  // Delete output pipe.
-  PLUGIN_DEBUG ("ITNP_New: deleting input fifo: %s\n", in_pipe_name);
-  unlink (out_pipe_name);
-  PLUGIN_DEBUG ("ITNP_New: deleted input fifo: %s\n", in_pipe_name);
-
- cleanup_out_pipe_name:
-  g_free (out_pipe_name);
-  out_pipe_name = NULL;
-
-  // cleanup_in_pipe:
-  // Delete input pipe.
-  PLUGIN_DEBUG ("ITNP_New: deleting output fifo: %s\n", out_pipe_name);
-  unlink (in_pipe_name);
-  PLUGIN_DEBUG ("ITNP_New: deleted output fifo: %s\n", out_pipe_name);
-
- cleanup_in_pipe_name:
-  g_free (in_pipe_name);
-  in_pipe_name = NULL;
-
- done:
-
-  // Now other threads may re-enter.. unlock the mutex
-  g_mutex_unlock(vm_start_mutex);
-
-}
-
-NPError
-ITNP_GetValue (NPP instance, NPPVariable variable, void* value)
-{
-  PLUGIN_DEBUG ("ITNP_GetValue\n");
-
-  NPError np_error = NPERR_NO_ERROR;
-
-  switch (variable)
-    {
-    // This plugin needs XEmbed support.
-    case NPPVpluginNeedsXEmbed:
-      {
-        PLUGIN_DEBUG ("ITNP_GetValue: returning TRUE for NeedsXEmbed.\n");
-        bool* bool_value = (bool*) value;
-        *bool_value = true;
-      }
-      break;
-    case NPPVpluginScriptableNPObject:
-      {
-         *(NPObject **)value = get_scriptable_object(instance);
-      }
-      break;
-    default:
-      PLUGIN_ERROR ("Unknown plugin value requested.");
-      np_error = NPERR_GENERIC_ERROR;
-      break;
-    }
-
-  PLUGIN_DEBUG ("ITNP_GetValue return\n");
-
-  return np_error;
-}
-
-NPError
-ITNP_Destroy (NPP instance, NPSavedData** save)
-{
-  PLUGIN_DEBUG ("ITNP_Destroy %p\n", instance);
-
-  ITNPPluginData* data = (ITNPPluginData*) instance->pdata;
-
-  if (data)
-    {
-      // Free plugin data.
-      plugin_data_destroy (instance);
-    }
-
-  int id = get_id_from_instance(instance);
-
-  g_hash_table_remove(instance_to_id_map, instance);
-  g_hash_table_remove(id_to_instance_map, GINT_TO_POINTER(id));
-
-  IcedTeaPluginUtilities::invalidateInstance(instance);
-
-  PLUGIN_DEBUG ("ITNP_Destroy return\n");
-
-  return NPERR_NO_ERROR;
-}
-
-NPError
-ITNP_SetWindow (NPP instance, NPWindow* window)
-{
-  PLUGIN_DEBUG ("ITNP_SetWindow\n");
-
-  if (instance == NULL)
-    {
-      PLUGIN_ERROR ("Invalid instance.");
-
-      return NPERR_INVALID_INSTANCE_ERROR;
-    }
-
-  gpointer id_ptr = g_hash_table_lookup(instance_to_id_map, instance);
-
-  gint id = 0;
-  if (id_ptr)
-    {
-      id = GPOINTER_TO_INT(id_ptr);
-    }
-
-  ITNPPluginData* data = (ITNPPluginData*) instance->pdata;
-
-  // Simply return if we receive a NULL window.
-  if ((window == NULL) || (window->window == NULL))
-    {
-      PLUGIN_DEBUG ("ITNP_SetWindow: got NULL window.\n");
-
-      return NPERR_NO_ERROR;
-    }
-
-  if (data->window_handle)
-    {
-      // The window already exists.
-      if (data->window_handle == window->window)
-    {
-          // The parent window is the same as in previous calls.
-          PLUGIN_DEBUG ("ITNP_SetWindow: window already exists.\n");
-
-          // Critical region.  Read data->appletviewer_mutex and send
-          // a message to the appletviewer.
-          g_mutex_lock (data->appletviewer_mutex);
-
-      if (jvm_up)
-        {
-          gboolean dim_changed = FALSE;
-
-          // The window is the same as it was for the last
-          // SetWindow call.
-          if (window->width != data->window_width)
-        {
-                  PLUGIN_DEBUG ("ITNP_SetWindow: window width changed.\n");
-          // The width of the plugin window has changed.
-
-                  // Store the new width.
-                  data->window_width = window->width;
-                  dim_changed = TRUE;
-        }
-
-          if (window->height != data->window_height)
-        {
-                  PLUGIN_DEBUG ("ITNP_SetWindow: window height changed.\n");
-          // The height of the plugin window has changed.
-
-                  // Store the new height.
-                  data->window_height = window->height;
-
-                  dim_changed = TRUE;
-        }
-
-        if (dim_changed) {
-            gchar* message = g_strdup_printf ("instance %d width %d height %d",
-                                                id, window->width, window->height);
-            plugin_send_message_to_appletviewer (message);
-            g_free (message);
-            message = NULL;
-        }
-
-
-        }
-      else
-        {
-              // The appletviewer is not running.
-          PLUGIN_DEBUG ("ITNP_SetWindow: appletviewer is not running.\n");
-        }
-
-          g_mutex_unlock (data->appletviewer_mutex);
-    }
-      else
-    {
-      // The parent window has changed.  This branch does run but
-      // doing nothing in response seems to be sufficient.
-      PLUGIN_DEBUG ("ITNP_SetWindow: parent window changed.\n");
-    }
-    }
-  else
-    {
-      PLUGIN_DEBUG ("ITNP_SetWindow: setting window.\n");
-
-      // Critical region.  Send messages to appletviewer.
-      g_mutex_lock (data->appletviewer_mutex);
-
-      gchar *window_message = g_strdup_printf ("instance %d handle %ld",
-                                               id, (gulong) window->window);
-      plugin_send_message_to_appletviewer (window_message);
-      g_free (window_message);
-
-      window_message = g_strdup_printf ("instance %d width %d height %d",
-                        id,
-                        window->width,
-                        window->height);
-      plugin_send_message_to_appletviewer (window_message);
-      g_free (window_message);
-      window_message = NULL;
-
-      g_mutex_unlock (data->appletviewer_mutex);
-
-      // Store the window handle.
-      data->window_handle = window->window;
-    }
-
-  PLUGIN_DEBUG ("ITNP_SetWindow return\n");
-
-  return NPERR_NO_ERROR;
-}
-
-NPError
-ITNP_NewStream (NPP instance, NPMIMEType type, NPStream* stream,
-               NPBool seekable, uint16_t* stype)
-{
-  PLUGIN_DEBUG ("ITNP_NewStream\n");
-
-  PLUGIN_DEBUG ("ITNP_NewStream return\n");
-
-  return NPERR_NO_ERROR;
-}
-
-void
-ITNP_StreamAsFile (NPP instance, NPStream* stream, const char* filename)
-{
-  PLUGIN_DEBUG ("ITNP_StreamAsFile\n");
-
-  PLUGIN_DEBUG ("ITNP_StreamAsFile return\n");
-}
-
-NPError
-ITNP_DestroyStream (NPP instance, NPStream* stream, NPReason reason)
-{
-  PLUGIN_DEBUG ("ITNP_DestroyStream\n");
-
-  PLUGIN_DEBUG ("ITNP_DestroyStream return\n");
-
-  return NPERR_NO_ERROR;
-}
-
-int32_t
-ITNP_WriteReady (NPP instance, NPStream* stream)
-{
-  PLUGIN_DEBUG ("ITNP_WriteReady\n");
-
-  PLUGIN_DEBUG ("ITNP_WriteReady return\n");
-
-  return 0;
-}
-
-int32_t
-ITNP_Write (NPP instance, NPStream* stream, int32_t offset, int32_t len,
-           void* buffer)
-{
-  PLUGIN_DEBUG ("ITNP_Write\n");
-
-  PLUGIN_DEBUG ("ITNP_Write return\n");
-
-  return 0;
-}
-
-void
-ITNP_Print (NPP instance, NPPrint* platformPrint)
-{
-  PLUGIN_DEBUG ("ITNP_Print\n");
-
-  PLUGIN_DEBUG ("ITNP_Print return\n");
-}
-
-int16_t
-ITNP_HandleEvent (NPP instance, void* event)
-{
-  PLUGIN_DEBUG ("ITNP_HandleEvent\n");
-
-  PLUGIN_DEBUG ("ITNP_HandleEvent return\n");
-
-  return 0;
-}
-
-void
-ITNP_URLNotify (NPP instance, const char* url, NPReason reason,
-               void* notifyData)
-{
-  PLUGIN_DEBUG ("ITNP_URLNotify\n");
-
-  PLUGIN_DEBUG ("ITNP_URLNotify return\n");
-}
-
-NPError
-get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len)
-{
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-  nsresult rv;
-  nsCOMPtr<nsIScriptSecurityManager> sec_man =
-    do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
-
-  if (!sec_man) {
-    return NPERR_GENERIC_ERROR;
-  }
-
-  nsCOMPtr<nsIIOService> io_svc = do_GetService("@mozilla.org/network/io-service;1", &rv);
-
-  if (NS_FAILED(rv) || !io_svc) {
-    return NPERR_GENERIC_ERROR;
-  }
-
-  nsCOMPtr<nsIURI> uri;
-  io_svc->NewURI(nsCString(siteAddr), NULL, NULL, getter_AddRefs(uri));
-
-  nsCOMPtr<nsICookieService> cookie_svc = do_GetService("@mozilla.org/cookieService;1", &rv);
-
-  if (NS_FAILED(rv) || !cookie_svc) {
-    return NPERR_GENERIC_ERROR;
-  }
-
-  rv = cookie_svc->GetCookieString(uri, NULL, cookieString);
-
-  if (NS_FAILED(rv) || !*cookieString) {
-    return NPERR_GENERIC_ERROR;
-  }
-
-#else
-
-  // getvalueforurl needs an NPP instance. Quite frankly, there is no easy way
-  // to know which instance needs the information, as applets on Java side can
-  // be multi-threaded and the thread making a proxy.cookie request cannot be
-  // easily tracked.
-
-  // Fortunately, XULRunner does not care about the instance as long as it is
-  // valid. So we just pick the first valid one and use it. Proxy/Cookie
-  // information is not instance specific anyway, it is URL specific.
-
-  if (browser_functions.getvalueforurl)
-  {
-      GHashTableIter iter;
-      gpointer id, instance;
-
-      g_hash_table_iter_init (&iter, instance_to_id_map);
-      g_hash_table_iter_next (&iter, &instance, &id);
-
-      return browser_functions.getvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len);
-  } else
-  {
-      return NPERR_GENERIC_ERROR;
-  }
-
-#endif
-
-  return NPERR_NO_ERROR;
-}
-
-// HELPER FUNCTIONS
-
-static void
-plugin_data_new (ITNPPluginData** data)
-{
-  PLUGIN_DEBUG ("plugin_data_new\n");
-
-  *data = (ITNPPluginData*)
-    (*browser_functions.memalloc) (sizeof (struct ITNPPluginData));
-
-  // appletviewer_alive is false until the applet viewer is spawned.
-  if (*data)
-    memset (*data, 0, sizeof (struct ITNPPluginData));
-
-  PLUGIN_DEBUG ("plugin_data_new return\n");
-}
-
-
-
-// Documentbase retrieval.  This function gets the current document's
-// documentbase.  This function relies on browser-private data so it
-// will only work when the plugin is loaded in a Mozilla-based
-// browser.  We could not find a way to retrieve the documentbase
-// using the original Netscape plugin API so we use the XPCOM API
-// instead.
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-static gchar*
-plugin_get_documentbase (NPP instance)
-{
-  PLUGIN_DEBUG ("plugin_get_documentbase\n");
-
-  nsIPluginInstance* xpcom_instance = NULL;
-  nsIPluginInstancePeer* peer = NULL;
-  nsresult result = 0;
-  nsIPluginTagInfo2* pluginTagInfo2 = NULL;
-  info_union u = { NULL };
-  char const* documentbase = NULL;
-  gchar* documentbase_copy = NULL;
-
-  xpcom_instance = (nsIPluginInstance*) (instance->ndata);
-  if (!xpcom_instance)
-    {
-      PLUGIN_ERROR ("xpcom_instance is NULL.");
-      goto cleanup_done;
-    }
-
-  xpcom_instance->GetPeer (&peer);
-  if (!peer)
-    {
-      PLUGIN_ERROR ("peer is NULL.");
-      goto cleanup_done;
-    }
-
-  u.info_field = &pluginTagInfo2;
-
-  result = peer->QueryInterface (kIPluginTagInfo2IID,
-                                 u.void_field);
-  if (result || !pluginTagInfo2)
-    {
-      PLUGIN_ERROR ("pluginTagInfo2 retrieval failed.");
-      goto cleanup_peer;
-    }
-
-  pluginTagInfo2->GetDocumentBase (&documentbase);
-
-  if (!documentbase)
-    {
-      // NULL => dummy instantiation for LiveConnect
-      goto cleanup_plugintaginfo2;
-    }
-
-  documentbase_copy = g_strdup (documentbase);
-
-  // Release references.
- cleanup_plugintaginfo2:
-  NS_RELEASE (pluginTagInfo2);
-
- cleanup_peer:
-  NS_RELEASE (peer);
-
- cleanup_done:
-  PLUGIN_DEBUG ("plugin_get_documentbase return\n");
-
-  PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy);
-  return documentbase_copy;
-}
-#else
-static gchar*
-plugin_get_documentbase (NPP instance)
-{
-  PLUGIN_DEBUG ("plugin_get_documentbase\n");
-
-  char const* documentbase = NULL;
-  gchar* documentbase_copy = NULL;
-
-  // FIXME: This method is not ideal, but there are no known NPAPI call
-  // for this. See thread for more information:
-  // http://www.mail-archive.com/chromium-dev@googlegroups.com/msg04844.html
-
-  // Additionally, since it is insecure, we cannot use it for making
-  // security decisions.
-  NPObject* window;
-  browser_functions.getvalue(instance, NPNVWindowNPObject, &window);
-
-  NPVariant location;
-  NPIdentifier location_id = browser_functions.getstringidentifier("location");
-  browser_functions.getproperty(instance, window, location_id, &location);
-
-  NPVariant href;
-  NPIdentifier href_id = browser_functions.getstringidentifier("href");
-  browser_functions.getproperty(instance, NPVARIANT_TO_OBJECT(location), 
-                               href_id, &href);
-
-  // Strip everything after the last "/"
-#if MOZILLA_VERSION_COLLAPSED < 1090200
-  gchar** parts = g_strsplit (NPVARIANT_TO_STRING(href).utf8characters, "/", -1);
-#else
-  gchar** parts = g_strsplit (NPVARIANT_TO_STRING(href).UTF8Characters, "/", -1);
-#endif
-  guint parts_sz = g_strv_length (parts);
-
-  std::string location_str;
-  for (int i=0; i < parts_sz - 1; i++)
-  {
-      location_str += parts[i];
-      location_str += "/";
-  }
-
-  documentbase_copy = g_strdup (location_str.c_str());
-
-  // Release references.
-  browser_functions.releasevariantvalue(&href);
-  browser_functions.releasevariantvalue(&location);
- cleanup_done:
-  PLUGIN_DEBUG ("plugin_get_documentbase return\n");
-  PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy);
-
-  return documentbase_copy;
-}
-#endif
-
-// This function displays an error message if the appletviewer has not
-// been installed correctly.
-static void
-plugin_display_failure_dialog ()
-{
-  GtkWidget* dialog = NULL;
-
-  PLUGIN_DEBUG ("plugin_display_failure_dialog\n");
-
-  dialog = gtk_message_dialog_new (NULL,
-                                   GTK_DIALOG_DESTROY_WITH_PARENT,
-                                   GTK_MESSAGE_ERROR,
-                                   GTK_BUTTONS_CLOSE,
-                                   FAILURE_MESSAGE,
-                                   appletviewer_executable);
-  gtk_widget_show_all (dialog);
-  gtk_dialog_run (GTK_DIALOG (dialog));
-  gtk_widget_destroy (dialog);
-
-  PLUGIN_DEBUG ("plugin_display_failure_dialog return\n");
-}
-
-
-
-// plugin_in_pipe_callback is called when data is available on the
-// input pipe, or when the appletviewer crashes or is killed.  It may
-// be called after data has been destroyed in which case it simply
-// returns FALSE to remove itself from the glib main loop.
-static gboolean
-plugin_in_pipe_callback (GIOChannel* source,
-                         GIOCondition condition,
-                         gpointer plugin_data)
-{
-  PLUGIN_DEBUG ("plugin_in_pipe_callback\n");
-
-  gboolean keep_installed = TRUE;
-
-  if (condition & G_IO_IN)
-    {
-      gchar* message = NULL;
-
-      if (g_io_channel_read_line (in_from_appletviewer,
-                                  &message, NULL, NULL,
-                                  &channel_error)
-          != G_IO_STATUS_NORMAL)
-        {
-          if (channel_error)
-            {
-              PLUGIN_ERROR_TWO ("Failed to read line from input channel",
-                                channel_error->message);
-              g_error_free (channel_error);
-              channel_error = NULL;
-            }
-          else
-            PLUGIN_ERROR ("Failed to read line from input channel");
-        } else
-        {
-          consume_message(message);
-        }
-
-      g_free (message);
-      message = NULL;
-
-      keep_installed = TRUE;
-    }
-
-  if (condition & (G_IO_ERR | G_IO_HUP))
-    {
-      PLUGIN_DEBUG ("appletviewer has stopped.\n");
-      keep_installed = FALSE;
-    }
-
-  PLUGIN_DEBUG ("plugin_in_pipe_callback return\n");
-
-  return keep_installed;
-}
-
-void consume_message(gchar* message) {
-
-	PLUGIN_DEBUG ("  PIPE: plugin read: %s\n", message);
-
-  if (g_str_has_prefix (message, "instance"))
-    {
-
-	  ITNPPluginData* data;
-      gchar** parts = g_strsplit (message, " ", -1);
-      guint parts_sz = g_strv_length (parts);
-
-      int instance_id = atoi(parts[1]);
-      NPP instance = (NPP) g_hash_table_lookup(id_to_instance_map,
-                                         GINT_TO_POINTER(instance_id));
-
-      if (instance_id > 0 && !instance)
-        {
-          PLUGIN_DEBUG("Instance %d is not active. Refusing to consume message \"%s\"\n", instance_id, message);
-          return;
-        }
-      else if (instance)
-        {
-           data = (ITNPPluginData*) instance->pdata;
-        }
-
-      if (g_str_has_prefix (parts[2], "url"))
-        {
-          // Open the URL in a new browser window.
-          gchar* decoded_url = (gchar*) calloc(strlen(parts[3]) + 1, sizeof(gchar));
-          IcedTeaPluginUtilities::decodeURL(parts[3], &decoded_url);
-
-          PLUGIN_DEBUG ("plugin_in_pipe_callback: opening URL %s\n", decoded_url);
-          PLUGIN_DEBUG ("plugin_in_pipe_callback: URL target %s\n", parts[4]);
-
-          NPError np_error =
-            (*browser_functions.geturl) (data->owner, decoded_url, parts[4]);
-
-
-          if (np_error != NPERR_NO_ERROR)
-            PLUGIN_ERROR ("Failed to load URL.");
-
-          g_free(decoded_url);
-          decoded_url = NULL;
-        }
-      else if (g_str_has_prefix (parts[2], "status"))
-        {
-
-          // clear the "instance X status" parts
-          sprintf(parts[0], "");
-          sprintf(parts[1], "");
-          sprintf(parts[2], "");
-
-          // join the rest
-          gchar* status_message = g_strjoinv(" ", parts);
-          PLUGIN_DEBUG ("plugin_in_pipe_callback: setting status %s\n", status_message);
-          (*browser_functions.status) (data->owner, status_message);
-
-          g_free(status_message);
-          status_message = NULL;
-        }
-      else if (g_str_has_prefix (parts[1], "internal"))
-    	{
-    	  //s->post(message);
-    	}
-      else
-        {
-          // All other messages are posted to the bus, and subscribers are
-          // expected to take care of them. They better!
-
-    	  java_to_plugin_bus->post(message);
-        }
-
-        g_strfreev (parts);
-        parts = NULL;
-    }
-  else if (g_str_has_prefix (message, "context"))
-    {
-	      java_to_plugin_bus->post(message);
-    }
-  else if (g_str_has_prefix (message, "plugin "))
-    {
-      // internal plugin related message
-      gchar** parts = g_strsplit (message, " ", 5);
-      if (g_str_has_prefix(parts[1], "PluginProxyInfo"))
-      {
-        gchar* proxy;
-        uint32_t len;
-
-        gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar));
-        IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
-        PLUGIN_DEBUG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url);
-
-        gchar* proxy_info;
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-	proxy = (char*) malloc(sizeof(char)*2048);
-#endif
-
-        proxy_info = g_strconcat ("plugin PluginProxyInfo reference ", parts[3], " ", NULL);
-        if (get_proxy_info(decoded_url, &proxy, &len) == NPERR_NO_ERROR)
-          {
-            proxy_info = g_strconcat (proxy_info, proxy, NULL);
-          }
-
-        PLUGIN_DEBUG("Proxy info: %s\n", proxy_info);
-        plugin_send_message_to_appletviewer(proxy_info);
-
-        g_free(decoded_url);
-        decoded_url = NULL;
-        g_free(proxy_info);
-        proxy_info = NULL;
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-	g_free(proxy);
-	proxy = NULL;
-#endif
-
-      } else if (g_str_has_prefix(parts[1], "PluginCookieInfo"))
-      {
-        gchar* decoded_url = (gchar*) calloc(strlen(parts[4])+1, sizeof(gchar));
-        IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
-
-        gchar* cookie_info = g_strconcat ("plugin PluginCookieInfo reference ", parts[3], " ", NULL);
-        gchar* cookie_string;
-        uint32_t len;
-        if (get_cookie_info(decoded_url, &cookie_string, &len) == NPERR_NO_ERROR)
-        {
-            cookie_info = g_strconcat (cookie_info, cookie_string, NULL);
-        }
-
-        PLUGIN_DEBUG("Cookie info: %s\n", cookie_info);
-        plugin_send_message_to_appletviewer(cookie_info);
-
-        g_free(decoded_url);
-        decoded_url = NULL;
-        g_free(cookie_info);
-        cookie_info = NULL;
-      }
-    }
-  else
-    {
-        g_print ("  Unable to handle message: %s\n", message);
-    }
-}
-
-void get_instance_from_id(int id, NPP& instance)
-{
-    instance = (NPP) g_hash_table_lookup(id_to_instance_map,
-                                       GINT_TO_POINTER(id));
-}
-
-int get_id_from_instance(NPP instance)
-{
-    int id = GPOINTER_TO_INT(g_hash_table_lookup(instance_to_id_map,
-                                                       instance));
-    PLUGIN_DEBUG("Returning id %d for instance %p\n", id, instance);
-    return id;
-}
-
-NPError
-get_proxy_info(const char* siteAddr, char** proxy, uint32_t* len)
-{
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-  nsresult rv;
-
-  // Initialize service variables
-  nsCOMPtr<nsIProtocolProxyService> proxy_svc = do_GetService("@mozilla.org/network/protocol-proxy-service;1", &rv);
-
-  if (!proxy_svc) {
-      printf("Cannot initialize proxy service\n");
-      return NPERR_GENERIC_ERROR;
-  }
-
-  nsCOMPtr<nsIIOService> io_svc = do_GetService("@mozilla.org/network/io-service;1", &rv);
-
-  if (NS_FAILED(rv) || !io_svc) {
-    printf("Cannot initialize io service\n");
-    return NPERR_GENERIC_ERROR;
-  }
-
-  // uri which needs to be accessed
-  nsCOMPtr<nsIURI> uri;
-  io_svc->NewURI(nsCString(siteAddr), NULL, NULL, getter_AddRefs(uri));
-
-  // find the proxy address if any
-  nsCOMPtr<nsIProxyInfo> info;
-  proxy_svc->Resolve(uri, 0, getter_AddRefs(info));
-
-  // if there is no proxy found, return immediately
-  if (!info) {
-     PLUGIN_DEBUG("%s does not need a proxy\n", siteAddr);
-     return NPERR_GENERIC_ERROR;
-  }
-
-  // if proxy info is available, extract it
-  nsCString phost;
-  PRInt32 pport;
-  nsCString ptype;
-
-  info->GetHost(phost);
-  info->GetPort(&pport);
-  info->GetType(ptype);
-
-  // resolve the proxy address to an IP
-  nsCOMPtr<nsIDNSService> dns_svc = do_GetService("@mozilla.org/network/dns-service;1", &rv);
-
-  if (!dns_svc) {
-      printf("Cannot initialize DNS service\n");
-      return NPERR_GENERIC_ERROR;
-  }
-
-  nsCOMPtr<nsIDNSRecord> record;
-  dns_svc->Resolve(phost, 0U, getter_AddRefs(record));
-
-  // TODO: Add support for multiple ips
-  nsDependentCString ipAddr;
-  record->GetNextAddrAsString(ipAddr);
-
-  if (!strcmp(ptype.get(), "http"))
-  {
-      snprintf(*proxy, sizeof(char)*1024, "%s %s:%d", "PROXY", ipAddr.get(), pport);
-  } else
-  {
-      snprintf(*proxy, sizeof(char)*1024, "%s %s:%d", "SOCKS", ipAddr.get(), pport);
-  }
-
-  *len = strlen(*proxy);
-
-  PLUGIN_DEBUG("Proxy info for %s: %s\n", siteAddr, *proxy);
-
-#else
-
-  if (browser_functions.getvalueforurl)
-  {
-
-      // As in get_cookie_info, we use the first active instance
-      GHashTableIter iter;
-      gpointer id, instance;
-
-      g_hash_table_iter_init (&iter, instance_to_id_map);
-      g_hash_table_iter_next (&iter, &instance, &id);
-
-      browser_functions.getvalueforurl((NPP) instance, NPNURLVProxy, siteAddr, proxy, len);
-  } else
-  {
-      return NPERR_GENERIC_ERROR;
-  }
-#endif
-
-  return NPERR_NO_ERROR;
-}
-
-// plugin_out_pipe_callback is called when the appletviewer crashes or
-// is killed.  It may be called after data has been destroyed in which
-// case it simply returns FALSE to remove itself from the glib main
-// loop.
-static gboolean
-plugin_out_pipe_callback (GIOChannel* source,
-                          GIOCondition condition,
-                          gpointer plugin_data)
-{
-  PLUGIN_DEBUG ("plugin_out_pipe_callback\n");
-
-  ITNPPluginData* data = (ITNPPluginData*) plugin_data;
-
-  PLUGIN_DEBUG ("plugin_out_pipe_callback: appletviewer has stopped.\n");
-
-  PLUGIN_DEBUG ("plugin_out_pipe_callback return\n");
-
-  return FALSE;
-}
-
-// remove all components from LD_LIBRARY_PATH, which start with
-// MOZILLA_FIVE_HOME; firefox has its own NSS based security provider,
-// which conflicts with the one configured in nss.cfg.
-static gchar*
-plugin_filter_ld_library_path(gchar *path_old)
-{
-  gchar *moz_home = g_strdup (g_getenv ("MOZILLA_FIVE_HOME"));
-  gchar *moz_prefix;
-  gchar *path_new;
-  gchar** components;
-  int i1, i2;
-
-  if (moz_home == NULL || path_old == NULL || strlen (path_old) == 0)
-    return path_old;
-  if (g_str_has_suffix (moz_home, "/"))
-    moz_home[strlen (moz_home - 1)] = '\0';
-  moz_prefix = g_strconcat (moz_home, "/", NULL);
-
-  components = g_strsplit (path_old, ":", -1);
-  for (i1 = 0, i2 = 0; components[i1] != NULL; i1++)
-    {
-      if (g_strcmp0 (components[i1], moz_home) == 0
-	  || g_str_has_prefix (components[i1], moz_home))
-	components[i2] = components[i1];
-      else
-	components[i2++] = components[i1];
-    }
-  components[i2] = NULL;
-
-  if (i1 > i2)
-    path_new = g_strjoinv (":", components);
-  g_strfreev (components);
-  g_free (moz_home);
-  g_free (moz_prefix);
-  g_free (path_old);
-
-  if (path_new == NULL || strlen (path_new) == 0)
-    {
-      PLUGIN_DEBUG("Unset LD_LIBRARY_PATH\n");
-      return NULL;
-    }
-  else
-    {
-      PLUGIN_DEBUG ("Set LD_LIBRARY_PATH: %s\n", path_new);
-      return path_new;
-    }
-}
-
-// build the environment to pass to the external plugin process
-static gchar**
-plugin_filter_environment(void)
-{
-  gchar **var_names = g_listenv();
-  gchar **new_env = (gchar**) malloc(sizeof(gchar*) * (g_strv_length (var_names) + 1));
-  int i_var, i_env;
-
-  for (i_var = 0, i_env = 0; var_names[i_var] != NULL; i_var++)
-    {
-      gchar *env_value = g_strdup (g_getenv (var_names[i_var]));
-
-      if (g_str_has_prefix (var_names[i_var], "LD_LIBRARY_PATH"))
-	env_value = plugin_filter_ld_library_path (env_value);
-      if (env_value != NULL)
-	{
-	  new_env[i_env++] = g_strdup_printf ("%s=%s", var_names[i_var], env_value);
-	  g_free (env_value);
-	}
-    }
-  new_env[i_env] = NULL;
-  return new_env;
-}
-
-static NPError
-plugin_test_appletviewer ()
-{
-  PLUGIN_DEBUG ("plugin_test_appletviewer: %s\n", appletviewer_executable);
-  NPError error = NPERR_NO_ERROR;
-
-  gchar* command_line[3] = { NULL, NULL, NULL };
-  gchar** environment;
-
-  command_line[0] = g_strdup (appletviewer_executable);
-  command_line[1] = g_strdup("-version");
-  command_line[2] = NULL;
-
-  environment = plugin_filter_environment();
-
-  if (!g_spawn_async (NULL, command_line, environment,
-		      (GSpawnFlags) 0,
-                      NULL, NULL, NULL, &channel_error))
-    {
-      if (channel_error)
-        {
-          PLUGIN_ERROR_TWO ("Failed to spawn applet viewer",
-                            channel_error->message);
-          g_error_free (channel_error);
-          channel_error = NULL;
-        }
-      else
-        PLUGIN_ERROR ("Failed to spawn applet viewer");
-      error = NPERR_GENERIC_ERROR;
-    }
-
-  g_strfreev (environment);
-
-  g_free (command_line[0]);
-  command_line[0] = NULL;
-  g_free (command_line[1]);
-  command_line[1] = NULL;
-  g_free (command_line[2]);
-  command_line[2] = NULL;
-
-  PLUGIN_DEBUG ("plugin_test_appletviewer return\n");
-  return error;
-}
-
-static NPError
-plugin_start_appletviewer (ITNPPluginData* data)
-{
-  PLUGIN_DEBUG ("plugin_start_appletviewer\n");
-  NPError error = NPERR_NO_ERROR;
-
-  gchar** command_line;
-  gchar** environment;
-
-  if (plugin_debug)
-  {
-      command_line = (gchar**) malloc(sizeof(gchar*)*8);
-      command_line[0] = g_strdup(appletviewer_executable);
-      command_line[1] = g_strdup("-Xdebug");
-      command_line[2] = g_strdup("-Xnoagent");
-      command_line[3] = g_strdup("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n");
-      command_line[4] = g_strdup("sun.applet.PluginMain");
-      command_line[5] = g_strdup(out_pipe_name);
-      command_line[6] = g_strdup(in_pipe_name);
-      command_line[7] = NULL;
-   } else
-   {
-       command_line = (gchar**) malloc(sizeof(gchar*)*5);
-       command_line[0] = g_strdup(appletviewer_executable);
-       command_line[1] = g_strdup("sun.applet.PluginMain");
-       command_line[2] = g_strdup(out_pipe_name);
-       command_line[3] = g_strdup(in_pipe_name);
-       command_line[4] = NULL;
-   }
-
-  environment = plugin_filter_environment();
-
-  if (!g_spawn_async (NULL, command_line, environment,
-		      (GSpawnFlags) G_SPAWN_DO_NOT_REAP_CHILD,
-                      NULL, NULL, &appletviewer_pid, &channel_error))
-    {
-      if (channel_error)
-        {
-          PLUGIN_ERROR_TWO ("Failed to spawn applet viewer",
-                            channel_error->message);
-          g_error_free (channel_error);
-          channel_error = NULL;
-        }
-      else
-        PLUGIN_ERROR ("Failed to spawn applet viewer");
-      error = NPERR_GENERIC_ERROR;
-    }
-
-  g_strfreev (environment);
-
-  g_free (command_line[0]);
-  command_line[0] = NULL;
-  g_free (command_line[1]);
-  command_line[1] = NULL;
-
-  if (plugin_debug)
-  {
-      g_free (command_line[2]);
-      command_line[2] = NULL;
-      g_free (command_line[3]);
-      command_line[3] = NULL;
-      g_free (command_line[4]);
-      command_line[4] = NULL;
-      g_free (command_line[5]);
-      command_line[5] = NULL;
-  }
-
-  g_free(command_line);
-  command_line = NULL;
-
-  if (appletviewer_pid)
-    {
-      PLUGIN_DEBUG("Initialized VM with pid=%d\n", appletviewer_pid);
-      appletviewer_watch_id = g_child_watch_add(appletviewer_pid, (GChildWatchFunc) appletviewer_monitor, (gpointer) appletviewer_pid);
-    }
-
-
-  PLUGIN_DEBUG ("plugin_start_appletviewer return\n");
-  return error;
-}
-
-// Build up the applet tag string that we'll send to the applet
-// viewer.
-static gchar*
-plugin_create_applet_tag (int16_t argc, char* argn[], char* argv[])
-{
-  PLUGIN_DEBUG ("plugin_create_applet_tag\n");
-
-  gchar* applet_tag = g_strdup ("<EMBED ");
-  gchar* parameters = g_strdup ("");
-
-  for (int16_t i = 0; i < argc; i++)
-    {
-      if (!g_ascii_strcasecmp (argn[i], "code"))
-        {
-          gchar* code = g_strdup_printf ("CODE=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, code, NULL);
-          g_free (code);
-          code = NULL;
-    }
-      else if (!g_ascii_strcasecmp (argn[i], "java_code"))
-    {
-          gchar* java_code = g_strdup_printf ("JAVA_CODE=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, java_code, NULL);
-          g_free (java_code);
-          java_code = NULL;
-    }
-      else if (!g_ascii_strcasecmp (argn[i], "codebase"))
-    {
-          gchar* codebase = g_strdup_printf ("CODEBASE=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, codebase, NULL);
-          g_free (codebase);
-          codebase = NULL;
-    }
-      else if (!g_ascii_strcasecmp (argn[i], "java_codebase"))
-    {
-          gchar* java_codebase = g_strdup_printf ("JAVA_CODEBASE=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, java_codebase, NULL);
-          g_free (java_codebase);
-          java_codebase = NULL;
-    }
-      else if (!g_ascii_strcasecmp (argn[i], "classid"))
-    {
-          gchar* classid = g_strdup_printf ("CLASSID=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, classid, NULL);
-          g_free (classid);
-          classid = NULL;
-    }
-      else if (!g_ascii_strcasecmp (argn[i], "archive"))
-    {
-          gchar* archive = g_strdup_printf ("ARCHIVE=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, archive, NULL);
-          g_free (archive);
-          archive = NULL;
-    }
-      else if (!g_ascii_strcasecmp (argn[i], "java_archive"))
-    {
-          gchar* java_archive = g_strdup_printf ("JAVA_ARCHIVE=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, java_archive, NULL);
-          g_free (java_archive);
-          java_archive = NULL;
-    }
-      else if (!g_ascii_strcasecmp (argn[i], "width"))
-    {
-          gchar* width = g_strdup_printf ("width=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, width, NULL);
-          g_free (width);
-          width = NULL;
-    }
-      else if (!g_ascii_strcasecmp (argn[i], "height"))
-    {
-          gchar* height = g_strdup_printf ("height=\"%s\" ", argv[i]);
-          applet_tag = g_strconcat (applet_tag, height, NULL);
-          g_free (height);
-          height = NULL;
-    }
-      else
-        {
-          // Escape the parameter value so that line termination
-          // characters will pass through the pipe.
-          if (argv[i] != '\0')
-            {
-              // worst case scenario -> all characters are newlines or
-              // returns, each of which translates to 5 substitutions
-              char* escaped = (char*) calloc(((strlen(argv[i])*5)+1), sizeof(char));
-
-              strcpy(escaped, "");
-              for (int j=0; j < strlen(argv[i]); j++)
-              {
-                  if (argv[i][j] == '\r')
-                      strcat(escaped, "&#13;");
-                  else if (argv[i][j] == '\n')
-                      strcat(escaped, "&#10;");
-                  else if (argv[i][j] == '>')
-                      strcat(escaped, "&gt;");
-                  else if (argv[i][j] == '<')
-                      strcat(escaped, "&lt;");
-                  else if (argv[i][j] == '&')
-                      strcat(escaped, "&amp;");
-                  else
-                  {
-                      char* orig_char = (char*) calloc(2, sizeof(char));
-                      orig_char[0] = argv[i][j];
-                      orig_char[1] = '\0';
-
-                      strcat(escaped, orig_char);
-
-                      free(orig_char);
-                      orig_char = NULL;
-                  }
-              }
-
-              parameters = g_strconcat (parameters, "<PARAM NAME=\"", argn[i],
-                                        "\" VALUE=\"", escaped, "\">", NULL);
-
-              free (escaped);
-              escaped = NULL;
-            }
-        }
-    }
-
-  applet_tag = g_strconcat (applet_tag, ">", parameters, "</EMBED>", NULL);
-
-  g_free (parameters);
-  parameters = NULL;
-
-  PLUGIN_DEBUG ("plugin_create_applet_tag return\n");
-
-  return applet_tag;
-}
-
-// plugin_send_message_to_appletviewer must be called while holding
-// data->appletviewer_mutex.
-void
-plugin_send_message_to_appletviewer (gchar const* message)
-{
-  PLUGIN_DEBUG ("plugin_send_message_to_appletviewer\n");
-
-  if (jvm_up)
-    {
-      gchar* newline_message = NULL;
-      gsize bytes_written = 0;
-
-      // Send message to appletviewer.
-      newline_message = g_strdup_printf ("%s\n", message);
-
-      // g_io_channel_write_chars will return something other than
-      // G_IO_STATUS_NORMAL if not all the data is written.  In that
-      // case we fail rather than retrying.
-      if (g_io_channel_write_chars (out_to_appletviewer,
-                                    newline_message, -1, &bytes_written,
-                                    &channel_error)
-            != G_IO_STATUS_NORMAL)
-        {
-          if (channel_error)
-            {
-              PLUGIN_ERROR_TWO ("Failed to write bytes to output channel",
-                                channel_error->message);
-              g_error_free (channel_error);
-              channel_error = NULL;
-            }
-          else
-            PLUGIN_ERROR ("Failed to write bytes to output channel");
-        }
-
-      if (g_io_channel_flush (out_to_appletviewer, &channel_error)
-          != G_IO_STATUS_NORMAL)
-        {
-          if (channel_error)
-            {
-              PLUGIN_ERROR_TWO ("Failed to flush bytes to output channel",
-                                channel_error->message);
-              g_error_free (channel_error);
-              channel_error = NULL;
-            }
-          else
-            PLUGIN_ERROR ("Failed to flush bytes to output channel");
-        }
-      g_free (newline_message);
-      newline_message = NULL;
-
-      PLUGIN_DEBUG ("  PIPE: plugin wrote: %s\n", message);
-    }
-
-  PLUGIN_DEBUG ("plugin_send_message_to_appletviewer return\n");
-}
-
-// Stop the appletviewer process.  When this is called the
-// appletviewer can be in any of three states: running, crashed or
-// hung.  If the appletviewer is running then sending it "shutdown"
-// will cause it to exit.  This will cause
-// plugin_out_pipe_callback/plugin_in_pipe_callback to be called and
-// the input and output channels to be shut down.  If the appletviewer
-// has crashed then plugin_out_pipe_callback/plugin_in_pipe_callback
-// would already have been called and data->appletviewer_alive cleared
-// in which case this function simply returns.  If the appletviewer is
-// hung then this function will be successful and the input and output
-// watches will be removed by plugin_data_destroy.
-// plugin_stop_appletviewer must be called with
-// data->appletviewer_mutex held.
-static void
-plugin_stop_appletviewer ()
-{
-  PLUGIN_DEBUG ("plugin_stop_appletviewer\n");
-
-  if (jvm_up)
-    {
-      // Shut down the appletviewer.
-      gsize bytes_written = 0;
-
-      if (out_to_appletviewer)
-        {
-          if (g_io_channel_write_chars (out_to_appletviewer, "shutdown",
-                                        -1, &bytes_written, &channel_error)
-              != G_IO_STATUS_NORMAL)
-            {
-              if (channel_error)
-                {
-                  PLUGIN_ERROR_TWO ("Failed to write shutdown message to"
-                                    " appletviewer", channel_error->message);
-                  g_error_free (channel_error);
-                  channel_error = NULL;
-                }
-              else
-                PLUGIN_ERROR ("Failed to write shutdown message to");
-            }
-
-          if (g_io_channel_flush (out_to_appletviewer, &channel_error)
-              != G_IO_STATUS_NORMAL)
-            {
-              if (channel_error)
-                {
-                  PLUGIN_ERROR_TWO ("Failed to write shutdown message to"
-                                    " appletviewer", channel_error->message);
-                  g_error_free (channel_error);
-                  channel_error = NULL;
-                }
-              else
-                PLUGIN_ERROR ("Failed to write shutdown message to");
-            }
-
-          if (g_io_channel_shutdown (out_to_appletviewer,
-                                     TRUE, &channel_error)
-              != G_IO_STATUS_NORMAL)
-            {
-              if (channel_error)
-                {
-                  PLUGIN_ERROR_TWO ("Failed to shut down appletviewer"
-                                    " output channel", channel_error->message);
-                  g_error_free (channel_error);
-                  channel_error = NULL;
-                }
-              else
-                PLUGIN_ERROR ("Failed to shut down appletviewer");
-            }
-        }
-
-      if (in_from_appletviewer)
-        {
-          if (g_io_channel_shutdown (in_from_appletviewer,
-                                     TRUE, &channel_error)
-              != G_IO_STATUS_NORMAL)
-            {
-              if (channel_error)
-                {
-                  PLUGIN_ERROR_TWO ("Failed to shut down appletviewer"
-                                    " input channel", channel_error->message);
-                  g_error_free (channel_error);
-                  channel_error = NULL;
-                }
-              else
-                PLUGIN_ERROR ("Failed to shut down appletviewer");
-            }
-        }
-    }
-
-  jvm_up = FALSE;
-  sleep(2); /* Needed to prevent crashes during debug (when JDWP port is not freed by the kernel right away) */
-
-  PLUGIN_DEBUG ("plugin_stop_appletviewer return\n");
-}
-
-static void appletviewer_monitor(GPid pid, gint status, gpointer data)
-{
-    PLUGIN_DEBUG ("appletviewer_monitor\n");
-    jvm_up = FALSE;
-    pid = -1;
-    PLUGIN_DEBUG ("appletviewer_monitor return\n");
-}
-
-static void
-plugin_data_destroy (NPP instance)
-{
-  PLUGIN_DEBUG ("plugin_data_destroy\n");
-
-  ITNPPluginData* tofree = (ITNPPluginData*) instance->pdata;
-
-  // Remove instance from map
-  gpointer id_ptr = g_hash_table_lookup(instance_to_id_map, instance);
-
-  if (id_ptr)
-    {
-      gint id = GPOINTER_TO_INT(id_ptr);
-      g_hash_table_remove(instance_to_id_map, instance);
-      g_hash_table_remove(id_to_instance_map, id_ptr);
-    }
-
-  tofree->window_handle = NULL;
-  tofree->window_height = 0;
-  tofree->window_width = 0;
-
-  // cleanup_appletviewer_mutex:
-  g_free (tofree->appletviewer_mutex);
-  tofree->appletviewer_mutex = NULL;
-
-  // cleanup_instance_string:
-  g_free (tofree->instance_string);
-  tofree->instance_string = NULL;
-
-  g_free(tofree->source);
-  tofree->source = NULL;
-
-  // cleanup_data:
-  // Eliminate back-pointer to plugin instance.
-  tofree->owner = NULL;
-  (*browser_functions.memfree) (tofree);
-  tofree = NULL;
-
-  PLUGIN_DEBUG ("plugin_data_destroy return\n");
-}
-
-// FACTORY FUNCTIONS
-
-// Provides the browser with pointers to the plugin functions that we
-// implement and initializes a local table with browser functions that
-// we may wish to call.  Called once, after browser startup and before
-// the first plugin instance is created.
-// The field 'initialized' is set to true once this function has
-// finished. If 'initialized' is already true at the beginning of
-// this function, then it is evident that NP_Initialize has already
-// been called. There is no need to call this function more than once and
-// this workaround avoids any duplicate calls.
-NPError
-NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable)
-{
-  PLUGIN_DEBUG ("NP_Initialize\n");
-
-  if (initialized)
-    return NPERR_NO_ERROR;
-  else if ((browserTable == NULL) || (pluginTable == NULL))
-    {
-      PLUGIN_ERROR ("Browser or plugin function table is NULL.");
-
-      return NPERR_INVALID_FUNCTABLE_ERROR;
-    }
-
-  // Ensure that the major version of the plugin API that the browser
-  // expects is not more recent than the major version of the API that
-  // we've implemented.
-  if ((browserTable->version >> 8) > NP_VERSION_MAJOR)
-    {
-      PLUGIN_ERROR ("Incompatible version.");
-
-      return NPERR_INCOMPATIBLE_VERSION_ERROR;
-    }
-
-  // Ensure that the plugin function table we've received is large
-  // enough to store the number of functions that we may provide.
-  if (pluginTable->size < sizeof (NPPluginFuncs))
-    {
-      PLUGIN_ERROR ("Invalid plugin function table.");
-
-      return NPERR_INVALID_FUNCTABLE_ERROR;
-    }
-
-  // Ensure that the browser function table is large enough to store
-  // the number of browser functions that we may use.
-  if (browserTable->size < sizeof (NPNetscapeFuncs))
-    {
-      fprintf (stderr, "ERROR: Invalid browser function table. Some functionality may be restricted.\n");
-    }
-
-  // Store in a local table the browser functions that we may use.
-  browser_functions.size                    = browserTable->size;
-  browser_functions.version                 = browserTable->version;
-  browser_functions.geturlnotify            = browserTable->geturlnotify;
-  browser_functions.geturl                  = browserTable->geturl;
-  browser_functions.posturlnotify           = browserTable->posturlnotify;
-  browser_functions.posturl                 = browserTable->posturl;
-  browser_functions.requestread             = browserTable->requestread;
-  browser_functions.newstream               = browserTable->newstream;
-  browser_functions.write                   = browserTable->write;
-  browser_functions.destroystream           = browserTable->destroystream;
-  browser_functions.status                  = browserTable->status;
-  browser_functions.uagent                  = browserTable->uagent;
-  browser_functions.memalloc                = browserTable->memalloc;
-  browser_functions.memfree                 = browserTable->memfree;
-  browser_functions.memflush                = browserTable->memflush;
-  browser_functions.reloadplugins           = browserTable->reloadplugins;
-  browser_functions.getJavaEnv              = browserTable->getJavaEnv;
-  browser_functions.getJavaPeer             = browserTable->getJavaPeer;
-  browser_functions.getvalue                = browserTable->getvalue;
-  browser_functions.setvalue                = browserTable->setvalue;
-  browser_functions.invalidaterect          = browserTable->invalidaterect;
-  browser_functions.invalidateregion        = browserTable->invalidateregion;
-  browser_functions.forceredraw             = browserTable->forceredraw;
-  browser_functions.getstringidentifier     = browserTable->getstringidentifier;
-  browser_functions.getstringidentifiers    = browserTable->getstringidentifiers;
-  browser_functions.getintidentifier        = browserTable->getintidentifier;
-  browser_functions.identifierisstring      = browserTable->identifierisstring;
-  browser_functions.utf8fromidentifier      = browserTable->utf8fromidentifier;
-  browser_functions.intfromidentifier       = browserTable->intfromidentifier;
-  browser_functions.createobject            = browserTable->createobject;
-  browser_functions.retainobject            = browserTable->retainobject;
-  browser_functions.releaseobject           = browserTable->releaseobject;
-  browser_functions.invoke                  = browserTable->invoke;
-  browser_functions.invokeDefault           = browserTable->invokeDefault;
-  browser_functions.evaluate                = browserTable->evaluate;
-  browser_functions.getproperty             = browserTable->getproperty;
-  browser_functions.setproperty             = browserTable->setproperty;
-  browser_functions.removeproperty          = browserTable->removeproperty;
-  browser_functions.hasproperty             = browserTable->hasproperty;
-  browser_functions.hasmethod               = browserTable->hasmethod;
-  browser_functions.releasevariantvalue     = browserTable->releasevariantvalue;
-  browser_functions.setexception            = browserTable->setexception;
-  browser_functions.pluginthreadasynccall   = browserTable->pluginthreadasynccall;
-#if MOZILLA_VERSION_COLLAPSED >= 1090100
-  browser_functions.getvalueforurl          = browserTable->getvalueforurl;
-  browser_functions.setvalueforurl          = browserTable->setvalueforurl;
-#endif
-
-  // Return to the browser the plugin functions that we implement.
-  pluginTable->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
-  pluginTable->size = sizeof (NPPluginFuncs);
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-  pluginTable->newp = NewNPP_NewProc (ITNP_New);
-  pluginTable->destroy = NewNPP_DestroyProc (ITNP_Destroy);
-  pluginTable->setwindow = NewNPP_SetWindowProc (ITNP_SetWindow);
-  pluginTable->newstream = NewNPP_NewStreamProc (ITNP_NewStream);
-  pluginTable->destroystream = NewNPP_DestroyStreamProc (ITNP_DestroyStream);
-  pluginTable->asfile = NewNPP_StreamAsFileProc (ITNP_StreamAsFile);
-  pluginTable->writeready = NewNPP_WriteReadyProc (ITNP_WriteReady);
-  pluginTable->write = NewNPP_WriteProc (ITNP_Write);
-  pluginTable->print = NewNPP_PrintProc (ITNP_Print);
-  pluginTable->urlnotify = NewNPP_URLNotifyProc (ITNP_URLNotify);
-  pluginTable->getvalue = NewNPP_GetValueProc (ITNP_GetValue);
-#else
-  pluginTable->newp = NPP_NewProcPtr (ITNP_New);
-  pluginTable->destroy = NPP_DestroyProcPtr (ITNP_Destroy);
-  pluginTable->setwindow = NPP_SetWindowProcPtr (ITNP_SetWindow);
-  pluginTable->newstream = NPP_NewStreamProcPtr (ITNP_NewStream);
-  pluginTable->destroystream = NPP_DestroyStreamProcPtr (ITNP_DestroyStream);
-  pluginTable->asfile = NPP_StreamAsFileProcPtr (ITNP_StreamAsFile);
-  pluginTable->writeready = NPP_WriteReadyProcPtr (ITNP_WriteReady);
-  pluginTable->write = NPP_WriteProcPtr (ITNP_Write);
-  pluginTable->print = NPP_PrintProcPtr (ITNP_Print);
-  pluginTable->urlnotify = NPP_URLNotifyProcPtr (ITNP_URLNotify);
-  pluginTable->getvalue = NPP_GetValueProcPtr (ITNP_GetValue);
-#endif
-
-  // Make sure the plugin data directory exists, creating it if
-  // necessary.
-  data_directory = g_strconcat (P_tmpdir, NULL);
-  if (!data_directory)
-    {
-      PLUGIN_ERROR ("Failed to create data directory name.");
-      return NPERR_OUT_OF_MEMORY_ERROR;
-    }
-  NPError np_error = NPERR_NO_ERROR;
-  gchar* filename = NULL;
-
-  // If P_tmpdir does not exist, try /tmp directly
-
-  if (!g_file_test (data_directory,
-                    (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
-    {
-      int file_error = 0;
-
-      data_directory = g_strconcat ("/tmp", NULL);
-        if (!data_directory)
-          {
-            PLUGIN_ERROR ("Failed to create data directory name.");
-            return NPERR_OUT_OF_MEMORY_ERROR;
-          }
-
-    }
-
-  data_directory = g_strconcat (data_directory, "/icedteaplugin-", getenv("USER"), NULL);
-
-  if (!data_directory)
-  {
-      PLUGIN_ERROR ("Failed to create data directory name.");
-      return NPERR_OUT_OF_MEMORY_ERROR;
-  }
-
-  // Now create a icedteaplugin subdir
-  if (!g_file_test (data_directory,
-                    (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
-    {
-      int file_error = 0;
-
-      file_error = g_mkdir (data_directory, 0700);
-      if (file_error != 0)
-        {
-          PLUGIN_ERROR_THREE ("Failed to create data directory",
-                          data_directory,
-                          strerror (errno));
-          np_error = NPERR_GENERIC_ERROR;
-          goto cleanup_data_directory;
-        }
-    }
-
-
-  // If data directory doesn't exit by this point, bail
-  if (!g_file_test (data_directory,
-                    (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
-    {
-      PLUGIN_ERROR_THREE ("Temp directory does not exist: ",
-                          data_directory,
-                          strerror (errno));
-
-      np_error = NPERR_GENERIC_ERROR;
-            goto cleanup_data_directory;
-
-    }
-
-  // Set appletviewer_executable.
-  Dl_info info;
-  int filename_size;
-  if (dladdr ((const void*) ITNP_New, &info) == 0)
-    {
-      PLUGIN_ERROR_TWO ("Failed to determine plugin shared object filename",
-                        dlerror ());
-      np_error = NPERR_GENERIC_ERROR;
-      goto cleanup_data_directory;
-    }
-  filename = (gchar*) malloc(sizeof(gchar)*1024);
-  filename_size = readlink(info.dli_fname, filename, 1023);
-  if (filename_size >= 0)
-  {
-      filename[filename_size] = '\0';
-  }
-
-  if (!filename)
-    {
-      PLUGIN_ERROR ("Failed to create plugin shared object filename.");
-      np_error = NPERR_OUT_OF_MEMORY_ERROR;
-      goto cleanup_data_directory;
-    }
-
-  if (filename_size <= 0)
-  {
-      free(filename);
-      filename = g_strdup(info.dli_fname);
-  }
-
-  appletviewer_executable = g_strdup_printf ("%s/../../bin/java",
-                                             dirname (filename));
-  PLUGIN_DEBUG(".so is located at: %s and the link points to: %s. Executing java from dir %s to run %s\n", info.dli_fname, filename, dirname (filename), appletviewer_executable);
-  if (!appletviewer_executable)
-    {
-      PLUGIN_ERROR ("Failed to create appletviewer executable name.");
-      np_error = NPERR_OUT_OF_MEMORY_ERROR;
-      goto cleanup_filename;
-    }
-
-  np_error = plugin_test_appletviewer ();
-  if (np_error != NPERR_NO_ERROR)
-    {
-      plugin_display_failure_dialog ();
-      goto cleanup_appletviewer_executable;
-    }
-  g_free (filename);
-
-  initialized = true;
-
-  // Initialize threads (needed for mutexes).
-  if (!g_thread_supported ())
-    g_thread_init (NULL);
-
-  plugin_instance_mutex = g_mutex_new ();
-
-  PLUGIN_DEBUG ("NP_Initialize: using %s\n", appletviewer_executable);
-
-  PLUGIN_DEBUG ("NP_Initialize return\n");
-
-  plugin_req_proc = new PluginRequestProcessor();
-  java_req_proc = new JavaMessageSender();
-
-  java_to_plugin_bus = new MessageBus();
-  plugin_to_java_bus = new MessageBus();
-
-  java_to_plugin_bus->subscribe(plugin_req_proc);
-  plugin_to_java_bus->subscribe(java_req_proc);
-
-  pthread_create (&plugin_request_processor_thread1, NULL, &queue_processor, (void*) plugin_req_proc);
-  pthread_create (&plugin_request_processor_thread2, NULL, &queue_processor, (void*) plugin_req_proc);
-  pthread_create (&plugin_request_processor_thread3, NULL, &queue_processor, (void*) plugin_req_proc);
-
-  return NPERR_NO_ERROR;
-
- cleanup_appletviewer_executable:
-  if (appletviewer_executable)
-    {
-      g_free (appletviewer_executable);
-      appletviewer_executable = NULL;
-    }
-
- cleanup_filename:
-  if (filename)
-    {
-      g_free (filename);
-      filename = NULL;
-    }
-
- cleanup_data_directory:
-  if (data_directory)
-    {
-      g_free (data_directory);
-      data_directory = NULL;
-    }
-
-
-  return np_error;
-}
-
-// Returns a string describing the MIME type that this plugin
-// handles.
-char*
-NP_GetMIMEDescription ()
-{
-  PLUGIN_DEBUG ("NP_GetMIMEDescription\n");
-
-  PLUGIN_DEBUG ("NP_GetMIMEDescription return\n");
-
-  return (char*) PLUGIN_MIME_DESC;
-}
-
-// Returns a value relevant to the plugin as a whole.  The browser
-// calls this function to obtain information about the plugin.
-NPError
-NP_GetValue (void* future, NPPVariable variable, void* value)
-{
-  PLUGIN_DEBUG ("NP_GetValue\n");
-
-  NPError result = NPERR_NO_ERROR;
-  gchar** char_value = (gchar**) value;
-
-  switch (variable)
-    {
-    case NPPVpluginNameString:
-      PLUGIN_DEBUG ("NP_GetValue: returning plugin name.\n");
-      *char_value = g_strdup (PLUGIN_NAME);
-      break;
-
-    case NPPVpluginDescriptionString:
-      PLUGIN_DEBUG ("NP_GetValue: returning plugin description.\n");
-      *char_value = g_strdup (PLUGIN_DESC);
-      break;
-
-    default:
-      PLUGIN_ERROR ("Unknown plugin value requested.");
-      result = NPERR_GENERIC_ERROR;
-      break;
-    }
-
-  PLUGIN_DEBUG ("NP_GetValue return\n");
-
-  return result;
-}
-
-// Shuts down the plugin.  Called after the last plugin instance is
-// destroyed.
-NPError
-NP_Shutdown (void)
-{
-  PLUGIN_DEBUG ("NP_Shutdown\n");
-
-  // Free mutex.
-  if (plugin_instance_mutex)
-    {
-      g_mutex_free (plugin_instance_mutex);
-      plugin_instance_mutex = NULL;
-    }
-
-  if (data_directory)
-    {
-      g_free (data_directory);
-      data_directory = NULL;
-    }
-
-  if (appletviewer_executable)
-    {
-      g_free (appletviewer_executable);
-      appletviewer_executable = NULL;
-    }
-
-  // stop the appletviewer
-  plugin_stop_appletviewer();
-
-  // remove monitor
-  if (appletviewer_watch_id != -1)
-    g_source_remove(appletviewer_watch_id);
-
-  // Removing a source is harmless if it fails since it just means the
-  // source has already been removed.
-  g_source_remove (in_watch_source);
-  in_watch_source = 0;
-
-  // cleanup_in_from_appletviewer:
-  if (in_from_appletviewer)
-    g_io_channel_unref (in_from_appletviewer);
-  in_from_appletviewer = NULL;
-
-  // cleanup_out_watch_source:
-  g_source_remove (out_watch_source);
-  out_watch_source = 0;
-
-  // cleanup_out_to_appletviewer:
-  if (out_to_appletviewer)
-    g_io_channel_unref (out_to_appletviewer);
-  out_to_appletviewer = NULL;
-
-  // cleanup_out_pipe:
-  // Delete output pipe.
-  PLUGIN_DEBUG ("NP_Shutdown: deleting output fifo: %s\n", out_pipe_name);
-  unlink (out_pipe_name);
-  PLUGIN_DEBUG ("NP_Shutdown: deleted output fifo: %s\n", out_pipe_name);
-
-  // cleanup_out_pipe_name:
-  g_free (out_pipe_name);
-  out_pipe_name = NULL;
-
-  // cleanup_in_pipe:
-  // Delete input pipe.
-  PLUGIN_DEBUG ("NP_Shutdown: deleting input fifo: %s\n", in_pipe_name);
-  unlink (in_pipe_name);
-  PLUGIN_DEBUG ("NP_Shutdown: deleted input fifo: %s\n", in_pipe_name);
-
-  // cleanup_in_pipe_name:
-  g_free (in_pipe_name);
-  in_pipe_name = NULL;
-
-  initialized = false;
-
-  pthread_cancel(plugin_request_processor_thread1);
-  pthread_cancel(plugin_request_processor_thread2);
-  pthread_cancel(plugin_request_processor_thread3);
-
-  java_to_plugin_bus->unSubscribe(plugin_req_proc);
-  plugin_to_java_bus->unSubscribe(java_req_proc);
-  //internal_bus->unSubscribe(java_req_proc);
-  //internal_bus->unSubscribe(plugin_req_proc);
-
-  delete plugin_req_proc;
-  delete java_req_proc;
-  delete java_to_plugin_bus;
-  delete plugin_to_java_bus;
-  //delete internal_bus;
-
-  PLUGIN_DEBUG ("NP_Shutdown return\n");
-
-  return NPERR_NO_ERROR;
-}
-
-NPObject*
-get_scriptable_object(NPP instance)
-{
-    NPObject* obj;
-    ITNPPluginData* data = (ITNPPluginData*) instance->pdata;
-
-    if (data->is_applet_instance) // dummy instance/package?
-    {
-        JavaRequestProcessor java_request = JavaRequestProcessor();
-        JavaResultData* java_result;
-        std::string instance_id = std::string();
-        std::string applet_class_id = std::string();
-
-        int id = get_id_from_instance(instance);
-        gchar* id_str = g_strdup_printf ("%d", id);
-
-        // Some browsers.. (e.g. chromium) don't call NPP_SetWindow
-        // for 0x0 plugins and therefore require initialization with
-        // a 0 handle
-        if (!data->window_handle)
-        {
-            data->window_handle = 0;
-            gchar *window_message = g_strdup_printf ("instance %s handle %d",
-                                                    id_str, 0);
-            plugin_send_message_to_appletviewer (window_message);
-            g_free (window_message);
-        }
-
-        java_result = java_request.getAppletObjectInstance(id_str);
-
-        g_free(id_str);
-
-        if (java_result->error_occurred)
-        {
-            printf("Error: Unable to fetch applet instance id from Java side.\n");
-            return NULL;
-        }
-
-        instance_id.append(*(java_result->return_string));
-
-        java_result = java_request.getClassID(instance_id);
-
-        if (java_result->error_occurred)
-        {
-            printf("Error: Unable to fetch applet instance id from Java side.\n");
-            return NULL;
-        }
-
-        applet_class_id.append(*(java_result->return_string));
-
-        obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(instance, applet_class_id, instance_id, false);
-
-    } else
-    {
-        obj = IcedTeaScriptablePluginObject::get_scriptable_java_package_object(instance, "");
-    }
-
-	return obj;
-}
-
-NPObject*
-allocate_scriptable_object(NPP npp, NPClass *aClass)
-{
-	PLUGIN_DEBUG("Allocating new scriptable object\n");
-	return new IcedTeaScriptablePluginObject(npp);
-}
--- a/plugin/icedteanp/IcedTeaNPPlugin.h	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/* IcedTeaNPPlugin.h
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#ifndef __ICEDTEANPPLUGIN_H__
-#define	__ICEDTEANPPLUGIN_H__
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-#include <nsThreadUtils.h>
-#else
-#include <npapi.h>
-#include <npruntime.h>
-#include <npfunctions.h>
-#endif
-
-// GLib includes.
-#include <glib.h>
-#include <glib/gstdio.h>
-
-// GTK includes.
-#include <gtk/gtk.h>
-
-#include "IcedTeaPluginUtils.h"
-#include "IcedTeaPluginRequestProcessor.h"
-
-// Work around across some chromium issues
-#define CHROMIUM_WORKAROUND
-
-// ITNPPluginData stores all the data associated with a single plugin
-// instance.  A separate plugin instance is created for each <APPLET>
-// tag.  For now, each plugin instance spawns its own applet viewer
-// process but this may need to change if we find pages containing
-// multiple applets that expect to be running in the same VM.
-struct ITNPPluginData
-{
-  // A unique identifier for this plugin window.
-  gchar* instance_string;
-  // Mutex to protect appletviewer_alive.
-  GMutex* appletviewer_mutex;
-  // Back-pointer to the plugin instance to which this data belongs.
-  // This should not be freed but instead simply set to NULL.
-  NPP owner;
-  // The address of the plugin window.  This should not be freed but
-  // instead simply set to NULL.
-  gpointer window_handle;
-  // The last plugin window width sent to us by the browser.
-  guint32 window_width;
-  // The last plugin window height sent to us by the browser.
-  guint32 window_height;
-  // The source location for this instance
-  gchar* source;
-  // If this is an actual applet instance, or a dummy instance for static calls
-  bool is_applet_instance;
-};
-
-// Queue processing threads
-static pthread_t plugin_request_processor_thread1;
-static pthread_t plugin_request_processor_thread2;
-static pthread_t plugin_request_processor_thread3;
-
-// Condition on which the queue processor waits
-extern pthread_cond_t cond_message_available;
-
-// debug switch
-extern int plugin_debug;
-
-// Browser function table.
-extern NPNetscapeFuncs browser_functions;
-
-// messages to the java side
-extern MessageBus* plugin_to_java_bus;
-
-// messages from the java side
-extern MessageBus* java_to_plugin_bus;
-
-// internal messages (e.g ones that need processing in main thread)
-//extern MessageBus* internal_bus;
-
-// subscribes to plugin_to_java_bus and sends messages over the link
-extern JavaMessageSender java_request_processor;
-
-// processes requests made to the plugin
-extern PluginRequestProcessor plugin_request_processor;
-
-/* Given an instance pointer, return its id */
-void get_instance_from_id(int id, NPP& instance);
-
-/* Given an instance id, return its pointer */
-int get_id_from_instance(NPP instance);
-
-/* Sends a message to the appletviewer */
-void plugin_send_message_to_appletviewer(gchar const* message);
-
-/* Returns an appropriate (package/object) scriptable npobject */
-NPObject* get_scriptable_object(NPP instance);
-
-/* Creates a new scriptable plugin object and returns it */
-NPObject* allocate_scriptable_object(NPP npp, NPClass *aClass);
-
-#endif	/* __ICEDTEANPPLUGIN_H__ */
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,996 +0,0 @@
-/* IcedTeaPluginRequestProcessor.cc
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include <typeinfo>
-
-#include "IcedTeaScriptablePluginObject.h"
-#include "IcedTeaNPPlugin.h"
-#include "IcedTeaPluginRequestProcessor.h"
-
-/*
- * This class processes requests made by Java. The requests include pointer
- * information, script execution and variable get/set
- */
-
-// Initialize static members used by the queue processing framework
-pthread_mutex_t message_queue_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t syn_write_mutex = PTHREAD_MUTEX_INITIALIZER;
-std::vector< std::vector<std::string*>* >* message_queue = new std::vector< std::vector<std::string*>* >();
-
-/**
- * PluginRequestProcessor constructor.
- *
- * Initializes various complex data structures used by the class.
- */
-
-PluginRequestProcessor::PluginRequestProcessor()
-{
-    this->pendingRequests = new std::map<pthread_t, uintmax_t>();
-
-    internal_req_ref_counter = 0;
-}
-
-/**
- * PluginRequestProcessor destructor.
- *
- * Frees memory used by complex objects.
- */
-
-PluginRequestProcessor::~PluginRequestProcessor()
-{
-    PLUGIN_DEBUG("PluginRequestProcessor::~PluginRequestProcessor\n");
-
-    if (pendingRequests)
-        delete pendingRequests;
-}
-
-/**
- * Processes plugin (C++ side) requests from the Java side, and internally.
- *
- * @param message The message request to process
- * @return boolean indicating whether the message is serviceable by this object
- */
-
-bool
-PluginRequestProcessor::newMessageOnBus(const char* message)
-{
-    PLUGIN_DEBUG("PluginRequestProcessor processing %s\n", message);
-
-    std::string* type;
-    std::string* command;
-    int counter = 0;
-
-    std::vector<std::string*>* message_parts = IcedTeaPluginUtilities::strSplit(message, " ");
-
-    std::vector<std::string*>::iterator the_iterator;
-    the_iterator = message_parts->begin();
-
-    IcedTeaPluginUtilities::printStringPtrVector("PluginRequestProcessor::newMessageOnBus:", message_parts);
-
-    type = message_parts->at(0);
-    command = message_parts->at(4);
-
-    if (!type->find("instance"))
-    {
-        if (!command->find("GetWindow"))
-        {
-            // Window can be queried from the main thread only. And this call
-            // returns immediately, so we do it in the same thread.
-            this->sendWindow(message_parts);
-            return true;
-        } else if (!command->find("GetMember") ||
-                   !command->find("SetMember") ||
-                   !command->find("ToString") ||
-                   !command->find("Call") ||
-                   !command->find("GetSlot") ||
-                   !command->find("SetSlot") ||
-                   !command->find("Eval") ||
-                   !command->find("Finalize"))
-        {
-
-            // Update queue synchronously
-        	pthread_mutex_lock(&message_queue_mutex);
-            message_queue->push_back(message_parts);
-            pthread_mutex_unlock(&message_queue_mutex);
-
-            // Broadcast that a message is now available
-            pthread_cond_broadcast(&cond_message_available);
-
-            return true;
-        }
-
-    }
-
-    IcedTeaPluginUtilities::freeStringPtrVector(message_parts);
-
-    // If we got here, it means we couldn't process the message. Let the caller know.
-    return false;
-}
-
-/**
- * Sends the window pointer to the Java side.
- *
- * @param message_parts The request message.
- */
-
-void
-PluginRequestProcessor::sendWindow(std::vector<std::string*>* message_parts)
-{
-    std::string* type;
-    std::string* command;
-    int reference;
-    std::string response = std::string();
-    std::string window_ptr_str = std::string();
-    NPVariant* variant = new NPVariant();
-    static NPObject* window_ptr;
-    int id;
-
-    type = message_parts->at(0);
-    id = atoi(message_parts->at(1)->c_str());
-    reference = atoi(message_parts->at(3)->c_str());
-    command = message_parts->at(4);
-
-    NPP instance;
-    get_instance_from_id(id, instance);
-
-    browser_functions.getvalue(instance, NPNVWindowNPObject, &window_ptr);
-    PLUGIN_DEBUG("ID=%d, Instance=%p, WindowPTR = %p\n", id, instance, window_ptr);
-
-    OBJECT_TO_NPVARIANT(window_ptr, *variant);
-    browser_functions.retainobject(window_ptr);
-    IcedTeaPluginUtilities::JSIDToString(variant, &window_ptr_str);
-
-    // We need the context 0 for backwards compatibility with the Java side
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
-    response += " JavaScriptGetWindow ";
-    response += window_ptr_str;
-
-    plugin_to_java_bus->post(response.c_str());
-
-    // store the instance pointer for future reference
-    IcedTeaPluginUtilities::storeInstanceID(variant, instance);
-}
-
-/**
- * Evaluates the given script
- *
- * @param message_parts The request message.
- */
-
-void
-PluginRequestProcessor::eval(std::vector<std::string*>* message_parts)
-{
-    JavaRequestProcessor request_processor = JavaRequestProcessor();
-    JavaResultData* java_result;
-
-    NPVariant* window_ptr;
-    NPP instance;
-    std::string script;
-    NPVariant result;
-    int reference;
-    std::string response = std::string();
-    std::string return_type = std::string();
-    int id;
-
-    reference = atoi(message_parts->at(3)->c_str());
-    window_ptr = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(message_parts->at(5));
-    instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(window_ptr);
-
-    java_result = request_processor.getString(*(message_parts->at(6)));
-    CHECK_JAVA_RESULT(java_result);
-    script.append(*(java_result->return_string));
-
-    AsyncCallThreadData thread_data = AsyncCallThreadData();
-    thread_data.result_ready = false;
-    thread_data.parameters = std::vector<void*>();
-    thread_data.result = std::string();
-
-    thread_data.parameters.push_back(instance);
-    thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*window_ptr));
-    thread_data.parameters.push_back(&script);
-
-#ifdef CHROMIUM_WORKAROUND
-    // Workaround for chromium
-    _eval(&thread_data);
-
-    if (!thread_data.call_successful)
-    {
-#endif
-        thread_data.result_ready = false;
-        browser_functions.pluginthreadasynccall(instance, &_eval, &thread_data);
-
-        while (!thread_data.result_ready) usleep(2000); // Wait till result is ready
-#ifdef CHROMIUM_WORKAROUND
-    }
-#endif
-
-    NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(thread_data.result);
-    std::string result_variant_jniid = std::string();
-    createJavaObjectFromVariant(instance, *result_variant, &result_variant_jniid);
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
-    response += " JavaScriptEval ";
-    response += result_variant_jniid;
-
-    plugin_to_java_bus->post(response.c_str());
-}
-
-/**
- * Calls the given javascript script
- *
- * @param message_parts The request message.
- */
-
-void
-PluginRequestProcessor::call(std::vector<std::string*>* message_parts)
-{
-    NPP instance;
-    std::string* window_ptr_str;
-    NPVariant* window_ptr;
-    int reference;
-    std::string window_function_name;
-    std::vector<NPVariant> args = std::vector<NPVariant>();
-    std::vector<std::string> arg_ids = std::vector<std::string>();
-    int arg_count;
-    std::string response = std::string();
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-    JavaResultData* java_result;
-
-    reference = atoi(message_parts->at(3)->c_str());
-
-    // window
-    window_ptr_str = message_parts->at(5);
-    window_ptr = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(window_ptr_str);
-
-    // instance
-    instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(window_ptr);
-
-    // function name
-    java_result = java_request.getString(*(message_parts->at(6)));
-    CHECK_JAVA_RESULT(java_result);
-    window_function_name.append(*(java_result->return_string));
-
-    // arguments
-    for (int i=7; i < message_parts->size(); i++)
-    {
-        arg_ids.push_back(*(message_parts->at(i)));
-    }
-
-    // determine arguments
-    for (int i=0; i < arg_ids.size(); i++)
-    {
-        NPVariant* variant = new NPVariant();
-        java_result = java_request.getValue(arg_ids[i]);
-        CHECK_JAVA_RESULT(java_result);
-
-        IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, variant);
-
-        args.push_back(*variant);
-    }
-
-    arg_count = args.size();
-    NPVariant *args_array = (NPVariant*) malloc(sizeof(NPVariant)*args.size());
-    for (int i=0; i < args.size(); i++)
-        args_array[i] = args[i];
-
-    AsyncCallThreadData thread_data = AsyncCallThreadData();
-    thread_data.result_ready = false;
-    thread_data.parameters = std::vector<void*>();
-    thread_data.result = std::string();
-
-    thread_data.parameters.push_back(instance);
-    thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*window_ptr));
-    thread_data.parameters.push_back(&window_function_name);
-    thread_data.parameters.push_back(&arg_count);
-    thread_data.parameters.push_back(args_array);
-
-#ifdef CHROMIUM_WORKAROUND
-    // Workaround for chromium
-    _call(&thread_data);
-
-    if (!thread_data.call_successful)
-    {
-#endif
-        thread_data.result_ready = false;
-        browser_functions.pluginthreadasynccall(instance, &_call, &thread_data);
-
-        while (!thread_data.result_ready) usleep(2000); // wait till ready
-#ifdef CHROMIUM_WORKAROUND
-    }
-#endif
-
-    NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(thread_data.result);
-    std::string result_variant_jniid = std::string();
-
-    if (result_variant)
-    {
-        createJavaObjectFromVariant(instance, *result_variant, &result_variant_jniid);
-    } else
-    {
-        result_variant_jniid = "0";
-    }
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
-    response += " JavaScriptCall ";
-    response += result_variant_jniid;
-
-    plugin_to_java_bus->post(response.c_str());
-
-    cleanup:
-    free(args_array);
-}
-
-/**
- * Sends the string value of the requested variable
- *
- * @param message_parts The request message.
- */
-void
-PluginRequestProcessor::sendString(std::vector<std::string*>* message_parts)
-{
-    std::string variant_ptr;
-    NPVariant* variant;
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-    JavaResultData* java_result;
-    int reference;
-    std::string response = std::string();
-
-    reference = atoi(message_parts->at(3)->c_str());
-    variant_ptr = *(message_parts->at(5));
-
-    variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(variant_ptr);
-    AsyncCallThreadData thread_data = AsyncCallThreadData();
-    thread_data.result_ready = false;
-    thread_data.parameters = std::vector<void*>();
-    thread_data.result = std::string();
-
-    NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(variant);
-    thread_data.parameters.push_back(instance);
-    thread_data.parameters.push_back(variant);
-
-#ifdef CHROMIUM_WORKAROUND
-    // Workaround for chromium
-    _getString(&thread_data);
-
-    if (!thread_data.call_successful)
-    {
-#endif
-        thread_data.result_ready = false;
-        browser_functions.pluginthreadasynccall(instance, &_getString, &thread_data);
-        while (!thread_data.result_ready) usleep(2000); // wait till ready
-#ifdef CHROMIUM_WORKAROUND
-    }
-#endif
-
-    // We need the context 0 for backwards compatibility with the Java side
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
-    response += " JavaScriptToString ";
-    response += thread_data.result;
-
-    plugin_to_java_bus->post(response.c_str());
-
-    cleanup:
-
-    pthread_mutex_lock(&tc_mutex);
-    thread_count--;
-    pthread_mutex_unlock(&tc_mutex);
-}
-
-/**
- * Sets variable to given value
- *
- * @param message_parts The request message.
- */
-
-void
-PluginRequestProcessor::setMember(std::vector<std::string*>* message_parts)
-{
-    std::string propertyNameID;
-    std::string value = std::string();
-    std::string response = std::string();
-    int reference;
-
-    NPP instance;
-    NPVariant* member;
-    NPIdentifier property_identifier;
-
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-    JavaResultData* java_result;
-
-    IcedTeaPluginUtilities::printStringPtrVector("PluginRequestProcessor::_setMember - ", message_parts);
-
-    reference = atoi(message_parts->at(3)->c_str());
-
-    member = (NPVariant*) (IcedTeaPluginUtilities::stringToJSID(*(message_parts->at(5))));
-    propertyNameID = *(message_parts->at(6));
-
-    if (*(message_parts->at(7)) == "literalreturn")
-    {
-        value.append(*(message_parts->at(7)));
-        value.append(" ");
-        value.append(*(message_parts->at(8)));
-    } else
-    {
-        value.append(*(message_parts->at(7)));
-    }
-
-    instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(member);
-
-    if (*(message_parts->at(4)) == "SetSlot")
-    {
-        property_identifier = browser_functions.getintidentifier(atoi(message_parts->at(6)->c_str()));
-    } else
-    {
-        java_result = java_request.getString(propertyNameID);
-
-        // the result we want is in result_string (assuming there was no error)
-        if (java_result->error_occurred)
-        {
-            printf("Unable to get member name for setMember. Error occurred: %s\n", java_result->error_msg);
-            //goto cleanup;
-        }
-
-        property_identifier = browser_functions.getstringidentifier(java_result->return_string->c_str());
-    }
-
-    AsyncCallThreadData thread_data = AsyncCallThreadData();
-    thread_data.result_ready = false;
-    thread_data.parameters = std::vector<void*>();
-    thread_data.result = std::string();
-
-    thread_data.parameters.push_back(instance);
-    thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*member));
-    thread_data.parameters.push_back(&property_identifier);
-    thread_data.parameters.push_back(&value);
-
-#ifdef CHROMIUM_WORKAROUND
-    // Workaround for chromium
-    _setMember(&thread_data);
-
-    if (!thread_data.call_successful)
-    {
-#endif
-        thread_data.result_ready = false;
-        browser_functions.pluginthreadasynccall(instance, &_setMember, &thread_data);
-
-        while (!thread_data.result_ready) usleep(2000); // wait till ready
-#ifdef CHROMIUM_WORKAROUND
-    }
-#endif
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
-    response.append(" JavaScriptSetMember ");
-    plugin_to_java_bus->post(response.c_str());
-
-    cleanup:
-
-    // property_name, type and value are deleted by _setMember
-    pthread_mutex_lock(&tc_mutex);
-    thread_count--;
-    pthread_mutex_unlock(&tc_mutex);
-}
-
-/**
- * Sends request member pointer to the Java side.
- *
- * This is a static function, called in another thread. Since certain data
- * can only be requested from the main thread in Mozilla, this function
- * does whatever it can seperately, and then makes an internal request that
- * causes _sendMember to do the rest of the work.
- *
- * @param message_parts The request message
- */
-
-void
-PluginRequestProcessor::sendMember(std::vector<std::string*>* message_parts)
-{
-    // member initialization
-    std::vector<std::string> args;
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-    JavaResultData* java_result;
-    NPVariant* parent_ptr;
-
-    //int reference;
-    std::string member_id = std::string();
-    std::string jsObjectClassID = std::string();
-    std::string jsObjectConstructorID = std::string();
-    std::string response = std::string();
-
-    NPIdentifier member_identifier;
-
-    int method_id;
-    int instance_id;
-    int reference;
-
-    // debug printout of parent thread data
-    IcedTeaPluginUtilities::printStringPtrVector("PluginRequestProcessor::getMember:", message_parts);
-
-    reference = atoi(message_parts->at(3)->c_str());
-
-    // store info in local variables for easy access
-    instance_id = atoi(message_parts->at(1)->c_str());
-    parent_ptr = (NPVariant*) (IcedTeaPluginUtilities::stringToJSID(message_parts->at(5)));
-    member_id.append(*(message_parts->at(6)));
-
-    /** Request data from Java if necessary **/
-    if (*(message_parts->at(4)) == "GetSlot")
-    {
-        member_identifier = browser_functions.getintidentifier(atoi(member_id.c_str()));
-    } else
-    {
-        // make a new request for getString, to get the name of the identifier
-        java_result = java_request.getString(member_id);
-
-        // the result we want is in result_string (assuming there was no error)
-        if (java_result->error_occurred)
-        {
-            printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg);
-            //goto cleanup;
-        }
-
-        member_identifier = browser_functions.getstringidentifier(java_result->return_string->c_str());
-    }
-
-    AsyncCallThreadData thread_data = AsyncCallThreadData();
-    thread_data.result_ready = false;
-    thread_data.parameters = std::vector<void*>();
-    thread_data.result = std::string();
-
-    NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(parent_ptr);
-    thread_data.parameters.push_back(instance);
-    thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*parent_ptr));
-    thread_data.parameters.push_back(&member_identifier);
-
-#ifdef CHROMIUM_WORKAROUND
-    // Workaround for chromium
-    _getMember(&thread_data);
-
-    if (!thread_data.call_successful)
-    {
-#endif
-        thread_data.result_ready = false;
-        browser_functions.pluginthreadasynccall(instance, &_getMember, &thread_data);
-
-        while (!thread_data.result_ready) usleep(2000); // wait till ready
-
-#ifdef CHROMIUM_WORKAROUND
-    }
-#endif
-
-    PLUGIN_DEBUG("Member PTR after internal request: %s\n", thread_data.result.c_str());
-
-    java_result = java_request.findClass(0, "netscape.javascript.JSObject");
-
-    // the result we want is in result_string (assuming there was no error)
-    if (java_result->error_occurred)
-    {
-        printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg);
-        //goto cleanup;
-    }
-
-    jsObjectClassID.append(*(java_result->return_string));
-
-    args = std::vector<std::string>();
-    std::string longArg = "J";
-    args.push_back(longArg);
-
-    java_result = java_request.getMethodID(jsObjectClassID,
-                                           browser_functions.getstringidentifier("<init>"),
-                                           args);
-
-    // the result we want is in result_string (assuming there was no error)
-    if (java_result->error_occurred)
-    {
-        printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg);
-        //goto cleanup;
-    }
-
-    jsObjectConstructorID.append(*(java_result->return_string));
-
-    // We have the method id. Now create a new object.
-
-    args.clear();
-    args.push_back(thread_data.result);
-    java_result = java_request.newObjectWithConstructor("",
-                                         jsObjectClassID,
-                                         jsObjectConstructorID,
-                                         args);
-
-    // the result we want is in result_string (assuming there was no error)
-    if (java_result->error_occurred)
-    {
-        printf("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg);
-        //goto cleanup;
-    }
-
-
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
-    if (*(message_parts->at(2)) == "GetSlot")
-    {
-        response.append(" JavaScriptGetMember ");
-    } else {
-        response.append(" JavaScriptGetSlot ");
-    }
-    response.append(java_result->return_string->c_str());
-    plugin_to_java_bus->post(response.c_str());
-
-
-    // Now be a good citizen and help keep the heap free of garbage
-    cleanup:
-
-    pthread_mutex_lock(&tc_mutex);
-    thread_count--;
-    pthread_mutex_unlock(&tc_mutex);
-}
-
-/**
- * Decrements reference count to given object
- *
- * @param message_parts The request message.
- */
-
-void
-PluginRequestProcessor::finalize(std::vector<std::string*>* message_parts)
-{
-    std::string* type;
-    std::string* command;
-    int reference;
-    std::string response = std::string();
-    std::string* variant_ptr_str;
-    NPVariant* variant_ptr;
-    NPObject* window_ptr;
-    int id;
-
-    type = message_parts->at(0);
-    id = atoi(message_parts->at(1)->c_str());
-    reference = atoi(message_parts->at(3)->c_str());
-    variant_ptr_str = message_parts->at(5);
-
-    NPP instance;
-    get_instance_from_id(id, instance);
-
-    variant_ptr = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(variant_ptr_str);
-    window_ptr = NPVARIANT_TO_OBJECT(*variant_ptr);
-    browser_functions.releaseobject(window_ptr);
-
-    // remove reference
-    IcedTeaPluginUtilities::removeInstanceID(variant_ptr);
-
-    // clear memory
-    free(variant_ptr);
-
-    // We need the context 0 for backwards compatibility with the Java side
-    IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
-    response += " JavaScriptFinalize";
-
-    plugin_to_java_bus->post(response.c_str());
-}
-
-
-void*
-queue_processor(void* data)
-{
-
-    PluginRequestProcessor* processor = (PluginRequestProcessor*) data;
-    std::vector<std::string*>* message_parts = NULL;
-    std::string command;
-    pthread_mutex_t wait_mutex = PTHREAD_MUTEX_INITIALIZER; // This is needed for API compat. and is unused
-
-    PLUGIN_DEBUG("Queue processor initialized. Queue = %p\n", message_queue);
-
-    while (true)
-    {
-        pthread_mutex_lock(&message_queue_mutex);
-        if (message_queue->size() > 0)
-        {
-            message_parts = message_queue->front();
-            message_queue->erase(message_queue->begin());
-        }
-        pthread_mutex_unlock(&message_queue_mutex);
-
-        if (message_parts)
-        {
-            command = *(message_parts->at(4));
-
-            if (command == "GetMember")
-            {
-                processor->sendMember(message_parts);
-            } else if (command == "ToString")
-            {
-                processor->sendString(message_parts);
-            } else if (command == "SetMember")
-            {
-            	// write methods are synchronized
-            	pthread_mutex_lock(&syn_write_mutex);
-                processor->setMember(message_parts);
-                pthread_mutex_unlock(&syn_write_mutex);
-            } else if (command == "Call")
-            {
-                // write methods are synchronized
-                pthread_mutex_lock(&syn_write_mutex);
-                processor->call(message_parts);
-                pthread_mutex_unlock(&syn_write_mutex);
-            } else if (command == "Eval")
-            {
-                // write methods are synchronized
-                pthread_mutex_lock(&syn_write_mutex);
-                processor->eval(message_parts);
-                pthread_mutex_unlock(&syn_write_mutex);
-            } else if (command == "GetSlot")
-            {
-                // write methods are synchronized
-                pthread_mutex_lock(&syn_write_mutex);
-                processor->sendMember(message_parts);
-                pthread_mutex_unlock(&syn_write_mutex);
-            } else if (command == "SetSlot")
-            {
-                // write methods are synchronized
-                pthread_mutex_lock(&syn_write_mutex);
-                processor->setMember(message_parts);
-                pthread_mutex_unlock(&syn_write_mutex);
-            } else if (command == "Finalize")
-            {
-                // write methods are synchronized
-                pthread_mutex_lock(&syn_write_mutex);
-                processor->finalize(message_parts);
-                pthread_mutex_unlock(&syn_write_mutex);
-            } else
-            {
-                // Nothing matched
-                IcedTeaPluginUtilities::printStringPtrVector("Error: Unable to process message: ", message_parts);
-            }
-
-            // Free memory for message_parts
-            IcedTeaPluginUtilities::freeStringPtrVector(message_parts);
-
-        } else
-        {
-        	pthread_cond_wait(&cond_message_available, &wait_mutex);
-            pthread_testcancel();
-        }
-
-        message_parts = NULL;
-    }
-
-    PLUGIN_DEBUG("Queue processing stopped.\n");
-}
-
-/******************************************
- * Functions delegated to the main thread *
- ******************************************/
-
-void
-_setMember(void* data)
-{
-    std::string* value;
-
-    NPP instance;
-    NPVariant value_variant = NPVariant();
-    NPObject* member;
-    NPIdentifier* property;
-
-    std::vector<void*> parameters = ((AsyncCallThreadData*) data)->parameters;
-    instance = (NPP) parameters.at(0);
-    member = (NPObject*) parameters.at(1);
-    property = (NPIdentifier*) parameters.at(2);
-    value = (std::string*) parameters.at(3);
-
-    PLUGIN_DEBUG("Setting %s on instance %p, object %p to value %s\n",
-		 browser_functions.utf8fromidentifier(*property),
-		 instance, member, value->c_str());
-
-    IcedTeaPluginUtilities::javaResultToNPVariant(instance, value, &value_variant);
-
-    ((AsyncCallThreadData*) data)->call_successful = browser_functions.setproperty(instance, member, *property, &value_variant);
-
-    ((AsyncCallThreadData*) data)->result_ready = true;
-}
-
-void
-_getMember(void* data)
-{
-    NPObject* parent_ptr;
-    NPVariant* member_ptr = new NPVariant();
-    std::string member_ptr_str = std::string();
-    NPP instance;
-
-    std::vector<void*> parameters = ((AsyncCallThreadData*) data)->parameters;
-
-    instance = (NPP) parameters.at(0);
-    parent_ptr = (NPObject*) parameters.at(1);
-    NPIdentifier* member_identifier = (NPIdentifier*) parameters.at(2);
-
-    // Get the NPVariant corresponding to this member
-    PLUGIN_DEBUG("Looking for %p %p %p (%s)\n",
-		 instance, parent_ptr, member_identifier,
-		 browser_functions.utf8fromidentifier(*member_identifier));
-
-    if (!browser_functions.hasproperty(instance, parent_ptr, *member_identifier))
-    {
-        printf("%s not found!\n", browser_functions.utf8fromidentifier(*member_identifier));
-    }
-    ((AsyncCallThreadData*) data)->call_successful =
-      browser_functions.getproperty(instance, parent_ptr, *member_identifier, member_ptr);
-
-    IcedTeaPluginUtilities::printNPVariant(*member_ptr);
-
-    if (((AsyncCallThreadData*) data)->call_successful)
-    {
-        IcedTeaPluginUtilities::JSIDToString(member_ptr, &member_ptr_str);
-        ((AsyncCallThreadData*) data)->result.append(member_ptr_str);
-    }
-    ((AsyncCallThreadData*) data)->result_ready = true;
-
-    // store member -> instance link
-    IcedTeaPluginUtilities::storeInstanceID(member_ptr, instance);
-
-    PLUGIN_DEBUG("_getMember returning.\n");
-}
-
-void
-_eval(void* data)
-{
-    NPP instance;
-    NPObject* window_ptr;
-    std::string* script_str;
-    NPIdentifier script_identifier;
-    NPString script = NPString();
-    NPVariant* eval_result = new NPVariant();
-    std::string eval_result_ptr_str = std::string();
-
-    PLUGIN_DEBUG("_eval called\n");
-
-    std::vector<void*>* call_data = (std::vector<void*>*) data;
-
-    instance = (NPP) call_data->at(0);
-    window_ptr = (NPObject*) call_data->at(1);
-    script_str = (std::string*) call_data->at(2);
-
-#if MOZILLA_VERSION_COLLAPSED < 1090200
-    script.utf8characters = script_str->c_str();
-    script.utf8length = script_str->size();
-
-    PLUGIN_DEBUG("Evaluating: %s\n", script.utf8characters);
-#else
-    script.UTF8Characters = script_str->c_str();
-    script.UTF8Length = script_str->size();
-
-    PLUGIN_DEBUG("Evaluating: %s\n", script.UTF8Characters);
-#endif
-
-    ((AsyncCallThreadData*) data)->call_successful = browser_functions.evaluate(instance, window_ptr, &script, eval_result);
-    IcedTeaPluginUtilities::printNPVariant(*eval_result);
-
-    if (((AsyncCallThreadData*) data)->call_successful)
-    {
-        IcedTeaPluginUtilities::JSIDToString(eval_result, &eval_result_ptr_str);
-        ((AsyncCallThreadData*) data)->result.append(eval_result_ptr_str);
-    }
-    ((AsyncCallThreadData*) data)->result_ready = true;
-
-    PLUGIN_DEBUG("_eval returning\n");
-}
-
-
-void
-_call(void* data)
-{
-    NPP instance;
-    NPObject* window_ptr;
-    std::string* function_name;
-    NPIdentifier function;
-    int* arg_count;
-    NPVariant* args;
-    NPVariant* call_result = new NPVariant();
-    std::string call_result_ptr_str = std::string();
-
-    PLUGIN_DEBUG("_call called\n");
-
-    std::vector<void*>* call_data = (std::vector<void*>*) data;
-
-    instance = (NPP) call_data->at(0);
-    window_ptr = (NPObject*) call_data->at(1);
-    function_name = (std::string*) call_data->at(2);
-
-    function = browser_functions.getstringidentifier(function_name->c_str());
-    arg_count = (int*) call_data->at(3);
-    args = (NPVariant*) call_data->at(4);
-
-    for (int i=0; i < *arg_count; i++) {
-        IcedTeaPluginUtilities::printNPVariant(args[i]);
-    }
-
-    PLUGIN_DEBUG("_calling\n");
-    ((AsyncCallThreadData*) data)->call_successful =
-      browser_functions.invoke(instance, window_ptr, function, args, *arg_count, call_result);
-    PLUGIN_DEBUG("_called\n");
-
-    IcedTeaPluginUtilities::printNPVariant(*call_result);
-
-    if (((AsyncCallThreadData*) data)->call_successful)
-    {
-        IcedTeaPluginUtilities::JSIDToString(call_result, &call_result_ptr_str);
-        ((AsyncCallThreadData*) data)->result.append(call_result_ptr_str);
-    }
-
-    ((AsyncCallThreadData*) data)->result_ready = true;
-
-    PLUGIN_DEBUG("_call returning\n");
-}
-
-void
-_getString(void* data)
-{
-    NPP instance;
-    NPObject* object;
-    NPIdentifier toString = browser_functions.getstringidentifier("toString");
-    NPVariant tostring_result;
-    std::string result = std::string();
-
-    std::vector<void*>* call_data = (std::vector<void*>*) data;
-    instance = (NPP) call_data->at(0);
-    NPVariant* variant = (NPVariant*) call_data->at(1);
-
-    PLUGIN_DEBUG("_getString called with %p and %p\n", instance, variant);
-
-    if (NPVARIANT_IS_OBJECT(*variant))
-    {
-      ((AsyncCallThreadData*) data)->call_successful =
-	browser_functions.invoke(instance, NPVARIANT_TO_OBJECT(*variant),
-				 toString, NULL, 0, &tostring_result);
-    }
-    else
-    {
-        IcedTeaPluginUtilities::NPVariantToString(*variant, &result);
-        tostring_result = NPVariant();
-        STRINGZ_TO_NPVARIANT(result.c_str(), tostring_result);
-	((AsyncCallThreadData*) data)->call_successful = true;
-    }
-
-    PLUGIN_DEBUG("ToString result: ");
-    IcedTeaPluginUtilities::printNPVariant(tostring_result);
-
-    if (((AsyncCallThreadData*) data)->call_successful)
-      {
-	createJavaObjectFromVariant(instance, tostring_result, &(((AsyncCallThreadData*) data)->result));
-      }
-    ((AsyncCallThreadData*) data)->result_ready = true; 
-
-    PLUGIN_DEBUG("_getString returning\n");
-}
-
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.h	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/* IcedTeaPluginRequestProcessor.h
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#ifndef __ICEDTEAPLUGINREQUESTPROCESSOR_H__
-#define __ICEDTEAPLUGINREQUESTPROCESSOR_H__
-
-#include <map>
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <time.h>
-
-#include <npapi.h>
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-#include <npupp.h>
-#else
-#include <npapi.h>
-#include <npruntime.h>
-#endif
-
-#include "IcedTeaPluginUtils.h"
-#include "IcedTeaJavaRequestProcessor.h"
-
-/**
- * Data structure passed to functions called in a new thread.
- */
-
-typedef struct async_call_thread_data
-{
-    std::vector<void*> parameters;
-	std::string result;
-	bool result_ready;
-	bool call_successful;
-} AsyncCallThreadData;
-
-/* Internal request reference counter */
-static long internal_req_ref_counter;
-
-/* Given a value and type, performs the appropriate Java->JS type
- * mapping and puts it in the given variant */
-
-static void convertToNPVariant(std::string value, std::string type, NPVariant* result_variant);
-
-// Internal methods that need to run in main thread
-void _getMember(void* data);
-void _setMember(void* data);
-void _call(void* data);
-void _eval(void* data);
-void _getString(void* data);
-
-static pthread_mutex_t tc_mutex = PTHREAD_MUTEX_INITIALIZER;
-static int thread_count = 0;
-
-void* queue_processor(void* data);
-
-/* Mutex to ensure that the request queue is accessed synchronously */
-extern pthread_mutex_t message_queue_mutex;
-
-/* Mutex to ensure synchronized writes */
-extern pthread_mutex_t syn_write_mutex;
-
-/* Queue for holding messages that get processed in a separate thread */
-extern std::vector< std::vector<std::string*>* >* message_queue;
-
-/**
- * Processes requests made TO the plugin (by java or anyone else)
- */
-class PluginRequestProcessor : public BusSubscriber
-{
-    private:
-
-    	/* Requests that are still pending */
-    	std::map<pthread_t, uintmax_t>* pendingRequests;
-
-    	/* Dispatch request processing to a new thread for asynch. processing */
-    	void dispatch(void* func_ptr (void*), std::vector<std::string>* message, std::string* src);
-
-    	/* Send main window pointer to Java */
-    	void sendWindow(std::vector<std::string*>* message_parts);
-
-    	/* Stores the variant on java side */
-    	void storeVariantInJava(NPVariant variant, std::string* result);
-
-    public:
-    	PluginRequestProcessor(); /* Constructor */
-    	~PluginRequestProcessor(); /* Destructor */
-
-    	/* Process new requests (if applicable) */
-        virtual bool newMessageOnBus(const char* message);
-
-        /* Send member ID to Java */
-        void sendMember(std::vector<std::string*>* message_parts);
-
-        /* Set member to given value */
-        void setMember(std::vector<std::string*>* message_parts);
-
-        /* Send string value of requested object */
-        void sendString(std::vector<std::string*>* message_parts);
-
-        /* Evaluate the given script */
-        void eval(std::vector<std::string*>* message_parts);
-
-        /* Evaluate the given script */
-        void call(std::vector<std::string*>* message_parts);
-
-        /* Decrements reference count for given object */
-        void finalize(std::vector<std::string*>* message_parts);
-};
-
-#endif // __ICEDTEAPLUGINREQUESTPROCESSOR_H__
--- a/plugin/icedteanp/IcedTeaPluginUtils.cc	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1047 +0,0 @@
-/* IcedTeaPluginUtils.cc
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include "IcedTeaNPPlugin.h"
-#include "IcedTeaScriptablePluginObject.h"
-#include "IcedTeaPluginUtils.h"
-
-/**
- * Misc. utility functions used by the plugin
- */
-
-/***********************************************
- * Begin IcedTeaPluginUtilities implementation *
-************************************************/
-
-// Initialize static variables
-int IcedTeaPluginUtilities::reference = 0;
-pthread_mutex_t IcedTeaPluginUtilities::reference_mutex = PTHREAD_MUTEX_INITIALIZER;
-std::map<void*, NPP>* IcedTeaPluginUtilities::instance_map = new std::map<void*, NPP>();
-std::map<std::string, NPObject*>* IcedTeaPluginUtilities::object_map = new std::map<std::string, NPObject*>();
-
-/**
- * Given a context number, constructs a message prefix to send to Java
- *
- * @param context The context of the request
- * @return The string prefix (allocated on heap)
- */
-
-void
-IcedTeaPluginUtilities::constructMessagePrefix(int context, std::string *result)
-{
-	std::string context_str = std::string();
-
-	itoa(context, &context_str);
-
-	result->append("context ");
-	result->append(context_str);
-	result->append(" reference -1");
-
-}
-
-/**
- * Given a context number, and reference number, constructs a message prefix to
- * send to Java
- *
- * @param context The context of the request
- * @param rerefence The reference number of the request
- * @param result The message
- */
-
-void
-IcedTeaPluginUtilities::constructMessagePrefix(int context, int reference, std::string* result)
-{
-    // Until security is implemented, use file:// source for _everything_
-
-	std::string context_str = std::string();
-	std::string reference_str = std::string();
-
-	itoa(context, &context_str);
-	itoa(reference, &reference_str);
-
-	*result += "context ";
-	result->append(context_str);
-	*result += " reference ";
-	result->append(reference_str);
-}
-
-/**
- * Given a context number, reference number, and source location, constructs
- * a message prefix to send to Java
- *
- * @param context The context of the request
- * @param rerefence The reference number of the request
- * @param address The address for the script that made the request
- * @param result The message
- */
-
-void
-IcedTeaPluginUtilities::constructMessagePrefix(int context, int reference,
-		                                       std::string address,
-		                                       std::string* result)
-{
-	std::string context_str = std::string();
-	std::string reference_str = std::string();
-
-	itoa(context, &context_str);
-	itoa(reference, &reference_str);
-
-	*result += "context ";
-	result->append(context_str);
-	*result += " reference ";
-	result->append(reference_str);
-
-	if (address.length() > 0)
-	{
-	    *result += " src ";
-        result->append(address);
-	}
-}
-
-/**
- * Returns a string representation of a void pointer
- *
- * @param id The pointer
- * @param result The string representation
- */
-
-void
-IcedTeaPluginUtilities::JSIDToString(void* id, std::string* result)
-{
-
-	char* id_str = (char*) malloc(sizeof(char)*20); // max = long long = 8446744073709551615 == 19 chars
-
-	if (sizeof(void*) == sizeof(long long))
-	{
-		sprintf(id_str, "%llu", id);
-	}
-	else
-	{
-		sprintf(id_str, "%lu", id); // else use long
-	}
-
-	result->append(id_str);
-
-	PLUGIN_DEBUG("Converting pointer %p to %s\n", id, id_str);
-	free(id_str);
-}
-
-/**
- * Returns a void pointer from a string representation
- *
- * @param id_str The string representation
- * @return The pointer
- */
-
-void*
-IcedTeaPluginUtilities::stringToJSID(std::string id_str)
-{
-	void* ptr;
-	if (sizeof(void*) == sizeof(long long))
-	{
-		PLUGIN_DEBUG("Casting (long long) \"%s\" -- %llu\n", id_str.c_str(), strtoull(id_str.c_str(), NULL, 0));
-		ptr = reinterpret_cast <void*> ((unsigned long long) strtoull(id_str.c_str(), NULL, 0));
-	} else
-	{
-		PLUGIN_DEBUG("Casting (long) \"%s\" -- %lu\n", id_str.c_str(), strtoul(id_str.c_str(), NULL, 0));
-		ptr = reinterpret_cast <void*> ((unsigned long)  strtoul(id_str.c_str(), NULL, 0));
-	}
-
-	PLUGIN_DEBUG("Casted: %p\n", ptr);
-
-	return ptr;
-}
-
-/**
- * Returns a void pointer from a string representation
- *
- * @param id_str The pointer to the string representation
- * @return The pointer
- */
-
-void*
-IcedTeaPluginUtilities::stringToJSID(std::string* id_str)
-{
-    void* ptr;
-    if (sizeof(void*) == sizeof(long long))
-    {
-        PLUGIN_DEBUG("Casting (long long) \"%s\" -- %llu\n", id_str->c_str(), strtoull(id_str->c_str(), NULL, 0));
-        ptr = reinterpret_cast <void*> ((unsigned long long) strtoull(id_str->c_str(), NULL, 0));
-    } else
-    {
-        PLUGIN_DEBUG("Casting (long) \"%s\" -- %lu\n", id_str->c_str(), strtoul(id_str->c_str(), NULL, 0));
-        ptr = reinterpret_cast <void*> ((unsigned long)  strtoul(id_str->c_str(), NULL, 0));
-    }
-
-    PLUGIN_DEBUG("Casted: %p\n", ptr);
-
-    return ptr;
-}
-
-/**
- * Increments the global reference number and returns it.
- *
- * This function is thread-safe.
- */
-int
-IcedTeaPluginUtilities::getReference()
-{
-	pthread_mutex_lock(&reference_mutex);
-
-	// If we are nearing the max, reset
-	if (reference > 0x7FFFFFFF - 10) {
-	    reference = 0;
-	}
-
-	reference++;
-	pthread_mutex_unlock(&reference_mutex);
-
-	return reference;
-}
-
-/**
- * Decrements the global reference number.
- *
- * This function is thread-safe.
- */
-void
-IcedTeaPluginUtilities::releaseReference()
-{
-    // do nothing for now
-}
-
-/**
- * Converts integer to char*
- *
- * @param i The integer to convert to ascii
- * @param result The resulting string
- */
-void
-IcedTeaPluginUtilities::itoa(int i, std::string* result)
-{
-	// largest possible integer is 10 digits long
-	char* int_str = (char*) malloc(sizeof(char)*11);
-	sprintf(int_str, "%d", i);
-	result->append(int_str);
-
-	free(int_str);
-}
-
-/**
- * Frees memory from a string* vector
- *
- * The vector deconstructor will only delete string pointers upon being
- * called. This function frees the associated string memory as well.
- *
- * @param v The vector whose strings are to be freed
- */
-void
-IcedTeaPluginUtilities::freeStringPtrVector(std::vector<std::string*>* v)
-{
-	if (v)
-	{
-		for (int i=0; i < v->size(); i++) {
-			delete v->at(i);
-		}
-
-		delete v;
-	}
-
-}
-
-/**
- * Given a string, splits it on the given delimiters.
- *
- * @param str The string to split
- * @param The delimiters to split on
- * @return A string vector containing the aplit components
- */
-
-std::vector<std::string*>*
-IcedTeaPluginUtilities::strSplit(const char* str, const char* delim)
-{
-	std::vector<std::string*>* v = new std::vector<std::string*>();
-	v->reserve(strlen(str)/2);
-	char* copy;
-
-	// Tokening is done on a copy
-	copy = (char*) malloc (sizeof(char)*strlen(str) + 1);
-	strcpy(copy, str);
-
-	char* tok_ptr;
-	tok_ptr = strtok (copy, delim);
-
-	while (tok_ptr != NULL)
-	{
-	    // Allocation on heap since caller has no way to knowing how much will
-	    // be needed. Make sure caller cleans up!
-		std::string* s = new std::string();
-		s->append(tok_ptr);
-		v->push_back(s);
-		tok_ptr = strtok (NULL, " ");
-	}
-
-	return v;
-}
-
-/**
- * Given a unicode byte array, converts it to a UTF8 string
- *
- * The actual contents in the array may be surrounded by other data.
- *
- * e.g. with length 5, begin = 3,
- * unicode_byte_array = "37 28 5 48 45 4c 4c 4f 9e 47":
- *
- * We'd start at 3 i.e. "48" and go on for 5 i.e. upto and including "4f".
- * So we convert "48 45 4c 4c 4f" which is "hello"
- *
- * @param length The length of the string
- * @param begin Where in the array to begin conversion
- * @param result_unicode_str The return variable in which the
- *        converted string is placed
- */
-
-void
-IcedTeaPluginUtilities::getUTF8String(int length, int begin, std::vector<std::string*>* unicode_byte_array, std::string* result_unicode_str)
-{
-	result_unicode_str->clear();
-	result_unicode_str->reserve(unicode_byte_array->size()/2);
-	for (int i = begin; i < begin+length; i++)
-	    result_unicode_str->push_back((char) strtol(unicode_byte_array->at(i)->c_str(), NULL, 16));
-
-	PLUGIN_DEBUG("Converted UTF-8 string: %s. Length=%d\n", result_unicode_str->c_str(), result_unicode_str->length());
-}
-
-/**
- * Given a UTF8 string, converts it to a space delimited string of hex characters
- *
- * The first element in the return array is the length of the string
- *
- * e.g. "hello" would convert to: "5 48 45 4c 4c 4f"
- *
- * @param str The string to convert
- * @param urt_str The result
- */
-
-void
-IcedTeaPluginUtilities::convertStringToUTF8(std::string* str, std::string* utf_str)
-{
-	std::ostringstream ostream;
-
-	std::string length = std::string();
-	itoa(str->length(), &length);
-
-	ostream << length;
-
-	// UTF-8 characters are 4-bytes max + space + '\0'
-	char* hex_value = (char*) malloc(sizeof(char)*10);
-
-	for (int i = 0; i < str->length(); i++)
-	{
-		sprintf(hex_value, " %hx", str->at(i));
-		ostream << hex_value;
-	}
-
-	utf_str->clear();
-	*utf_str = ostream.str();
-
-	free(hex_value);
-	PLUGIN_DEBUG("Converted %s to UTF-8 string %s\n", str->c_str(), utf_str->c_str());
-}
-
-/**
- * Given a unicode byte array, converts it to a UTF16LE/UCS-2 string
- *
- * This works in a manner similar to getUTF8String, except that it reads 2
- * slots for each byte.
- *
- * @param length The length of the string
- * @param begin Where in the array to begin conversion
- * @param result_unicode_str The return variable in which the
- *        converted string is placed
- */
-void
-IcedTeaPluginUtilities::getUTF16LEString(int length, int begin, std::vector<std::string*>* unicode_byte_array, std::wstring* result_unicode_str)
-{
-
-	wchar_t c;
-
-	if (plugin_debug) printf("Converted UTF-16LE string: ");
-
-	result_unicode_str->clear();
-	for (int i = begin; i < begin+length; i+=2)
-	{
-		int low = strtol(unicode_byte_array->at(i)->c_str(), NULL, 16);
-		int high = strtol(unicode_byte_array->at(i+1)->c_str(), NULL, 16);
-
-        c = ((high << 8) | low);
-
-        if ((c >= 'a' && c <= 'z') ||
-        	(c >= 'A' && c <= 'Z') ||
-        	(c >= '0' && c <= '9'))
-        {
-        	if (plugin_debug) printf("%c", c);
-        }
-
-        result_unicode_str->push_back(c);
-	}
-
-	// not routing via debug print macros due to wide-string issues
-	if (plugin_debug) printf(". Length=%d\n", result_unicode_str->length());
-}
-
-/*
- * Prints the given string vector (if debug is true)
- *
- * @param prefix The prefix to print before printing the vector contents
- * @param cv The string vector whose contents are to be printed
- */
-void
-IcedTeaPluginUtilities::printStringVector(const char* prefix, std::vector<std::string>* str_vector)
-{
-
-        // This is a CPU intensive function. Run only if debugging
-        if (!plugin_debug)
-            return;
-
-	std::string* str = new std::string();
-	*str += "{ ";
-	for (int i=0; i < str_vector->size(); i++)
-	{
-		*str += str_vector->at(i);
-
-		if (i != str_vector->size() - 1)
-			*str += ", ";
-	}
-
-	*str += " }";
-
-	PLUGIN_DEBUG("%s %s\n", prefix, str->c_str());
-
-	delete str;
-}
-
-const gchar*
-IcedTeaPluginUtilities::getSourceFromInstance(NPP instance)
-{
-    // At the moment, src cannot be securely fetched via NPAPI
-    // See:
-    // http://www.mail-archive.com/chromium-dev@googlegroups.com/msg04872.html
-
-    // Since we use the insecure window.location.href attribute to compute
-    // source, we cannot use it to make security decisions. Therefore,
-    // instance associated source will always return empty
-
-    //ITNPPluginData* data = (ITNPPluginData*) instance->pdata;
-    //return (data->source) ? data->source : "";
-
-    return "http://null.null";
-}
-
-/**
- * Stores a window pointer <-> instance mapping
- *
- * @param member_ptr The pointer key
- * @param instance The instance to associate with this pointer
- */
-
-void
-IcedTeaPluginUtilities::storeInstanceID(void* member_ptr, NPP instance)
-{
-    PLUGIN_DEBUG("Storing instance %p with key %p\n", instance, member_ptr);
-    instance_map->insert(std::make_pair(member_ptr, instance));
-}
-
-/**
- * Removes a window pointer <-> instance mapping
- *
- * @param member_ptr The key to remove
- */
-
-void
-IcedTeaPluginUtilities::removeInstanceID(void* member_ptr)
-{
-    PLUGIN_DEBUG("Removing key %p from instance map\n", member_ptr);
-    instance_map->erase(member_ptr);
-}
-
-/**
- * Removes all mappings to a given instance, and all associated objects
- */
-void
-IcedTeaPluginUtilities::invalidateInstance(NPP instance)
-{
-    PLUGIN_DEBUG("Invalidating instance %p\n", instance);
-
-    std::map<void*,NPP>::iterator iterator;
-
-    for (iterator = instance_map->begin(); iterator != instance_map->end(); iterator++)
-    {
-        if ((*iterator).second == instance)
-        {
-            instance_map->erase((*iterator).first);
-        }
-    }
-}
-
-/**
- * Given the window pointer, returns the instance associated with it
- *
- * @param member_ptr The pointer key
- * @return The associated instance
- */
-
-NPP
-IcedTeaPluginUtilities::getInstanceFromMemberPtr(void* member_ptr)
-{
-
-    NPP instance = NULL;
-    PLUGIN_DEBUG("getInstanceFromMemberPtr looking for %p\n", member_ptr);
-
-    std::map<void*, NPP>::iterator iterator = instance_map->find(member_ptr);
-
-    if (iterator != instance_map->end())
-    {
-        instance = instance_map->find(member_ptr)->second;
-        PLUGIN_DEBUG("getInstanceFromMemberPtr found %p. Instance = %p\n", member_ptr, instance);
-    }
-
-    return instance;
-}
-
-/**
- * Given a java id key ('classid:instanceid'), returns the associated valid NPObject, if any
- *
- * @param key the key
- * @return The associated active NPObject, NULL otherwise
- */
-
-NPObject*
-IcedTeaPluginUtilities::getNPObjectFromJavaKey(std::string key)
-{
-
-    NPObject* object = NULL;
-    PLUGIN_DEBUG("getNPObjectFromJavaKey looking for %s\n", key.c_str());
-
-    std::map<std::string, NPObject*>::iterator iterator = object_map->find(key);
-
-    if (iterator != object_map->end())
-    {
-        NPObject* mapped_object = object_map->find(key)->second;
-
-        if (getInstanceFromMemberPtr(mapped_object) != NULL)
-        {
-            object = mapped_object;
-            PLUGIN_DEBUG("getNPObjectFromJavaKey found %s. NPObject = %p\n", key.c_str(), object);
-        }
-    }
-
-    return object;
-}
-
-/**
- * Stores a java id key <-> NPObject mapping
- *
- * @param key The Java ID Key
- * @param object The object to map to
- */
-
-void
-IcedTeaPluginUtilities::storeObjectMapping(std::string key, NPObject* object)
-{
-    PLUGIN_DEBUG("Storing object %p with key %s\n", object, key.c_str());
-    object_map->insert(std::make_pair(key, object));
-}
-
-/**
- * Removes a java id key <-> NPObject mapping
- *
- * @param key The key to remove
- */
-
-void
-IcedTeaPluginUtilities::removeObjectMapping(std::string key)
-{
-    PLUGIN_DEBUG("Removing key %s from object map\n", key.c_str());
-    object_map->erase(key);
-}
-
-/*
- * Similar to printStringVector, but takes a vector of string pointers instead
- *
- * @param prefix The prefix to print before printing the vector contents
- * @param cv The string* vector whose contents are to be printed
- */
-
-void
-IcedTeaPluginUtilities::printStringPtrVector(const char* prefix, std::vector<std::string*>* str_ptr_vector)
-{
-        // This is a CPU intensive function. Run only if debugging
-        if (!plugin_debug)
-            return;
-
-	std::string* str = new std::string();
-	*str += "{ ";
-	for (int i=0; i < str_ptr_vector->size(); i++)
-	{
-		*str += *(str_ptr_vector->at(i));
-
-		if (i != str_ptr_vector->size() - 1)
-			*str += ", ";
-	}
-
-	*str += " }";
-
-	PLUGIN_DEBUG("%s %s\n", prefix, str->c_str());
-
-	delete str;
-}
-
-void
-IcedTeaPluginUtilities::printNPVariant(NPVariant variant)
-{
-    // This is a CPU intensive function. Run only if debugging
-    if (!plugin_debug)
-        return;
-
-    if (NPVARIANT_IS_VOID(variant))
-    {
-    	PLUGIN_DEBUG("VOID %d\n", variant);
-    }
-    else if (NPVARIANT_IS_NULL(variant))
-    {
-    	PLUGIN_DEBUG("NULL\n", variant);
-    }
-    else if (NPVARIANT_IS_BOOLEAN(variant))
-    {
-    	PLUGIN_DEBUG("BOOL: %d\n", NPVARIANT_TO_BOOLEAN(variant));
-    }
-    else if (NPVARIANT_IS_INT32(variant))
-    {
-    	PLUGIN_DEBUG("INT32: %d\n", NPVARIANT_TO_INT32(variant));
-    }
-    else if (NPVARIANT_IS_DOUBLE(variant))
-    {
-    	PLUGIN_DEBUG("DOUBLE: %f\n", NPVARIANT_TO_DOUBLE(variant));
-    }
-    else if (NPVARIANT_IS_STRING(variant))
-    {
-#if MOZILLA_VERSION_COLLAPSED < 1090200
-    	PLUGIN_DEBUG("STRING: %s\n", NPVARIANT_TO_STRING(variant).utf8characters);
-#else
-    	PLUGIN_DEBUG("STRING: %s\n", NPVARIANT_TO_STRING(variant).UTF8Characters);
-#endif
-    }
-    else
-    {
-    	PLUGIN_DEBUG("OBJ: %p\n", NPVARIANT_TO_OBJECT(variant));
-    }
-}
-
-void
-IcedTeaPluginUtilities::NPVariantToString(NPVariant variant, std::string* result)
-{
-	char* str = (char*) malloc(sizeof(char)*32); // enough for everything except string
-
-    if (NPVARIANT_IS_VOID(variant))
-    {
-        sprintf(str, "%p", variant);
-    }
-    else if (NPVARIANT_IS_NULL(variant))
-    {
-    	sprintf(str, "NULL");
-    }
-    else if (NPVARIANT_IS_BOOLEAN(variant))
-    {
-    	if (NPVARIANT_TO_BOOLEAN(variant))
-    		sprintf(str, "true");
-    	else
-    		sprintf(str, "false");
-    }
-    else if (NPVARIANT_IS_INT32(variant))
-    {
-    	sprintf(str, "%d", NPVARIANT_TO_INT32(variant));
-    }
-    else if (NPVARIANT_IS_DOUBLE(variant))
-    {
-    	sprintf(str, "%f", NPVARIANT_TO_DOUBLE(variant));;
-    }
-    else if (NPVARIANT_IS_STRING(variant))
-    {
-    	free(str);
-#if MOZILLA_VERSION_COLLAPSED < 1090200
-    	str = (char*) malloc(sizeof(char)*NPVARIANT_TO_STRING(variant).utf8length);
-    	sprintf(str, "%s", NPVARIANT_TO_STRING(variant).utf8characters);
-#else
-        str = (char*) malloc(sizeof(char)*NPVARIANT_TO_STRING(variant).UTF8Length);
-        sprintf(str, "%s", NPVARIANT_TO_STRING(variant).UTF8Characters);
-#endif
-    }
-    else
-    {
-        sprintf(str, "[Object %p]", variant);
-    }
-
-    result->append(str);
-    free(str);
-}
-
-bool
-IcedTeaPluginUtilities::javaResultToNPVariant(NPP instance,
-                                              std::string* java_value,
-                                              NPVariant* variant)
-{
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-    JavaResultData* java_result;
-
-    if (java_value->find("literalreturn") == 0)
-    {
-        // 'literalreturn ' == 14 to skip
-        std::string value = java_value->substr(14);
-
-        // VOID/BOOLEAN/NUMBER
-
-        if (value == "void")
-        {
-            PLUGIN_DEBUG("Method call returned void\n");
-            VOID_TO_NPVARIANT(*variant);
-        } else if (value == "null")
-        {
-            PLUGIN_DEBUG("Method call returned null\n");
-            NULL_TO_NPVARIANT(*variant);
-        }else if (value == "true")
-        {
-            PLUGIN_DEBUG("Method call returned a boolean (true)\n");
-            BOOLEAN_TO_NPVARIANT(true, *variant);
-        } else if (value == "false")
-        {
-            PLUGIN_DEBUG("Method call returned a boolean (false)\n");
-            BOOLEAN_TO_NPVARIANT(false, *variant);
-        } else
-        {
-            double d = strtod(value.c_str(), NULL);
-
-            // See if it is convertible to int
-            if (value.find(".") != std::string::npos ||
-                d < -(0x7fffffffL - 1L) ||
-                d > 0x7fffffffL)
-            {
-                PLUGIN_DEBUG("Method call returned a double %f\n", d);
-                DOUBLE_TO_NPVARIANT(d, *variant);
-            } else
-            {
-                int32_t i = (int32_t) d;
-                PLUGIN_DEBUG("Method call returned an int %d\n", i);
-                INT32_TO_NPVARIANT(i, *variant);
-            }
-        }
-    } else {
-        // Else this is a complex java object
-
-        // To keep code a little bit cleaner, we create variables with proper descriptive names
-        std::string return_obj_instance_id = std::string();
-        std::string return_obj_class_id = std::string();
-        std::string return_obj_class_name = std::string();
-        return_obj_instance_id.append(*java_value);
-
-        // Find out the class name first, because string is a special case
-        java_result = java_request.getClassName(return_obj_instance_id);
-
-        if (java_result->error_occurred)
-        {
-            return false;
-        }
-
-        return_obj_class_name.append(*(java_result->return_string));
-
-        if (return_obj_class_name == "java.lang.String")
-        {
-            // String is a special case as NPVariant can handle it directly
-            java_result = java_request.getString(return_obj_instance_id);
-
-            if (java_result->error_occurred)
-            {
-                return false;
-            }
-
-            // needs to be on the heap
-            NPUTF8* return_str = (NPUTF8*) malloc(sizeof(NPUTF8)*java_result->return_string->size() + 1);
-            strcpy(return_str, java_result->return_string->c_str());
-
-            PLUGIN_DEBUG("Method call returned a string: \"%s\"\n", return_str);
-            STRINGZ_TO_NPVARIANT(return_str, *variant);
-
-        } else {
-
-            // Else this is a regular class. Reference the class object so
-            // we can construct an NPObject with it and the instance
-            java_result = java_request.getClassID(return_obj_instance_id);
-
-            if (java_result->error_occurred)
-            {
-                return false;
-            }
-
-            return_obj_class_id.append(*(java_result->return_string));
-
-            NPObject* obj;
-
-            if (return_obj_class_name.find('[') == 0) // array
-                obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(
-                                instance,
-                                return_obj_class_id, return_obj_instance_id, true);
-            else
-                obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(
-                                                instance,
-                                                return_obj_class_id, return_obj_instance_id, false);
-
-            OBJECT_TO_NPVARIANT(obj, *variant);
-        }
-    }
-
-    return true;
-}
-
-bool
-IcedTeaPluginUtilities::isObjectJSArray(NPP instance, NPObject* object)
-{
-
-    NPVariant constructor_v = NPVariant();
-    NPIdentifier constructor_id = browser_functions.getstringidentifier("constructor");
-    browser_functions.getproperty(instance, object, constructor_id, &constructor_v);
-    IcedTeaPluginUtilities::printNPVariant(constructor_v);
-
-    // void constructor => not an array
-    if (NPVARIANT_IS_VOID(constructor_v))
-        return false;
-
-    NPObject* constructor = NPVARIANT_TO_OBJECT(constructor_v);
-
-    NPVariant constructor_str;
-    NPIdentifier toString = browser_functions.getstringidentifier("toString");
-    browser_functions.invoke(instance, constructor, toString, NULL, 0, &constructor_str);
-    IcedTeaPluginUtilities::printNPVariant(constructor_str);
-
-    std::string constructor_name = std::string();
-
-#if MOZILLA_VERSION_COLLAPSED < 1090200
-    constructor_name.append(NPVARIANT_TO_STRING(constructor_str).utf8characters);
-#else
-    constructor_name.append(NPVARIANT_TO_STRING(constructor_str).UTF8Characters);
-#endif
-
-    PLUGIN_DEBUG("Constructor for NPObject is %s\n", constructor_name.c_str());
-
-    return constructor_name.find("function Array") == 0;
-}
-
-void
-IcedTeaPluginUtilities::decodeURL(const gchar* url, gchar** decoded_url)
-{
-
-    PLUGIN_DEBUG("GOT URL: %s -- %s\n", url, *decoded_url);
-    int length = strlen(url);
-    for (int i=0; i < length; i++)
-    {
-        if (url[i] == '%' && i < length - 2)
-        {
-            unsigned char code1 = (unsigned char) url[i+1];
-            unsigned char code2 = (unsigned char) url[i+2];
-
-            if (!IS_VALID_HEX(&code1) || !IS_VALID_HEX(&code2))
-                continue;
-
-            // Convert hex value to integer
-            int converted1 = HEX_TO_INT(&code1);
-            int converted2 = HEX_TO_INT(&code2);
-
-            // bitshift 4 to simulate *16
-            int value = (converted1 << 4) + converted2;
-            char decoded = value;
-
-            strncat(*decoded_url, &decoded, 1);
-
-            i += 2;
-        } else
-        {
-            strncat(*decoded_url, &url[i], 1);
-        }
-    }
-
-    PLUGIN_DEBUG("SENDING URL: %s\n", *decoded_url);
-}
-
-/******************************************
- * Begin JavaMessageSender implementation *
- ******************************************
- *
- * This implementation is very simple and is therefore folded into this file
- * rather than a new one.
- */
-
-/**
- * Sends to the Java side
- *
- * @param message The message to send.
- * @param returns whether the message was consumable (always true)
- */
-
-bool
-JavaMessageSender::newMessageOnBus(const char* message)
-{
-	char* msg = (char*) malloc(sizeof(char)*strlen(message) + 1);
-	strcpy(msg, message);
-	plugin_send_message_to_appletviewer(msg);
-
-	free(msg);
-	msg = NULL;
-
-	// Always successful
-	return true;
-}
-
-/***********************************
- * Begin MessageBus implementation *
- ***********************************/
-
-/**
- * Constructor.
- *
- * Initializes the mutexes needed by the other functions.
- */
-MessageBus::MessageBus()
-{
-	int ret;
-
-	ret = pthread_mutex_init(&subscriber_mutex, NULL);
-
-	if(ret)
-		PLUGIN_DEBUG("Error: Unable to initialize subscriber mutex: %d\n", ret);
-
-	ret = pthread_mutex_init(&msg_queue_mutex, NULL);
-	if(ret)
-		PLUGIN_DEBUG("Error: Unable to initialize message queue mutex: %d\n", ret);
-
-	PLUGIN_DEBUG("Mutexs %p and %p initialized\n", &subscriber_mutex, &msg_queue_mutex);
-}
-
-/**
- * Destructor.
- *
- * Destroy the mutexes initialized by the constructor.
- */
-
-MessageBus::~MessageBus()
-{
-    PLUGIN_DEBUG("MessageBus::~MessageBus\n");
-
-	int ret;
-
-	ret = pthread_mutex_destroy(&subscriber_mutex);
-	if(ret)
-		PLUGIN_DEBUG("Error: Unable to destroy subscriber mutex: %d\n", ret);
-
-	ret = pthread_mutex_destroy(&msg_queue_mutex);
-	if(ret)
-			PLUGIN_DEBUG("Error: Unable to destroy message queue mutex: %d\n", ret);
-}
-
-/**
- * Adds the given BusSubscriber as a subscriber to self
- *
- * @param b The BusSubscriber to subscribe
- */
-void
-MessageBus::subscribe(BusSubscriber* b)
-{
-    // Applets may initialize in parallel. So lock before pushing.
-
-	PLUGIN_DEBUG("Subscribing %p to bus %p\n", b, this);
-    pthread_mutex_lock(&subscriber_mutex);
-    subscribers.push_back(b);
-    pthread_mutex_unlock(&subscriber_mutex);
-}
-
-/**
- * Removes the given BusSubscriber from the subscriber list
- *
- * @param b The BusSubscriber to ubsubscribe
- */
-void
-MessageBus::unSubscribe(BusSubscriber* b)
-{
-    // Applets may initialize in parallel. So lock before pushing.
-
-	PLUGIN_DEBUG("Un-subscribing %p from bus %p\n", b, this);
-    pthread_mutex_lock(&subscriber_mutex);
-    subscribers.remove(b);
-    pthread_mutex_unlock(&subscriber_mutex);
-}
-
-/**
- * Notifies all subscribers with the given message
- *
- * @param message The message to send to the subscribers
- */
-void
-MessageBus::post(const char* message)
-{
-	char* msg = (char*) malloc(sizeof(char)*strlen(message) + 1);
-	bool message_consumed = false;
-
-	// consumer frees this memory
-	strcpy(msg, message);
-
-	PLUGIN_DEBUG("Trying to lock %p...\n", &msg_queue_mutex);
-	pthread_mutex_lock(&subscriber_mutex);
-
-    PLUGIN_DEBUG("Message %s received on bus. Notifying subscribers.\n", msg);
-
-    std::list<BusSubscriber*>::const_iterator i;
-    for( i = subscribers.begin(); i != subscribers.end() && !message_consumed; ++i ) {
-    	PLUGIN_DEBUG("Notifying subscriber %p of %s\n", *i, msg);
-    	message_consumed = ((BusSubscriber*) *i)->newMessageOnBus(msg);
-    }
-
-    pthread_mutex_unlock(&subscriber_mutex);
-
-    if (!message_consumed)
-    	PLUGIN_DEBUG("Warning: No consumer found for message %s\n", msg);
-
-    PLUGIN_DEBUG("%p unlocked...\n", &msg_queue_mutex);
-}
--- a/plugin/icedteanp/IcedTeaPluginUtils.h	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,296 +0,0 @@
-/* IcedTeaPluginUtils.h
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-/**
- * Utility classes for the IcedTeaPlugin
- */
-
-#ifndef __ICEDTEAPLUGINUTILS_H__
-#define __ICEDTEAPLUGINUTILS_H__
-
-#include <pthread.h>
-#include <stdio.h>
-
-#include <cstring>
-#include <iostream>
-#include <list>
-#include <map>
-#include <queue>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include <npapi.h>
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-#include <npupp.h>
-#else
-#include <npapi.h>
-#include <npruntime.h>
-#endif
-
-#include "IcedTeaNPPlugin.h"
-
-#define PLUGIN_DEBUG(...) \
-  do                                                          \
-  {                                                           \
-    if (plugin_debug)                                         \
-    {                                                         \
-      fprintf (stderr, "ITNPP Thread# %ld: ", pthread_self()); \
-      fprintf (stderr, __VA_ARGS__);                          \
-    }                                                         \
-  } while (0)
-
-#define CHECK_JAVA_RESULT(result_data)                               \
-{                                                                    \
-    if (((JavaResultData*) result_data)->error_occurred)             \
-    {                                                                \
-        printf("Error: Error occurred on Java side: %s.\n",          \
-               ((JavaResultData*) result_data)->error_msg->c_str()); \
-        return;                                                      \
-    }                                                                \
-}
-
-#define HEX_TO_INT(c) \
-    ((*c >= 'a') ? *c - 'a' + 10 : \
-     (*c >= 'A') ? *c - 'A' + 10 : \
-     *c - '0')
-
-#define IS_VALID_HEX(c) \
-    ((*c >= '0' && *c <= '9') || \
-     (*c >= 'a' && *c <= 'f') || \
-     (*c >= 'A' && *c <= 'F'))
-
-/*
- * This struct holds data specific to a Java operation requested by the plugin
- */
-typedef struct java_result_data
-{
-
-    // Return identifier (if applicable)
-    int return_identifier;
-
-    // Return string (if applicable)
-    std::string* return_string;
-
-    // Return wide/mb string (if applicable)
-    std::wstring* return_wstring;
-
-    // Error message (if an error occurred)
-    std::string* error_msg;
-
-    // Boolean indicating if an error occurred
-    bool error_occurred;
-
-} JavaResultData;
-
-/*
- * Misc. utility functions
- *
- * This class is never instantiated and should contain static functions only
- */
-
-class IcedTeaPluginUtilities
-{
-
-    private:
-        static int reference; /* Reference count */
-
-        /* Mutex lock for updating reference count */
-        static pthread_mutex_t reference_mutex;
-
-        /* Map holding window pointer<->instance relationships */
-        static std::map<void*, NPP>* instance_map;
-
-        /* Map holding java-side-obj-key->NPObject relationship  */
-        static std::map<std::string, NPObject*>* object_map;
-
-    public:
-
-    	/* Constructs message prefix with given context */
-    	static void constructMessagePrefix(int context,
-                                           std::string* result);
-
-    	/* Constructs message prefix with given context and reference */
-    	static void constructMessagePrefix(int context, int reference,
-                                           std::string* result);
-
-    	/* Constructs message prefix with given context, reference and src */
-    	static void constructMessagePrefix(int context, int reference,
-                                           std::string address,
-                                           std::string* result);
-
-    	/* Converts given pointer to a string representation */
-    	static void JSIDToString(void* id, std::string* result);
-
-    	/* Converts the given string representation to a pointer */
-    	static void* stringToJSID(std::string id_str);
-    	static void* stringToJSID(std::string* id_str);
-
-    	/* Increments reference count and returns it */
-    	static int getReference();
-
-    	/* Decrements reference count */
-    	static void releaseReference();
-
-    	/* Converts the given integer to a string */
-    	static void itoa(int i, std::string* result);
-
-    	/* Frees the given vector and the strings that its contents point to */
-    	static void freeStringPtrVector(std::vector<std::string*>* v);
-
-    	/* Splits the given string based on the delimiter provided */
-    	static std::vector<std::string*>* strSplit(const char* str,
-    			                                  const char* delim);
-
-    	/* Converts given unicode integer byte array to UTF8 string  */
-    	static void getUTF8String(int length, int begin,
-    			std::vector<std::string*>* unicode_byte_array,
-    			std::string* result_unicode_str);
-
-    	/* Converts given UTF8 string to unicode integer byte array */
-    	static void convertStringToUTF8(std::string* str,
-    			                        std::string* utf_str);
-
-    	/* Converts given unicode integer byte array to UTF16LE/UCS-2 string */
-    	static void getUTF16LEString(int length, int begin,
-    			std::vector<std::string*>* unicode_byte_array,
-    			std::wstring* result_unicode_str);
-
-    	/* Prints contents of given string vector */
-    	static void printStringVector(const char* prefix, std::vector<std::string>* cv);
-
-    	/* Prints contents of given string pointer vector */
-    	static void printStringPtrVector(const char* prefix, std::vector<std::string*>* cv);
-
-    	static std::string* variantToClassName(NPVariant variant);
-
-    	static void printNPVariant(NPVariant variant);
-
-    	static void NPVariantToString(NPVariant variant, std::string* result);
-
-        static bool javaResultToNPVariant(NPP instance,
-                                          std::string* java_result,
-                                          NPVariant* variant);
-
-    	static const gchar* getSourceFromInstance(NPP instance);
-
-    	static void storeInstanceID(void* member_ptr, NPP instance);
-
-    	static void	removeInstanceID(void* member_ptr);
-
-        static NPP getInstanceFromMemberPtr(void* member_ptr);
-
-    	static NPObject* getNPObjectFromJavaKey(std::string key);
-
-    	static void storeObjectMapping(std::string key, NPObject* object);
-
-    	static void removeObjectMapping(std::string key);
-
-    	static void invalidateInstance(NPP instance);
-
-    	static bool isObjectJSArray(NPP instance, NPObject* object);
-
-    	static void decodeURL(const char* url, char** decoded_url);
-};
-
-/*
- * A bus subscriber interface. Implementors must implement the newMessageOnBus
- * method.
- */
-class BusSubscriber
-{
-    private:
-
-    public:
-    	BusSubscriber() {}
-
-    	/* Notifies this subscriber that a new message as arrived */
-        virtual bool newMessageOnBus(const char* message) = 0;
-};
-
-/*
- * This implementation is very simple and is therefore folded into this file
- * rather than a new one.
- */
-class JavaMessageSender : public BusSubscriber
-{
-    private:
-    public:
-
-    	/* Sends given message to Java side */
-        virtual bool newMessageOnBus(const char* message);
-};
-
-/*
- * Represents a message bus.
- * The bus can also have subscribers who are notified when a new message
- * arrives.
- */
-class MessageBus
-{
-    private:
-    	/* Mutex for locking the message queue */
-    	pthread_mutex_t msg_queue_mutex;
-
-    	/* Mutex used when adjusting subscriber list */
-    	pthread_mutex_t subscriber_mutex;
-
-    	/* Subscriber list */
-        std::list<BusSubscriber*> subscribers;
-
-        /* Queued messages */
-        std::queue<char*> msgQueue;
-
-    public:
-    	MessageBus();
-
-        ~MessageBus();
-
-        /* subscribe to this bus */
-        void subscribe(BusSubscriber* b);
-
-        /* unsubscribe from this bus */
-        void unSubscribe(BusSubscriber* b);
-
-        /* Post a message on to the bus (it is safe to free the message pointer
-           after this function returns) */
-        void post(const char* message);
-};
-
-#endif // __ICEDTEAPLUGINUTILS_H__
--- a/plugin/icedteanp/IcedTeaRunnable.cc	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/* IcedTeaRunnable.cc
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include <stdio.h>
-#include "IcedTeaRunnable.h"
-
-NS_IMPL_ISUPPORTS1 (IcedTeaRunnable, nsIRunnable)
-
-IcedTeaRunnable::IcedTeaRunnable ()
-{
-}
-
-IcedTeaRunnable::~IcedTeaRunnable ()
-{
-}
-
-NS_IMETHODIMP
-IcedTeaRunnable::Run ()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-IcedTeaRunnableMethod::IcedTeaRunnableMethod (Method method, void* thread_data, void* result)
-: method (method),
-  thread_data(thread_data),
-  result(result)
-{
-}
-
-IcedTeaRunnableMethod::~IcedTeaRunnableMethod ()
-{
- }
-
-NS_IMETHODIMP
-IcedTeaRunnableMethod::Run ()
-{
-    printf("Running method...\n");
-    (*method) (thread_data, result);
-    return NS_OK;
-}
--- a/plugin/icedteanp/IcedTeaRunnable.h	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/* IcedTeaRunnable.h
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#ifndef __ICEDTEARUNNABLE_H__
-#define __ICEDTEARUNNABLE_H__
-
-#define MOZILLA 1
-#if MOZILLA
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-#include <nsIRunnable.h>
-#include <string>
-#endif
-
-/*
- * This struct holds the result from the main-thread dispatched method
- */
-typedef struct result_data
-{
-	// Return identifier (if applicable)
-    int return_identifier;
-
-    // Return string (if applicable)
-    std::string* return_string;
-
-    // Return wide/mb string (if applicable)
-    std::wstring* return_wstring;
-
-    // Error message (if an error occurred)
-    std::string* error_msg;
-
-    // Boolean indicating if an error occurred
-    bool error_occured;
-
-    // If this result is ready
-    bool result_ready;
-
-} ResultData;
-
-class IcedTeaRunnable : public nsIRunnable
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIRUNNABLE
-
-  IcedTeaRunnable ();
-
-  ~IcedTeaRunnable ();
-};
-
-class IcedTeaRunnableMethod : public IcedTeaRunnable
-{
-public:
-
-  typedef void* (*Method) (void*, void*);
-
-  IcedTeaRunnableMethod (Method, void* thread_data, void* result);
-  NS_IMETHOD Run ();
-
-  ~IcedTeaRunnableMethod ();
-
-  Method method;
-  void* thread_data;
-  void* result;
-};
-
-#endif /* MOZILLA */
-
-#endif /* __ICEDTEARUNNABLE_H__ */
--- a/plugin/icedteanp/IcedTeaScriptablePluginObject.cc	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,897 +0,0 @@
-/* IcedTeaScriptablePluginObject.cc
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include <typeinfo>
-
-#include "IcedTeaScriptablePluginObject.h"
-
-IcedTeaScriptablePluginObject::IcedTeaScriptablePluginObject(NPP instance)
-{
-	this->instance = instance;
-	IcedTeaPluginUtilities::storeInstanceID(this, instance);
-}
-
-void
-IcedTeaScriptablePluginObject::deAllocate(NPObject *npobj)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::deAllocate %p\n", npobj);
-}
-
-void
-IcedTeaScriptablePluginObject::invalidate(NPObject *npobj)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::invalidate %p\n", npobj);
-}
-
-bool
-IcedTeaScriptablePluginObject::hasMethod(NPObject *npobj, NPIdentifier name)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::hasMethod %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptablePluginObject::invoke(NPObject *npobj, NPIdentifier name, const NPVariant *args,
-			uint32_t argCount,NPVariant *result)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::invoke %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptablePluginObject::invokeDefault(NPObject *npobj, const NPVariant *args,
-			       uint32_t argCount, NPVariant *result)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::invokeDefault %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptablePluginObject::hasProperty(NPObject *npobj, NPIdentifier name)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::hasProperty %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptablePluginObject::getProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
-{
-	// Package request?
-	if (!strcmp(browser_functions.utf8fromidentifier(name), "java"))
-	{
-		//NPObject* obj = IcedTeaScriptablePluginObject::get_scriptable_java_package_object(getInstanceFromMemberPtr(npobj), name);
-		//OBJECT_TO_NPVARIANT(obj, *result);
-
-		//printf ("Filling variant %p with object %p\n", result);
-	}
-
-	return false;
-}
-
-bool
-IcedTeaScriptablePluginObject::setProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::setProperty %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptablePluginObject::removeProperty(NPObject *npobj, NPIdentifier name)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::removeProperty %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptablePluginObject::enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::enumerate %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptablePluginObject::construct(NPObject *npobj, const NPVariant *args, uint32_t argCount,
-	           NPVariant *result)
-{
-	printf ("** Unimplemented: IcedTeaScriptablePluginObject::construct %p\n", npobj);
-	return false;
-}
-
-NPObject*
-allocate_scriptable_jp_object(NPP npp, NPClass *aClass)
-{
-    PLUGIN_DEBUG("Allocating new scriptable Java Package object\n");
-    return new IcedTeaScriptableJavaPackageObject(npp);
-}
-
-NPObject*
-IcedTeaScriptablePluginObject::get_scriptable_java_package_object(NPP instance, const NPUTF8* name)
-{
-
-	NPObject* scriptable_object;
-
-	NPClass* np_class = new NPClass();
-	np_class->structVersion = NP_CLASS_STRUCT_VERSION;
-	np_class->allocate = allocate_scriptable_jp_object;
-	np_class->deallocate = IcedTeaScriptableJavaPackageObject::deAllocate;
-	np_class->invalidate = IcedTeaScriptableJavaPackageObject::invalidate;
-	np_class->hasMethod = IcedTeaScriptableJavaPackageObject::hasMethod;
-	np_class->invoke = IcedTeaScriptableJavaPackageObject::invoke;
-	np_class->invokeDefault = IcedTeaScriptableJavaPackageObject::invokeDefault;
-	np_class->hasProperty = IcedTeaScriptableJavaPackageObject::hasProperty;
-	np_class->getProperty = IcedTeaScriptableJavaPackageObject::getProperty;
-	np_class->setProperty = IcedTeaScriptableJavaPackageObject::setProperty;
-	np_class->removeProperty = IcedTeaScriptableJavaPackageObject::removeProperty;
-	np_class->enumerate = IcedTeaScriptableJavaPackageObject::enumerate;
-	np_class->construct = IcedTeaScriptableJavaPackageObject::construct;
-
-	scriptable_object = browser_functions.createobject(instance, np_class);
-	PLUGIN_DEBUG("Returning new scriptable package class: %p from instance %p with name %s\n", scriptable_object, instance, name);
-
-    ((IcedTeaScriptableJavaPackageObject*) scriptable_object)->setPackageName(name);
-
-    IcedTeaPluginUtilities::storeInstanceID(scriptable_object, instance);
-
-	return scriptable_object;
-}
-
-IcedTeaScriptableJavaPackageObject::IcedTeaScriptableJavaPackageObject(NPP instance)
-{
-    PLUGIN_DEBUG("Constructing new scriptable java package object\n");
-	this->instance = instance;
-	this->package_name = new std::string();
-}
-
-IcedTeaScriptableJavaPackageObject::~IcedTeaScriptableJavaPackageObject()
-{
-    delete this->package_name;
-}
-
-void
-IcedTeaScriptableJavaPackageObject::setPackageName(const NPUTF8* name)
-{
-    this->package_name->append(name);
-}
-
-std::string
-IcedTeaScriptableJavaPackageObject::getPackageName()
-{
-    return this->package_name->c_str();
-}
-
-void
-IcedTeaScriptableJavaPackageObject::deAllocate(NPObject *npobj)
-{
-    browser_functions.releaseobject(npobj);
-}
-
-void
-IcedTeaScriptableJavaPackageObject::invalidate(NPObject *npobj)
-{
-	// nothing to do for these
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::hasMethod(NPObject *npobj, NPIdentifier name)
-{
-    // Silly caller. Methods are for objects!
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::invoke(NPObject *npobj, NPIdentifier name, const NPVariant *args,
-			uint32_t argCount,NPVariant *result)
-{
-	printf ("** Unimplemented: IcedTeaScriptableJavaPackageObject::invoke %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::invokeDefault(NPObject *npobj, const NPVariant *args,
-			       uint32_t argCount, NPVariant *result)
-{
-	printf ("** Unimplemented: IcedTeaScriptableJavaPackageObject::invokeDefault %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::hasProperty(NPObject *npobj, NPIdentifier name)
-{
-	PLUGIN_DEBUG("IcedTeaScriptableJavaPackageObject::hasProperty %s\n", browser_functions.utf8fromidentifier(name));
-
-	bool hasProperty = false;
-	JavaResultData* java_result;
-	JavaRequestProcessor* java_request = new JavaRequestProcessor();
-    NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj);
-    int plugin_instance_id = get_id_from_instance(instance);
-
-	PLUGIN_DEBUG("Object package name: \"%s\"\n", ((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName().c_str());
-
-	// "^java" is always a package
-	if (((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName().length() == 0 &&
-	    (  !strcmp(browser_functions.utf8fromidentifier(name), "java") ||
-	       !strcmp(browser_functions.utf8fromidentifier(name), "javax")))
-	{
-	    return true;
-	}
-
-	std::string property_name = ((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName();
-	if (property_name.length() > 0)
-	    property_name += ".";
-	property_name += browser_functions.utf8fromidentifier(name);
-
-	PLUGIN_DEBUG("Looking for name \"%s\"\n", property_name.c_str());
-
-	java_result = java_request->hasPackage(plugin_instance_id, property_name);
-
-	if (!java_result->error_occurred && java_result->return_identifier != 0) hasProperty = true;
-
-	// No such package. Do we have a class with that name?
-	if (!hasProperty)
-	{
-		java_result = java_request->findClass(plugin_instance_id, property_name);
-	}
-
-	if (java_result->return_identifier != 0) hasProperty = true;
-
-	delete java_request;
-
-	return hasProperty;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::getProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
-{
-
-	PLUGIN_DEBUG("IcedTeaScriptableJavaPackageObject::getProperty %s\n", browser_functions.utf8fromidentifier(name));
-
-	if (!browser_functions.utf8fromidentifier(name))
-	    return false;
-
-	bool isPropertyClass = false;
-	JavaResultData* java_result;
-	JavaRequestProcessor java_request = JavaRequestProcessor();
-    NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj);
-    int plugin_instance_id = get_id_from_instance(instance);
-
-	std::string property_name = ((IcedTeaScriptableJavaPackageObject*) npobj)->getPackageName();
-	if (property_name.length() > 0)
-	    property_name += ".";
-	property_name += browser_functions.utf8fromidentifier(name);
-
-	java_result = java_request.findClass(plugin_instance_id, property_name);
-	isPropertyClass = (java_result->return_identifier == 0);
-
-	//NPIdentifier property = browser_functions.getstringidentifier(property_name.c_str());
-
-	NPObject* obj;
-
-	if (isPropertyClass)
-	{
-		PLUGIN_DEBUG("Returning package object\n");
-		obj = IcedTeaScriptablePluginObject::get_scriptable_java_package_object(
-                                  IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj),
-                                  property_name.c_str());
-	}
-	else
-	{
-		PLUGIN_DEBUG("Returning Java object\n");
-		obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(
-		                IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj),
-		                *(java_result->return_string), "0", false);
-	}
-
-	OBJECT_TO_NPVARIANT(obj, *result);
-
-	return true;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::setProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value)
-{
-	// Can't be going around setting properties on namespaces.. that's madness!
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::removeProperty(NPObject *npobj, NPIdentifier name)
-{
-	printf ("** Unimplemented: IcedTeaScriptableJavaPackageObject::removeProperty %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count)
-{
-	printf ("** Unimplemented: IcedTeaScriptableJavaPackageObject::enumerate %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::construct(NPObject *npobj, const NPVariant *args, uint32_t argCount,
-	           NPVariant *result)
-{
-	printf ("** Unimplemented: IcedTeaScriptableJavaPackageObject::construct %p\n", npobj);
-	return false;
-}
-
-NPObject*
-allocate_scriptable_java_object(NPP npp, NPClass *aClass)
-{
-    PLUGIN_DEBUG("Allocating new scriptable Java object\n");
-    return new IcedTeaScriptableJavaObject(npp);
-}
-
-NPObject*
-IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(NPP instance,
-                                    std::string class_id,
-                                    std::string instance_id,
-                                    bool isArray)
-{
-    NPObject* scriptable_object;
-
-    std::string obj_key = std::string();
-    obj_key += class_id;
-    obj_key += ":";
-    obj_key += instance_id;
-
-    PLUGIN_DEBUG("get_scriptable_java_object searching for %s...\n", obj_key.c_str());
-    scriptable_object = IcedTeaPluginUtilities::getNPObjectFromJavaKey(obj_key);
-
-    if (scriptable_object != NULL)
-    {
-        PLUGIN_DEBUG("Returning existing object %p\n", scriptable_object);
-        browser_functions.retainobject(scriptable_object);
-        return scriptable_object;
-    }
-
-
-	NPClass* np_class = new NPClass();
-	np_class->structVersion = NP_CLASS_STRUCT_VERSION;
-	np_class->allocate = allocate_scriptable_java_object;
-	np_class->deallocate = IcedTeaScriptableJavaObject::deAllocate;
-	np_class->invalidate = IcedTeaScriptableJavaObject::invalidate;
-	np_class->hasMethod = IcedTeaScriptableJavaObject::hasMethod;
-	np_class->invoke = IcedTeaScriptableJavaObject::invoke;
-	np_class->invokeDefault = IcedTeaScriptableJavaObject::invokeDefault;
-	np_class->hasProperty = IcedTeaScriptableJavaObject::hasProperty;
-	np_class->getProperty = IcedTeaScriptableJavaObject::getProperty;
-	np_class->setProperty = IcedTeaScriptableJavaObject::setProperty;
-	np_class->removeProperty = IcedTeaScriptableJavaObject::removeProperty;
-	np_class->enumerate = IcedTeaScriptableJavaObject::enumerate;
-	np_class->construct = IcedTeaScriptableJavaObject::construct;
-
-	// try to create normally
-    scriptable_object =  browser_functions.createobject(instance, np_class);
-
-    // didn't work? try creating asynch
-    if (!scriptable_object)
-    {
-        AsyncCallThreadData thread_data = AsyncCallThreadData();
-        thread_data.result_ready = false;
-        thread_data.parameters = std::vector<void*>();
-        thread_data.result = std::string();
-
-        thread_data.parameters.push_back(instance);
-        thread_data.parameters.push_back(np_class);
-        thread_data.parameters.push_back(&scriptable_object);
-
-        browser_functions.pluginthreadasynccall(instance, &_createAndRetainJavaObject, &thread_data);
-
-        while (!thread_data.result_ready) usleep(2000); // wait till ready
-    } else
-    {
-        // Else retain object and continue
-        browser_functions.retainobject(scriptable_object);
-    }
-
-    PLUGIN_DEBUG("Constructed new Java Object with classid=%s, instanceid=%s, isArray=%d and scriptable_object=%p\n", class_id.c_str(), instance_id.c_str(), isArray, scriptable_object);
-
-	((IcedTeaScriptableJavaObject*) scriptable_object)->setClassIdentifier(class_id);
-    ((IcedTeaScriptableJavaObject*) scriptable_object)->setIsArray(isArray);
-
-	if (instance_id != "0")
-	    ((IcedTeaScriptableJavaObject*) scriptable_object)->setInstanceIdentifier(instance_id);
-
-	IcedTeaPluginUtilities::storeInstanceID(scriptable_object, instance);
-	IcedTeaPluginUtilities::storeObjectMapping(obj_key, scriptable_object);
-
-	PLUGIN_DEBUG("Inserting into object_map key %s->%p\n", obj_key.c_str(), scriptable_object);
-	return scriptable_object;
-}
-
-/* Creates and retains a scriptable java object (intended to be called asynch.) */
-void
-_createAndRetainJavaObject(void* data)
-{
-    PLUGIN_DEBUG("Asynchronously creating/retaining object ...\n");
-
-    std::vector<void*> parameters = ((AsyncCallThreadData*) data)->parameters;
-    NPP instance = (NPP) parameters.at(0);
-    NPClass* np_class = (NPClass*) parameters.at(1);
-    NPObject** scriptable_object = (NPObject**) parameters.at(2);
-
-    *scriptable_object = browser_functions.createobject(instance, np_class);
-    browser_functions.retainobject(*scriptable_object);
-
-    ((AsyncCallThreadData*) data)->result_ready = true;
-}
-
-bool
-IcedTeaScriptableJavaPackageObject::is_valid_java_object(NPObject* object_ptr) {
-    return IcedTeaPluginUtilities::getInstanceFromMemberPtr(object_ptr) != NULL;
-}
-
-IcedTeaScriptableJavaObject::IcedTeaScriptableJavaObject(NPP instance)
-{
-	this->instance = instance;
-	this->class_id = new std::string();
-	this->instance_id = new std::string();
-}
-
-IcedTeaScriptableJavaObject::~IcedTeaScriptableJavaObject()
-{
-	delete this->class_id;
-	delete this->instance_id;
-}
-
-void
-IcedTeaScriptableJavaObject::setClassIdentifier(std::string class_id)
-{
-	this->class_id->append(class_id);
-}
-
-void
-IcedTeaScriptableJavaObject::setInstanceIdentifier(std::string instance_id)
-{
-	this->instance_id->append(instance_id);
-}
-
-void
-IcedTeaScriptableJavaObject::setIsArray(bool isArray)
-{
-    this->isObjectArray = isArray;
-}
-
-void
-IcedTeaScriptableJavaObject::deAllocate(NPObject *npobj)
-{
-	browser_functions.releaseobject(npobj);
-}
-
-void
-IcedTeaScriptableJavaObject::invalidate(NPObject *npobj)
-{
-	IcedTeaPluginUtilities::removeInstanceID(npobj);
-
-	std::string obj_key = std::string();
-	obj_key += ((IcedTeaScriptableJavaObject*) npobj)->getClassID();
-	obj_key += ":";
-	obj_key += ((IcedTeaScriptableJavaObject*) npobj)->getInstanceID();
-
-	IcedTeaPluginUtilities::removeObjectMapping(obj_key);
-}
-
-bool
-IcedTeaScriptableJavaObject::hasMethod(NPObject *npobj, NPIdentifier name)
-{
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasMethod %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
-    bool hasMethod = false;
-
-    // If object is an array and requested "method" may be a number, check for it first
-    if ( !((IcedTeaScriptableJavaObject*) npobj)->isArray()  ||
-         (browser_functions.intfromidentifier(name) < 0))
-    {
-
-        if (!browser_functions.utf8fromidentifier(name))
-            return false;
-
-        JavaResultData* java_result;
-        JavaRequestProcessor java_request = JavaRequestProcessor();
-
-        std::string classId = std::string(((IcedTeaScriptableJavaObject*) npobj)->getClassID());
-        std::string methodName = browser_functions.utf8fromidentifier(name);
-
-        java_result = java_request.hasMethod(classId, methodName);
-        hasMethod = java_result->return_identifier != 0;
-    }
-
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasMethod returning %d\n", hasMethod);
-    return hasMethod;
-}
-
-bool
-IcedTeaScriptableJavaObject::invoke(NPObject *npobj, NPIdentifier name, const NPVariant *args,
-			uint32_t argCount, NPVariant *result)
-{
-    NPUTF8* method_name = browser_functions.utf8fromidentifier(name);
-
-    // Extract arg type array
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::invoke %s. Args follow.\n", method_name);
-    for (int i=0; i < argCount; i++)
-    {
-        IcedTeaPluginUtilities::printNPVariant(args[i]);
-    }
-
-    JavaResultData* java_result;
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-
-    NPObject* obj;
-    std::string instance_id = ((IcedTeaScriptableJavaObject*) npobj)->getInstanceID();
-    std::string class_id = ((IcedTeaScriptableJavaObject*) npobj)->getClassID();
-    std::string callee;
-    std::string source;
-
-    NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj);
-
-    // First, load the arguments into the java-side table
-    std::string id = std::string();
-    std::vector<std::string> arg_ids = std::vector<std::string>();
-    for (int i=0; i < argCount; i++) {
-        id.clear();
-        createJavaObjectFromVariant(instance, args[i], &id);
-
-        if (id == "-1")
-        {
-            printf("Unable to create arguments on Java side\n");
-            return false;
-        }
-
-        arg_ids.push_back(id);
-    }
-
-    if (instance_id.length() == 0) // Static
-    {
-        PLUGIN_DEBUG("Calling static method\n");
-        callee = ((IcedTeaScriptableJavaObject*) npobj)->getClassID();
-        java_result = java_request.callStaticMethod(
-                        IcedTeaPluginUtilities::getSourceFromInstance(instance),
-                        callee, browser_functions.utf8fromidentifier(name), arg_ids);
-    } else
-    {
-        PLUGIN_DEBUG("Calling method normally\n");
-        callee = ((IcedTeaScriptableJavaObject*) npobj)->getInstanceID();
-        java_result = java_request.callMethod(
-                        IcedTeaPluginUtilities::getSourceFromInstance(instance),
-                        callee, browser_functions.utf8fromidentifier(name), arg_ids);
-    }
-
-    if (java_result->error_occurred)
-    {
-        // error message must be allocated on heap
-        char* error_msg = (char*) malloc(java_result->error_msg->length()*sizeof(char));
-        strcpy(error_msg, java_result->error_msg->c_str());
-        browser_functions.setexception(npobj, error_msg);
-        return false;
-    }
-
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::invoke converting and returning.\n");
-    return IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, result);
-}
-
-bool
-IcedTeaScriptableJavaObject::invokeDefault(NPObject *npobj, const NPVariant *args,
-			       uint32_t argCount, NPVariant *result)
-{
-	printf ("** Unimplemented: IcedTeaScriptableJavaObject::invokeDefault %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaObject::hasProperty(NPObject *npobj, NPIdentifier name)
-{
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
-    bool hasProperty = false;
-
-    // If it is an array, only length and indexes are valid
-    if (((IcedTeaScriptableJavaObject*) npobj)->isArray())
-    {
-        if (browser_functions.intfromidentifier(name) >= 0 ||
-            !strcmp(browser_functions.utf8fromidentifier(name), "length"))
-            hasProperty = true;
-
-    } else
-    {
-
-        if (!browser_functions.utf8fromidentifier(name))
-            return false;
-
-        if (!strcmp(browser_functions.utf8fromidentifier(name), "Packages"))
-        {
-            hasProperty = true;
-        } else {
-
-            JavaResultData* java_result;
-            JavaRequestProcessor java_request = JavaRequestProcessor();
-
-            std::string class_id = std::string(((IcedTeaScriptableJavaObject*) npobj)->getClassID());
-            std::string fieldName = browser_functions.utf8fromidentifier(name);
-
-            java_result = java_request.hasField(class_id, fieldName);
-
-            hasProperty = java_result->return_identifier != 0;
-        }
-    }
-
-	PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasProperty returning %d\n", hasProperty);
-	return hasProperty;
-}
-
-bool
-IcedTeaScriptableJavaObject::getProperty(NPObject *npobj, NPIdentifier name, NPVariant *result)
-{
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::getProperty %s (ival=%d)\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
-
-    bool isPropertyClass = false;
-    JavaResultData* java_result;
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-
-    NPObject* obj;
-    std::string instance_id = ((IcedTeaScriptableJavaObject*) npobj)->getInstanceID();
-    std::string class_id = ((IcedTeaScriptableJavaObject*) npobj)->getClassID();
-    NPP instance = ((IcedTeaScriptableJavaObject*) npobj)->getInstance();
-
-    if (instance_id.length() > 0) // Could be an array or a simple object
-    {
-        // If array and requesting length
-        if ( ((IcedTeaScriptableJavaObject*) npobj)->isArray() &&
-             browser_functions.utf8fromidentifier(name) &&
-             !strcmp(browser_functions.utf8fromidentifier(name), "length"))
-        {
-            java_result = java_request.getArrayLength(instance_id);
-        } else if ( ((IcedTeaScriptableJavaObject*) npobj)->isArray() &&
-                    browser_functions.intfromidentifier(name) >= 0) // else if array and requesting index
-        {
-
-            java_result = java_request.getArrayLength(instance_id);
-            if (java_result->error_occurred)
-            {
-                printf("ERROR: Couldn't fetch array length\n");
-                return false;
-            }
-
-            int length = atoi(java_result->return_string->c_str());
-
-            // Access beyond size?
-            if (browser_functions.intfromidentifier(name) >= length)
-            {
-                VOID_TO_NPVARIANT(*result);
-                return true;
-            }
-
-            std::string index = std::string();
-            IcedTeaPluginUtilities::itoa(browser_functions.intfromidentifier(name), &index);
-            java_result = java_request.getSlot(instance_id, index);
-
-        } else // Everything else
-        {
-            if (!browser_functions.utf8fromidentifier(name))
-                return false;
-
-            if (!strcmp(browser_functions.utf8fromidentifier(name), "Packages"))
-            {
-                NPObject* pkgObject = IcedTeaScriptablePluginObject::get_scriptable_java_package_object(instance, "");
-                OBJECT_TO_NPVARIANT(pkgObject, *result);
-                return true;
-            }
-
-            java_result = java_request.getField(
-                        IcedTeaPluginUtilities::getSourceFromInstance(instance),
-                        class_id, instance_id, browser_functions.utf8fromidentifier(name));
-        }
-    }
-    else
-    {
-        if (!browser_functions.utf8fromidentifier(name))
-            return true;
-
-        java_result = java_request.getStaticField(
-                                IcedTeaPluginUtilities::getSourceFromInstance(instance),
-                                class_id, browser_functions.utf8fromidentifier(name));
-    }
-
-    if (java_result->error_occurred)
-    {
-        return false;
-    }
-
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::getProperty converting and returning.\n");
-    return IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, result);
-}
-
-bool
-IcedTeaScriptableJavaObject::setProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value)
-{
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::setProperty %s (ival=%d) to:\n", browser_functions.utf8fromidentifier(name), browser_functions.intfromidentifier(name));
-    IcedTeaPluginUtilities::printNPVariant(*value);
-
-    bool isPropertyClass = false;
-    JavaResultData* java_result;
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-
-    NPObject* obj;
-    std::string instance_id = ((IcedTeaScriptableJavaObject*) npobj)->getInstanceID();
-    std::string class_id = ((IcedTeaScriptableJavaObject*) npobj)->getClassID();
-
-    NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj);
-
-    if (instance_id.length() > 0) // Could be an array or a simple object
-    {
-        // If array
-        if ( ((IcedTeaScriptableJavaObject*) npobj)->isArray() &&
-             browser_functions.utf8fromidentifier(name) &&
-             !strcmp(browser_functions.utf8fromidentifier(name), "length"))
-        {
-            printf("ERROR: Array length is not a modifiable property\n");
-            return false;
-        } else if ( ((IcedTeaScriptableJavaObject*) npobj)->isArray() &&
-                    browser_functions.intfromidentifier(name) >= 0) // else if array and requesting index
-        {
-
-            java_result = java_request.getArrayLength(instance_id);
-            if (java_result->error_occurred)
-            {
-                printf("ERROR: Couldn't fetch array length\n");
-                return false;
-            }
-
-            int length = atoi(java_result->return_string->c_str());
-
-            // Access beyond size?
-            if (browser_functions.intfromidentifier(name) >= length)
-            {
-                return true;
-            }
-
-            std::string index = std::string();
-            IcedTeaPluginUtilities::itoa(browser_functions.intfromidentifier(name), &index);
-
-            std::string value_id = std::string();
-            createJavaObjectFromVariant(instance, *value, &value_id);
-
-            java_result = java_request.setSlot(instance_id, index, value_id);
-
-        } else // Everything else
-        {
-            std::string value_id = std::string();
-            createJavaObjectFromVariant(instance, *value, &value_id);
-
-            java_result = java_request.setField(
-                        IcedTeaPluginUtilities::getSourceFromInstance(instance),
-                        class_id, instance_id, browser_functions.utf8fromidentifier(name), value_id);
-        }
-    }
-    else
-    {
-        std::string value_id = std::string();
-        createJavaObjectFromVariant(instance, *value, &value_id);
-
-        java_result = java_request.setStaticField(
-                                IcedTeaPluginUtilities::getSourceFromInstance(instance),
-                                class_id, browser_functions.utf8fromidentifier(name), value_id);
-    }
-
-    if (java_result->error_occurred)
-    {
-        return false;
-    }
-
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::setProperty returning.\n");
-    return true;
-}
-
-bool
-IcedTeaScriptableJavaObject::removeProperty(NPObject *npobj, NPIdentifier name)
-{
-	printf ("** Unimplemented: IcedTeaScriptableJavaObject::removeProperty %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaObject::enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count)
-{
-	printf ("** Unimplemented: IcedTeaScriptableJavaObject::enumerate %p\n", npobj);
-	return false;
-}
-
-bool
-IcedTeaScriptableJavaObject::construct(NPObject *npobj, const NPVariant *args, uint32_t argCount,
-	           NPVariant *result)
-{
-    // Extract arg type array
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::construct %s. Args follow.\n", ((IcedTeaScriptableJavaObject*) npobj)->getClassID().c_str());
-    for (int i=0; i < argCount; i++)
-    {
-        IcedTeaPluginUtilities::printNPVariant(args[i]);
-    }
-
-    JavaResultData* java_result;
-    JavaRequestProcessor java_request = JavaRequestProcessor();
-
-    NPObject* obj;
-    std::string class_id = ((IcedTeaScriptableJavaObject*) npobj)->getClassID();
-    NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj);
-
-    // First, load the arguments into the java-side table
-    std::string id = std::string();
-    std::vector<std::string> arg_ids = std::vector<std::string>();
-    for (int i=0; i < argCount; i++) {
-        id.clear();
-        createJavaObjectFromVariant(instance, args[i], &id);
-        if (id == "0")
-        {
-            // error message must be allocated on heap
-            char* error_msg = (char*) malloc(1024*sizeof(char));
-            strcpy(error_msg, "Unable to create argument on Java side");
-
-            browser_functions.setexception(npobj, error_msg);
-            return false;
-        }
-
-        arg_ids.push_back(id);
-    }
-
-    java_result = java_request.newObject(
-                            IcedTeaPluginUtilities::getSourceFromInstance(instance),
-                            class_id,
-                            arg_ids);
-
-    if (java_result->error_occurred)
-    {
-        // error message must be allocated on heap
-        int length = java_result->error_msg->length();
-        char* error_msg = (char*) malloc((length+1)*sizeof(char));
-        strcpy(error_msg, java_result->error_msg->c_str());
-
-        browser_functions.setexception(npobj, error_msg);
-        return false;
-    }
-
-    std::string return_obj_instance_id = std::string();
-    std::string return_obj_class_id = class_id;
-    return_obj_instance_id.append(*(java_result->return_string));
-
-    obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_object(
-                                IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj),
-                                return_obj_class_id, return_obj_instance_id, false);
-
-    OBJECT_TO_NPVARIANT(obj, *result);
-
-    PLUGIN_DEBUG("IcedTeaScriptableJavaObject::construct returning.\n");
-    return true;
-}
--- a/plugin/icedteanp/IcedTeaScriptablePluginObject.h	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-/* IcedTeaScriptablePluginObject.h
-
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-#ifndef __ICEDTEASCRIPTABLEPLUGINOBJECT_H_
-#define __ICEDTEASCRIPTABLEPLUGINOBJECT_H_
-
-#if MOZILLA_VERSION_COLLAPSED < 1090100
-#include "npupp.h"
-#else
-#include <npapi.h>
-#include <npruntime.h>
-#endif
-
-#include "IcedTeaJavaRequestProcessor.h"
-#include "IcedTeaNPPlugin.h"
-
-/**
- * IcedTeaScriptablePluginObject, an extended NPObject that implements
- * static functions whose pointers are supplied to NPClass.
- */
-
-class IcedTeaScriptablePluginObject: public NPObject
-{
-
-    private:
-    	NPP instance;
-
-    public:
-        IcedTeaScriptablePluginObject(NPP instance);
-
-        static void deAllocate(NPObject *npobj);
-
-        static void invalidate(NPObject *npobj);
-
-        static bool hasMethod(NPObject *npobj, NPIdentifier name);
-
-        static bool invoke(NPObject *npobj, NPIdentifier name,
-                const NPVariant *args, uint32_t argCount, NPVariant *result);
-
-        static bool invokeDefault(NPObject *npobj, const NPVariant *args,
-                uint32_t argCount, NPVariant *result);
-
-        static bool hasProperty(NPObject *npobj, NPIdentifier name);
-
-        static bool getProperty(NPObject *npobj, NPIdentifier name,
-                NPVariant *result);
-
-        static bool setProperty(NPObject *npobj, NPIdentifier name,
-                const NPVariant *value);
-
-        static bool removeProperty(NPObject *npobj, NPIdentifier name);
-
-        static bool enumerate(NPObject *npobj, NPIdentifier **value,
-                uint32_t *count);
-
-        static bool construct(NPObject *npobj, const NPVariant *args,
-                uint32_t argCount, NPVariant *result);
-
-        static NPObject* get_scriptable_java_package_object(NPP instance, const NPUTF8* name);
-};
-
-NPObject* allocate_scriptable_jp_object(NPP npp, NPClass *aClass);
-
-class IcedTeaScriptableJavaPackageObject: public NPObject
-{
-
-    private:
-    	NPP instance;
-    	std::string* package_name;
-
-    public:
-    	IcedTeaScriptableJavaPackageObject(NPP instance);
-
-    	~IcedTeaScriptableJavaPackageObject();
-
-    	void setPackageName(const NPUTF8* name);
-
-    	std::string getPackageName();
-
-        static void deAllocate(NPObject *npobj);
-
-        static void invalidate(NPObject *npobj);
-
-        static bool hasMethod(NPObject *npobj, NPIdentifier name);
-
-        static bool invoke(NPObject *npobj, NPIdentifier name,
-                const NPVariant *args, uint32_t argCount, NPVariant *result);
-
-        static bool invokeDefault(NPObject *npobj, const NPVariant *args,
-                uint32_t argCount, NPVariant *result);
-
-        static bool hasProperty(NPObject *npobj, NPIdentifier name);
-
-        static bool getProperty(NPObject *npobj, NPIdentifier name,
-                NPVariant *result);
-
-        static bool setProperty(NPObject *npobj, NPIdentifier name,
-                const NPVariant *value);
-
-        static bool removeProperty(NPObject *npobj, NPIdentifier name);
-
-        static bool enumerate(NPObject *npobj, NPIdentifier **value,
-                uint32_t *count);
-
-        static bool construct(NPObject *npobj, const NPVariant *args,
-                uint32_t argCount, NPVariant *result);
-
-        static NPObject* get_scriptable_java_object(NPP instance,
-                                                    std::string class_id,
-                                                    std::string instance_id,
-                                                    bool isArray);
-
-        static bool is_valid_java_object(NPObject* object_ptr);
-};
-
-class IcedTeaScriptableJavaObject: public NPObject
-{
-
-    private:
-    	NPP instance;
-    	bool isObjectArray;
-    	std::string* class_id;
-    	std::string* instance_id;
-
-    public:
-    	IcedTeaScriptableJavaObject(NPP instance);
-
-    	~IcedTeaScriptableJavaObject();
-
-    	void setClassIdentifier(std::string class_id);
-
-    	void setInstanceIdentifier(std::string instance_id);
-
-    	void setIsArray(bool isArray);
-
-    	std::string getClassID() { return *class_id; }
-
-    	std::string getInstanceID() { return *instance_id; }
-
-    	NPP getInstance() { return instance; }
-
-    	bool isArray() { return isObjectArray; }
-
-        static void deAllocate(NPObject *npobj);
-
-        static void invalidate(NPObject *npobj);
-
-        static bool hasMethod(NPObject *npobj, NPIdentifier name);
-
-        static bool invoke(NPObject *npobj, NPIdentifier name,
-                const NPVariant *args, uint32_t argCount, NPVariant *result);
-
-        static bool invokeDefault(NPObject *npobj, const NPVariant *args,
-                uint32_t argCount, NPVariant *result);
-
-        static bool hasProperty(NPObject *npobj, NPIdentifier name);
-
-        static bool getProperty(NPObject *npobj, NPIdentifier name,
-                NPVariant *result);
-
-        static bool setProperty(NPObject *npobj, NPIdentifier name,
-                const NPVariant *value);
-
-        static bool removeProperty(NPObject *npobj, NPIdentifier name);
-
-        static bool enumerate(NPObject *npobj, NPIdentifier **value,
-                uint32_t *count);
-
-        static bool construct(NPObject *npobj, const NPVariant *args,
-                uint32_t argCount, NPVariant *result);
-};
-
-/* Creates and retains a scriptable java object (intended to be called asynch.) */
-
-void _createAndRetainJavaObject(void* data);
-
-#endif /* __ICEDTEASCRIPTABLEPLUGINOBJECT_H_ */
--- a/plugin/icedteanp/java/netscape/javascript/JSException.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-package netscape.javascript;
-
-/**
- * JSException is an exception which is thrown when JavaScript code
- * returns an error.
- */
-
-public
-class JSException extends RuntimeException {
-    public static final int EXCEPTION_TYPE_EMPTY = -1;
-    public static final int EXCEPTION_TYPE_VOID = 0;
-    public static final int EXCEPTION_TYPE_OBJECT = 1;
-    public static final int EXCEPTION_TYPE_FUNCTION = 2;
-    public static final int EXCEPTION_TYPE_STRING = 3;
-    public static final int EXCEPTION_TYPE_NUMBER = 4;
-    public static final int EXCEPTION_TYPE_BOOLEAN = 5;
-    public static final int EXCEPTION_TYPE_ERROR = 6;
-
-    public String filename;
-    public int lineno;
-    public String source;
-    public int tokenIndex;
-    public int wrappedExceptionType;
-    public Object wrappedException;
-
-    /**
-     * Constructs a JSException without a detail message.
-     * A detail message is a String that describes this particular exception.
-     *
-     * @deprecated Not for public use in future versions.
-     */
-    public JSException() {
-	super();
-        filename = "unknown";
-        lineno = 0;
-        source = "";
-        tokenIndex = 0;
-	wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
-    }
-
-    /**
-     * Constructs a JSException with a detail message.
-     * A detail message is a String that describes this particular exception.
-     * @param s the detail message
-     *
-     * @deprecated Not for public use in future versions.
-     */
-    public JSException(String s) {
-	super(s);
-        filename = "unknown";
-        lineno = 0;
-        source = "";
-        tokenIndex = 0;
-	wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
-    }
-
-    /**
-     * Constructs a JSException with a wrapped JavaScript exception object.
-     * This constructor needs to be public so that Java users can throw 
-     * exceptions to JS cleanly.
-     */
-    public JSException(int wrappedExceptionType, Object wrappedException) {
-	super();
-	this.wrappedExceptionType = wrappedExceptionType;
-	this.wrappedException = wrappedException;
-    }
-    
-    /**
-     * Constructs a JSException with a detail message and all the
-     * other info that usually comes with a JavaScript error.
-     * @param s the detail message
-     *
-     * @deprecated Not for public use in future versions.
-     */
-    public JSException(String s, String filename, int lineno,
-                       String source, int tokenIndex) {
-	super(s);
-        this.filename = filename;
-        this.lineno = lineno;
-        this.source = source;
-        this.tokenIndex = tokenIndex;
-	wrappedExceptionType = EXCEPTION_TYPE_EMPTY;
-    }
-
-    /**
-     * Instance method getWrappedExceptionType returns the int mapping of the
-     * type of the wrappedException Object.
-     */
-    public int getWrappedExceptionType() {
-	return wrappedExceptionType;
-    }
-
-    /**
-     * Instance method getWrappedException.
-     */
-    public Object getWrappedException() {
-	return wrappedException;
-    }
-
-}
-
--- a/plugin/icedteanp/java/netscape/javascript/JSObject.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,297 +0,0 @@
-/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/* more doc todo:
- *  threads
- *  gc
- *  
- *
- */
-
-package netscape.javascript;
-
-import java.applet.Applet;
-import java.security.AccessControlContext;
-import java.security.AccessControlException;
-import java.security.AccessController;
-import java.security.BasicPermission;
-
-import sun.applet.PluginAppletViewer;
-import sun.applet.PluginDebug;
-
-
-
-/**
- * JSObject allows Java to manipulate objects that are
- * defined in JavaScript.
- * Values passed from Java to JavaScript are converted as
- * follows:<ul>
- * <li>JSObject is converted to the original JavaScript object
- * <li>Any other Java object is converted to a JavaScript wrapper,
- *   which can be used to access methods and fields of the java object.
- *   Converting this wrapper to a string will call the toString method
- *   on the original object, converting to a number will call the
- *   doubleValue method if possible and fail otherwise.  Converting
- *   to a boolean will try to call the booleanValue method in the
- *   same way.
- * <li>Java arrays are wrapped with a JavaScript object that understands
- *   array.length and array[index]
- * <li>A Java boolean is converted to a JavaScript boolean
- * <li>Java byte, char, short, int, long, float, and double are converted
- *   to JavaScript numbers
- * </ul>
- * Values passed from JavaScript to Java are converted as follows:<ul>
- * <li>objects which are wrappers around java objects are unwrapped
- * <li>other objects are wrapped with a JSObject
- * <li>strings, numbers and booleans are converted to String, Double,
- *   and Boolean objects respectively
- * </ul>
- * This means that all JavaScript values show up as some kind
- * of java.lang.Object in Java.  In order to make much use of them,
- * you will have to cast them to the appropriate subclass of Object,
- * e.g. <code>(String) window.getMember("name");</code> or
- * <code>(JSObject) window.getMember("document");</code>.
- */
-public final class JSObject {
-    /* the internal object data */
-    private long                              internal;
-
-    /**
-     * initialize
-     */
-    private static void initClass() {
-        PluginDebug.debug ("JSObject.initClass");
-    }
-
-    static {
-        PluginDebug.debug ("JSObject INITIALIZER");
-    }
-
-    /**
-     * it is illegal to construct a JSObject manually
-     */
-    public JSObject(int jsobj_addr) {
-        this((long) jsobj_addr);
-    }
-
-    /**
-     * it is illegal to construct a JSObject manually
-     */
-    public JSObject(String jsobj_addr) {
-        this((long) Long.parseLong(jsobj_addr));
-    }
-
-    public JSObject(long jsobj_addr) {
-        
-        // See if the caller has permission
-        
-        try {
-            AccessController.getContext().checkPermission(new JSObjectCreatePermission());
-        } catch (AccessControlException ace) {
-            
-            // If not, only caller with JSObject.getWindow on the stack may 
-            // make this call unprivileged.
-            
-            // Although this check is inefficient, it should happen only once
-            // during applet init, so we look the other way
-
-            StackTraceElement[] stack =  Thread.currentThread().getStackTrace();
-            boolean mayProceed = false;
-            
-            for (int i=0; i < stack.length; i++) {
-                if (stack[i].getClassName().equals("netscape.javascript.JSObject") &&
-                    stack[i].getMethodName().equals("getWindow")) {
-                    mayProceed = true;
-                }
-            }
-
-            if (!mayProceed) throw ace;
-        }
-
-        PluginDebug.debug ("JSObject long CONSTRUCTOR");
-        internal = jsobj_addr;
-    }
-
-    /**
-     * Retrieves a named member of a JavaScript object. 
-     * Equivalent to "this.<i>name</i>" in JavaScript.
-     */
-    public Object	getMember(String name)
-    {
-        PluginDebug.debug ("JSObject.getMember " + name);
-
-        Object o = PluginAppletViewer.getMember(internal, name);
-        PluginDebug.debug ("JSObject.getMember GOT " + o);
-        return o;
-    }
-
-
-    /**
-     * Retrieves an indexed member of a JavaScript object.
-     * Equivalent to "this[<i>index</i>]" in JavaScript.
-     */
-    //    public Object		getMember(int index) { return getSlot(index); }
-    public Object	getSlot(int index)
-    {
-        PluginDebug.debug ("JSObject.getSlot " + index);
-
-        return PluginAppletViewer.getSlot(internal, index);
-    }
-
-
-    /**
-     * Sets a named member of a JavaScript object. 
-     * Equivalent to "this.<i>name</i> = <i>value</i>" in JavaScript.
-     */
-    public void 		setMember(String name, Object value)
-    {
-        PluginDebug.debug ("JSObject.setMember " + name + " " + value);
-
-        PluginAppletViewer.setMember(internal, name, value);
-    }
-
-    /**
-     * Sets an indexed member of a JavaScript object. 
-     * Equivalent to "this[<i>index</i>] = <i>value</i>" in JavaScript.
-     */
-    //    public void 		setMember(int index, Object value) {
-    //        setSlot(index, value);
-    //    }
-    public void 		setSlot(int index, Object value)
-    {
-        PluginDebug.debug ("JSObject.setSlot " + index + " " + value);
-
-        PluginAppletViewer.setSlot(internal, index, value);
-    }
-
-
-    // TODO: toString, finalize.
-
-    /**
-     * Removes a named member of a JavaScript object.
-     */
-    public void 		removeMember(String name)
-    {
-        PluginDebug.debug ("JSObject.removeMember " + name);
-
-        PluginAppletViewer.removeMember(internal, name);
-    }
-
-
-    /**
-     * Calls a JavaScript method.
-     * Equivalent to "this.<i>methodName</i>(<i>args</i>[0], <i>args</i>[1], ...)" in JavaScript.
-     */
-    public Object	call(String methodName, Object args[])
-    {
-    	if (args == null)
-    		args = new Object[0];
-
-    	PluginDebug.debug ("JSObject.call " + methodName);
-        for (int i = 0; i < args.length; i++)
-            PluginDebug.debug (" " + args[i]);
-        PluginDebug.debug("");
-        return PluginAppletViewer.call(internal, methodName, args);
-    }
-
-
-    /**
-     * Evaluates a JavaScript expression. The expression is a string 
-     * of JavaScript source code which will be evaluated in the context
-     * given by "this".
-     */
-    public Object	eval(String s)
-    {
-        PluginDebug.debug("JSObject.eval " + s);
-        return PluginAppletViewer.eval(internal, s);
-    }
-
-
-    /**
-     * Converts a JSObject to a String.
-     */
-    public String        toString()
-    {
-        PluginDebug.debug("JSObject.toString");
-        return PluginAppletViewer.javascriptToString(internal);
-    }
-
-
-    // should use some sort of identifier rather than String
-    // is "property" the right word?
-    //    native String[]                         listProperties();
-
-
-    /**
-     * get a JSObject for the window containing the given applet
-     */
-    public static JSObject	getWindow(Applet applet)
-    {
-        PluginDebug.debug("JSObject.getWindow");
-        // FIXME: handle long case as well.
-        long internal = 0;
-        internal = ((PluginAppletViewer)
-                    applet.getAppletContext()).getWindow();
-        PluginDebug.debug ("GOT IT: " + internal);
-        return new JSObject((long) internal);
-    }
-
-
-    /**
-     * Finalization decrements the reference count on the corresponding
-     * JavaScript object.
-     */
-    protected void	finalize()
-    {
-        PluginDebug.debug("JSObject.finalize ");
-        PluginAppletViewer.JavaScriptFinalize(internal);
-    }
-
-
-    /**
-     * Override java.lang.Object.equals() because identity is not preserved
-     * with instances of JSObject.
-     */
-    public boolean equals(Object obj)
-    {
-        PluginDebug.debug("JSObject.equals " + obj);
-
-        return false;
-    }
-}
--- a/plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/* JSObjectCreatePermission.java
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
- 
-package netscape.javascript;
-
-import java.security.BasicPermission;
-
-
-public class JSObjectCreatePermission extends BasicPermission {
-    public JSObjectCreatePermission() {
-        super("JSObjectCreate");
-    }
-}
--- a/plugin/icedteanp/java/netscape/javascript/JSProxy.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * The JSProxy interface allows applets and plugins to
- * share javascript contexts.
- */
-
-package netscape.javascript;
-import java.applet.Applet;
-
-public interface JSProxy {
-    Object  getMember(JSObject jso, String name);
-    Object  getSlot(JSObject jso, int index);
-    void    setMember(JSObject jso, String name, Object value);
-    void    setSlot(JSObject jso, int index, Object value);
-    void    removeMember(JSObject jso, String name);
-    Object  call(JSObject jso, String methodName, Object args[]);
-    Object  eval(JSObject jso, String s);
-    String      toString(JSObject jso);
-    JSObject    getWindow(Applet applet);
-}
--- a/plugin/icedteanp/java/netscape/javascript/JSRunnable.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-package netscape.javascript;
-
-import sun.applet.PluginDebug;
-
-/**
- * Runs a JavaScript object with a run() method in a separate thread.
- */
-public class JSRunnable implements Runnable {
-	private JSObject runnable;
-
-	public JSRunnable(JSObject runnable) {
-		this.runnable = runnable;
-		synchronized(this) {
-			new Thread(this).start();
-			try {
-				this.wait();
-			} catch (InterruptedException ie) {
-			}
-		}
-	}
-	
-	public void run() {
-		try {
-			runnable.call("run", null);
-			synchronized(this) {
-				notifyAll();
-			}
-		} catch (Throwable t) {
-			PluginDebug.debug(t.toString());
-			t.printStackTrace(System.err);
-		}
-	}
-}
--- a/plugin/icedteanp/java/netscape/javascript/JSUtil.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-/* ** */
-
-package netscape.javascript;
-import java.io.*;
-
-public class JSUtil {
-
-    /* Return the stack trace of an exception or error as a String */
-    public static String getStackTrace(Throwable t) {
-	ByteArrayOutputStream captureStream;
-	PrintWriter p;
-	
-	captureStream = new ByteArrayOutputStream();
-	p = new PrintWriter(captureStream);
-
-	t.printStackTrace(p);
-	p.flush();
-
-	return captureStream.toString();
-    }
-}
--- a/plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/* ForbiddenTargetException.java
-   Copyright (C) 2010  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package netscape.security;
-
-public class ForbiddenTargetException extends RuntimeException{
-
-    private static final long serialVersionUID = 1271219852541058396L;
-
-    public ForbiddenTargetException() {
-        super();
-    }
-
-    public ForbiddenTargetException(String s) {
-        super(s);
-    }
-
-}
--- a/plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package sun.applet;
-
-import java.security.AccessControlContext;
-import java.util.HashMap;
-
-public class AppletSecurityContextManager {
-
-	// Context identifier -> PluginAppletSecurityContext object.
-	// FIXME: make private
-	private static HashMap<Integer, PluginAppletSecurityContext> contexts = new HashMap();
-	
-	public static void addContext(int identifier, PluginAppletSecurityContext context) {
-		contexts.put(identifier, context);
-	}
-	
-	public static PluginAppletSecurityContext getSecurityContext(int identifier) {
-		return contexts.get(identifier);
-	}
-
-	public static void dumpStore(int identifier) {
-		contexts.get(identifier).dumpStore();
-	}
-	
-	public static void handleMessage(int identifier, int reference,	String src, String[] privileges, String message) {
-		PluginDebug.debug(identifier + " -- " + src + " -- " + reference + " -- " + message + " CONTEXT= " + contexts.get(identifier));
-		AccessControlContext callContext = null;
-
-		privileges = privileges != null ? privileges : new String[0];
-		callContext = contexts.get(identifier).getAccessControlContext(privileges, src); 
-
-		contexts.get(identifier).handleMessage(reference, src, callContext, message);
-	}
-}
--- a/plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/* GetMemberPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-
-public class GetMemberPluginCallRequest extends PluginCallRequest {
-    Object object = null;
-
-    public GetMemberPluginCallRequest(String message, Long reference) {
-        super(message, reference);
-        PluginDebug.debug ("GetMemberPluginCall " + message);
-    }
-
-    public void parseReturn(String message) {
-    	PluginDebug.debug ("GetMemberParseReturn GOT: " + message);
-        String[] args = message.split(" ");
-        // FIXME: Is it even possible to distinguish between null and void
-        // here?
-        if (args[3] != "null" && args[3] != "void")
-        	object = AppletSecurityContextManager.getSecurityContext(0).getObject(Integer.parseInt(args[3]));
-        setDone(true);
-    }
-
-    public Object getObject() {
-    	return this.object;
-    }
-}
-
--- a/plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/* GetWindowPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.security.AccessControlContext;
-import java.security.ProtectionDomain;
-
-
-
-public class GetWindowPluginCallRequest extends PluginCallRequest {
-    // FIXME: look into int vs long JavaScript internal values.
-    long internal;
-
-    public GetWindowPluginCallRequest(String message, Long reference) {
-        super(message, reference);
-    }
-
-    public void parseReturn(String message) {
-    	PluginDebug.debug ("GetWindowParseReturn GOT: " + message);
-        String[] args = message.split(" ");
-        // FIXME: add thread ID to messages to support multiple
-        // threads using the netscape.javascript package.
-        internal = Long.parseLong(args[3]);
-        setDone(true);
-    }
-
-    public Long getObject() {
-    	return this.internal;
-    }
-}
--- a/plugin/icedteanp/java/sun/applet/JavaConsole.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-/* JavaConsole -- A java console for the plugin
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSplitPane;
-import javax.swing.JTextArea;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.TitledBorder;
-
-/**
- * A simple Java console for IcedTeaPlugin
- * 
- */
-public class JavaConsole {
-
-    private boolean initialized = false;
-
-    JFrame consoleWindow;
-    JTextArea stdErrText;
-    JTextArea stdOutText;
-
-    /**
-     * Initialize the console
-     */
-    public void initialize() {
-
-        try {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        consoleWindow = new JFrame("Java Console");
-
-        JPanel contentPanel = new JPanel();
-        contentPanel.setLayout(new GridBagLayout());
-
-        GridBagConstraints c;
-
-        Font monoSpace = new Font("Monospaced", Font.PLAIN, 12);
-
-        /* std out */
-
-        stdOutText = new JTextArea();
-        JScrollPane stdOutScrollPane = new JScrollPane(stdOutText);
-        stdOutScrollPane.setBorder(new TitledBorder(
-                new EmptyBorder(5, 5, 5, 5), "System.out"));
-        stdOutText.setEditable(false);
-        stdOutText.setFont(monoSpace);
-
-        TextAreaUpdater stdOutUpdater = new TextAreaUpdater(new File(
-                PluginMain.PLUGIN_STDOUT_FILE), stdOutText);
-        stdOutUpdater.setName("IcedteaPlugin Console Thread(System.out)");
-
-        /* std err */
-
-        stdErrText = new JTextArea();
-        JScrollPane stdErrScrollPane = new JScrollPane(stdErrText);
-        stdErrScrollPane.setBorder(new TitledBorder(
-                new EmptyBorder(5, 5, 5, 5), "System.err"));
-        stdErrText.setEditable(false);
-        stdErrText.setFont(monoSpace);
-
-        TextAreaUpdater stdErrUpdater = new TextAreaUpdater(new File(
-                PluginMain.PLUGIN_STDERR_FILE), stdErrText);
-        stdErrUpdater.setName("IcedteaPlugin Console Thread(System.err)");
-
-        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
-                stdOutScrollPane, stdErrScrollPane);
-
-        c = new GridBagConstraints();
-        c.fill = GridBagConstraints.BOTH;
-        c.gridheight = 10;
-        c.weighty = 1;
-
-        contentPanel.add(splitPane, c);
-
-        /* buttons */
-
-        c = new GridBagConstraints();
-        c.gridy = 10;
-        c.gridheight = 1;
-        c.weightx = 0.5;
-        c.weighty = 0;
-
-        JPanel buttonPanel = new JPanel();
-        contentPanel.add(buttonPanel, c);
-
-        JButton gcButton = new JButton("Run GC");
-        buttonPanel.add(gcButton);
-        gcButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                printMemoryInfo();
-                System.out.print("Performing Garbage Collection....");
-                System.gc();
-                System.out.println("Done");
-                printMemoryInfo();
-            }
-
-        });
-
-        JButton finalizersButton = new JButton("Run Finalizers");
-        buttonPanel.add(finalizersButton);
-        finalizersButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                printMemoryInfo();
-                System.out.print("Running finalization....");
-                Runtime.getRuntime().runFinalization();
-                System.out.println("Done");
-                printMemoryInfo();
-            }
-        });
-
-        JButton memoryButton = new JButton("Memory Info");
-        buttonPanel.add(memoryButton);
-        memoryButton.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                printMemoryInfo();
-            }
-
-        });
-
-        JButton systemPropertiesButton = new JButton("System Properties");
-        buttonPanel.add(systemPropertiesButton);
-        systemPropertiesButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                printSystemProperties();
-            }
-
-        });
-
-        JButton classloadersButton = new JButton("Classloaders");
-        buttonPanel.add(classloadersButton);
-        classloadersButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                printClassLoaders();
-            }
-
-        });
-
-        JButton threadListButton = new JButton("Thread List");
-        buttonPanel.add(threadListButton);
-        threadListButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                printThreadInfo();
-            }
-
-        });
-
-        JButton closeButton = new JButton("Close");
-        buttonPanel.add(closeButton);
-        closeButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                SwingUtilities.invokeLater(new Runnable() {
-                    public void run() {
-                        hideConsole();
-                    }
-                });
-            }
-        });
-
-        stdOutUpdater.start();
-        stdErrUpdater.start();
-
-        consoleWindow.add(contentPanel);
-        consoleWindow.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
-        consoleWindow.pack();
-        consoleWindow.setSize(new Dimension(900, 600));
-        consoleWindow.setMinimumSize(new Dimension(900, 300));
-
-        initialized = true;
-
-        splitPane.setDividerLocation(0.5);
-        splitPane.setResizeWeight(0.5);
-    }
-
-    public void showConsole() {
-
-        if (!initialized) {
-            initialize();
-        }
-
-        consoleWindow.setVisible(true);
-    }
-
-    public void hideConsole() {
-        consoleWindow.setVisible(false);
-    }
-
-    protected void printSystemProperties() {
-
-        System.out.println(" ----");
-        System.out.println("System Properties:");
-        System.out.println();
-        Properties p = System.getProperties();
-        Set<Object> keys = p.keySet();
-        for (Object key : keys) {
-            System.out.println(key.toString() + ": " + p.get(key));
-        }
-
-        System.out.println(" ----");
-    }
-
-    private void printClassLoaders() {
-        System.out.println(" ----");
-        System.out.println("Available Classloaders: ");
-        Set<String> loaders = PluginAppletSecurityContext.getLoaderInfo().keySet();
-        for (String loader: loaders) {
-            System.out.println(loader + "\n"
-                    + "  codebase = " 
-                    + PluginAppletSecurityContext.getLoaderInfo().get(loader));
-        }
-        System.out.println(" ----");
-    }
-
-    private void printMemoryInfo() {
-        System.out.println(" ----- ");
-        System.out.println("  Memory Info:");
-        System.out.println("    Max Memory:   " 
-                + String.format("%1$10d", Runtime.getRuntime().maxMemory()));
-        System.out.println("    Total Memory: "
-                + String.format("%1$10d", Runtime.getRuntime().totalMemory()));
-        System.out.println("    Free Memory:  "
-                + String.format("%1$10d", Runtime.getRuntime().freeMemory()));
-        System.out.println(" ----");
-
-    }
-
-    private void printThreadInfo() {
-        Map<Thread, StackTraceElement[]> map = Thread.getAllStackTraces();
-        Set<Thread> keys = map.keySet();
-        for (Thread key : keys) {
-            System.out.println("Thread " + key.getId() + ": " + key.getName());
-            for (StackTraceElement element : map.get(key)) {
-                System.out.println("  " + element);
-            }
-
-        }
-    }
-
-    public static void main(String[] args) {
-
-        final JavaConsole console = new JavaConsole();
-
-        boolean toShowConsole = false; 
-
-        for (int i = 0; i < args.length; i++) {
-            if (args[i] == "--show-console") {
-                toShowConsole = true;
-            }
-        }
-
-        if (toShowConsole) {
-            SwingUtilities.invokeLater(new Runnable() {
-                public void run() {
-                    console.showConsole();
-                }
-            });
-        }
-
-    }
-
-    /**
-     * This thread updates the text on a JTextArea based on the text in a file
-     */
-    class TextAreaUpdater extends Thread {
-
-        File fileToRead;
-        JTextArea outputTextArea;
-
-        public TextAreaUpdater(File file, JTextArea textArea) {
-            fileToRead = file;
-            outputTextArea = textArea;
-            setDaemon(true);
-        }
-
-        public void run() {
-
-            try {
-                BufferedReader reader = new BufferedReader(new FileReader(
-                        fileToRead));
-                String line;
-                while (true) {
-                    while ((line = reader.readLine()) != null) {
-                        outputTextArea.insert(line + "\n", outputTextArea
-                                .getDocument().getLength());
-                        outputTextArea.setCaretPosition(outputTextArea
-                                .getText().length());
-                    }
-                    Thread.sleep(1000);
-                }
-
-            } catch (FileNotFoundException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            } catch (IOException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-                Thread.currentThread().interrupt();
-            }
-
-        }
-
-    }
-
-}
--- a/plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,696 +0,0 @@
-/* MethodOverloadResolver -- Resolves overloaded methods
-   Copyright (C) 2009 Red Hat 
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-
-/* 
- * This class resolved overloaded methods in Java objects using a cost 
- * based-approach as described here:
- *
- * http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect/#OVERLOADED_METHODS
- */
-
-public class MethodOverloadResolver {
-
-    private static boolean debugging = false;
-    
-    public static void main(String[] args) {
-        testMethodResolver();
-    }
-
-    public static void testMethodResolver() {
-        debugging = true;
-
-        ArrayList<Object[]> list = new ArrayList<Object[]>(20);
-        FooClass fc = new FooClass();
-        
-        // Numeric to java primitive
-        // foo_i has Integer and int params
-        String s1 = "foo_string_int(S,I)";
-        String s1a = "foo_string_int(S,S)";
-        Object[] o1 = { fc.getClass(), "foo_string_int", "blah", 42 };
-        list.add(o1);
-        Object[] o1a = { fc.getClass(), "foo_string_int", "blah", "42.42" };
-        list.add(o1a);
-        
-        // Null to non-primitive type
-        // foo_i is overloaded with Integer and int 
-        String s2 = "foo_string_int(N)";
-        Object[] o2 = { fc.getClass(), "foo_string_int", "blah", null };
-        list.add(o2);
-        
-        // foo_jsobj is overloaded with JSObject and String params
-        String s3 = "foo_jsobj(LLowCostSignatureComputer/JSObject;)";
-        Object[] o3 = { fc.getClass(), "foo_jsobj", new JSObject() };
-        list.add(o3);
-
-        // foo_classtype is overloaded with Number and Integer
-        String s4 = "foo_classtype(Ljava/lang/Integer;)";
-        Object[] o4 = { fc.getClass(), "foo_classtype", 42 };
-        list.add(o4);
-        
-        // foo_multiprim is overloaded with int, long and float types
-        String s5 = "foo_multiprim(I)";
-        String s6 = "foo_multiprim(F)";
-        String s6a = "foo_multiprim(D)";
-        
-        Object[] o5 = { fc.getClass(), "foo_multiprim", new Integer(42) };
-        Object[] o6 = { fc.getClass(), "foo_multiprim", new Float(42.42) };
-        Object[] o6a = { fc.getClass(), "foo_multiprim", new Double(42.42) };
-        list.add(o5);
-        list.add(o6);
-        list.add(o6a);
-        
-        // foo_float has float, String and JSObject type
-        String s7 = "foo_float(I)";
-        Object[] o7 = { fc.getClass(), "foo_float", new Integer(42) };
-        list.add(o7);
-
-        // foo_multiprim(float) is what this should convert
-        String s8 = "foo_float(S)";
-        Object[] o8 = { fc.getClass(), "foo_float", "42" };
-        list.add(o8);
-        
-        // foo_class is overloaded with BarClass 2 and 3
-        String s9 = "foo_class(LLowCostSignatureComputer/BarClass3;)";
-        Object[] o9 = { fc.getClass(), "foo_class", new BarClass3() };
-        list.add(o9);
-
-        // foo_strandbyteonly takes string and byte
-        String s10 = "foo_strandbyteonly(I)";
-        Object[] o10 = { fc.getClass(), "foo_strandbyteonly", 42 };
-        list.add(o10);
-
-        // JSOBject to string
-        String s11 = "foo_strandbyteonly(LLowCostSignatureComputer/JSObject;)";
-        Object[] o11 = { fc.getClass(), "foo_strandbyteonly", new JSObject() };
-        list.add(o11);
-
-        // jsobject to string and int to float
-        String s12 = "foo_str_and_float(S,I)";
-        Object[] o12 = { fc.getClass(), "foo_str_and_float", new JSObject(), new Integer(42) };
-        list.add(o12);
-        
-        // call for which no match will be found
-        String s13 = "foo_int_only(JSObject)";
-        Object[] o13 = { fc.getClass(), "foo_int_only", new JSObject() };
-        list.add(o13);
-        
-        // method with no args
-        String s14 = "foo_noargs()";
-        Object[] o14 = { fc.getClass(), "foo_noargs" };
-        list.add(o14);
-        
-        // method which takes a primitive bool, given a Boolean
-        String s15 = "foo_boolonly()";
-        Object[] o15 = { fc.getClass(), "foo_boolonly", new Boolean(true) };
-        list.add(o15);
-
-        for (Object[] o : list) {
-            Object[] methodAndArgs = getMatchingMethod(o);
-            if (debugging)
-                if (methodAndArgs != null)
-                    System.out.println("Best match: " + methodAndArgs[0] + "\n");
-                else
-                    System.out.println("No match found.\n");
-                
-        }
-        
-    }
-
-    /* 
-     * Cost based overload resolution algorithm based on cost rules specified here:
-     * 
-     * http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect/#OVERLOADED_METHODS
-     */
-
-    public static Object[] getMatchingMethod(Object[] callList) {
-        Object[] ret = null;
-        Class c = (Class) callList[0];
-        String methodName = (String) callList[1];
-
-        Method[] matchingMethods = getMatchingMethods(c, methodName, callList.length - 2);
-        
-        if (debugging)
-            System.out.println("getMatchingMethod called with: " + printList(callList));
-
-        int lowestCost = Integer.MAX_VALUE;
-
-        ArrayList<Object> paramList = new ArrayList<Object>();
-
-        for (Method matchingMethod : matchingMethods) {
-
-            int methodCost = 0;
-            Class[] paramTypes = matchingMethod.getParameterTypes();
-            Object[] methodAndArgs = new Object[paramTypes.length + 1];
-            methodAndArgs[0] = matchingMethod;
-
-            // Figure out which of the matched methods best represents what we
-            // want
-            for (int i = 0; i < paramTypes.length; i++) {
-                Class paramTypeClass = paramTypes[i];
-                Object suppliedParam = callList[i + 2];
-                Class suppliedParamClass = suppliedParam != null ? suppliedParam
-                        .getClass()
-                        : null;
-
-                Object[] costAndCastedObj = getCostAndCastedObject(
-                        suppliedParam, paramTypeClass);
-                methodCost += (Integer) costAndCastedObj[0];
-                
-                if ((Integer) costAndCastedObj[0] < 0) break;
-                
-                Object castedObj = paramTypeClass.isPrimitive() ? costAndCastedObj[1]
-                        : paramTypeClass.cast(costAndCastedObj[1]);
-                methodAndArgs[i + 1] = castedObj;
-
-                Class castedObjClass = castedObj == null ? null : castedObj
-                        .getClass();
-                Boolean castedObjIsPrim = castedObj == null ? null : castedObj
-                        .getClass().isPrimitive();
-
-                if (debugging)
-                    System.out.println("Param " + i + " of method "
-                            + matchingMethod + " has cost "
-                            + (Integer) costAndCastedObj[0]
-                            + " original param type " + suppliedParamClass
-                            + " casted to " + castedObjClass + " isPrimitive="
-                            + castedObjIsPrim + " value " + castedObj);
-            }
-
-            if ((methodCost > 0 && methodCost < lowestCost) || 
-                 paramTypes.length == 0) {
-                ret = methodAndArgs;
-                lowestCost = methodCost;
-            }
-
-        }
-
-        return ret;
-    }
-
-    public static Object[] getMatchingConstructor(Object[] callList) {
-        Object[] ret = null;
-        Class c = (Class) callList[0];
-
-        Constructor[] matchingConstructors = getMatchingConstructors(c, callList.length - 1);
-        
-        if (debugging)
-            System.out.println("getMatchingConstructor called with: " + printList(callList));
-
-        int lowestCost = Integer.MAX_VALUE;
-
-        ArrayList<Object> paramList = new ArrayList<Object>();
-
-        for (Constructor matchingConstructor : matchingConstructors) {
-
-            int constructorCost = 0;
-            Class[] paramTypes = matchingConstructor.getParameterTypes();
-            Object[] constructorAndArgs = new Object[paramTypes.length + 1];
-            constructorAndArgs[0] = matchingConstructor;
-
-            // Figure out which of the matched methods best represents what we
-            // want
-            for (int i = 0; i < paramTypes.length; i++) {
-                Class paramTypeClass = paramTypes[i];
-                Object suppliedParam = callList[i + 1];
-                Class suppliedParamClass = suppliedParam != null ? suppliedParam
-                        .getClass()
-                        : null;
-
-                Object[] costAndCastedObj = getCostAndCastedObject(
-                        suppliedParam, paramTypeClass);
-                constructorCost += (Integer) costAndCastedObj[0];
-                
-                if ((Integer) costAndCastedObj[0] < 0) break;
-                
-                Object castedObj = paramTypeClass.isPrimitive() ? costAndCastedObj[1]
-                        : paramTypeClass.cast(costAndCastedObj[1]);
-                constructorAndArgs[i + 1] = castedObj;
-
-                Class castedObjClass = castedObj == null ? null : castedObj
-                        .getClass();
-                Boolean castedObjIsPrim = castedObj == null ? null : castedObj
-                        .getClass().isPrimitive();
-
-                if (debugging)
-                    System.out.println("Param " + i + " of constructor "
-                            + matchingConstructor + " has cost "
-                            + (Integer) costAndCastedObj[0]
-                            + " original param type " + suppliedParamClass
-                            + " casted to " + castedObjClass + " isPrimitive="
-                            + castedObjIsPrim + " value " + castedObj);
-            }
-
-            if ((constructorCost > 0 && constructorCost < lowestCost) || 
-                 paramTypes.length == 0) {
-                ret = constructorAndArgs;
-                lowestCost = constructorCost;
-            }
-        }
-
-        return ret;
-    }
-
-    public static Object[] getCostAndCastedObject(Object suppliedParam, Class paramTypeClass) {
-        
-        Object[] ret = new Object[2];
-        Integer cost = new Integer(0);
-        Object castedObj;
-
-        Class suppliedParamClass = suppliedParam != null ? suppliedParam.getClass() : null ;
-        
-        // Either both are an array, or neither are
-        boolean suppliedParamIsArray = suppliedParamClass != null && suppliedParamClass.isArray();
-        if (paramTypeClass.isArray() != suppliedParamIsArray && 
-                !paramTypeClass.equals(Object.class)         &&
-                !paramTypeClass.equals(String.class)) {
-        	ret[0] = Integer.MIN_VALUE; // Not allowed
-            ret[1] = suppliedParam;
-            return ret;
-        }
-
-        // If param type is an array, supplied obj must be an array, Object or String (guaranteed by checks above)
-        // If it is an array, we need to copy/cast as we scan the array
-        // If it an object, we return "as is" [Everything can be narrowed to an object, cost=6]
-        // If it is a string, we need to convert according to the JS engine rules
-
-        if (paramTypeClass.isArray()) {
-            
-            Object newArray = Array.newInstance(paramTypeClass.getComponentType(), Array.getLength(suppliedParam));
-            for (int i=0; i < Array.getLength(suppliedParam); i++) {
-            	Object original = Array.get(suppliedParam, i);
-            	
-            	// When dealing with arrays, we represent empty slots with 
-            	// null. We need to convert this to 0 before recursive 
-            	// calling, since normal transformation does not allow 
-            	// null -> primitive
-            	
-            	if (original == null && paramTypeClass.getComponentType().isPrimitive())
-            	    original = 0;
-            	
-            	Object[] costAndCastedObject = getCostAndCastedObject(original, paramTypeClass.getComponentType());
-            	
-            	if ((Integer) costAndCastedObject[0] < 0) {
-            		ret[0] = Integer.MIN_VALUE; // Not allowed
-                    ret[1] = suppliedParam;
-                    return ret;
-            	}
-
-            	Array.set(newArray, i, costAndCastedObject[1]);
-            }
-            
-            ret[0] = 9;
-            ret[1] = newArray;
-            return ret;
-        }
-        
-        if (suppliedParamIsArray && paramTypeClass.equals(String.class)) {
-            
-            ret[0] = 9;
-            ret[1] = getArrayAsString(suppliedParam);
-            return ret;
-        }
-
-        // If this is null, there are only 2 possible cases
-        if (suppliedParamClass == null) {
-            castedObj = null; // if value is null.. well, it is null
-
-            if (!paramTypeClass.isPrimitive()) {
-                cost += 2; // Null to any non-primitive type
-            } else {
-                cost = Integer.MIN_VALUE; // Null to primitive not allowed
-            }
-        } else if (paramTypeClass.isPrimitive() && paramTypeClass.equals(getPrimitive(suppliedParam))) {
-            cost += 1; // Numeric type to the analogous Java primitive type
-            castedObj = suppliedParam; // Let auto-boxing handle it
-        } else if (suppliedParamClass.equals(paramTypeClass)) {
-           cost += 3; // Class type to Class type where the types are equal
-           castedObj = suppliedParam;
-        } else if (isNum(suppliedParam) && 
-                       (paramTypeClass.isPrimitive() ||
-                        java.lang.Number.class.isAssignableFrom(paramTypeClass) ||
-                        java.lang.Character.class.isAssignableFrom(paramTypeClass) ||
-                        java.lang.Byte.class.isAssignableFrom(paramTypeClass)
-                       )
-                   ) {
-            cost += 4; // Numeric type to a different primitive type
-
-            if (suppliedParam.toString().equals("true"))
-                suppliedParam = "1";
-            else if (suppliedParam.toString().equals("false"))
-                suppliedParam = "0";
-            
-            if (paramTypeClass.equals(Boolean.TYPE))
-                castedObj = getNum(suppliedParam.toString(), paramTypeClass).doubleValue() != 0D;
-            else if (paramTypeClass.equals(Character.TYPE))
-                castedObj = (char) Short.decode(suppliedParam.toString()).shortValue();
-            else
-                castedObj = getNum(suppliedParam.toString(), paramTypeClass);
-        } else if (suppliedParam instanceof java.lang.String &&
-                    isNum(suppliedParam) &&
-                        (paramTypeClass.isInstance(java.lang.Number.class) ||
-                         paramTypeClass.isInstance(java.lang.Character.class) ||
-                         paramTypeClass.isInstance(java.lang.Byte.class) ||
-                         paramTypeClass.isPrimitive())
-                   ) {
-            cost += 5; // String to numeric type
-            
-            if (suppliedParam.toString().equals("true"))
-                suppliedParam = "1";
-            else if (suppliedParam.toString().equals("false"))
-                suppliedParam = "0";
-            
-            if (paramTypeClass.equals(Character.TYPE))
-                castedObj = (char) Short.decode(suppliedParam.toString()).shortValue();
-            else
-                castedObj = getNum(suppliedParam.toString(), paramTypeClass);
-        }  else if (suppliedParam instanceof java.lang.String &&
-                     (paramTypeClass.equals(java.lang.Boolean.class) ||
-                      paramTypeClass.equals(java.lang.Boolean.TYPE))
-                    ){
-
-            cost += 5; // Same cost as above
-            castedObj = new Boolean(suppliedParam.toString().length() > 0);
-        } else if (paramTypeClass.isAssignableFrom(suppliedParamClass)) {
-            cost += 6; // Class type to superclass type;
-            castedObj = paramTypeClass.cast(suppliedParam);
-        } else if (paramTypeClass.equals(String.class)) {
-            cost += 7; // Any Java value to String
-            castedObj = suppliedParam.toString();
-        } else if (suppliedParam instanceof JSObject &&
-                   paramTypeClass.isArray()) {
-            cost += 8; // JSObject to Java array 
-            castedObj = (JSObject) suppliedParam;
-        } else {
-            cost = Integer.MIN_VALUE; // Not allowed
-            castedObj = suppliedParam;
-        }
-        
-        ret[0] = cost;
-        ret[1] = castedObj;
-
-        return ret;
-
-    }
-    
-    private static Method[] getMatchingMethods(Class c, String name, int paramCount) {
-        Method[] allMethods = c.getMethods();
-        ArrayList<Method> matchingMethods = new ArrayList(5);
-        
-        for (Method m: allMethods) {
-            if (m.getName().equals(name) && m.getParameterTypes().length == paramCount)
-                matchingMethods.add(m);
-        }
-
-        return matchingMethods.toArray(new Method[0]);
-    }
-    
-    private static Constructor[] getMatchingConstructors(Class c, int paramCount) {
-        Constructor[] allConstructors = c.getConstructors();
-        ArrayList<Constructor> matchingConstructors = new ArrayList<Constructor>(5);
-        
-        for (Constructor cs: allConstructors) {
-            if (cs.getParameterTypes().length == paramCount)
-                matchingConstructors.add(cs);
-        }
-
-        return matchingConstructors.toArray(new Constructor[0]);
-    }
-
-    private static Class getPrimitive(Object o) {
-        
-        if (o instanceof java.lang.Byte) {
-            return java.lang.Byte.TYPE;
-        } else if (o instanceof java.lang.Character) {
-            return java.lang.Character.TYPE;
-        } else if (o instanceof java.lang.Short) {
-            return java.lang.Short.TYPE;
-        } else if (o instanceof java.lang.Integer) {
-            return java.lang.Integer.TYPE;
-        } else if (o instanceof java.lang.Long) {
-            return java.lang.Long.TYPE;
-        } else if (o instanceof java.lang.Float) {
-            return java.lang.Float.TYPE;
-        } else if (o instanceof java.lang.Double) {
-            return java.lang.Double.TYPE;
-        } else if (o instanceof java.lang.Boolean) {
-            return java.lang.Boolean.TYPE;
-        }
-
-        return o.getClass();
-    }
-
-    private static boolean isNum (Object o) {
-        
-        if (o instanceof java.lang.Number)
-            return true;
-        
-        // Boolean is changeable to number as well
-        if (o instanceof java.lang.Boolean)
-            return true;
-
-        // At this point, it _has_ to be a string else automatically 
-        // return false
-        if (!(o instanceof java.lang.String))
-            return false;
-
-        try {
-            Long.parseLong((String) o); // whole number test
-            return true;
-        } catch (NumberFormatException nfe) {}
-        
-        try {
-            Float.parseFloat((String) o); // decimal
-            return true;
-        } catch (NumberFormatException nfe) {}
-
-        
-        return false;
-    }
-
-    private static Number getNum (String s, Class c) throws NumberFormatException {
-
-        Number n;
-        if (s.contains("."))
-            n = new Double(s);
-        else
-            n = new Long(s);
-        
-        // See if we need to collapse first
-        if (c.equals(java.lang.Integer.class) ||
-            c.equals(java.lang.Integer.TYPE)) {
-            return n.intValue();
-        }
-
-        if (c.equals(java.lang.Long.class) ||
-            c.equals(java.lang.Long.TYPE)) {
-            return n.longValue();
-        }
-
-        if (c.equals(java.lang.Short.class) ||
-            c.equals(java.lang.Short.TYPE)) {
-            return n.shortValue();
-        }
-        
-        if (c.equals(java.lang.Float.class) ||
-            c.equals(java.lang.Float.TYPE)) {
-            return n.floatValue();
-        }
-        
-        if (c.equals(java.lang.Double.class) ||
-            c.equals(java.lang.Double.TYPE)) {
-            return n.doubleValue();
-        }
-
-        if (c.equals(java.lang.Byte.class) ||
-            c.equals(java.lang.Byte.TYPE)) {
-            return n.byteValue();
-        }
-
-        return n;
-    }
-
-    private static String printList (Object[] oList) {
-        
-        String ret = "";
-        
-        ret += "{ ";
-        for (Object o : oList) {
-            
-            String oStr = o != null ? o.toString() + " [" + o.getClass() + "]" : "null";
-            
-            ret += oStr;
-            ret += ", ";
-        }
-        ret = ret.substring(0, ret.length()-2); // remove last ", "
-        ret += " }";
-
-        return ret;
-    }
-    
-    private static String getArrayAsString(Object array) {
-        // We are guaranteed that supplied object is a String
-        
-        String ret = new String();
-        
-        for (int i=0; i < Array.getLength(array); i++) {
-            Object element = Array.get(array, i);
-            
-            if (element != null) {
-                if (element.getClass().isArray()) {
-                    ret += getArrayAsString(element);
-                } else {
-                    ret += element;
-                }
-            }
-            
-            ret += ",";
-        }
-
-        // Trim the final ","
-        if (ret.length() > 0) {
-            ret = ret.substring(0, ret.length() - 1);
-        }
-        
-        return ret;
-    }
-}
-
-/** Begin test classes **/
-
-class FooClass {
-
-    public FooClass() {}
-    
-    public FooClass(Boolean b, int i) {}
-
-    public FooClass(Boolean b, Integer i) {}
-
-    public FooClass(Boolean b, short s) {}
-
-    public FooClass(String s, int i) {}
-
-    public FooClass(String s, Integer i) {}
-
-    public FooClass(java.lang.Number num) {}
-
-    public FooClass(java.lang.Integer integer) {}
-
-    public FooClass(long l) {}
-
-    public FooClass(double d) {}
-
-    public FooClass(float f) {}
-    
-    public FooClass(JSObject j) {}
-
-    public FooClass(BarClass1 b) {}
-
-    public FooClass(BarClass2 b) {}
-
-    public FooClass(String s) {}
-    
-    public FooClass(byte b) {}
-    
-    public FooClass(String s, Float f) {}
-    
-    public FooClass (int i) {}
-
-    public void FooClass() {}
-
-    public void FooClass(boolean b) {}
-
-    
-    public void foo(Boolean b, int i) {}
-
-    public void foo(Boolean b, Integer i) {}
-
-    public void foo(Boolean b, short s) {}
-
-    public void foo_string_int(String s, int i) {}
-
-    public void foo_string_int(String s, Integer i) {}
-
-    public void foo_jsobj(JSObject j) {}
-
-    public void foo_jsobj(String s) {}
-
-    public void foo_classtype(java.lang.Number num) {}
-
-    public void foo_classtype(java.lang.Integer integer) {}
-
-    public void foo_multiprim(int i) {}
-
-    public void foo_multiprim(long l) {}
-
-    public void foo_multiprim(float f) {}
-    
-    public void foo_multiprim(double d) {}
-
-    public void foo_float(float f) {}
-    
-    public void foo_float(String s) {}
-    
-    public void foo_float(JSObject j) {}
-
-    public void foo_class(BarClass1 b) {}
-
-    public void foo_class(BarClass2 b) {}
-
-    public void foo_strandbyteonly(String s) {}
-    
-    public void foo_strandbyteonly(byte b) {}
-    
-    public void foo_str_and_float(String s, Float f) {}
-    
-    public void foo_int_only (int i) {}
-    
-    public void foo_noargs() {}
-
-    public void foo_boolonly(boolean b) {}
-}
-
-class BarClass1 {}
-class BarClass2 extends BarClass1 {}
-class BarClass3 extends BarClass2 {}
-class JSObject {}
--- a/plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/* PasswordAuthenticationDialog -- requests authentication information from users
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.awt.Dimension;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.net.PasswordAuthentication;
-
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JPasswordField;
-import javax.swing.JTextField;
-import javax.swing.SwingUtilities;
-
-/**
- * Modal non-minimizable dialog to request http authentication credentials
- */
-
-public class PasswordAuthenticationDialog extends JDialog {
-    
-    private JLabel jlInfo = new JLabel("");
-    private JTextField jtfUserName = new JTextField();
-    private JPasswordField jpfPassword = new JPasswordField();
-    private boolean userCancelled;
-
-    public PasswordAuthenticationDialog() {
-        initialize();
-    }
-
-    /**
-     * Initialized the dialog components
-     */
-    
-    public void initialize() {
-
-        setTitle("IcedTea Java Plugin - Authorization needed to proceed");
-
-        setLayout(new GridBagLayout());
-
-        JLabel jlUserName = new JLabel("Username: ");
-        JLabel jlPassword = new JLabel("Password: ");
-        JButton jbOK = new JButton("OK");
-        JButton jbCancel = new JButton("Cancel");
-
-        jtfUserName.setSize(20, 10);
-        jpfPassword.setSize(20, 10);
-
-        GridBagConstraints c;
-        
-        c = new GridBagConstraints();
-        c.fill = c.HORIZONTAL;
-        c.gridx = 0;
-        c.gridy = 0;
-        c.gridwidth = 2;
-        c.insets = new Insets(10, 5, 3, 3);
-        add(jlInfo, c);
-        
-        c = new GridBagConstraints();
-        c.gridx = 0;
-        c.gridy = 1;
-        c.insets = new Insets(10, 5, 3, 3);
-        add(jlUserName, c);
-        
-        c = new GridBagConstraints();
-        c.fill = c.HORIZONTAL;
-        c.gridx = 1;
-        c.gridy = 1;
-        c.insets = new Insets(10, 5, 3, 3);
-        c.weightx = 1.0;
-        add(jtfUserName, c);
-
-
-        c = new GridBagConstraints();
-        c.gridx = 0;
-        c.gridy = 2;
-        c.insets = new Insets(5, 5, 3, 3);
-        add(jlPassword, c);
-        
-        c = new GridBagConstraints();
-        c.fill = c.HORIZONTAL;
-        c.gridx = 1;
-        c.gridy = 2;
-        c.insets = new Insets(5, 5, 3, 3);
-        c.weightx = 1.0;
-        add(jpfPassword, c);
-
-        c = new GridBagConstraints();
-        c.anchor = c.SOUTHEAST;
-        c.gridx = 1;
-        c.gridy = 3;
-        c.insets = new Insets(5, 5, 3, 70);
-        c.weightx = 0.0;
-        add(jbCancel, c);
-        
-        c = new GridBagConstraints();
-        c.anchor = c.SOUTHEAST;
-        c.gridx = 1;
-        c.gridy = 3;
-        c.insets = new Insets(5, 5, 3, 3);
-        c.weightx = 0.0;
-        add(jbOK, c);
-        
-        setMinimumSize(new Dimension(400,150));
-        setMaximumSize(new Dimension(1024,150));
-        setAlwaysOnTop(true);
-        
-        setSize(400,150);
-        setLocationRelativeTo(null);
-
-        // OK => read supplied info and pass it on
-        jbOK.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                userCancelled = false;
-                dispose();
-            }
-        });
-        
-        // Cancel => discard supplied info and pass on an empty auth
-        jbCancel.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                userCancelled = true;
-                dispose();
-            }
-        });
-        
-        // "return" key in either user or password field => OK
-
-        jtfUserName.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                userCancelled = false;
-                dispose();
-            }
-        });
-        
-        jpfPassword.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                userCancelled = false;
-                dispose();
-            }
-        });
-    }
-
-    /**
-     * Present a dialog to the user asking them for authentication information
-     * 
-     * @param hostThe host for with authentication is needed
-     * @param port The port being accessed
-     * @param prompt The prompt (realm) as presented by the server
-     * @param type The type of server (proxy/web)
-     * @return PasswordAuthentication containing the credentials (empty credentials if user cancelled)
-     */
-    protected PasswordAuthentication askUser(String host, int port, String prompt, String type) {
-        PasswordAuthentication auth = null;
-
-        host += port != -1 ? ":" + port : "";
-
-        // This frame is reusable. So reset everything first.
-        userCancelled = true;
-        jlInfo.setText("<html>The " + type + " server at " + host + " is requesting authentication. It says \"" + prompt + "\"</html>");
-
-        try {
-            SwingUtilities.invokeAndWait( new Runnable() {
-                public void run() {
-                    // show dialog to user
-                    setVisible(true);
-                }
-            });
-        
-            PluginDebug.debug("password dialog shown");
-            
-            // wait until dialog is gone
-            while (this.isShowing()) {
-                try {
-                    Thread.sleep(200);
-                } catch (InterruptedException ie) {
-                }
-            }
-            
-            PluginDebug.debug("password dialog closed");
-
-            if (!userCancelled) {
-                auth = new PasswordAuthentication(jtfUserName.getText(), jpfPassword.getText().toCharArray());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            
-            // Nothing else we can do. Empty auth will be returned
-        }
-
-        return auth;
-    }
-
-    public static void main(String[] args) {
-        PasswordAuthenticationDialog frame = new PasswordAuthenticationDialog();
-
-        PasswordAuthentication auth = frame.askUser("127.0.0.1", 3128, "Password for local proxy", "proxy");
-
-        System.err.println("Auth info: " + auth.getUserName() + ":" + new String(auth.getPassword()));
-        System.exit(0);
-    }
-}
--- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1505 +0,0 @@
-/* PluginAppletSecurityContext -- execute plugin JNI messages
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.io.File;
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.AccessControlContext;
-import java.security.AccessControlException;
-import java.security.AccessController;
-import java.security.AllPermission;
-import java.security.BasicPermission;
-import java.security.CodeSource;
-import java.security.Permissions;
-import java.security.PrivilegedAction;
-import java.security.ProtectionDomain;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction;
-
-import net.sourceforge.jnlp.runtime.JNLPRuntime;
-import netscape.javascript.JSObjectCreatePermission;
-
-
-
-class Signature {
-	private String signature;
-	private int currentIndex;
-	private List<Class> typeList;
-	private static final char ARRAY = '[';
-	private static final char OBJECT = 'L';
-	private static final char SIGNATURE_ENDCLASS = ';';
-	private static final char SIGNATURE_FUNC = '(';
-	private static final char SIGNATURE_ENDFUNC = ')';
-	private static final char VOID = 'V';
-	private static final char BOOLEAN = 'Z';
-	private static final char BYTE = 'B';
-	private static final char CHARACTER = 'C';
-	private static final char SHORT = 'S';
-	private static final char INTEGER = 'I';
-	private static final char LONG = 'J';
-	private static final char FLOAT = 'F';
-	private static final char DOUBLE = 'D';
-
-	private String nextTypeName() {
-		char key = signature.charAt(currentIndex++);
-
-		switch (key) {
-		case ARRAY:
-			return nextTypeName() + "[]";
-
-		case OBJECT:
-			int endClass = signature.indexOf(SIGNATURE_ENDCLASS, currentIndex);
-			String retVal = signature.substring(currentIndex, endClass);
-			retVal = retVal.replace('/', '.');
-			currentIndex = endClass + 1;
-			return retVal;
-
-			// FIXME: generated bytecode with classes named after
-			// primitives will not work in this scheme -- those
-			// classes will be incorrectly treated as primitive
-			// types.
-		case VOID:
-			return "void";
-		case BOOLEAN:
-			return "boolean";
-		case BYTE:
-			return "byte";
-		case CHARACTER:
-			return "char";
-		case SHORT:
-			return "short";
-		case INTEGER:
-			return "int";
-		case LONG:
-			return "long";
-		case FLOAT:
-			return "float";
-		case DOUBLE:
-			return "double";
-
-		case SIGNATURE_ENDFUNC:
-			return null;
-
-		case SIGNATURE_FUNC:
-			return nextTypeName();
-
-		default:
-			throw new IllegalArgumentException(
-					"Invalid JNI signature character '" + key + "'");
-		}
-	}
-
-	public Signature(String signature, ClassLoader cl) {
-		this.signature = signature;
-		currentIndex = 0;
-		typeList = new ArrayList<Class>(10);
-
-		String elem;
-		while (currentIndex < signature.length()) {
-			elem = nextTypeName();
-			
-			if (elem == null) // end of signature
-				continue;
-			
-			// System.out.println ("NEXT TYPE: " + elem);
-			Class primitive = primitiveNameToType(elem);
-			if (primitive != null)
-				typeList.add(primitive);
-			else {
-				// System.out.println ("HERE1");
-				int dimsize = 0;
-				int n = elem.indexOf('[');
-				if (n != -1) {
-					// System.out.println ("HERE2");
-					String arrayType = elem.substring(0, n);
-					dimsize++;
-					n = elem.indexOf('[', n + 1);
-					// System.out.println ("HERE2.5");
-					while (n != -1) {
-						dimsize++;
-						n = elem.indexOf('[', n + 1);
-						// System.out.println ("HERE2.8");
-					}
-					int[] dims = new int[dimsize];
-					primitive = primitiveNameToType(arrayType);
-					// System.out.println ("HERE3");
-					if (primitive != null) {
-						typeList.add(Array.newInstance(primitive, dims)
-								.getClass());
-						// System.out.println ("HERE4");
-					} else
-						typeList.add(Array.newInstance(
-								getClass(arrayType, cl), dims).getClass());
-				} else {
-					typeList.add(getClass(elem, cl));
-				}
-			}
-		}
-		if (signature.length() < 2) {
-			throw new IllegalArgumentException("Invalid JNI signature '"
-					+ signature + "'");
-		}
-	}
-
-	public static Class getClass(String name, ClassLoader cl) {
-
-		Class c = null;
-		
-		try {
-			c = Class.forName(name);
-		} catch (ClassNotFoundException cnfe) {
-			
-			PluginDebug.debug("Class " + name + " not found in primordial loader. Looking in " + cl);
-			try {
-				c = cl.loadClass(name);
-			} catch (ClassNotFoundException e) {
-				throw (new RuntimeException(new ClassNotFoundException("Unable to find class " + name)));
-			}
-		}
-
-		return c;
-	}
-	
-	public static Class primitiveNameToType(String name) {
-		if (name.equals("void"))
-			return Void.TYPE;
-		else if (name.equals("boolean"))
-			return Boolean.TYPE;
-		else if (name.equals("byte"))
-			return Byte.TYPE;
-		else if (name.equals("char"))
-			return Character.TYPE;
-		else if (name.equals("short"))
-			return Short.TYPE;
-		else if (name.equals("int"))
-			return Integer.TYPE;
-		else if (name.equals("long"))
-			return Long.TYPE;
-		else if (name.equals("float"))
-			return Float.TYPE;
-		else if (name.equals("double"))
-			return Double.TYPE;
-		else
-			return null;
-	}
-
-	public Class[] getClassArray() {
-		return typeList.subList(0, typeList.size()).toArray(new Class[] {});
-	}
-}
-
-public class PluginAppletSecurityContext {
-	
-	private static Hashtable<ClassLoader, URL> classLoaders = new Hashtable<ClassLoader, URL>();
-	private static Hashtable<Integer, ClassLoader> instanceClassLoaders = new Hashtable<Integer, ClassLoader>();
-
-	// FIXME: make private
-	public PluginObjectStore store = new PluginObjectStore();
-	private Throwable throwable = null;
-	private ClassLoader liveconnectLoader = ClassLoader.getSystemClassLoader();
-	int identifier = 0;
-	
-	public static PluginStreamHandler streamhandler;
-	
-	long startTime = 0;
-
-	public PluginAppletSecurityContext(int identifier) {
-		this.identifier = identifier;
-		
-		// also, override the basedir, use a different one for the plugin
-		File f = new File(System.getProperty("user.home") + "/.icedteaplugin/");
-		f.mkdir();
-		JNLPRuntime.setBaseDir(f);
-
-		// We need a security manager.. and since there is a good chance that 
-		// an applet will be loaded at some point, we should make it the SM 
-		// that JNLPRuntime will try to install
-		if (System.getSecurityManager() == null) {
-			JNLPRuntime.initialize(/* isApplication */ false);
-		}
-
-		JNLPRuntime.disableExit();
-		
-		URL u = null;
-		try {
-		    u = new URL("file://");
-		} catch (Exception e) {
-		    e.printStackTrace();
-		}
-		
-
-		this.classLoaders.put(liveconnectLoader, u);
-	}
-
-	private static <V> V parseCall(String s, ClassLoader cl, Class<V> c) {
-		if (c == Integer.class)
-			return (V) new Integer(s);
-		else if (c == String.class)
-			return (V) new String(s);
-		else if (c == Signature.class)
-			return (V) new Signature(s, cl);
-		else
-			throw new RuntimeException("Unexpected call value.");
-	}
-
-	private Object parseArgs(String s, Class c) {
-		if (c == Boolean.TYPE || c == Boolean.class)
-			return new Boolean(s);
-		else if (c == Byte.TYPE || c == Byte.class)
-			return new Byte(s);
-		else if (c == Character.TYPE || c == Character.class) {
-			String[] bytes = s.split("_");
-			int low = Integer.parseInt(bytes[0]);
-			int high = Integer.parseInt(bytes[1]);
-			int full = ((high << 8) & 0x0ff00) | (low & 0x0ff);
-			return new Character((char) full);
-		} else if (c == Short.TYPE || c == Short.class)
-			return new Short(s);
-		else if (c == Integer.TYPE || c == Integer.class)
-			return new Integer(s);
-		else if (c == Long.TYPE || c == Long.class)
-			return new Long(s);
-		else if (c == Float.TYPE || c == Float.class)
-			return new Float(s);
-		else if (c == Double.TYPE || c == Double.class)
-			return new Double(s);
-		else
-			return store.getObject(new Integer(s));
-	}
-
-	public void associateSrc(ClassLoader cl, URL src) {
-	    PluginDebug.debug("Associating " + cl + " with " + src);
-	    this.classLoaders.put(cl, src);
-	}
-	
-    public void associateInstance(Integer i, ClassLoader cl) {
-        PluginDebug.debug("Associating " + cl + " with instance " + i);
-        this.instanceClassLoaders.put(i, cl);
-    }
-
-	public static void setStreamhandler(PluginStreamHandler sh) {
-		streamhandler = sh;
-	}
-	
-	public static Map<String, String> getLoaderInfo() {
-	    Hashtable<String, String> map = new Hashtable<String, String>();
-
-	    for (ClassLoader loader : PluginAppletSecurityContext.classLoaders.keySet()) {
-	        map.put(loader.getClass().getName(), classLoaders.get(loader).toString());
-	    }
-
-	    return map;
-	}
-
-	public void handleMessage(int reference, String src, AccessControlContext callContext, String message) {
-
-		startTime = new java.util.Date().getTime();
-
-		try {
-			if (message.startsWith("FindClass")) {
-				ClassLoader cl = null;
-				Class c = null;
-				cl = liveconnectLoader;
-				String[] args = message.split(" ");
-				Integer instance = new Integer(args[1]);
-				String className = args[2].replace('/', '.');
-				PluginDebug.debug("Searching for class " + className + " in " + cl);
-
-				try {
-					c = cl.loadClass(className);
-					store.reference(c);
-					write(reference, "FindClass " + store.getIdentifier(c));
-				} catch (ClassNotFoundException cnfe) {
-				    
-			        cl = this.instanceClassLoaders.get(instance);
-			        PluginDebug.debug("Not found. Looking in " + cl);
-			        
-                    if (instance != 0 && cl != null) {				    
-				        try {
-				            c = cl.loadClass(className);
-				            store.reference(c);
-				            write(reference, "FindClass " + store.getIdentifier(c));
-				        } catch (ClassNotFoundException cnfe2) {
-				            write(reference, "FindClass 0");
-				        }
-				    } else {
-				        write(reference, "FindClass 0");
-				    }
-				}
-
-			} else if (message.startsWith("GetStaticMethodID")
-					|| message.startsWith("GetMethodID")) {
-				String[] args = message.split(" ");
-				Integer classID = parseCall(args[1], null, Integer.class);
-				String methodName = parseCall(args[2], null, String.class);
-				Signature signature = parseCall(args[3], ((Class) store.getObject(classID)).getClassLoader(), Signature.class);
-				Object[] a = signature.getClassArray();
-
-				Class c;
-
-				if (message.startsWith("GetStaticMethodID") || 
-				    methodName.equals("<init>") || 
-				    methodName.equals("<clinit>"))
-					c = (Class) store.getObject(classID);
-				else
-					c = store.getObject(classID).getClass();
-
-				Method m = null;
-				Constructor cs = null;
-				Object o = null;
-				if (methodName.equals("<init>")
-						|| methodName.equals("<clinit>")) {
-					o = cs = c.getConstructor(signature.getClassArray());
-					store.reference(cs);
-				} else {
-					o = m = c.getMethod(methodName, signature.getClassArray());
-					store.reference(m);
-				}
-				PluginDebug.debug(o + " has id " + store.getIdentifier(o));
-				write(reference, args[0] + " " + store.getIdentifier(o));
-			} else if (message.startsWith("GetStaticFieldID")
-					|| message.startsWith("GetFieldID")) {
-				String[] args = message.split(" ");
-				Integer classID = parseCall(args[1], null, Integer.class);
-				Integer fieldID = parseCall(args[2], null, Integer.class);
-				String fieldName = (String) store.getObject(fieldID);
-
-				Class c = (Class) store.getObject(classID);
-
-				PluginDebug.debug("GetStaticFieldID/GetFieldID got class=" + c.getName());
-				
-				Field f = null;
-				f = c.getField(fieldName);
-
-				store.reference(f);
-
-				write(reference, "GetStaticFieldID " + store.getIdentifier(f));
-			} else if (message.startsWith("GetStaticField")) {
-				String[] args = message.split(" ");
-				String type = parseCall(args[1], null, String.class);
-				Integer classID = parseCall(args[1], null, Integer.class);
-				Integer fieldID = parseCall(args[2], null, Integer.class);
-
-				final Class c = (Class) store.getObject(classID);
-				final Field f = (Field) store.getObject(fieldID);
-
-				AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
-				checkPermission(src, c, acc);
-
-				Object ret = AccessController.doPrivileged(new PrivilegedAction<Object> () {
-					public Object run() {
-						try {
-							return f.get(c);
-						} catch (Throwable t) {
-							return t;
-						}
-					}
-				}, acc);
-
-				if (ret instanceof Throwable)
-					throw (Throwable) ret;
-
-                if (ret == null) {
-                    write(reference, "GetStaticField literalreturn null");
-                } else if (f.getType() == Boolean.TYPE
-                        || f.getType() == Byte.TYPE
-                        || f.getType() == Short.TYPE
-                        || f.getType() == Integer.TYPE
-                        || f.getType() == Long.TYPE) {
-                    write(reference, "GetStaticField literalreturn " + ret);
-                } else if (f.getType() == Float.TYPE
-                		|| f.getType() == Double.TYPE) {
-                	write(reference, "GetStaticField literalreturn " + String.format("%308.308e", ret));
-                } else if (f.getType() == Character.TYPE) {
-                    write(reference, "GetStaticField literalreturn " + (int) (Character) ret);
-                } else {
-                    // Track returned object.
-                    store.reference(ret);
-                    write(reference, "GetStaticField " + store.getIdentifier(ret));
-                }
-			} else if (message.startsWith("GetValue")) {
-                String[] args = message.split(" ");
-                Integer index = parseCall(args[1], null, Integer.class);
-                
-                Object ret = store.getObject(index);
-
-                if (ret == null) {
-                    write(reference, "GetValue literalreturn null");
-                } else if (ret.getClass() == Boolean.TYPE
-                        || ret.getClass() == Boolean.class
-                        || ret.getClass() == Byte.TYPE
-                        || ret.getClass() == Byte.class
-                        || ret.getClass() == Short.TYPE
-                        || ret.getClass() == Short.class
-                        || ret.getClass() == Integer.TYPE
-                        || ret.getClass() == Integer.class
-                        || ret.getClass() == Long.TYPE
-                        || ret.getClass() == Long.class) {
-                    write(reference, "GetValue literalreturn " + ret);
-                } else if (ret.getClass() == Float.TYPE
-                        || ret.getClass() == Float.class
-                        || ret.getClass() == Double.TYPE
-                        || ret.getClass() == Double.class) {
-                    write(reference, "GetValue literalreturn " + String.format("%308.308e", ret));
-                } else if (ret.getClass() == Character.TYPE
-                        || ret.getClass() == Character.class) {
-                    write(reference, "GetValue literalreturn " + (int) (Character) ret);
-                } else {
-                    // Track returned object.
-                    store.reference(ret);
-                    write(reference, "GetValue " + store.getIdentifier(ret));
-                }
-            } else if (message.startsWith("SetStaticField") ||
-			           message.startsWith("SetField")) {
-				String[] args = message.split(" ");
-				Integer classOrObjectID = parseCall(args[1], null, Integer.class);
-				Integer fieldID = parseCall(args[2], null, Integer.class);
-				Object value = store.getObject(parseCall(args[3], null, Integer.class));
-
-				final Object o = store.getObject(classOrObjectID);
-				final Field f = (Field) store.getObject(fieldID);
-
-				final Object fValue = MethodOverloadResolver.getCostAndCastedObject(value, f.getType())[1];
-
-				AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
-				checkPermission(src, 
-				                message.startsWith("SetStaticField") ? (Class) o : o.getClass(), 
-				                acc);
-
-				Object ret = AccessController.doPrivileged(new PrivilegedAction<Object> () {
-					public Object run() {
-						try {
-							f.set(o, fValue);
-						} catch (Throwable t) {
-							return t;
-						}
-						
-						return null;
-					}
-				}, acc);
-
-				if (ret instanceof Throwable)
-					throw (Throwable) ret;
-
-				write(reference, "SetField");
-			} else if (message.startsWith("GetObjectArrayElement")) {
-				String[] args = message.split(" ");
-				Integer arrayID = parseCall(args[1], null, Integer.class);
-				Integer index = parseCall(args[2], null, Integer.class);
-
-				Object ret = Array.get(store.getObject(arrayID), index);
-				Class retClass = store.getObject(arrayID).getClass().getComponentType(); // prevent auto-boxing influence
-				
-                if (ret == null) {
-                    write(reference, "GetObjectArrayElement literalreturn null");
-                } else if (retClass == Boolean.TYPE
-                        || retClass == Byte.TYPE
-                        || retClass == Short.TYPE
-                        || retClass== Integer.TYPE
-                        || retClass== Long.TYPE) {
-                    write(reference, "GetObjectArrayElement literalreturn " + ret);
-                } else if (retClass == Float.TYPE
-                		|| retClass == Double.TYPE) {
-                	write(reference, "GetObjectArrayElement literalreturn " + String.format("%308.308e", ret));                    
-                } else if (retClass == Character.TYPE) {
-                    write(reference, "GetObjectArrayElement literalreturn " + (int) (Character) ret);
-                } else {
-                    // Track returned object.
-                    store.reference(ret);
-                    write(reference, "GetObjectArrayElement " + store.getIdentifier(ret));
-                }				
-
-			} else if (message.startsWith("SetObjectArrayElement")) {
-				String[] args = message.split(" ");
-				Integer arrayID = parseCall(args[1], null, Integer.class);
-				Integer index = parseCall(args[2], null, Integer.class);
-				Integer objectID = parseCall(args[3], null, Integer.class);
-
-				Object value = store.getObject(objectID);
-				
-				// Cast the object to appropriate type before insertion
-				value = MethodOverloadResolver.getCostAndCastedObject(value, store.getObject(arrayID).getClass().getComponentType())[1];
-				
-				//if (value == null &&
-				//    store.getObject(arrayID).getClass().getComponentType().isPrimitive()) {
-				//    value = 0;
-				//}
-
-				Array.set(store.getObject(arrayID), index, value);				    
-
-				write(reference, "SetObjectArrayElement");
-			} else if (message.startsWith("GetArrayLength")) {
-				String[] args = message.split(" ");
-				Integer arrayID = parseCall(args[1], null, Integer.class);
-
-				//System.out.println("ARRAYID: " + arrayID);
-				Object o = (Object) store.getObject(arrayID);
-				int len = 0;
-				len = Array.getLength(o);
-				// System.out.println ("Returning array length: " + len);
-
-				// System.out.println ("array length: " + o + " " + len);
-				write(reference, "GetArrayLength " + Array.getLength(o));
-			} else if (message.startsWith("GetField")) {
-				String[] args = message.split(" ");
-				String type = parseCall(args[1], null, String.class);
-				Integer objectID = parseCall(args[1], null, Integer.class);
-				Integer fieldID = parseCall(args[2], null, Integer.class);
-
-				final Object o = (Object) store.getObject(objectID);
-				final Field f = (Field) store.getObject(fieldID);
-
-				AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
-				checkPermission(src, o.getClass(), acc);
-
-				Object ret = AccessController.doPrivileged(new PrivilegedAction<Object> () {
-					public Object run() {
-						try {
-							return f.get(o);
-						} catch (Throwable t) {
-							return t;
-						}
-					}
-				}, acc);
-
-				if (ret instanceof Throwable)
-					throw (Throwable) ret;
-
-                if (ret == null) {
-                    write(reference, "GetField literalreturn null");
-                } else if (f.getType() == Boolean.TYPE
-                        || f.getType() == Byte.TYPE
-                        || f.getType() == Short.TYPE
-                        || f.getType() == Integer.TYPE
-                        || f.getType() == Long.TYPE) {
-                    write(reference, "GetField literalreturn " + ret);
-                } else if (f.getType() == Float.TYPE
-                		|| f.getType() == Double.TYPE) {
-                	write(reference, "GetField literalreturn " + String.format("%308.308e", ret));
-                } else if (f.getType() == Character.TYPE) {
-                    write(reference, "GetField literalreturn " + (int) (Character) ret);
-                } else {
-                    // Track returned object.
-                    store.reference(ret);
-                    write(reference, "GetField " + store.getIdentifier(ret));
-                }
-
-			} else if (message.startsWith("GetObjectClass")) {
-				int oid = Integer.parseInt(message.substring("GetObjectClass"
-						.length() + 1));
-				// System.out.println ("GETTING CLASS FOR: " + oid);
-				Class c = store.getObject(oid).getClass();
-				// System.out.println (" OBJ: " + store.getObject(oid));
-				// System.out.println (" CLS: " + c);
-				store.reference(c);
-
-				write(reference, "GetObjectClass " + store.getIdentifier(c));
-			} else if (message.startsWith("CallMethod") ||
-					   message.startsWith("CallStaticMethod")) {
-				String[] args = message.split(" ");
-				Integer objectID = parseCall(args[1], null, Integer.class);
-				String methodName = parseCall(args[2], null, String.class);
-				Object o = null;
-				Class c;
-
-				if (message.startsWith("CallMethod")) {
-					o = (Object) store.getObject(objectID);
-					c = o.getClass();
-				} else {
-					c = (Class) store.getObject(objectID);
-				}
-
-				// length -3 to discard first 3, + 2 for holding object 
-				// and method name
-				Object[] arguments = new Object[args.length - 1];
-				arguments[0] = c;
-				arguments[1] = methodName;
-                for (int i = 0; i < args.length - 3; i++) {
-                    arguments[i+2] = store.getObject(parseCall(args[3 + i], null, Integer.class));
-                    PluginDebug.debug("GOT ARG: " + arguments[i+2]);
-                }
-
-                Object[] matchingMethodAndArgs = MethodOverloadResolver.getMatchingMethod(arguments);
-                
-                if (matchingMethodAndArgs == null) {
-                    write(reference, "Error: No suitable method named " + methodName + " with matching args found");
-                    return;
-                }
-
-				final Method m = (Method) matchingMethodAndArgs[0];
-				Object[] castedArgs = new Object[matchingMethodAndArgs.length - 1];
-				for (int i=0; i < castedArgs.length; i++) {
-				    castedArgs[i] = matchingMethodAndArgs[i+1];
-				}
-
-				String collapsedArgs = "";
-				for (Object arg : castedArgs) {
-					collapsedArgs += " " + arg;
-				}
-
-				PluginDebug.debug("Calling method " + m + " on object " + o
-						+ " (" + c + ") with " + collapsedArgs);
-
-				AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
-				checkPermission(src, c, acc);
-
-				final Object[] fArguments = castedArgs;
-				final Object callableObject = o;
-				// Set the method accessible prior to calling. See:
-				// http://forums.sun.com/thread.jspa?threadID=332001&start=15&tstart=0
-				m.setAccessible(true);
-				Object ret = AccessController.doPrivileged(new PrivilegedAction<Object> () {
-					public Object run() {
-						try {
-							return m.invoke(callableObject, fArguments);
-						} catch (Throwable t) {
-							return t;
-						}
-					}
-				}, acc);
-
-				if (ret instanceof Throwable)
-					throw (Throwable) ret;
-
-				String retO;
-				if (ret == null) {
-					retO = "null";
-				} else {
-					retO = m.getReturnType().toString();
-				}
-
-				PluginDebug.debug("Calling " + m + " on " + o + " with "
-						+ collapsedArgs + " and that returned: " + ret
-						+ " of type " + retO);
-
-				if (m.getReturnType().equals(java.lang.Void.class) || 
-				    m.getReturnType().equals(java.lang.Void.TYPE)) {
-                    write(reference, "CallMethod literalreturn void");
-                } else if (ret == null) {
-					write(reference, "CallMethod literalreturn null");
-				} else if (m.getReturnType() == Boolean.TYPE
-						|| m.getReturnType() == Byte.TYPE
-						|| m.getReturnType() == Short.TYPE
-						|| m.getReturnType() == Integer.TYPE
-						|| m.getReturnType() == Long.TYPE) {
-					write(reference, "CallMethod literalreturn " + ret);
-                } else if (m.getReturnType() == Float.TYPE
-                		|| m.getReturnType() == Double.TYPE) {
-                	write(reference, "CallMethod literalreturn " + String.format("%308.308e", ret));  
-				} else if (m.getReturnType() == Character.TYPE) {
-					write(reference, "CallMethod literalreturn " +  (int) (Character) ret);
-				} else {
-					// Track returned object.
-					store.reference(ret);
-					write(reference, "CallMethod " + store.getIdentifier(ret));
-				}
-			} else if (message.startsWith("GetSuperclass")) {
-				String[] args = message.split(" ");
-				Integer classID = parseCall(args[1], null, Integer.class);
-				Class c = null;
-				Class ret = null;
-
-				c = (Class) store.getObject(classID);
-				ret = c.getSuperclass();
-				store.reference(ret);
-
-				write(reference, "GetSuperclass " + store.getIdentifier(ret));
-			} else if (message.startsWith("IsAssignableFrom")) {
-				String[] args = message.split(" ");
-				Integer classID = parseCall(args[1], null, Integer.class);
-				Integer superclassID = parseCall(args[2], null, Integer.class);
-
-				boolean result = false;
-				Class clz = (Class) store.getObject(classID);
-				Class sup = (Class) store.getObject(superclassID);
-
-				result = sup.isAssignableFrom(clz);
-
-				write(reference, "IsAssignableFrom " + (result ? "1" : "0"));
-			} else if (message.startsWith("IsInstanceOf")) {
-				String[] args = message.split(" ");
-				Integer objectID = parseCall(args[1], null, Integer.class);
-				Integer classID = parseCall(args[2], null, Integer.class);
-
-				boolean result = false;
-				Object o = (Object) store.getObject(objectID);
-				Class c = (Class) store.getObject(classID);
-
-				result = c.isInstance(o);
-
-				write(reference, "IsInstanceOf " + (result ? "1" : "0"));
-			} else if (message.startsWith("GetStringUTFLength")) {
-				String[] args = message.split(" ");
-				Integer stringID = parseCall(args[1], null, Integer.class);
-
-				String o = null;
-				byte[] b = null;
-				o = (String) store.getObject(stringID);
-				b = o.getBytes("UTF-8");
-				// System.out.println ("STRING UTF-8 LENGTH: " + o + " " +
-				// b.length);
-
-				write(reference, "GetStringUTFLength " + o.length());
-			} else if (message.startsWith("GetStringLength")) {
-				String[] args = message.split(" ");
-				Integer stringID = parseCall(args[1], null, Integer.class);
-
-				String o = null;
-				byte[] b = null;
-				o = (String) store.getObject(stringID);
-				b = o.getBytes("UTF-16LE");
-				// System.out.println ("STRING UTF-16 LENGTH: " + o + " " +
-				// b.length);
-
-				// System.out.println ("Java: GetStringLength " + b.length);
-				write(reference, "GetStringLength " + o.length());
-			} else if (message.startsWith("GetStringUTFChars")) {
-				String[] args = message.split(" ");
-				Integer stringID = parseCall(args[1], null, Integer.class);
-
-				String o = null;
-				byte[] b = null;
-				StringBuffer buf = null;
-				o = (String) store.getObject(stringID);
-				b = o.getBytes("UTF-8");
-				buf = new StringBuffer(b.length * 2);
-				buf.append(b.length);
-				for (int i = 0; i < b.length; i++)
-					buf
-							.append(" "
-									+ Integer
-											.toString(((int) b[i]) & 0x0ff, 16));
-
-				// System.out.println ("Java: GetStringUTFChars: " + o);
-				// //System.out.println ("String UTF BYTES: " + buf);
-				write(reference, "GetStringUTFChars " + buf);
-			} else if (message.startsWith("GetStringChars")) {
-				String[] args = message.split(" ");
-				Integer stringID = parseCall(args[1], null, Integer.class);
-
-				String o = null;
-				byte[] b = null;
-				StringBuffer buf = null;
-				o = (String) store.getObject(stringID);
-				// FIXME: LiveConnect uses UCS-2.
-				b = o.getBytes("UTF-16LE");
-				buf = new StringBuffer(b.length * 2);
-				buf.append(b.length);
-				for (int i = 0; i < b.length; i++)
-					buf
-							.append(" "
-									+ Integer
-											.toString(((int) b[i]) & 0x0ff, 16));
-
-				PluginDebug.debug("Java: GetStringChars: " + o);
-				PluginDebug.debug("  String BYTES: " + buf);
-				write(reference, "GetStringChars " + buf);
-			} else if (message.startsWith("GetToStringValue")) {
-                String[] args = message.split(" ");
-                Integer objectID = parseCall(args[1], null, Integer.class);
-
-                String o = null;
-                byte[] b = null;
-                StringBuffer buf = null;
-                o = store.getObject(objectID).toString();
-                b = o.getBytes("UTF-8");
-                buf = new StringBuffer(b.length * 2);
-                buf.append(b.length);
-                for (int i = 0; i < b.length; i++)
-                    buf
-                            .append(" "
-                                    + Integer
-                                            .toString(((int) b[i]) & 0x0ff, 16));
-
-                write(reference, "GetToStringValue " + buf);
-            } else if (message.startsWith("NewArray")) {
-				String[] args = message.split(" ");
-				String type = parseCall(args[1], null, String.class);
-				Integer length = parseCall(args[2], null, Integer.class);
-
-				// System.out.println ("CALLING: NewArray: " + type + " " +
-				// length + " "
-				// + Signature.primitiveNameToType(type));
-
-				Object newArray = null;
-
-				Class c;
-				if (type.equals("bool")) {
-				    c = Boolean.class;
-				} else if (type.equals("double")) {
-				    c = Double.class;
-				} else if (type.equals("int")) {
-				    c = Integer.class;
-                } else if (type.equals("string")) {
-                    c = String.class;
-                } else if (isInt(type)) {
-                    c = (Class) store.getObject(Integer.parseInt(type));
-                } else {
-                    c = JSObject.class;
-                }
-
-				if (args.length > 3)
-				    newArray = Array.newInstance(c, new int[] { length, parseCall(args[3], null, Integer.class)});
-				else
-				    newArray = Array.newInstance(c, length);
-
-				store.reference(newArray);
-				write(reference, "NewArray " + store.getIdentifier(newArray));
-			} else if (message.startsWith("HasMethod")) {
-                String[] args = message.split(" ");
-                Integer classNameID = parseCall(args[1], null, Integer.class);
-                Integer methodNameID = parseCall(args[2], null, Integer.class);
-                
-                Class c = (Class) store.getObject(classNameID);
-                String methodName = (String) store.getObject(methodNameID);
-
-                Method method = null;
-                Method[] classMethods = c.getMethods();
-                for (Method m: classMethods) {
-                	if (m.getName().equals(methodName)) {
-                		method = m;
-                		break;
-                	}
-                }
-                
-                int hasMethod = (method != null) ? 1 : 0; 
-
-                write(reference, "HasMethod " + hasMethod);
-            } else if (message.startsWith("HasPackage")) {
-                String[] args = message.split(" ");
-                Integer instance = parseCall(args[1], null, Integer.class);
-                Integer nameID = parseCall(args[2], null, Integer.class);
-                String pkgName = (String) store.getObject(nameID);
-
-                Package pkg = Package.getPackage(pkgName);
-                int hasPkg = (pkg != null) ? 1 : 0; 
-
-                write(reference, "HasPackage " + hasPkg);
-
-            } else if (message.startsWith("HasField")) {
-                String[] args = message.split(" ");
-                Integer classNameID = parseCall(args[1], null, Integer.class);
-                Integer fieldNameID = parseCall(args[2], null, Integer.class);
-                
-                Class c = (Class) store.getObject(classNameID);
-                String fieldName = (String) store.getObject(fieldNameID);
-
-                Field field = null;
-                Field[] classFields = c.getFields();
-                for (Field f: classFields) {
-                	if (f.getName().equals(fieldName)) {
-                		field = f;
-                		break;
-                	}
-                }
-
-                int hasField = (field != null) ? 1 : 0; 
-
-                write(reference, "HasField " + hasField);
-            } else if (message.startsWith("NewObjectArray")) {
-				String[] args = message.split(" ");
-				Integer length = parseCall(args[1], null, Integer.class);
-				Integer classID = parseCall(args[2], null, Integer.class);
-				Integer objectID = parseCall(args[3], null, Integer.class);
-
-				// System.out.println ("CALLING: NewObjectArray: " +
-				// classID + " " + length + " "
-				// + objectID);
-
-				Object newArray = null;
-				newArray = Array.newInstance((Class) store.getObject(classID),
-						length);
-
-				Object[] array = (Object[]) newArray;
-				for (int i = 0; i < array.length; i++)
-					array[i] = store.getObject(objectID);
-				store.reference(newArray);
-				write(reference, "NewObjectArray "
-						+ store.getIdentifier(newArray));
-			} else if (message.startsWith("NewObjectWithConstructor")) {
-
-                String[] args = message.split(" ");
-                Integer classID = parseCall(args[1], null, Integer.class);
-                Integer methodID = parseCall(args[2], null, Integer.class);
-
-                final Constructor m = (Constructor) store.getObject(methodID);
-                Class[] argTypes = m.getParameterTypes();
-
-                // System.out.println ("NEWOBJ: HERE1");
-                Object[] arguments = new Object[argTypes.length];
-                // System.out.println ("NEWOBJ: HERE2");
-                for (int i = 0; i < argTypes.length; i++) {
-                    arguments[i] = parseArgs(args[3 + i], argTypes[i]);
-                    // System.out.println ("NEWOBJ: GOT ARG: " + arguments[i]);
-                }
-
-                final Object[] fArguments = arguments;
-                AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
-
-                Class c = (Class) store.getObject(classID);
-                checkPermission(src, c, acc);
-
-                Object ret = AccessController.doPrivileged(new PrivilegedAction<Object> () {
-                    public Object run() {
-                        try {
-                            return m.newInstance(fArguments);
-                        } catch (Throwable t) {
-                            return t;
-                        }
-                    }
-                }, acc);
-
-                if (ret instanceof Throwable)
-                    throw (Throwable) ret;
-
-                store.reference(ret);
-
-                write(reference, "NewObject " + store.getIdentifier(ret));
-
-            } else if (message.startsWith("NewObject")) {
-				String[] args = message.split(" ");
-				Integer classID = parseCall(args[1], null, Integer.class);
-				Class c = (Class) store.getObject(classID);
-                final Constructor cons;
-                final Object[] fArguments;
-
-                Object[] arguments = new Object[args.length - 1];
-                arguments[0] = c;
-                for (int i = 0; i < args.length - 2; i++) {
-                    arguments[i + 1] = store.getObject(parseCall(args[2 + i],
-                            null, Integer.class));
-                    PluginDebug.debug("GOT ARG: " + arguments[i + 1]);
-                }
-
-                Object[] matchingConstructorAndArgs = MethodOverloadResolver
-                        .getMatchingConstructor(arguments);
-
-                if (matchingConstructorAndArgs == null) {
-                    write(reference,
-                            "Error: No suitable constructor with matching args found");
-                    return;
-                }
-
-                Object[] castedArgs = new Object[matchingConstructorAndArgs.length - 1];
-                for (int i = 0; i < castedArgs.length; i++) {
-                    castedArgs[i] = matchingConstructorAndArgs[i + 1];
-                }
-
-                cons = (Constructor) matchingConstructorAndArgs[0];
-                fArguments = castedArgs;
-
-                String collapsedArgs = "";
-                for (Object arg : fArguments) {
-                    collapsedArgs += " " + arg.toString();
-                }
-
-                PluginDebug.debug("Calling constructor on class " + c + 
-                                   " with " + collapsedArgs);
-
-                AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext();
-				checkPermission(src, c, acc);
-
-				Object ret = AccessController.doPrivileged(new PrivilegedAction<Object> () {
-					public Object run() {
-						try {
-							return cons.newInstance(fArguments);
-						} catch (Throwable t) {
-							return t;
-						}
-					}
-				}, acc);
-
-				if (ret instanceof Throwable)
-					throw (Throwable) ret;
-
-				store.reference(ret);
-
-				write(reference, "NewObject " + store.getIdentifier(ret));
-
-			} else if (message.startsWith("NewStringUTF")) {
-                PluginDebug.debug("MESSAGE: " + message);
-                String[] args = message.split(" ");
-                int length = new Integer(args[1]);
-                byte[] byteArray = new byte[length];
-                String ret = null;
-                int i = 0;
-                int j = 2;
-                int c;
-                while (i < length) {
-                    c = Integer.parseInt(args[j++], 16);
-                    byteArray[i++] = (byte) c;
-                } 
-
-                ret = new String(byteArray, "UTF-8");
-                PluginDebug.debug("NEWSTRINGUTF: " + ret);
-
-                store.reference(ret);
-                write(reference, "NewStringUTF " + store.getIdentifier(ret));
-			} else if (message.startsWith("NewString")) {
-                PluginDebug.debug("MESSAGE: " + message);
-                String[] args = message.split(" ");
-                Integer strlength = parseCall(args[1], null, Integer.class);
-                int bytelength = 2 * strlength;
-                byte[] byteArray = new byte[bytelength];
-                String ret = null;
-                for (int i = 0; i < strlength; i++) {
-                    int c = parseCall(args[2 + i], null, Integer.class);
-                    PluginDebug.debug("char " + i + " " + c);
-                    // Low.
-                    byteArray[2 * i] = (byte) (c & 0x0ff);
-                    // High.
-                    byteArray[2 * i + 1] = (byte) ((c >> 8) & 0x0ff);
-                }
-                ret = new String(byteArray, 0, bytelength, "UTF-16LE");
-                PluginDebug.debug("NEWSTRING: " + ret);
-
-                // System.out.println ("NEWOBJ: CALLED: " + ret);
-                // System.out.println ("NEWOBJ: CALLED: " +
-                // store.getObject(ret));
-                store.reference(ret);
-                write(reference, "NewString " + store.getIdentifier(ret));
-
-			} else if (message.startsWith("ExceptionOccurred")) {
-				PluginDebug.debug("EXCEPTION: " + throwable);
-				if (throwable != null)
-					store.reference(throwable);
-				write(reference, "ExceptionOccurred "
-						+ store.getIdentifier(throwable));
-			} else if (message.startsWith("ExceptionClear")) {
-				if (throwable != null && store.contains(throwable))
-					store.unreference(store.getIdentifier(throwable));
-				throwable = null;
-				write(reference, "ExceptionClear");
-			} else if (message.startsWith("DeleteGlobalRef")) {
-				String[] args = message.split(" ");
-				Integer id = parseCall(args[1], null, Integer.class);
-				store.unreference(id);
-				write(reference, "DeleteGlobalRef");
-			} else if (message.startsWith("DeleteLocalRef")) {
-				String[] args = message.split(" ");
-				Integer id = parseCall(args[1], null, Integer.class);
-				store.unreference(id);
-				write(reference, "DeleteLocalRef");
-			} else if (message.startsWith("NewGlobalRef")) {
-				String[] args = message.split(" ");
-				Integer id = parseCall(args[1], null, Integer.class);
-				store.reference(store.getObject(id));
-				write(reference, "NewGlobalRef " + id);
-			} else if (message.startsWith("GetClassName")) {
-				String[] args = message.split(" ");
-				Integer objectID = parseCall(args[1], null, Integer.class);
-				Object o = (Object) store.getObject(objectID);
-				write(reference, "GetClassName " + o.getClass().getName());
-			} else if (message.startsWith("GetClassID")) {
-                String[] args = message.split(" ");
-                Integer objectID = parseCall(args[1], null, Integer.class);
-                store.reference(store.getObject(objectID).getClass());
-                write(reference, "GetClassID " + store.getIdentifier(store.getObject(objectID).getClass()));
-            }
-		} catch (Throwable t) {
-			t.printStackTrace();
-			String msg = t.getCause() != null ? t.getCause().getMessage() : t.getMessage();
-
-			// add an identifier string to let javaside know of the type of error
-			// check for cause as well, since the top level exception will be InvocationTargetException in most cases
-			if (t instanceof AccessControlException || t.getCause() instanceof AccessControlException) {
-				msg = "LiveConnectPermissionNeeded " + msg;
-			}
-
-			write(reference, " Error " + msg);
-
-			// ExceptionOccured is only called after Callmethod() by mozilla. So
-			// for exceptions that are not related to CallMethod, we need a way
-			// to log them. This is how we do it.. send an error message to the
-			// c++ side to let it know that something went wrong, and it will do
-			// the right thing to let mozilla know
-
-			// Store the cause as the actual exception. This is needed because 
-			// the exception we get here will always be an 
-			// "InvocationTargetException" due to the use of reflection above
-			if (message.startsWith("CallMethod") || message.startsWith("CallStaticMethod"))
-				throwable = t.getCause();
-		}
-
-	}
-
-	/**
-	 * Checks if the calling script is allowed to access the specified class
-	 *  
-	 * @param jsSrc The source of the script
-	 * @param target The target class that the script is trying to access
-	 * @param acc AccessControlContext for this execution
-	 * @throws AccessControlException If the script has insufficient permissions
-	 */
-	public void checkPermission(String jsSrc, Class target, AccessControlContext acc) throws AccessControlException {
-	    // NPRuntime does not allow cross-site calling. We therefore always 
-	    // allow this, for the time being
-	    return;
-	}
-
-	private void write(int reference, String message) {
-		PluginDebug.debug("appletviewer writing " + message);
-		streamhandler.write("context " + identifier + " reference " + reference
-				+ " " + message);
-	}
-
-	public void prePopulateLCClasses() {
-		
-		int classID;
-		
-		prepopulateClass("netscape/javascript/JSObject");
-		classID = prepopulateClass("netscape/javascript/JSException");
-		prepopulateMethod(classID, "<init>", "(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;I)");
-		prepopulateMethod(classID, "<init>", "(ILjava/lang/Object;)");
-		prepopulateField(classID, "lineno");
-		prepopulateField(classID, "tokenIndex");
-		prepopulateField(classID, "source");
-		prepopulateField(classID, "filename");
-		prepopulateField(classID, "wrappedExceptionType");
-		prepopulateField(classID, "wrappedException");
-		
-		classID = prepopulateClass("netscape/javascript/JSUtil");
-		prepopulateMethod(classID, "getStackTrace", "(Ljava/lang/Throwable;)");
-
-		prepopulateClass("java/lang/Object");
-		classID = prepopulateClass("java/lang/Class");
-		prepopulateMethod(classID, "getMethods", "()");
-		prepopulateMethod(classID, "getConstructors", "()");
-		prepopulateMethod(classID, "getFields", "()");
-		prepopulateMethod(classID, "getName", "()");
-		prepopulateMethod(classID, "isArray", "()");
-		prepopulateMethod(classID, "getComponentType", "()");
-		prepopulateMethod(classID, "getModifiers", "()");
-		
-
-		classID = prepopulateClass("java/lang/reflect/Method");
-		prepopulateMethod(classID, "getName", "()");
-		prepopulateMethod(classID, "getParameterTypes", "()");
-		prepopulateMethod(classID, "getReturnType", "()");
-		prepopulateMethod(classID, "getModifiers", "()");
-
-		classID = prepopulateClass("java/lang/reflect/Constructor");
-		prepopulateMethod(classID, "getParameterTypes", "()");
-		prepopulateMethod(classID, "getModifiers", "()");
-		
-		classID = prepopulateClass("java/lang/reflect/Field");
-		prepopulateMethod(classID, "getName", "()");
-		prepopulateMethod(classID, "getType", "()");
-		prepopulateMethod(classID, "getModifiers", "()");
-		
-		classID = prepopulateClass("java/lang/reflect/Array");
-		prepopulateMethod(classID, "newInstance", "(Ljava/lang/Class;I)");
-		
-		classID = prepopulateClass("java/lang/Throwable");
-		prepopulateMethod(classID, "toString", "()");
-		prepopulateMethod(classID, "getMessage", "()");
-		
-		classID = prepopulateClass("java/lang/System");
-		prepopulateMethod(classID, "identityHashCode", "(Ljava/lang/Object;)");
-		
-		classID = prepopulateClass("java/lang/Boolean");
-		prepopulateMethod(classID, "booleanValue", "()");
-		prepopulateMethod(classID, "<init>", "(Z)");
-
-		classID = prepopulateClass("java/lang/Double");
-		prepopulateMethod(classID, "doubleValue", "()");
-		prepopulateMethod(classID, "<init>", "(D)");
-
-		classID = prepopulateClass("java/lang/Void");
-		prepopulateField(classID, "TYPE");
-
-		prepopulateClass("java/lang/String");		
-		prepopulateClass("java/applet/Applet");
-	}
-
-	private int prepopulateClass(String name) {
-		name = name.replace('/', '.');
-		ClassLoader cl = liveconnectLoader;
-		Class c = null;
-
-		try {
-			c = cl.loadClass(name);
-			store.reference(c);
-		} catch (ClassNotFoundException cnfe) {
-			// do nothing ... this should never happen
-			cnfe.printStackTrace();
-		}
-
-		return store.getIdentifier(c);
-	}
-	
-	private int prepopulateMethod(int classID, String methodName, String signatureStr) {
-		Signature signature = parseCall(signatureStr, ((Class) store.getObject(classID)).getClassLoader(), Signature.class);
-		Object[] a = signature.getClassArray();
-
-		Class c = (Class) store.getObject(classID);
-		Method m = null;
-		Constructor cs = null;
-		Object o = null;
-		
-		try {
-			if (methodName.equals("<init>")
-					|| methodName.equals("<clinit>")) {
-				o = cs = c.getConstructor(signature.getClassArray());
-				store.reference(cs);
-			} else {
-				o = m = c.getMethod(methodName, signature.getClassArray());
-				store.reference(m);
-			}
-		} catch (NoSuchMethodException e) {
-			// should never happen
-			e.printStackTrace();
-		}
-		
-		return store.getIdentifier(m);
-	}
-	
-	private int prepopulateField(int classID, String fieldName) {
-
-		Class c = (Class) store.getObject(classID);
-		Field f = null;
-		try {
-			f = c.getField(fieldName);
-		} catch (SecurityException e) {
-			// should never happen
-			e.printStackTrace();
-		} catch (NoSuchFieldException e) {
-			// should never happen			
-			e.printStackTrace();
-		}
-
-		store.reference(f);
-		return store.getIdentifier(f);
-	}
-
-	public void dumpStore() {
-		store.dump();
-	}
-
-	public Object getObject(int identifier) {
-		return store.getObject(identifier);		
-	}
-
-	public int getIdentifier(Object o) {
-		return store.getIdentifier(o);
-	}
-
-	public void store(Object o) {
-		store.reference(o);
-	}
-
-	/**
-	 * Returns a "closed" AccessControlContext i.e. no permissions to get out of sandbox.
-	 */
-	public AccessControlContext getClosedAccessControlContext() {
-		// Deny everything
-		Permissions p = new Permissions();
-		ProtectionDomain pd = new ProtectionDomain(null, p);
-		return new AccessControlContext(new ProtectionDomain[] {pd});
-	}
-
-	public AccessControlContext getAccessControlContext(String[] nsPrivilegeList, String src) {
-
-/*
-		for (int i=0; i < nsPrivilegeList.length; i++) {
-			String privilege = nsPrivilegeList[i];
-
-			if (privilege.equals("UniversalAccept")) {
-				SocketPermission sp = new SocketPermission("*", "accept,resolve");
-				grantedPermissions.add(sp);
-			} else if (privilege.equals("UniversalAwtEventQueueAccess")) {
-				AWTPermission awtp = new AWTPermission("accessEventQueue");
-				grantedPermissions.add(awtp);
-			} else if (privilege.equals("UniversalConnect")) {
-				SocketPermission sp = new SocketPermission("*", "connect,resolve");
-				grantedPermissions.add(sp);
-			} else if (privilege.equals("UniversalListen")) {
-				SocketPermission sp = new SocketPermission("*", "listen,resolve");
-				grantedPermissions.add(sp);
-			} else if (privilege.equals("UniversalExecAccess")) {
-				FilePermission fp = new FilePermission("<<ALL FILES>>", "execute");
-				RuntimePermission rtp = new RuntimePermission("setIO");
-				grantedPermissions.add(fp);
-				grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalExitAccess")) {
-				// Doesn't matter what the permissions are. Do not allow VM to exit.. we 
-				// use a single VM for the entire browser lifecycle once invoked, we 
-				// cannot let it exit
-
-				//RuntimePermission rtp = new RuntimePermission("exitVM.*");
-				//grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalFileDelete")) {
-				FilePermission fp = new FilePermission("<<ALL FILES>>", "delete");
-				grantedPermissions.add(fp);
-			} else if (privilege.equals("UniversalFileRead")) {
-				FilePermission fp = new FilePermission("<<ALL FILES>>", "read");
-				grantedPermissions.add(fp);
-			} else if (privilege.equals("UniversalFileWrite")) {
-				FilePermission fp = new FilePermission("<<ALL FILES>>", "write");
-				grantedPermissions.add(fp);
-			}  else if (privilege.equals("UniversalFdRead")) {
-				RuntimePermission rtp = new RuntimePermission("readFileDescriptor");
-				grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalFdWrite")) {
-				RuntimePermission rtp = new RuntimePermission("writeFileDescriptor");
-				grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalLinkAccess")) {
-				RuntimePermission rtp = new RuntimePermission("loadLibrary.*");
-				grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalListen")) {
-				SocketPermission sp = new SocketPermission("*", "listen");
-				grantedPermissions.add(sp);
-			} else if (privilege.equals("UniversalMulticast")) {
-				SocketPermission sp = new SocketPermission("*", "accept,connect,resolve");
-				grantedPermissions.add(sp);
-			} else if (privilege.equals("UniversalPackageAccess")) {
-				RuntimePermission rtp = new RuntimePermission("defineClassInPackage.*");
-				grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalPackageDefinition")) {
-				RuntimePermission rtp = new RuntimePermission("accessClassInPackage.*");
-				grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalPrintJobAccess")) {
-				RuntimePermission rtp = new RuntimePermission("queuePrintJob");
-				grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalPropertyRead")) {
-				PropertyPermission pp = new PropertyPermission("*", "read");
-				grantedPermissions.add(pp);
-			} else if (privilege.equals("UniversalPropertyWrite")) {
-				PropertyPermission pp = new PropertyPermission("*", "write");
-				grantedPermissions.add(pp);
-			} else if (privilege.equals("UniversalSetFactory")) {
-				RuntimePermission rtp = new RuntimePermission("setFactory");
-				grantedPermissions.add(rtp);
-			} else if (privilege.equals("UniversalSystemClipboardAccess")) {
-				AWTPermission awtp = new AWTPermission("accessClipboard");
-				grantedPermissions.add(awtp);
-			} else if (privilege.equals("UniversalThreadAccess")) {
-				RuntimePermission rtp1 = new RuntimePermission("modifyThread");
-				RuntimePermission rtp2 = new RuntimePermission("stopThread");
-				grantedPermissions.add(rtp1);
-				grantedPermissions.add(rtp2);
-			} else if (privilege.equals("UniversalThreadGroupAccess")) {
-				RuntimePermission rtp1 = new RuntimePermission("modifyThreadGroup");
-				RuntimePermission rtp2 = new RuntimePermission("modifyThread");
-				RuntimePermission rtp3 = new RuntimePermission("stopThread");
-				grantedPermissions.add(rtp1);
-				grantedPermissions.add(rtp2);
-				grantedPermissions.add(rtp3);
-			} else if (privilege.equals("UniversalTopLevelWindow")) {
-				AWTPermission awtp = new AWTPermission("topLevelWindow");
-				grantedPermissions.add(awtp);
-			} else if (privilege.equals("UniversalBrowserRead")) {
-				BrowserReadPermission bp = new BrowserReadPermission();
-				grantedPermissions.add(bp);
-			} else if (privilege.equals("UniversalJavaPermissions")) {
-				AllPermission ap = new AllPermission();
-				grantedPermissions.add(ap);
-			}
-		}
-		
-		// what to do with these is unknown: UniversalConnectWithRedirect, UniversalDialogModality, UniversalSendMail, LimitedInstall, FullInstall, SilentInstall
-*/
-
-		Permissions grantedPermissions = new Permissions();
-
-		for (int i=0; i < nsPrivilegeList.length; i++) {
-			String privilege = nsPrivilegeList[i];
-
-			if (privilege.equals("UniversalBrowserRead")) {
-				BrowserReadPermission bp = new BrowserReadPermission();
-				grantedPermissions.add(bp);
-			} else if (privilege.equals("UniversalJavaPermission")) {
-				AllPermission ap = new AllPermission();
-				grantedPermissions.add(ap);
-			}
-		}
-
-		CodeSource cs = new CodeSource((URL) null, (java.security.cert.Certificate  [])null);
-		
-		if (src != null && src.length() > 0) {
-			try {
-				cs = new CodeSource(new URL(src + "/"), (java.security.cert.Certificate[]) null);
-			} catch (MalformedURLException mfue) {
-				// do nothing
-			}
-			
-			if (src.equals("[System]"))
-			    grantedPermissions.add(new JSObjectCreatePermission());
-			
-		} else {
-		    JSObjectCreatePermission perm = new JSObjectCreatePermission();
-		    grantedPermissions.add(perm);
-		}
-
-		ProtectionDomain pd = new ProtectionDomain(cs, grantedPermissions, null, null);
-
-		// Add to hashmap
-		return new AccessControlContext(new ProtectionDomain[] {pd});
-	}
-
-    // private static final == inline
-    private static final boolean isInt(Object o) {
-        boolean isInt = false;
-
-        try {
-            Integer.parseInt((String) o);
-            isInt = true;
-        } catch (Exception e) {
-            // don't care
-        }
-
-        return isInt;
-    }
-	
-	class BrowserReadPermission extends BasicPermission {
-		public BrowserReadPermission() {
-			super("browserRead");
-		}
-	}
-	
-}
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2190 +0,0 @@
-/* PluginAppletViewer -- Handles embedding of the applet panel
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
-  * Copyright 1995-2004 Sun Microsystems, Inc.  All Rights Reserved.
-  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-  *
-  * This code is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU General Public License version 2 only, as
-  * published by the Free Software Foundation.  Sun designates this
-  * particular file as subject to the "Classpath" exception as provided
-  * by Sun in the LICENSE file that accompanied this code.
-  *
-  * This code is distributed in the hope that it will be useful, but WITHOUT
-  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-  * version 2 for more details (a copy is included in the LICENSE file that
-  * accompanied this code).
-  *
-  * You should have received a copy of the GNU General Public License version
-  * 2 along with this work; if not, write to the Free Software Foundation,
-  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-  *
-  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-  * CA 95054 USA or visit www.sun.com if you need additional information or
-  * have any questions.
-  */
-
- package sun.applet;
-
- import java.applet.Applet;
-import java.applet.AppletContext;
-import java.applet.AudioClip;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.Image;
-import java.awt.Insets;
-import java.awt.Label;
-import java.awt.Toolkit;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.awt.print.PageFormat;
-import java.awt.print.Printable;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.SocketPermission;
-import java.net.URI;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.AllPermission;
-import java.security.PrivilegedAction;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.swing.SwingUtilities;
-
-import net.sourceforge.jnlp.NetxPanel;
-import net.sourceforge.jnlp.runtime.JNLPClassLoader;
-import sun.awt.AppContext;
-import sun.awt.SunToolkit;
-import sun.awt.X11.XEmbeddedFrame;
-import sun.misc.Ref;
-
-import com.sun.jndi.toolkit.url.UrlUtil;
-
- /**
-  * Lets us construct one using unix-style one shot behaviors
-  */
-
- class PluginAppletPanelFactory
- {
-
-     public AppletPanel createPanel(PluginStreamHandler streamhandler,
-                                    int identifier,
-                                    long handle, int x, int y,
-                                    final URL doc, final Hashtable atts) {
-
-         AppletViewerPanel panel = (AppletViewerPanel) AccessController.doPrivileged(new PrivilegedAction() {
-             public Object run() {
-                    try {
-                        AppletPanel panel = new NetxPanel(doc, atts, false);
-                        AppletViewerPanel.debug("Using NetX panel");
-                        PluginDebug.debug(atts.toString());
-                        return panel;
-                    } catch (Exception ex) {
-                        AppletViewerPanel.debug("Unable to start NetX applet - defaulting to Sun applet", ex);
-                        return new AppletViewerPanel(doc, atts);
-                    }
-             }
-         });
-
-         double heightFactor = 1.0;
-         double widthFactor = 1.0;
-
-         if (atts.get("heightPercentage") != null) {
-             heightFactor = (Integer) atts.get("heightPercentage")/100.0;
-         }
-
-         if (atts.get("widthPercentage") != null) {
-             widthFactor = (Integer) atts.get("widthPercentage")/100.0;
-         }
-
-
-         // put inside initial 0 handle frame
-         PluginAppletViewer.reFrame(null, identifier, System.out,
-                 heightFactor, widthFactor, 0, panel);
-
-         panel.init();
-
-         // Start the applet
-         initEventQueue(panel);
-
-         // Applet initialized. Find out it's classloader and add it to the list
-         String portComponent = doc.getPort() != -1 ? ":" + doc.getPort() : "";
-         String codeBase = doc.getProtocol() + "://" + doc.getHost() + portComponent;
-
-         if (atts.get("codebase") != null) {
-             try {
-                 URL appletSrcURL = new URL(codeBase + (String) atts.get("codebase"));
-                 codeBase = appletSrcURL.getProtocol() + "://" + appletSrcURL.getHost();
-             } catch (MalformedURLException mfue) {
-                 // do nothing
-             }
-         }
-
-
-         // Wait for the panel to initialize
-         // (happens in a separate thread)
-         Applet a;
-
-         // Wait for panel to come alive
-         int maxWait = PluginAppletViewer.APPLET_TIMEOUT; // wait for panel to come alive
-         int wait = 0;
-         while ((panel == null) || (!((NetxPanel) panel).isAlive() && wait < maxWait)) {
-              try {
-                  Thread.sleep(50);
-                  wait += 50;
-              } catch (InterruptedException ie) {
-                  // just wait
-              }
-         }
-
-         // Wait for the panel to initialize
-         // (happens in a separate thread)
-         while (panel.getApplet() == null &&
-                ((NetxPanel) panel).isAlive()) {
-             try {
-                 Thread.sleep(50);
-                 PluginDebug.debug("Waiting for applet to initialize...");
-             } catch (InterruptedException ie) {
-                 // just wait
-             }
-         }
-
-         a = panel.getApplet();
-
-         // Still null?
-         if (panel.getApplet() == null) {
-             streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError " + "Initialization failed");
-             return null;
-         }
-
-         PluginDebug.debug("Applet " + a.getClass() + " initialized");
-         streamhandler.write("instance " + identifier + " reference 0 initialized");
-
-         AppletSecurityContextManager.getSecurityContext(0).associateSrc(((NetxPanel) panel).getAppletClassLoader(), doc);
-         AppletSecurityContextManager.getSecurityContext(0).associateInstance(identifier, ((NetxPanel) panel).getAppletClassLoader());
-
-         return panel;
-     }
-
-     public boolean isStandalone()
-     {
-         return false;
-     }
-
-     /**
-      * Send the initial set of events to the appletviewer event queue.
-      * On start-up the current behaviour is to load the applet and call
-      * Applet.init() and Applet.start().
-      */
-     private void initEventQueue(AppletPanel panel) {
-         // appletviewer.send.event is an undocumented and unsupported system
-         // property which is used exclusively for testing purposes.
-         PrivilegedAction pa = new PrivilegedAction() {
-             public Object run() {
-                 return System.getProperty("appletviewer.send.event");
-             }
-         };
-         String eventList = (String) AccessController.doPrivileged(pa);
-
-         if (eventList == null) {
-             // Add the standard events onto the event queue.
-             panel.sendEvent(AppletPanel.APPLET_LOAD);
-             panel.sendEvent(AppletPanel.APPLET_INIT);
-             panel.sendEvent(AppletPanel.APPLET_START);
-         } else {
-             // We're testing AppletViewer.  Force the specified set of events
-             // onto the event queue, wait for the events to be processed, and
-             // exit.
-
-             // The list of events that will be executed is provided as a
-             // ","-separated list.  No error-checking will be done on the list.
-             String [] events = splitSeparator(",", eventList);
-
-             for (int i = 0; i < events.length; i++) {
-                 PluginDebug.debug("Adding event to queue: " + events[i]);
-                 if (events[i].equals("dispose"))
-                     panel.sendEvent(AppletPanel.APPLET_DISPOSE);
-                 else if (events[i].equals("load"))
-                     panel.sendEvent(AppletPanel.APPLET_LOAD);
-                 else if (events[i].equals("init"))
-                     panel.sendEvent(AppletPanel.APPLET_INIT);
-                 else if (events[i].equals("start"))
-                     panel.sendEvent(AppletPanel.APPLET_START);
-                 else if (events[i].equals("stop"))
-                     panel.sendEvent(AppletPanel.APPLET_STOP);
-                 else if (events[i].equals("destroy"))
-                     panel.sendEvent(AppletPanel.APPLET_DESTROY);
-                 else if (events[i].equals("quit"))
-                     panel.sendEvent(AppletPanel.APPLET_QUIT);
-                 else if (events[i].equals("error"))
-                     panel.sendEvent(AppletPanel.APPLET_ERROR);
-                 else
-                     // non-fatal error if we get an unrecognized event
-                     PluginDebug.debug("Unrecognized event name: " + events[i]);
-             }
-
-             while (!panel.emptyEventQueue()) ;
-         }
-     }
-
-
-     /**
-      * Split a string based on the presence of a specified separator.  Returns
-      * an array of arbitrary length.  The end of each element in the array is
-      * indicated by the separator of the end of the string.  If there is a
-      * separator immediately before the end of the string, the final element
-      * will be empty.  None of the strings will contain the separator.  Useful
-      * when separating strings such as "foo/bar/bas" using separator "/".
-      *
-      * @param sep  The separator.
-      * @param s    The string to split.
-      * @return     An array of strings.  Each string in the array is determined
-      *             by the location of the provided sep in the original string,
-      *             s.  Whitespace not stripped.
-      */
-     private String [] splitSeparator(String sep, String s) {
-         Vector v = new Vector();
-         int tokenStart = 0;
-         int tokenEnd   = 0;
-
-         while ((tokenEnd = s.indexOf(sep, tokenStart)) != -1) {
-             v.addElement(s.substring(tokenStart, tokenEnd));
-             tokenStart = tokenEnd+1;
-         }
-         // Add the final element.
-         v.addElement(s.substring(tokenStart));
-
-         String [] retVal = new String[v.size()];
-         v.copyInto(retVal);
-         return retVal;
-     }
- }
-
- class PluginParseRequest
- {
-     long handle;
-     String tag;
-     String documentbase;
- }
-
- /*
-  */
- // FIXME: declare JSProxy implementation
- public class PluginAppletViewer extends XEmbeddedFrame
-     implements AppletContext, Printable {
-     /**
-      * Some constants...
-      */
-     private static String defaultSaveFile = "Applet.ser";
-
-     private static enum PAV_INIT_STATUS {PRE_INIT, IN_INIT, INIT_COMPLETE, INACTIVE};
-
-     /**
-      * The panel in which the applet is being displayed.
-      */
-     AppletViewerPanel panel;
-
-     /**
-      * The status line.
-      */
-     Label label;
-
-     /**
-      * output status messages to this stream
-      */
-
-     PrintStream statusMsgStream;
-
-     int identifier;
-
-     private static HashMap<Integer, PluginParseRequest> requests =
-         new HashMap();
-
-     // Instance identifier -> PluginAppletViewer object.
-     private static HashMap<Integer, PluginAppletViewer> applets =
-         new HashMap();
-
-     private static PluginStreamHandler streamhandler;
-
-     private static PluginCallRequestFactory requestFactory;
-
-     private static HashMap<Integer, PAV_INIT_STATUS> status =
-         new HashMap<Integer,PAV_INIT_STATUS>();
-
-     private double proposedHeightFactor;
-     private double proposedWidthFactor;
-
-     private long handle = 0;
-     private WindowListener windowEventListener = null;
-     private AppletEventListener appletEventListener = null;
-
-     public static final int APPLET_TIMEOUT = 60000;
-
-     private static Long requestIdentityCounter = 0L;
-
-     /**
-      * Null constructor to allow instantiation via newInstance()
-      */
-     public PluginAppletViewer() {
-     }
-
-     public static void reFrame(PluginAppletViewer oldFrame,
-                         int identifier, PrintStream statusMsgStream,
-                         double heightFactor, double widthFactor, long handle,
-                         AppletViewerPanel panel) {
-
-         PluginDebug.debug("Reframing " + panel);
-
-         // SecurityManager MUST be set, and only privileged code may call reFrame()
-         System.getSecurityManager().checkPermission(new AllPermission());
-
-         // Same handle => nothing to do
-         if (oldFrame != null && handle == oldFrame.handle)
-             return;
-
-         PluginAppletViewer newFrame = new PluginAppletViewer(handle, identifier, statusMsgStream, heightFactor, widthFactor, panel);
-
-         if (oldFrame != null) {
-             applets.remove(oldFrame.identifier);
-             oldFrame.removeWindowListener(oldFrame.windowEventListener);
-             panel.removeAppletListener(oldFrame.appletEventListener);
-             oldFrame.remove(panel);
-             oldFrame.dispose();
-         }
-
-         newFrame.add("Center", panel);
-         newFrame.pack();
-
-         newFrame.appletEventListener = new AppletEventListener(newFrame, newFrame);
-         panel.addAppletListener(newFrame.appletEventListener);
-
-         applets.put(identifier, newFrame);
-
-         // dispose oldframe if necessary
-         if (oldFrame != null) {
-             oldFrame.dispose();
-         }
-
-         PluginDebug.debug(panel + " reframed");
-     }
-
-     /**
-      * Create new plugin appletviewer frame
-      */
-     private PluginAppletViewer(long handle, final int identifier,
-                                PrintStream statusMsgStream, double heightFactor,
-                                double widthFactor, AppletViewerPanel appletPanel) {
-
-         super(handle, true);
-         this.statusMsgStream = statusMsgStream;
-         this.identifier = identifier;
-         this.proposedHeightFactor = heightFactor;
-         this.proposedWidthFactor = widthFactor;
-         this.panel = appletPanel;
-
-        if (!appletPanels.contains(panel))
-             appletPanels.addElement(panel);
-
-         windowEventListener = new WindowAdapter() {
-
-             public void windowClosing(WindowEvent evt) {
-                 appletClose();
-             }
-
-             public void windowIconified(WindowEvent evt) {
-                 appletStop();
-             }
-
-             public void windowDeiconified(WindowEvent evt) {
-                 appletStart();
-             }
-         };
-
-         addWindowListener(windowEventListener);
-
-     }
-
-     private static class AppletEventListener implements AppletListener
-     {
-         final Frame frame;
-         final PluginAppletViewer appletViewer;
-
-         public AppletEventListener(Frame frame, PluginAppletViewer appletViewer)
-         {
-           this.frame = frame;
-           this.appletViewer = appletViewer;
-         }
-
-         public void appletStateChanged(AppletEvent evt)
-         {
-         AppletPanel src = (AppletPanel)evt.getSource();
-
-         switch (evt.getID()) {
-                      case AppletPanel.APPLET_RESIZE: {
-             if(src != null) {
-                 appletViewer.resize(appletViewer.preferredSize());
-                 appletViewer.validate();
-                          }
-             break;
-             }
-             case AppletPanel.APPLET_LOADING_COMPLETED: {
-             Applet a = src.getApplet(); // sun.applet.AppletPanel
-
-             // Fixed #4754451: Applet can have methods running on main
-             // thread event queue.
-             //
-             // The cause of this bug is that the frame of the applet
-             // is created in main thread group. Thus, when certain
-             // AWT/Swing events are generated, the events will be
-             // dispatched through the wrong event dispatch thread.
-             //
-             // To fix this, we rearrange the AppContext with the frame,
-             // so the proper event queue will be looked up.
-             //
-             // Swing also maintains a Frame list for the AppContext,
-             // so we will have to rearrange it as well.
-             //
-             if (a != null)
-                 AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a));
-             else
-                 AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext());
-
-             status.put(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE);
-
-             break;
-             }
-         }
-         }
-     }
-
-    public static void setStreamhandler(PluginStreamHandler sh) {
-        streamhandler = sh;
-    }
-
-    public static void setPluginCallRequestFactory(PluginCallRequestFactory rf) {
-        requestFactory = rf;
-    }
-
-     /**
-      * Handle an incoming message from the plugin.
-      */
-     public static void handleMessage(int identifier, int reference, String message)
-     {
-
-                 PluginDebug.debug("PAV handling: " + message);
-
-         try {
-                 if (message.startsWith("tag")) {
-
-                         // tag and handle must both be set before parsing, so we need
-                         // synchronization here, as the setting of these variables
-                         // may happen in independent threads
-
-                         synchronized(requests) {
-
-                     // Check if we should proceed with init
-                     // (=> no if destroy was called after tag, but before
-                     // handle)
-                     if (status.containsKey(identifier) &&
-                         status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) {
-
-                         PluginDebug.debug("Inactive flag set. Refusing to initialize instance " + identifier);
-                         requests.remove(identifier);
-                         return;
-
-                     }
-
-                     status.put(identifier, PAV_INIT_STATUS.PRE_INIT);
-
-                     PluginParseRequest request = requests.get(identifier);
-                     if (request == null) {
-                         request = new PluginParseRequest();
-                         requests.put(identifier, request);
-                     }
-                     int index = message.indexOf(' ', "tag".length() + 1);
-                     request.documentbase =
-                         UrlUtil.decode(message.substring("tag".length() + 1, index));
-                     request.tag = message.substring(index + 1);
-                     PluginDebug.debug ("REQUEST TAG: " + request.tag + " " +
-                             Thread.currentThread());
-
-                         PluginDebug.debug ("REQUEST TAG, PARSING " +
-                                 Thread.currentThread());
-                         PluginAppletViewer.parse
-                         (identifier, request.handle,
-                                 new StringReader(request.tag),
-                                 new URL(request.documentbase));
-                         requests.remove(identifier);
-
-                         // Panel initialization cannot be aborted mid-way.
-                         // Once it is initialized, double check to see if this
-                         // panel needs to stay around..
-                         if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) {
-                             PluginDebug.debug("Inactive flag set. Destroying applet instance " + identifier);
-                             applets.get(identifier).handleMessage(-1, "destroy");
-                         }
-                 }
-
-             } else {
-                 PluginDebug.debug ("Handling message: " + message + " instance " + identifier + " " + Thread.currentThread());
-
-                 // Destroy may be called while initialization is still going
-                 // on. We therefore special case it.
-                 if (!applets.containsKey(identifier) && message.equals("destroy")) {
-
-                     // Set the status to inactive right away. Doesn't matter if it
-                     // gets clobbered during init. due to a race. That is what the
-                     // double check below is for.
-                     PluginDebug.debug("Destroy called during initialization. Delaying destruction.");
-                     status.put(identifier, PAV_INIT_STATUS.INACTIVE);
-
-                     // We have set the flags. We now lock what stage 1 and 2
-                     // lock on, and force a synchronous status check+action.
-                     synchronized (requests) {
-                         // re-check (inside lock) if the applet is
-                         // initialized at this point.
-                         if (applets.containsKey(identifier)) {
-                             PluginDebug.debug("Init done. destroying normally.");
-                             applets.get(identifier).handleMessage(reference, message);
-                         } else {
-                         }
-                     } // unlock
-
-                     // we're done here
-                     return;
-                 }
-
-                 // For messages other than destroy, wait till initialization finishes
-                 while (!applets.containsKey(identifier) &&
-                         (
-                           !status.containsKey(identifier) ||
-                            status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT)
-                         )
-                        );
-
-                 // don't bother processing further for inactive applets
-                 if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE))
-                     return;
-
-                 if (message.startsWith("handle")) {
-
-                     PluginDebug.debug("handle command waiting for applet to complete loading.");
-                     int maxWait = APPLET_TIMEOUT; // wait for applet to fully load
-                     int wait = 0;
-                     while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) &&
-                             (wait < maxWait)) {
-
-                          try {
-                              Thread.sleep(50);
-                              wait += 50;
-                          } catch (InterruptedException ie) {
-                              // just wait
-                          }
-                     }
-
-                     if (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE))
-                         throw new Exception("Applet initialization timeout");
-
-                     PluginDebug.debug("Applet loading complete. Proceeding to reframe.");
-                     long handle = Long.parseLong
-                     (message.substring("handle".length() + 1));
-
-                     PluginAppletViewer oldFrame = applets.get(identifier);
-                     reFrame(oldFrame, oldFrame.identifier, oldFrame.statusMsgStream,
-                             oldFrame.proposedHeightFactor, oldFrame.proposedWidthFactor,
-                             handle, oldFrame.panel);
-
-                 } else {
-                     applets.get(identifier).handleMessage(reference, message);
-                 }
-             }
-         } catch (Exception e) {
-
-             e.printStackTrace();
-
-             // If an exception happened during pre-init, we need to update status
-             if (status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT))
-                 status.put(identifier, PAV_INIT_STATUS.INACTIVE);
-
-             throw new RuntimeException("Failed to handle message: " +
-                     message + " for instance " + identifier, e);
-         }
-     }
-
-     public void handleMessage(int reference, String message)
-     {
-         if (message.startsWith("width")) {
-
-             // Wait for panel to come alive
-             int maxWait = APPLET_TIMEOUT; // wait for panel to come alive
-             int wait = 0;
-             while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) {
-                  try {
-                      Thread.sleep(50);
-                      wait += 50;
-                  } catch (InterruptedException ie) {
-                      // just wait
-                  }
-             }
-
-             // 0 => width, 1=> width_value, 2 => height, 3=> height_value
-             String[] dimMsg = message.split(" ");
-
-             final int height = (int) (proposedHeightFactor*Integer.parseInt(dimMsg[3]));
-             final int width = (int) (proposedWidthFactor*Integer.parseInt(dimMsg[1]));
-
-             if (panel instanceof NetxPanel)
-                 ((NetxPanel) panel).updateSizeInAtts(height, width);
-
-             try {
-                SwingUtilities.invokeAndWait(new Runnable() {
-                     public void run() {
-
-                         setSize(width, height);
-
-                         // There is a rather odd drawing bug whereby resizing
-                         // the panel makes no difference on initial call
-                         // because the panel thinks that it is already the
-                         // right size. Validation has no effect there either.
-                         // So we work around by setting size to 1, validating,
-                         // and then setting to the right size and validating
-                         // again. This is not very efficient, and there is
-                         // probably a better way -- but resizing happens
-                         // quite infrequently, so for now this is how we do it
-
-                         panel.setSize(1,1);
-                         panel.validate();
-
-                                         panel.setSize(width, height);
-                                         panel.validate();
-                                         }
-                                 });
-                        } catch (InterruptedException e) {
-                                // do nothing
-                                e.printStackTrace();
-                        } catch (InvocationTargetException e) {
-                                // do nothing
-                                e.printStackTrace();
-                        }
-
-         } else if (message.startsWith("destroy")) {
-             dispose();
-             status.put(identifier, PAV_INIT_STATUS.INACTIVE);
-         } else if (message.startsWith("GetJavaObject")) {
-
-             // FIXME: how do we determine what security context this
-             // object should belong to?
-             Object o;
-
-             // Wait for panel to come alive
-             int maxWait = APPLET_TIMEOUT; // wait for panel to come alive
-             int wait = 0;
-             while ((panel == null) || (!((NetxPanel) panel).isAlive() && wait < maxWait)) {
-                  try {
-                      Thread.sleep(50);
-                      wait += 50;
-                  } catch (InterruptedException ie) {
-                      // just wait
-                  }
-             }
-
-             // Wait for the panel to initialize
-             // (happens in a separate thread)
-             while (panel.getApplet() == null &&
-                    ((NetxPanel) panel).isAlive()) {
-                 try {
-                     Thread.sleep(50);
-                     PluginDebug.debug("Waiting for applet to initialize...");
-                 } catch (InterruptedException ie) {
-                     // just wait
-                 }
-             }
-
-             PluginDebug.debug(panel + " -- " + panel.getApplet() + " -- " + ((NetxPanel) panel).isAlive());
-
-             // Still null?
-             if (panel.getApplet() == null) {
-                 this.streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError " + "Initialization failed");
-                 return;
-             }
-
-             o = panel.getApplet();
-             PluginDebug.debug ("Looking for object " + o + " panel is " + panel);
-             AppletSecurityContextManager.getSecurityContext(0).store(o);
-             PluginDebug.debug ("WRITING 1: " + "context 0 reference " + reference + " GetJavaObject "
-                                 + AppletSecurityContextManager.getSecurityContext(0).getIdentifier(o));
-             streamhandler.write("context 0 reference " + reference + " GetJavaObject "
-                              + AppletSecurityContextManager.getSecurityContext(0).getIdentifier(o));
-             PluginDebug.debug ("WRITING 1 DONE");
-         }
-     }
-
-     // FIXME: Kind of hackish way to ensure synchronized re-drawing
-     private synchronized void forceredraw() {
-         doLayout();
-     }
-
-     /*
-      * Methods for java.applet.AppletContext
-      */
-
-     private static Map audioClips = new HashMap();
-
-     /**
-      * Get an audio clip.
-      */
-     public AudioClip getAudioClip(URL url) {
-        checkConnect(url);
-        synchronized (audioClips) {
-            AudioClip clip = (AudioClip)audioClips.get(url);
-            if (clip == null) {
-                audioClips.put(url, clip = new AppletAudioClip(url));
-            }
-            return clip;
-        }
-     }
-
-     private static Map imageRefs = new HashMap();
-
-     /**
-      * Get an image.
-      */
-     public Image getImage(URL url) {
-        return getCachedImage(url);
-     }
-
-     private Image getCachedImage(URL url) {
-        // System.getSecurityManager().checkConnection(url.getHost(), url.getPort());
-        return (Image)getCachedImageRef(url).get();
-     }
-
-     /**
-      * Get an image ref.
-      */
-     private synchronized Ref getCachedImageRef(URL url) {
-         PluginDebug.debug("getCachedImageRef() searching for " + url);
-
-         try {
-
-             String originalURL = url.toString();
-             String codeBase = panel.getCodeBase().toString();
-
-             if (originalURL.startsWith(codeBase)) {
-
-                 PluginDebug.debug("getCachedImageRef() got URL = " + url);
-                 PluginDebug.debug("getCachedImageRef() plugin codebase = " + codeBase);
-
-                 // try to fetch it locally
-                 if (panel instanceof NetxPanel) {
-
-                     URL localURL = null;
-
-                     String resourceName = originalURL.substring(codeBase.length());
-                     JNLPClassLoader loader = (JNLPClassLoader) ((NetxPanel) panel).getAppletClassLoader();
-
-                     if (loader.resourceAvailableLocally(resourceName))
-                         localURL = loader.getResource(resourceName);
-
-                     url = localURL != null ? localURL : url;
-                 }
-             }
-
-             PluginDebug.debug("getCachedImageRef() getting img from URL = " + url);
-
-             synchronized (imageRefs) {
-                 AppletImageRef ref = (AppletImageRef)imageRefs.get(url);
-                 if (ref == null) {
-                     ref = new AppletImageRef(url);
-                     imageRefs.put(url, ref);
-                 }
-                 return ref;
-             }
-         } catch (Exception e) {
-             System.err.println("Error occurred when trying to fetch image:");
-             e.printStackTrace();
-             return null;
-         }
-     }
-
-     /**
-      * Flush the image cache.
-      */
-     static void flushImageCache() {
-        imageRefs.clear();
-     }
-
-     static Vector appletPanels = new Vector();
-
-     /**
-      * Get an applet by name.
-      */
-     public Applet getApplet(String name) {
-        name = name.toLowerCase();
-        SocketPermission panelSp =
-            new SocketPermission(panel.getCodeBase().getHost(), "connect");
-        for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
-            AppletPanel p = (AppletPanel)e.nextElement();
-            String param = p.getParameter("name");
-            if (param != null) {
-                param = param.toLowerCase();
-            }
-            if (name.equals(param) &&
-                p.getDocumentBase().equals(panel.getDocumentBase())) {
-
-                SocketPermission sp =
-                    new SocketPermission(p.getCodeBase().getHost(), "connect");
-
-                if (panelSp.implies(sp)) {
-                    return p.applet;
-                }
-            }
-        }
-        return null;
-     }
-
-     /**
-      * Return an enumeration of all the accessible
-      * applets on this page.
-      */
-     public Enumeration getApplets() {
-        Vector v = new Vector();
-        SocketPermission panelSp =
-            new SocketPermission(panel.getCodeBase().getHost(), "connect");
-
-        for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
-            AppletPanel p = (AppletPanel)e.nextElement();
-            if (p.getDocumentBase().equals(panel.getDocumentBase())) {
-
-                SocketPermission sp =
-                    new SocketPermission(p.getCodeBase().getHost(), "connect");
-                if (panelSp.implies(sp)) {
-                    v.addElement(p.applet);
-                }
-            }
-        }
-        return v.elements();
-     }
-
-     /**
-      * Ignore.
-      */
-     public void showDocument(URL url) {
-         PluginDebug.debug("Showing document...");
-        showDocument(url, "_self");
-     }
-
-     /**
-      * Ignore.
-      */
-     public void showDocument(URL url, String target) {
-        try {
-             // FIXME: change to postCallRequest
-            write("url " + UrlUtil.encode(url.toString(), "UTF-8") + " " + target);
-        } catch (IOException exception) {
-            // Deliberately ignore IOException.  showDocument may be
-            // called from threads other than the main thread after
-            // streamhandler.pluginOutputStream has been closed.
-        }
-     }
-
-     /**
-      * Show status.
-      */
-     public void showStatus(String status) {
-        try {
-             // FIXME: change to postCallRequest
-                // For statuses, we cannot have a newline
-            status = status.replace("\n", " ");
-            write("status " + status);
-        } catch (IOException exception) {
-            // Deliberately ignore IOException.  showStatus may be
-            // called from threads other than the main thread after
-            // streamhandler.pluginOutputStream has been closed.
-        }
-     }
-
-     /**
-      * Returns an incremental number (unique identifier) for a message.
-      * If identifier hits Long.MAX_VALUE it loops back starting at 0.
-      *
-      *  @return A unique Long identifier for the request
-      */
-     private static Long getRequestIdentifier() {
-         synchronized (requestIdentityCounter) {
-
-             if (requestIdentityCounter == Long.MAX_VALUE)
-                 requestIdentityCounter = 0L;
-
-             return requestIdentityCounter++;
-        }
-     }
-
-     public long getWindow() {
-         PluginDebug.debug ("STARTING getWindow");
-         Long reference = getRequestIdentifier();
-
-         PluginCallRequest request = requestFactory.getPluginCallRequest("window",
-             "instance " + identifier + " reference " +
-             + reference + " " + "GetWindow", reference);
-
-         PluginDebug.debug ("STARTING postCallRequest");
-                 streamhandler.postCallRequest(request);
-         PluginDebug.debug ("STARTING postCallRequest done");
-         streamhandler.write(request.getMessage());
-         try {
-                 PluginDebug.debug ("wait request 1");
-                 synchronized(request) {
-                         PluginDebug.debug ("wait request 2");
-                         while ((Long) request.getObject() == 0)
-                                 request.wait();
-                         PluginDebug.debug ("wait request 3");
-                 }
-         } catch (InterruptedException e) {
-                 throw new RuntimeException("Interrupted waiting for call request.",
-                                 e);
-         }
-
-         PluginDebug.debug ("STARTING getWindow DONE");
-         return (Long) request.getObject();
-     }
-
-     // FIXME: make private, access via reflection.
-     public static Object getMember(long internal, String name)
-     {
-         AppletSecurityContextManager.getSecurityContext(0).store(name);
-         int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
-         Long reference = getRequestIdentifier();
-
-         // Prefix with dummy instance for convenience.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("member",
-             "instance " + 0 + " reference " + reference + " GetMember " +
-             internal + " " + nameID, reference);
-
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait getMEM request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait getMEM request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait getMEM request 3 GOT: " + request.getObject().getClass());
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" getMember DONE");
-         return request.getObject();
-     }
-
-     public static void setMember(long internal, String name, Object value) {
-         System.err.println("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive());
-         AppletSecurityContextManager.getSecurityContext(0).store(name);
-         int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
-         Long reference = getRequestIdentifier();
-
-         // work on a copy of value, as we don't want to be manipulating
-         // complex objects
-         String valueToSetTo;
-         if (value instanceof java.lang.Byte ||
-             value instanceof java.lang.Character ||
-             value instanceof java.lang.Short ||
-             value instanceof java.lang.Integer ||
-             value instanceof java.lang.Long ||
-             value instanceof java.lang.Float ||
-             value instanceof java.lang.Double ||
-             value instanceof java.lang.Boolean) {
-
-             valueToSetTo = "literalreturn " + value.toString();
-
-             // Character -> Str results in str value.. we need int value as
-             // per specs.
-             if (value instanceof java.lang.Character) {
-                 valueToSetTo = "literalreturn " + (int) ((java.lang.Character) value).charValue();
-             } else if (value instanceof Float ||
-                        value instanceof Double) {
-                 valueToSetTo = "literalreturn " + String.format("%308.308e", value);
-             }
-
-         } else {
-             AppletSecurityContextManager.getSecurityContext(0).store(value);
-             valueToSetTo = Integer.toString(AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value));
-         }
-
-         // Prefix with dummy instance for convenience.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("void",
-             "instance " + 0 + " reference " + reference + " SetMember " +
-             internal + " " + nameID + " " + valueToSetTo, reference);
-
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait setMem request: " + request.getMessage());
-             PluginDebug.debug ("wait setMem request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait setMem request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait setMem request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" setMember DONE");
-     }
-
-     // FIXME: handle long index as well.
-     public static void setSlot(long internal, int index, Object value) {
-         AppletSecurityContextManager.getSecurityContext(0).store(value);
-         Long reference = getRequestIdentifier();
-
-         // work on a copy of value, as we don't want to be manipulating
-         // complex objects
-         String valueToSetTo;
-         if (value instanceof java.lang.Byte ||
-             value instanceof java.lang.Character ||
-             value instanceof java.lang.Short ||
-             value instanceof java.lang.Integer ||
-             value instanceof java.lang.Long ||
-             value instanceof java.lang.Float ||
-             value instanceof java.lang.Double ||
-             value instanceof java.lang.Boolean) {
-
-             valueToSetTo = "literalreturn " + value.toString();
-
-             // Character -> Str results in str value.. we need int value as
-             // per specs.
-             if (value instanceof java.lang.Character) {
-                 valueToSetTo = "literalreturn " + (int) ((java.lang.Character) value).charValue();
-             } else if (value instanceof Float ||
-                        value instanceof Double) {
-                 valueToSetTo = "literalreturn " + String.format("%308.308e", value);
-             }
-
-         } else {
-             AppletSecurityContextManager.getSecurityContext(0).store(value);
-             valueToSetTo = Integer.toString(AppletSecurityContextManager.getSecurityContext(0).getIdentifier(value));
-         }
-
-         // Prefix with dummy instance for convenience.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("void",
-             "instance " + 0 + " reference " + reference + " SetSlot " +
-             internal + " " + index + " " + valueToSetTo, reference);
-
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait setSlot request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait setSlot request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait setSlot request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" setSlot DONE");
-     }
-
-     public static Object getSlot(long internal, int index)
-     {
-         Long reference = getRequestIdentifier();
-
-         // Prefix with dummy instance for convenience.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("member",
-             "instance " + 0 + " reference " + reference + " GetSlot " +
-             internal + " " + index, reference);
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait getSlot request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait getSlot request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait getSlot request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" getSlot DONE");
-         return request.getObject();
-     }
-
-     public static Object eval(long internal, String s)
-     {
-         AppletSecurityContextManager.getSecurityContext(0).store(s);
-         int stringID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(s);
-         Long reference = getRequestIdentifier();
-
-         // Prefix with dummy instance for convenience.
-         // FIXME: rename GetMemberPluginCallRequest ObjectPluginCallRequest.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("member",
-             "instance " + 0 + " reference " + reference + " Eval " +
-             internal + " " + stringID, reference);
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait eval request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait eval request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait eval request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" getSlot DONE");
-         return request.getObject();
-     }
-
-     public static void removeMember (long internal, String name) {
-         AppletSecurityContextManager.getSecurityContext(0).store(name);
-         int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
-         Long reference = getRequestIdentifier();
-
-         // Prefix with dummy instance for convenience.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("void",
-             "instance " + 0 + " reference " + reference + " RemoveMember " +
-             internal + " " + nameID, reference);
-
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait removeMember request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait removeMember request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait removeMember request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" RemoveMember DONE");
-     }
-
-     public static Object call(long internal, String name, Object args[])
-     {
-         // FIXME: when is this removed from the object store?
-         // FIXME: reference should return the ID.
-         // FIXME: convenience method for this long line.
-         AppletSecurityContextManager.getSecurityContext(0).store(name);
-         int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name);
-         Long reference = getRequestIdentifier();
-
-         String argIDs = "";
-         for (Object arg : args)
-         {
-             AppletSecurityContextManager.getSecurityContext(0).store(arg);
-             argIDs += AppletSecurityContextManager.getSecurityContext(0).getIdentifier(arg) + " ";
-         }
-         argIDs = argIDs.trim();
-
-         // Prefix with dummy instance for convenience.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("member",
-             "instance " + 0 + " reference " + reference + " Call " +
-             internal + " " + nameID + " " + argIDs, reference);
-
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait call request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait call request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait call request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" Call DONE");
-         return request.getObject();
-     }
-
-     public static Object requestPluginCookieInfo(URI uri) {
-
-         PluginCallRequest request;
-         Long reference = getRequestIdentifier();
-
-         try
-         {
-             String encodedURI = UrlUtil.encode(uri.toString(), "UTF-8");
-             request = requestFactory.getPluginCallRequest("cookieinfo",
-                 "plugin PluginCookieInfo " + "reference " + reference +
-                 " " + encodedURI, reference);
-
-         } catch (UnsupportedEncodingException e)
-         {
-             e.printStackTrace();
-             return null;
-         }
-
-         PluginMessageConsumer.registerPriorityWait(reference);
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait cookieinfo request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait cookieinfo request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait cookieinfo request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for cookieinfo request.",
-                                        e);
-         }
-         PluginDebug.debug (" Cookieinfo DONE");
-         return request.getObject();
-     }
-
-     public static Object requestPluginProxyInfo(URI uri) {
-
-         String requestURI = null;
-         Long reference = getRequestIdentifier();
-
-         try {
-
-             // there is no easy way to get SOCKS proxy info. So, we tell mozilla that we want proxy for
-             // an HTTP uri in case of non http/ftp protocols. If we get back a SOCKS proxy, we can
-             // use that, if we get back an http proxy, we fallback to DIRECT connect
-
-             String scheme = uri.getScheme();
-             String port = uri.getPort() != -1 ? ":" + uri.getPort() : "";
-             if (!uri.getScheme().startsWith("http") && !uri.getScheme().equals("ftp"))
-                 scheme = "http";
-
-             requestURI = UrlUtil.encode(scheme + "://" + uri.getHost() + port + "/" + uri.getPath(), "UTF-8");
-         } catch (Exception e) {
-             PluginDebug.debug("Cannot construct URL from " + uri.toString() + " ... falling back to DIRECT proxy");
-             e.printStackTrace();
-             return null;
-         }
-
-         PluginCallRequest request = requestFactory.getPluginCallRequest("proxyinfo",
-             "plugin PluginProxyInfo reference " + reference + " " +
-             requestURI, reference);
-
-         PluginMessageConsumer.registerPriorityWait(reference);
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait call request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait call request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait call request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" Call DONE");
-         return request.getObject();
-     }
-
-     public static void JavaScriptFinalize(long internal)
-     {
-         Long reference = getRequestIdentifier();
-
-         // Prefix with dummy instance for convenience.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("void",
-             "instance " + 0 + " reference " + reference + " Finalize " +
-             internal, reference);
-
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait finalize request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait finalize request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait finalize request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" finalize DONE");
-     }
-
-     public static String javascriptToString(long internal)
-     {
-         Long reference = getRequestIdentifier();
-
-         // Prefix with dummy instance for convenience.
-         PluginCallRequest request = requestFactory.getPluginCallRequest("member",
-             "instance " + 0 + " reference " + reference + " ToString " +
-             internal, reference);
-
-         streamhandler.postCallRequest(request);
-         streamhandler.write(request.getMessage());
-         try {
-             PluginDebug.debug ("wait ToString request 1");
-             synchronized(request) {
-                 PluginDebug.debug ("wait ToString request 2");
-                 while (request.isDone() == false)
-                     request.wait();
-                 PluginDebug.debug ("wait ToString request 3");
-             }
-         } catch (InterruptedException e) {
-             throw new RuntimeException("Interrupted waiting for call request.",
-                                        e);
-         }
-         PluginDebug.debug (" ToString DONE");
-         return (String) request.getObject();
-     }
-
-     // FIXME: make this private and access it from JSObject using
-     // reflection.
-     private void write(String message) throws IOException {
-         PluginDebug.debug ("WRITING 2: " + "instance " + identifier + " " + message);
-         streamhandler.write("instance " + identifier + " " + message);
-         PluginDebug.debug ("WRITING 2 DONE");
-     }
-
-     public void setStream(String key, InputStream stream)throws IOException{
-        // We do nothing.
-     }
-
-     public InputStream getStream(String key){
-        // We do nothing.
-        return null;
-     }
-
-     public Iterator getStreamKeys(){
-        // We do nothing.
-        return null;
-     }
-
-     /**
-      * System parameters.
-      */
-     static Hashtable systemParam = new Hashtable();
-
-     static {
-        systemParam.put("codebase", "codebase");
-        systemParam.put("code", "code");
-        systemParam.put("alt", "alt");
-        systemParam.put("width", "width");
-        systemParam.put("height", "height");
-        systemParam.put("align", "align");
-        systemParam.put("vspace", "vspace");
-        systemParam.put("hspace", "hspace");
-     }
-
-     /**
-      * Print the HTML tag.
-      */
-     public static void printTag(PrintStream out, Hashtable atts) {
-        out.print("<applet");
-
-        String v = (String)atts.get("codebase");
-        if (v != null) {
-            out.print(" codebase=\"" + v + "\"");
-        }
-
-        v = (String)atts.get("code");
-        if (v == null) {
-            v = "applet.class";
-        }
-        out.print(" code=\"" + v + "\"");
-        v = (String)atts.get("width");
-        if (v == null) {
-            v = "150";
-        }
-        out.print(" width=" + v);
-
-        v = (String)atts.get("height");
-        if (v == null) {
-            v = "100";
-        }
-        out.print(" height=" + v);
-
-        v = (String)atts.get("name");
-        if (v != null) {
-            out.print(" name=\"" + v + "\"");
-        }
-        out.println(">");
-
-        // A very slow sorting algorithm
-        int len = atts.size();
-        String params[] = new String[len];
-        len = 0;
-        for (Enumeration e = atts.keys() ; e.hasMoreElements() ;) {
-            String param = (String)e.nextElement();
-            int i = 0;
-            for (; i < len ; i++) {
-                if (params[i].compareTo(param) >= 0) {
-                    break;
-                }
-            }
-            System.arraycopy(params, i, params, i + 1, len - i);
-            params[i] = param;
-            len++;
-        }
-
-        for (int i = 0 ; i < len ; i++) {
-            String param = params[i];
-            if (systemParam.get(param) == null) {
-                out.println("<param name=" + param +
-                            " value=\"" + atts.get(param) + "\">");
-            }
-        }
-        out.println("</applet>");
-     }
-
-     /**
-      * Make sure the atrributes are uptodate.
-      */
-     public void updateAtts() {
-        Dimension d = panel.size();
-        Insets in = panel.insets();
-        panel.atts.put("width",
-                       new Integer(d.width - (in.left + in.right)).toString());
-        panel.atts.put("height",
-                       new Integer(d.height - (in.top + in.bottom)).toString());
-     }
-
-     /**
-      * Restart the applet.
-      */
-     void appletRestart() {
-        panel.sendEvent(AppletPanel.APPLET_STOP);
-        panel.sendEvent(AppletPanel.APPLET_DESTROY);
-        panel.sendEvent(AppletPanel.APPLET_INIT);
-        panel.sendEvent(AppletPanel.APPLET_START);
-     }
-
-     /**
-      * Reload the applet.
-      */
-     void appletReload() {
-        panel.sendEvent(AppletPanel.APPLET_STOP);
-        panel.sendEvent(AppletPanel.APPLET_DESTROY);
-        panel.sendEvent(AppletPanel.APPLET_DISPOSE);
-
-        /**
-         * Fixed #4501142: Classlaoder sharing policy doesn't
-         * take "archive" into account. This will be overridden
-         * by Java Plug-in.                     [stanleyh]
-         */
-        AppletPanel.flushClassLoader(panel.getClassLoaderCacheKey());
-
-         /*
-          * Make sure we don't have two threads running through the event queue
-          * at the same time.
-          */
-         try {
-             panel.joinAppletThread();
-            panel.release();
-         } catch (InterruptedException e) {
-             return;   // abort the reload
-         }
-
-         AccessController.doPrivileged(new PrivilegedAction() {
-             public Object run() {
-                 panel.createAppletThread();
-                 return null;
-             }
-         });
-
-        panel.sendEvent(AppletPanel.APPLET_LOAD);
-        panel.sendEvent(AppletPanel.APPLET_INIT);
-        panel.sendEvent(AppletPanel.APPLET_START);
-     }
-
-     public int print(Graphics graphics, PageFormat pf, int pageIndex) {
-         return Printable.NO_SUCH_PAGE;
-     }
-
-     /**
-      * Start the applet.
-      */
-     void appletStart() {
-        panel.sendEvent(AppletPanel.APPLET_START);
-     }
-
-     /**
-      * Stop the applet.
-      */
-     void appletStop() {
-        panel.sendEvent(AppletPanel.APPLET_STOP);
-     }
-
-     /**
-      * Shutdown a viewer.
-      * Stop, Destroy, Dispose and Quit a viewer
-      */
-     private void appletShutdown(AppletPanel p) {
-        p.sendEvent(AppletPanel.APPLET_STOP);
-        p.sendEvent(AppletPanel.APPLET_DESTROY);
-        p.sendEvent(AppletPanel.APPLET_DISPOSE);
-        p.sendEvent(AppletPanel.APPLET_QUIT);
-     }
-
-     /**
-      * Close this viewer.
-      * Stop, Destroy, Dispose and Quit an AppletView, then
-      * reclaim resources and exit the program if this is
-      * the last applet.
-      */
-     void appletClose() {
-
-         // The caller thread is event dispatch thread, so
-         // spawn a new thread to avoid blocking the event queue
-         // when calling appletShutdown.
-         //
-         final AppletPanel p = panel;
-
-         new Thread(new Runnable()
-         {
-             public void run()
-             {
-                 ThreadGroup tg = ((JNLPClassLoader) p.applet.getClass().getClassLoader()).getApplication().getThreadGroup();
-
-                 appletShutdown(p);
-                 appletPanels.removeElement(p);
-                 dispose();
-
-                 if (tg.activeCount() > 0)
-                 tg.stop();
-
-                 if (countApplets() == 0) {
-                     appletSystemExit();
-                 }
-             }
-         }).start();
-
-         status.put(identifier, PAV_INIT_STATUS.INACTIVE);
-     }
-
-     /**
-      * Exit the program.
-      * Exit from the program (if not stand alone) - do no clean-up
-      */
-     private void appletSystemExit() {
-         // Do nothing. Exit is handled by another
-         // block of code, called when _all_ applets are gone
-     }
-
-     /**
-      * How many applets are running?
-      */
-
-     public static int countApplets() {
-        return appletPanels.size();
-     }
-
- 
-     /**
-      * The current character.
-      */
-     static int c;
-
-     /**
-      * Scan spaces.
-      */
-     public static void skipSpace(Reader in) throws IOException {
-         while ((c >= 0) &&
-               ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'))) {
-            c = in.read();
-        }
-     }
-
-     /**
-      * Scan identifier
-      */
-     public static String scanIdentifier(Reader in) throws IOException {
-        StringBuffer buf = new StringBuffer();
-
-        if (c == '!') {
-        // Technically, we should be scanning for '!--' but we are reading
-        // from a stream, and there is no way to peek ahead. That said,
-        // a ! at this point can only mean comment here afaik, so we
-        // should be okay
-        skipComment(in);
-        return "";
-    }
-
-        while (true) {
-            if (((c >= 'a') && (c <= 'z')) ||
-                ((c >= 'A') && (c <= 'Z')) ||
-                ((c >= '0') && (c <= '9')) || (c == '_')) {
-                buf.append((char)c);
-                c = in.read();
-            } else {
-                return buf.toString();
-            }
-        }
-     }
-
-     public static void skipComment(Reader in) throws IOException {
-         StringBuffer buf = new StringBuffer();
-         boolean commentHeaderPassed = false;
-         c = in.read();
-         buf.append((char)c);
-
-         while (true) {
-             if (c == '-' && (c = in.read()) == '-') {
-                 buf.append((char)c);
-                 if (commentHeaderPassed) {
-                     // -- encountered ... is > next?
-                     if ((c = in.read()) == '>') {
-                         buf.append((char)c);
-
-                         PluginDebug.debug("Comment skipped: " + buf.toString());
-
-                         // comment skipped.
-                         return;
-                     }
-                 } else {
-                     // first -- is part of <!-- ... , just mark that we have passed it
-                     commentHeaderPassed = true;
-                 }
-
-             } else if (commentHeaderPassed == false) {
-                 buf.append((char)c);
-                 PluginDebug.debug("Warning: Attempted to skip comment, but this tag does not appear to be a comment: " + buf.toString());
-                 return;
-             }
-
-             c = in.read();
-             buf.append((char)c);
-         }
-     }
-
-     /**
-      * Scan tag
-      */
-     public static Hashtable scanTag(Reader in) throws IOException {
-        Hashtable atts = new Hashtable();
-        skipSpace(in);
-         while (c >= 0 && c != '>') {
-            String att = scanIdentifier(in);
-            String val = "";
-            skipSpace(in);
-            if (c == '=') {
-                int quote = -1;
-                c = in.read();
-                skipSpace(in);
-                if ((c == '\'') || (c == '\"')) {
-                    quote = c;
-                    c = in.read();
-                }
-                StringBuffer buf = new StringBuffer();
-                 while ((c > 0) &&
-                       (((quote < 0) && (c != ' ') && (c != '\t') &&
-                          (c != '\n') && (c != '\r') && (c != '>'))
-                        || ((quote >= 0) && (c != quote)))) {
-                    buf.append((char)c);
-                    c = in.read();
-                }
-                if (c == quote) {
-                    c = in.read();
-                }
-                skipSpace(in);
-                val = buf.toString();
-            }
-
-        att = att.replace("&gt;", ">");
-        att = att.replace("&lt;", "<");
-        att = att.replace("&amp;", "&");
-        att = att.replace("&#10;", "\n");
-        att = att.replace("&#13;", "\r");
-
-        val = val.replace("&gt;", ">");
-        val = val.replace("&lt;", "<");
-        val = val.replace("&amp;", "&");
-        val = val.replace("&#10;", "\n");
-        val = val.replace("&#13;", "\r");
-
-        PluginDebug.debug("PUT " + att + " = '" + val + "'");
-        atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val);
-
-             while (true) {
-                 if ((c == '>') || (c < 0) ||
-                     ((c >= 'a') && (c <= 'z')) ||
-                     ((c >= 'A') && (c <= 'Z')) ||
-                     ((c >= '0') && (c <= '9')) || (c == '_'))
-                     break;
-                 c = in.read();
-             }
-             //skipSpace(in);
-        }
-        return atts;
-     }
-
-     // private static final == inline
-     private static final boolean isInt(Object o) {
-         boolean isInt = false;
-
-         try {
-             Integer.parseInt((String) o);
-             isInt = true;
-         } catch (Exception e) {
-             // don't care
-         }
-
-         return isInt;
-     }
-
-     /* values used for placement of AppletViewer's frames */
-     private static int x = 0;
-     private static int y = 0;
-     private static final int XDELTA = 30;
-     private static final int YDELTA = XDELTA;
-
-     static String encoding = null;
-
-     static private Reader makeReader(InputStream is) {
-        if (encoding != null) {
-            try {
-                return new BufferedReader(new InputStreamReader(is, encoding));
-            } catch (IOException x) { }
-        }
-        InputStreamReader r = new InputStreamReader(is);
-        encoding = r.getEncoding();
-        return new BufferedReader(r);
-     }
-
-     /**
-      * Scan an html file for <applet> tags
-      */
-     public static void parse(int identifier, long handle, Reader in, URL url, String enc)
-         throws IOException {
-         encoding = enc;
-         parse(identifier, handle, in, url, System.out, new PluginAppletPanelFactory());
-     }
-
-     public static void parse(int identifier, long handle, Reader in, URL url)
-         throws IOException {
-
-         final int fIdentifier = identifier;
-         final long fHandle = handle;
-         final Reader fIn = in;
-         final URL fUrl = url;
-         PrivilegedAction pa = new PrivilegedAction() {
-                 public Object run() {
-                         try {
-                                 parse(fIdentifier, fHandle, fIn, fUrl,
-                                       System.out, new PluginAppletPanelFactory());
-                         } catch (IOException ioe) {
-                                 return ioe;
-                         }
-
-                         return null;
-                 }
-         };
-
-         Object ret = AccessController.doPrivileged(pa);
-         if (ret instanceof IOException) {
-                 throw (IOException) ret;
-         }
-     }
-
-     public static void parse(int identifier, long handle, Reader in, URL url,
-                              PrintStream statusMsgStream,
-                              PluginAppletPanelFactory factory)
-         throws IOException
-     {
-         // <OBJECT> <EMBED> tag flags
-         boolean isAppletTag = false;
-         boolean isObjectTag = false;
-         boolean isEmbedTag = false;
-         boolean objectTagAlreadyParsed = false;
-
-         // warning messages
-         String requiresNameWarning = amh.getMessage("parse.warning.requiresname");
-         String paramOutsideWarning = amh.getMessage("parse.warning.paramoutside");
-         String appletRequiresCodeWarning = amh.getMessage("parse.warning.applet.requirescode");
-         String appletRequiresHeightWarning = amh.getMessage("parse.warning.applet.requiresheight");
-         String appletRequiresWidthWarning = amh.getMessage("parse.warning.applet.requireswidth");
-         String objectRequiresCodeWarning = amh.getMessage("parse.warning.object.requirescode");
-         String objectRequiresHeightWarning = amh.getMessage("parse.warning.object.requiresheight");
-         String objectRequiresWidthWarning = amh.getMessage("parse.warning.object.requireswidth");
-         String embedRequiresCodeWarning = amh.getMessage("parse.warning.embed.requirescode");
-         String embedRequiresHeightWarning = amh.getMessage("parse.warning.embed.requiresheight");
-         String embedRequiresWidthWarning = amh.getMessage("parse.warning.embed.requireswidth");
-         String appNotLongerSupportedWarning = amh.getMessage("parse.warning.appnotLongersupported");
-
-         java.net.URLConnection conn = url.openConnection();
-         /* The original URL may have been redirected - this
-          * sets it to whatever URL/codebase we ended up getting
-          */
-         url = conn.getURL();
-
-         int ydisp = 1;
-         Hashtable atts = null;
-
-         while(true) {
-                 c = in.read();
-                 if (c == -1)
-                         break;
-
-                 if (c == '<') {
-                         c = in.read();
-                         if (c == '/') {
-                                 c = in.read();
-                                 String nm = scanIdentifier(in);
-                                 if (nm.equalsIgnoreCase("applet") ||
-                                                 nm.equalsIgnoreCase("object") ||
-                                                 nm.equalsIgnoreCase("embed")) {
-
-                                         // We can't test for a code tag until </OBJECT>
-                                         // because it is a parameter, not an attribute.
-                                         if(isObjectTag) {
-                                                 if (atts.get("code") == null && atts.get("object") == null) {
-                                                         statusMsgStream.println(objectRequiresCodeWarning);
-                                                         atts = null;
-                                                 }
-                                         }
-
-                                         if (atts != null) {
-                                                 // XXX 5/18 In general this code just simply
-                                                 // shouldn't be part of parsing.  It's presence
-                                                 // causes things to be a little too much of a
-                                                 // hack.
-                                                 // Let user know we are starting up
-                                                 streamhandler.write("instance " + identifier + " status " + amh.getMessage("status.start"));
-                                                 factory.createPanel(streamhandler, identifier, handle, x, y, url, atts);
-                                                 x += XDELTA;
-                                                 y += YDELTA;
-                                                 // make sure we don't go too far!
-                                                 Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
-                                                 if ((x > d.width - 300) || (y > d.height - 300)) {
-                                                         x = 0;
-                                                         y = 2 * ydisp * YDELTA;
-                                                         ydisp++;
-                                                 }
-                                         }
-                                         atts = null;
-                                         isAppletTag = false;
-                                         isObjectTag = false;
-                                         isEmbedTag = false;
-                                 }
-                         }
-                         else {
-                                 String nm = scanIdentifier(in);
-                                 if (nm.equalsIgnoreCase("param")) {
-                                         Hashtable t = scanTag(in);
-                                         String att = (String)t.get("name");
-
-                                         if (atts.containsKey(att))
-                                             continue;
-
-                                         if (att == null) {
-                                                 statusMsgStream.println(requiresNameWarning);
-                                         } else {
-                                                 String val = (String)t.get("value");
-                                                 if (val == null) {
-                                                         statusMsgStream.println(requiresNameWarning);
-                                                 } else if (atts != null) {
-                                                         att = att.replace("&gt;", ">");
-                                                         att = att.replace("&lt;", "<");
-                                                         att = att.replace("&amp;", "&");
-                                                         att = att.replace("&#10;", "\n");
-                                                         att = att.replace("&#13;", "\r");
-                                                         att = att.replace("&quot;", "\"");
-
-                                                         val = val.replace("&gt;", ">");
-                                                         val = val.replace("&lt;", "<");
-                                                         val = val.replace("&amp;", "&");
-                                                         val = val.replace("&#10;", "\n");
-                                                         val = val.replace("&#13;", "\r");
-                                                         val = val.replace("&quot;", "\"");
-                                                         PluginDebug.debug("PUT " + att + " = " + val);
-                                                             atts.put(att.toLowerCase(), val);
-                                                 } else {
-                                                         statusMsgStream.println(paramOutsideWarning);
-                                                 }
-                                         }
-                                 }
-                                 else if (nm.equalsIgnoreCase("applet")) {
-                                         isAppletTag = true;
-                                         atts = scanTag(in);
-
-                         // If there is a classid and no code tag present, transform it to code tag
-                                         if (atts.get("code") == null &&
-                                             atts.get("classid") != null &&
-                                             !((String) atts.get("classid")).startsWith("clsid:")) {
-                                           atts.put("code", atts.get("classid"));
-                                         }
-
-                         // remove java: from code tag
-                         if (atts.get("code") != null && ((String) atts.get("code")).startsWith("java:")) {
-                             atts.put("code", ((String) atts.get("code")).substring(5));
-                         }
-
-                                         if (atts.get("code") == null && atts.get("object") == null) {
-                                                 statusMsgStream.println(appletRequiresCodeWarning);
-                                                 atts = null;
-                                         }
-
-                                         if (atts.get("width") == null || !isInt(atts.get("width"))) {
-                                                 atts.put("width", "1000");
-                                                 atts.put("widthPercentage", 100);
-                                         } else if (((String) atts.get("width")).endsWith("%")) {
-                                                 String w = (String) atts.get("width");
-                                                 atts.put("width", "100");
-                                                 atts.put("widthPercentage", Integer.parseInt((w.substring(0,  w.length() -1))));
-                                          }
-
-                                         if (atts.get("height") == null || !isInt(atts.get("height"))) {
-                                                 atts.put("height", "1000");
-                                                 atts.put("heightPercentage", 100);
-                                         } else if (((String) atts.get("height")).endsWith("%")) {
-                                                 String h = (String) atts.get("height");
-                                                 atts.put("height", "100");
-                                                 atts.put("heightPercentage", Integer.parseInt(h.substring(0,  h.length() -1)));
-                                         }
-                                 }
-                                 else if (nm.equalsIgnoreCase("object")) {
-                                         isObjectTag = true;
-
-                                     // Once code is set, additional nested objects are ignored
-                                     if (!objectTagAlreadyParsed) {
-                                         objectTagAlreadyParsed = true;
-                                         atts = scanTag(in);
-                                     }
-
-                                         // If there is a classid and no code tag present, transform it to code tag
-                                         if (atts.get("code") == null && atts.get("classid") != null &&
-                                             !((String) atts.get("classid")).startsWith("clsid:")) {
-                                           atts.put("code", atts.get("classid"));
-                                         }
-
-                         // remove java: from code tag
-                         if (atts.get("code") != null && ((String) atts.get("code")).startsWith("java:")) {
-                             atts.put("code", ((String) atts.get("code")).substring(5));
-                         }
-
-                         // java_* aliases override older names:
-                         // http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-ie
-                         if (atts.get("java_code") != null) {
-                             atts.put("code", ((String) atts.get("java_code")));
-                         }
-
-                         if (atts.containsKey("code")) {
-                             objectTagAlreadyParsed = true;
-                         }
-
-                         if (atts.get("java_codebase") != null) {
-                             atts.put("codebase", ((String) atts.get("java_codebase")));
-                         }
-
-                         if (atts.get("java_archive") != null) {
-                             atts.put("archive", ((String) atts.get("java_archive")));
-                         }
-
-                         if (atts.get("java_object") != null) {
-                             atts.put("object", ((String) atts.get("java_object")));
-                         }
-
-                         if (atts.get("java_type") != null) {
-                             atts.put("type", ((String) atts.get("java_type")));
-                         }
-
-                                         if (atts.get("width") == null || !isInt(atts.get("width"))) {
-                                                 atts.put("width", "1000");
-                                                 atts.put("widthPercentage", 100);
-                                         } else if (((String) atts.get("width")).endsWith("%")) {
-                                                 String w = (String) atts.get("width");
-                                                 atts.put("width", "100");
-                                                 atts.put("widthPercentage", Integer.parseInt(w.substring(0,  w.length() -1)));
-                                         }
-
-                                         if (atts.get("height") == null || !isInt(atts.get("height"))) {
-                                                 atts.put("height", "1000");
-                                                 atts.put("heightPercentage", 100);
-                                         } else if (((String) atts.get("height")).endsWith("%")) {
-                                                 String h = (String) atts.get("height");
-                                                 atts.put("height", "100");
-                                                 atts.put("heightPercentage", Integer.parseInt(h.substring(0,  h.length() -1)));
-                                         }
-                                 }
-                                 else if (nm.equalsIgnoreCase("embed")) {
-                                         isEmbedTag = true;
-                                         atts = scanTag(in);
-
-                         // If there is a classid and no code tag present, transform it to code tag
-                                         if (atts.get("code") == null &&
-                                             atts.get("classid") != null &&
-                                             !((String) atts.get("classid")).startsWith("clsid:")) {
-                                           atts.put("code", atts.get("classid"));
-                                         }
-
-                         // remove java: from code tag
-                         if (atts.get("code") != null && ((String) atts.get("code")).startsWith("java:")) {
-                             atts.put("code", ((String) atts.get("code")).substring(5));
-                         }
-
-                                         // java_* aliases override older names:
-                                         // http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav
-                                         if (atts.get("java_code") != null) {
-                                             atts.put("code", ((String) atts.get("java_code")));
-                                         }
-
-                         if (atts.get("java_codebase") != null) {
-                             atts.put("codebase", ((String) atts.get("java_codebase")));
-                         }
-
-                         if (atts.get("java_archive") != null) {
-                             atts.put("archive", ((String) atts.get("java_archive")));
-                         }
-
-                         if (atts.get("java_object") != null) {
-                             atts.put("object", ((String) atts.get("java_object")));
-                         }
-
-                         if (atts.get("java_type") != null) {
-                             atts.put("type", ((String) atts.get("java_type")));
-                         }
-
-                                         if (atts.get("code") == null && atts.get("object") == null) {
-                                                 statusMsgStream.println(embedRequiresCodeWarning);
-                                                 atts = null;
-                                         }
-
-                                         if (atts.get("width") == null || !isInt(atts.get("width"))) {
-                                                 atts.put("width", "1000");
-                                                 atts.put("widthPercentage", 100);
-                                         } else if (((String) atts.get("width")).endsWith("%")) {
-                                                 String w = (String) atts.get("width");
-                                                 atts.put("width", "100");
-                                                 atts.put("widthPercentage", Integer.parseInt(w.substring(0,  w.length() -1)));
-                                         }
-
-                                         if (atts.get("height") == null || !isInt(atts.get("height"))) {
-                                                 atts.put("height", "1000");
-                                                 atts.put("heightPercentage", 100);
-                                         } else if (((String) atts.get("height")).endsWith("%")) {
-                                                 String h = (String) atts.get("height");
-                                                 atts.put("height", "100");
-                                                 atts.put("heightPercentage", Integer.parseInt(h.substring(0,  h.length() -1)));
-                                         }
-                                 }
-                                 else if (nm.equalsIgnoreCase("app")) {
-                                         statusMsgStream.println(appNotLongerSupportedWarning);
-                                         Hashtable atts2 = scanTag(in);
-                                         nm = (String)atts2.get("class");
-                                         if (nm != null) {
-                                                 atts2.remove("class");
-                                                 atts2.put("code", nm + ".class");
-                                         }
-                                         nm = (String)atts2.get("src");
-                                         if (nm != null) {
-                                                 atts2.remove("src");
-                                                 atts2.put("codebase", nm);
-                                         }
-                                         if (atts2.get("width") == null || !isInt(atts2.get("width"))) {
-                                                 atts2.put("width", "1000");
-                                                 atts2.put("widthPercentage", 100);
-                                         } else if (((String) atts.get("width")).endsWith("%")) {
-                                                 String w = (String) atts.get("width");
-                                                 atts2.put("width", "100");
-                                                 atts2.put("widthPercentage", Integer.parseInt(w.substring(0,  w.length() -1)));
-                                         }
-
-                                         if (atts2.get("height") == null || !isInt(atts2.get("height"))) {
-                                                 atts2.put("height", "1000");
-                                                 atts2.put("heightPercentage", 100);
-                                         } else if (((String) atts.get("height")).endsWith("%")) {
-                                                 String h = (String) atts.get("height");
-                                                 atts2.put("height", "100");
-                                                 atts2.put("heightPercentage", Integer.parseInt(h.substring(0,  h.length() -1)));
-                                         }
-
-                                         printTag(statusMsgStream, atts2);
-                                         statusMsgStream.println();
-                                 }
-                         }
-                 }
-         }
-         in.close();
-     }
- 
-
-     private static AppletMessageHandler amh = new AppletMessageHandler("appletviewer");
-
-     private static void checkConnect(URL url)
-     {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            try {
-                java.security.Permission perm =
-                    url.openConnection().getPermission();
-                if (perm != null)
-                    security.checkPermission(perm);
-                else
-                    security.checkConnect(url.getHost(), url.getPort());
-            } catch (java.io.IOException ioe) {
-                    security.checkConnect(url.getHost(), url.getPort());
-            }
-        }
-     }
- }
--- a/plugin/icedteanp/java/sun/applet/PluginCallRequest.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/* PluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.security.AccessControlContext;
-import java.security.ProtectionDomain;
-
-// FIXME: for each type of request extend a new (anonymous?)
-// PluginCallRequest.
-public abstract class PluginCallRequest {
-    String message;
-    Long reference;
-    PluginCallRequest next;
-    boolean done = false;
-
-    public PluginCallRequest(String message, Long reference) {
-        this.message = message;
-        this.reference = reference;
-    }
-
-    public String getMessage() {
-    	return this.message;
-    }
-    
-    public boolean isDone() {
-    	return this.done;
-    }
-    
-    public boolean setDone(boolean done) {
-    	return this.done = done;
-    }
-    
-    public void setNext(PluginCallRequest next) {
-    	this.next = next;
-    }
-    
-    public PluginCallRequest getNext() {
-    	return this.next;
-    }
-
-    /**
-     * Returns whether the given message is serviceable by this object
-     * 
-     * @param message The message to service
-     * @return boolean indicating if message is serviceable
-     */
-    public boolean serviceable(String message) {
-        return message.contains("reference " + reference);
-    }
-    
-    public abstract void parseReturn(String message);
-    
-    public abstract Object getObject();
-}
--- a/plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package sun.applet;
-
-
-public class PluginCallRequestFactory {
-    
-	public PluginCallRequest getPluginCallRequest(String id, String message, Long reference) {
-
-		if (id == "member") {
-			return new GetMemberPluginCallRequest(message, reference);
-		} else if (id == "void") {
-			return new VoidPluginCallRequest(message, reference);
-		} else if (id == "window") {
-			return new GetWindowPluginCallRequest(message, reference);
-		} else if (id == "proxyinfo") {
-            return new PluginProxyInfoRequest(message, reference);
-        } else if (id == "cookieinfo") {
-            return new PluginCookieInfoRequest(message, reference);
-        } else {
-			throw new RuntimeException ("Unknown plugin call request type requested from factory");
-		}
-	}
-
-}
--- a/plugin/icedteanp/java/sun/applet/PluginClassLoader.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package sun.applet;
-
-public class PluginClassLoader extends ClassLoader {
-
-	public PluginClassLoader() {
-		super();
-	}
-
-	public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
-		return super.loadClass(name, resolve);
-	}
-	
-}
--- a/plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/* PluginCookieInfoRequest -- Object representing a request for cookie information from the browser
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-
-/**
- * This class represents a request object for cookie information for a given URI
- */
-
-public class PluginCookieInfoRequest extends PluginCallRequest {
-
-    String cookieString = new String();
-
-    public PluginCookieInfoRequest(String message, Long reference) {
-        super(message, reference);
-    }
-
-    public void parseReturn(String cookieInfo) {
-
-        // try to parse the proxy information. If things go wrong, do nothing .. 
-        // this will keep internal = null which forces a direct connection
-
-    	PluginDebug.debug ("PluginCookieInfoRequest GOT: " + cookieInfo);
-
-    	// Skip the first 5 components. We are guaranteed 5 components, 
-    	// so no index -1 to worry about
-    	cookieInfo = cookieInfo.substring(cookieInfo.indexOf(' ')+1);
-    	cookieInfo = cookieInfo.substring(cookieInfo.indexOf(' ')+1);
-    	cookieInfo = cookieInfo.substring(cookieInfo.indexOf(' ')+1);
-    	cookieInfo = cookieInfo.substring(cookieInfo.indexOf(' ')+1);
-    	cookieString = cookieInfo.substring(cookieInfo.indexOf(' ')+1);
-
-        setDone(true);
-    }
-
-    public String getObject() {
-    	return this.cookieString;
-    }
-}
--- a/plugin/icedteanp/java/sun/applet/PluginCookieManager.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/* PluginCookieManager -- Cookie manager for the plugin
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.io.IOException;
-import java.net.CookieManager;
-import java.net.HttpCookie;
-import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-public class PluginCookieManager extends CookieManager 
-{
-    public Map<String, List<String>> get(URI uri,
-			Map<String, List<String>> requestHeaders) throws IOException {
-		// pre-condition check
-		if (uri == null || requestHeaders == null) {
-			throw new IllegalArgumentException("Argument is null");
-		}
-
-		Map<String, List<String>> cookieMap = new java.util.HashMap<String, List<String>>();
-
-		String cookies = (String) PluginAppletViewer
-				.requestPluginCookieInfo(uri);
-		List<String> cookieHeader = new java.util.ArrayList<String>();
-
-		if (cookies != null && cookies.length() > 0)
-			cookieHeader.add(cookies);
-		
-		// Add anything else that mozilla didn't add
-        for (HttpCookie cookie : getCookieStore().get(uri)) {
-            // apply path-matches rule (RFC 2965 sec. 3.3.4)
-            if (pathMatches(uri.getPath(), cookie.getPath())) {
-            	cookieHeader.add(cookie.toString());
-            }
-        }
-
-		cookieMap.put("Cookie", cookieHeader);
-		return Collections.unmodifiableMap(cookieMap);
-	}
-
-    private boolean pathMatches(String path, String pathToMatchWith) {
-        if (path == pathToMatchWith)
-            return true;
-        if (path == null || pathToMatchWith == null)
-            return false;
-        if (path.startsWith(pathToMatchWith))
-            return true;
-
-        return false;
-    }
-}
--- a/plugin/icedteanp/java/sun/applet/PluginDebug.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package sun.applet;
-
-import java.io.*;
-
-public class PluginDebug {
-
-	static final boolean DEBUG = System.getenv().containsKey("ICEDTEAPLUGIN_DEBUG"); 
-
-    public static void debug(String message) {
-    	if (DEBUG)
-    		System.err.println(message);
-	}
-}
--- a/plugin/icedteanp/java/sun/applet/PluginException.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package sun.applet;
-
-
-public class PluginException extends Exception {
-
-	public PluginException (PluginStreamHandler sh, int instance, int reference, Throwable t) {
-		t.printStackTrace();
-		this.setStackTrace(t.getStackTrace());
-		
-		AppletSecurityContextManager.dumpStore(0);
-
-		String message = "instance " + instance + " reference " + reference + " Error " + t.getMessage();
-		sh.write(message);
-	}
-}
--- a/plugin/icedteanp/java/sun/applet/PluginMain.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,327 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-/*
- * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package sun.applet;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.net.Authenticator;
-import java.net.CookieHandler;
-import java.net.CookieManager;
-import java.net.PasswordAuthentication;
-import java.net.ProxySelector;
-import java.util.Enumeration;
-import java.util.Properties;
-
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-
-import net.sourceforge.jnlp.security.VariableX509TrustManager;
-
-/**
- * The main entry point into PluginAppletViewer.
- */
-public class PluginMain
-{
-
-    // the files where stdout/stderr are sent to
-    public static final String PLUGIN_STDERR_FILE = System.getProperty("user.home") + "/.icedteaplugin/java.stderr";
-    public static final String PLUGIN_STDOUT_FILE = System.getProperty("user.home") + "/.icedteaplugin/java.stdout";
-
-	final boolean redirectStreams = System.getenv().containsKey("ICEDTEAPLUGIN_DEBUG");
-	static PluginStreamHandler streamHandler;
-	
-    // This is used in init().	Getting rid of this is desirable but depends
-    // on whether the property that uses it is necessary/standard.
-    public static final String theVersion = System.getProperty("java.version");
-    
-    private PluginAppletSecurityContext securityContext;
-
-    /**
-     * The main entry point into AppletViewer.
-     */
-    public static void main(String args[])
-	throws IOException
-    {
-        if (args.length != 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) {
-            System.err.println("Invalid pipe names provided. Refusing to proceed.");
-            System.exit(1);
-        }
-
-    	try {
-    		PluginMain pm = new PluginMain(args[0], args[1]);
-    	} catch (Exception e) {
-    		e.printStackTrace();
-    		System.err.println("Something very bad happened. I don't know what to do, so I am going to exit :(");
-    		System.exit(1);
-    	}
-    }
-
-    public PluginMain(String inPipe, String outPipe) {
-    	
-    	try {
-    		File errFile = new File(PLUGIN_STDERR_FILE);
-    		File outFile = new File(PLUGIN_STDOUT_FILE);
-
-    		System.setErr(new TeeOutputStream(new FileOutputStream(errFile), System.err));
-    		System.setOut(new TeeOutputStream(new FileOutputStream(outFile), System.out));
-    	} catch (Exception e) {
-    		PluginDebug.debug("Unable to redirect streams");
-    		e.printStackTrace();
-    	}
-
-    	connect(inPipe, outPipe);
-
-    	securityContext = new PluginAppletSecurityContext(0);
-    	securityContext.prePopulateLCClasses();
-    	securityContext.setStreamhandler(streamHandler);
-    	AppletSecurityContextManager.addContext(0, securityContext);
-
-		PluginAppletViewer.setStreamhandler(streamHandler);
-		PluginAppletViewer.setPluginCallRequestFactory(new PluginCallRequestFactory());
-
-    	init();
-
-		// Streams set. Start processing.
-		streamHandler.startProcessing();
-    }
-
-	public void connect(String inPipe, String outPipe) {
-		try {
-			streamHandler = new PluginStreamHandler(new FileInputStream(inPipe), new FileOutputStream(outPipe));
-	    	PluginDebug.debug("Streams initialized");
-		} catch (IOException ioe) {
-			ioe.printStackTrace();
-		}
-	}
-
-	private static void init() {
-		Properties avProps = new Properties();
-
-		// ADD OTHER RANDOM PROPERTIES
-		// XXX 5/18 need to revisit why these are here, is there some
-		// standard for what is available?
-
-		// Standard browser properties
-		avProps.put("browser", "sun.applet.AppletViewer");
-		avProps.put("browser.version", "1.06");
-		avProps.put("browser.vendor", "Sun Microsystems Inc.");
-		avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion);
-
-		// Define which packages can be extended by applets
-		// XXX 5/19 probably not needed, not checked in AppletSecurity
-		avProps.put("package.restrict.definition.java", "true");
-		avProps.put("package.restrict.definition.sun", "true");
-
-		// Define which properties can be read by applets.
-		// A property named by "key" can be read only when its twin
-		// property "key.applet" is true.  The following ten properties
-		// are open by default.	 Any other property can be explicitly
-		// opened up by the browser user by calling appletviewer with
-		// -J-Dkey.applet=true
-		avProps.put("java.version.applet", "true");
-		avProps.put("java.vendor.applet", "true");
-		avProps.put("java.vendor.url.applet", "true");
-		avProps.put("java.class.version.applet", "true");
-		avProps.put("os.name.applet", "true");
-		avProps.put("os.version.applet", "true");
-		avProps.put("os.arch.applet", "true");
-		avProps.put("file.separator.applet", "true");
-		avProps.put("path.separator.applet", "true");
-		avProps.put("line.separator.applet", "true");
-		
-		avProps.put("javaplugin.nodotversion", "160_17");
-		avProps.put("javaplugin.version", "1.6.0_17");
-		avProps.put("javaplugin.vm.options", "");
-
-		// Read in the System properties.  If something is going to be
-		// over-written, warn about it.
-		Properties sysProps = System.getProperties();
-		for (Enumeration e = sysProps.propertyNames(); e.hasMoreElements(); ) {
-			String key = (String) e.nextElement();
-			String val = (String) sysProps.getProperty(key);
-			avProps.setProperty(key, val);
-		}
-
-		// INSTALL THE PROPERTY LIST
-		System.setProperties(avProps);
-
-
-		try {
-		    SSLSocketFactory sslSocketFactory;
-		    SSLContext context = SSLContext.getInstance("SSL");
-		    TrustManager[] trust = new TrustManager[] { VariableX509TrustManager.getInstance() };
-		    context.init(null, trust, null);
-		    sslSocketFactory = context.getSocketFactory();
-		    
-		    HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
-		} catch (Exception e) {
-		    System.err.println("Unable to set SSLSocketfactory (may _prevent_ access to sites that should be trusted)! Continuing anyway...");
-		    e.printStackTrace();
-		}
-
-		// plug in a custom authenticator and proxy selector
-        Authenticator.setDefault(new CustomAuthenticator());
-        ProxySelector.setDefault(new PluginProxySelector());
-        
-        CookieManager ckManager = new PluginCookieManager();
-        CookieHandler.setDefault(ckManager);
-	}
-
-    static boolean messageAvailable() {
-    	return streamHandler.messageAvailable();
-    }
-
-    static String getMessage() {
-    	return streamHandler.getMessage();
-    }
-    
-    static class CustomAuthenticator extends Authenticator {
-        
-        public PasswordAuthentication getPasswordAuthentication() {
-
-            // No security check is required here, because the only way to 
-            // set parameters for which auth info is needed 
-            // (Authenticator:requestPasswordAuthentication()), has a security 
-            // check
-
-            String type = this.getRequestorType() == RequestorType.PROXY ? "proxy" : "web"; 
-
-            // request auth info from user
-            PasswordAuthenticationDialog pwDialog = new PasswordAuthenticationDialog();
-            PasswordAuthentication auth = pwDialog.askUser(this.getRequestingHost(), this.getRequestingPort(), this.getRequestingPrompt(), type);
-            
-            // send it along
-            return auth;
-        }
-    }
-
-    /**
-     * Behaves like the 'tee' command, sends output to both actual std stream and a
-     * file
-     */
-    class TeeOutputStream extends PrintStream {
-
-        // Everthing written to TeeOutputStream is written to this file
-        PrintStream logFile;
-
-        public TeeOutputStream(FileOutputStream fileOutputStream,
-                PrintStream stdStream) {
-            super(stdStream);
-            logFile = new PrintStream(fileOutputStream);
-        }
-
-        @Override
-        public boolean checkError() {
-            boolean thisError = super.checkError();
-            boolean fileError = logFile.checkError();
-
-            return thisError || fileError;
-        }
-
-        @Override
-        public void close() {
-            logFile.close();
-            super.close();
-        }
-
-        @Override
-        public void flush() {
-            logFile.flush();
-            super.flush();
-        }
-
-        /*
-         * The big ones: these do the actual writing
-         */
-
-        @Override
-        public void write(byte[] buf, int off, int len) {
-            logFile.write(buf, off, len);
-
-            if (!redirectStreams)
-                super.write(buf, off, len);
-        }
-
-        @Override
-        public void write(int b) {
-            logFile.write(b);
-            
-            if (!redirectStreams)
-                super.write(b);
-        }
-
-        @Override
-        public void write(byte[] b) throws IOException {
-            logFile.write(b);
-            
-            if (!redirectStreams)
-                super.write(b);
-        }
-    }
-    
-}
--- a/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,311 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Set;
-
-class PluginMessageConsumer {
-
-	private static int MAX_PARALLEL_INITS = 1;
-
-	// Each initialization requires 5 responses (tag, handle, width, proxy, cookie) 
-	// before the message stack unlocks/collapses. This works out well because we 
-	// want to allow upto 5 parallel tasks anyway
-	private static int MAX_WORKERS = MAX_PARALLEL_INITS*5;
-	private static int PRIORITY_WORKERS = MAX_PARALLEL_INITS*2;
-
-	private static Hashtable<Integer, PluginMessageHandlerWorker> initWorkers = new Hashtable<Integer, PluginMessageHandlerWorker>(2);
-
-	LinkedList<String> readQueue = new LinkedList<String>();
-	private static LinkedList<String> priorityWaitQueue = new LinkedList<String>();
-	ArrayList<PluginMessageHandlerWorker> workers = new ArrayList<PluginMessageHandlerWorker>();
-	PluginStreamHandler streamHandler = null;
-	AppletSecurity as;
-	ConsumerThread consumerThread = new ConsumerThread();
-	private static ArrayList<Integer> processedIds = new ArrayList<Integer>();
-
-	/** 
-	 * Registers a reference to wait for. Responses to registered priority 
-	 * references get handled by priority worker if normal workers are busy.
-	 *
-	 * @param reference The reference to give priority to
-	 */
-	public static void registerPriorityWait(Long reference) {
-	    PluginDebug.debug("Registering priority for reference " + reference);
-	    registerPriorityWait("reference " + reference.toString());
-	}
-
-	/** 
-     * Registers a string to wait for.
-     *
-     * @param searchString the string to look for in a response
-     */
-    public static void registerPriorityWait(String searchString) {
-        PluginDebug.debug("Registering priority for string " + searchString);
-        synchronized (priorityWaitQueue) {
-            if (!priorityWaitQueue.contains(searchString))
-                priorityWaitQueue.add(searchString);
-        }
-    }
-
-	/** 
-     * Unregisters a priority reference to wait for.
-     *
-     * @param reference The reference to remove
-     */
-    public static void unRegisterPriorityWait(Long reference) {
-        unRegisterPriorityWait(reference.toString());
-    }
-
-    /** 
-     * Unregisters a priority string to wait for.
-     *
-     * @param searchString The string to unregister from the priority list
-     */
-    public static void unRegisterPriorityWait(String searchString) {
-        synchronized (priorityWaitQueue) {
-            priorityWaitQueue.remove(searchString);
-        }
-    }
-
-    /**
-     * Returns the reference for this message. This method assumes that 
-     * the message has a reference number.
-     * 
-     * @param The message
-     * @return the reference number
-     */
-    private Long getReference(String[] msgParts) {
-        return Long.parseLong(msgParts[3]);
-    }
-    
-	public PluginMessageConsumer(PluginStreamHandler streamHandler) {
-		
-		as = new AppletSecurity();
-		this.streamHandler = streamHandler;
-		this.consumerThread.start();
-	}
-
-	private String getPriorityStrIfPriority(String message) {
-
-	    synchronized (priorityWaitQueue) {
-	        Iterator<String> it = priorityWaitQueue.iterator();
-
-	        while (it.hasNext()) {
-	            String priorityStr = it.next();
-	            if (message.indexOf(priorityStr) > 0)
-	                return priorityStr;
-	        }
-	    }
-
-	    return null;
-	}
-
-	private boolean isInInit(Integer instanceNum) {
-	    return initWorkers.containsKey(instanceNum);
-	}
-
-	private void addToInitWorkers(Integer instanceNum, PluginMessageHandlerWorker worker) {
-        synchronized(initWorkers) {
-            initWorkers.put(instanceNum, worker);
-        }
-	}
-
-	private boolean okayToProcess(String[] msgParts) {
-
-	    if (msgParts[2].equals("tag")) {
-
-	        Integer instanceNum = new Integer(msgParts[1]);
-
-	        synchronized(initWorkers) {
-	            if (initWorkers.size() >= MAX_PARALLEL_INITS) {
-	                return false;
-	            }
-	        }
-	        
-	        registerPriorityWait("instance " + instanceNum + " handle");
-
-	    } else if (msgParts[2].equals("handle")) {
-	            Integer instanceNum = new Integer(msgParts[1]);
-
-	            // If this instance is not in init, return false immediately. 
-	            // Handle messages should NEVER go before tag messages
-	            if (!isInInit(instanceNum))
-	                return false;
-
-		        registerPriorityWait("instance " + instanceNum + " width");
-	    } else if (msgParts[2].equals("width")) {
-	    	
-	    	// width messages cannot proceed until handle and tag have been resolved
-	    	Integer instanceNum = new Integer(msgParts[1]);
-
-	    	if (!processedIds.contains(instanceNum)) {
-                return false;
-            }
-	    }
-
-	    return true;
-	}
-
-	public void notifyWorkerIsFree(PluginMessageHandlerWorker worker) {
-	    synchronized (initWorkers) {
-	        Iterator<Integer> i = initWorkers.keySet().iterator();
-            while (i.hasNext()) {
-                Integer key = i.next();
-                if (initWorkers.get(key).equals(worker)) {
-                    processedIds.add(key);
-                    initWorkers.remove(key);
-                }
-            }
-	    }
-	    
-	    consumerThread.interrupt();
-	}
-
-	public void queue(String message) {
-	    synchronized(readQueue) {
-	        readQueue.addLast(message);
-	    }
-	    
-	    // Wake that lazy consumer thread
-	    consumerThread.interrupt();
-	}
-
-	protected class ConsumerThread extends Thread { 
-	    public void run() {
-
-	        while (true) {
-
-                String message = null;
-
-	            synchronized(readQueue) {
-	                message = readQueue.poll();
-	            }
-
-	            if (message != null) {
-
-	                String[] msgParts = message.split(" ");
-
-	                // if it is no okay to process just yet, push it back and 
-	                if (!okayToProcess(msgParts)) {
-	                    synchronized(readQueue) {
-	                        readQueue.addLast(message);
-	                    }
-	                    
-	                    continue; // re-loop to try next msg
-	                }
-
-	                String priorityStr = getPriorityStrIfPriority(message);
-	                boolean isPriorityResponse = (priorityStr != null);
-		
-	                //PluginDebug.debug("Message " + message + " (priority=" + isPriorityResponse + ") ready to be processed. Looking for free worker...");
-	                final PluginMessageHandlerWorker worker = getFreeWorker(isPriorityResponse);
-	                
-	                if (worker == null) {
-	                    synchronized(readQueue) {
-                            readQueue.addLast(message);
-                        }
-
-	                    continue; // re-loop to try next msg
-	                }
-
-	                if (msgParts[2].equals("tag"))
-	                    addToInitWorkers((new Integer(msgParts[1])), worker);
-
-	                if (isPriorityResponse) {
-	                    unRegisterPriorityWait(priorityStr);
-	                }
-
-                    worker.setmessage(message);
-	                worker.interrupt();
-
-	            } else {
-	                try {
-	                    Thread.sleep(1000);
-	                } catch (InterruptedException ie) {}
-	            }
-	        }
-	    }
-	}
-
-	private PluginMessageHandlerWorker getFreeWorker(boolean prioritized) {
-
-			for (PluginMessageHandlerWorker worker: workers) {
-				if (worker.isFree(prioritized)) {
-					PluginDebug.debug("Found free worker (" + worker.isPriority() + ") with id " + worker.getWorkerId());
-					// mark it busy before returning
-					worker.busy();
-					return worker;
-				}
-			}
-
-			// If we have less than MAX_WORKERS, create a new worker
-			if (workers.size() <= MAX_WORKERS) {
-			    PluginMessageHandlerWorker worker = null;
-			    
-			    if (workers.size() < (MAX_WORKERS - PRIORITY_WORKERS)) {
-			        PluginDebug.debug("Cannot find free worker, creating worker " + workers.size());
-			        worker = new PluginMessageHandlerWorker(this, streamHandler, workers.size(), as, false);
-			    } else if (prioritized) {
-			        PluginDebug.debug("Cannot find free worker, creating priority worker " + workers.size());
-			        worker = new PluginMessageHandlerWorker(this, streamHandler, workers.size(), as, true);
-			    } else {
-			        return null;
-			    }
-
-		        worker.start();
-		        worker.busy();
-		        workers.add(worker);
-		        return worker;
-
-			}
-			
-			// No workers available. Better luck next time! 
-			return null;
-	}
-	
-	private void dumpWorkerStatus() {
-		for (PluginMessageHandlerWorker worker: workers) {
-			PluginDebug.debug(worker.toString());
-		}
-	}
-}
--- a/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package sun.applet;
-
-
-class PluginMessageHandlerWorker extends Thread {
-
-	private boolean free = true;
-	private boolean isPriorityWorker = false;
-	private int id;
-	private String message = null;
-	private SecurityManager sm;
-	PluginStreamHandler streamHandler = null;
-	PluginMessageConsumer consumer = null;
-
-	public PluginMessageHandlerWorker(
-	            PluginMessageConsumer consumer, 
-	            PluginStreamHandler streamHandler, int id, 
-	            SecurityManager sm, boolean isPriorityWorker) {
-
-		this.id = id;
-		this.streamHandler = streamHandler;
-		this.sm = sm;
-		this.isPriorityWorker = isPriorityWorker;
-		this.consumer = consumer;
-		
-		PluginDebug.debug("Worker " + this.id + " (priority=" + isPriorityWorker + ") created."); 
-	}
-
-	public void setmessage(String message) {
-		this.message = message;
-	}
-
-	public void run() {
-		while (true) {
-
-			if (message != null) {
-				
-			    PluginDebug.debug("Consumer (priority=" + isPriorityWorker + ") thread " + id + " consuming " + message);
-			    
-				// ideally, whoever returns things object should mark it 
-				// busy first, but just in case..
-				busy();
-
-				try {
-					streamHandler.handleMessage(message);
-				} catch (PluginException pe) {
-					/*
-					   catch the exception and DO NOTHING. The plugin should take over after 
-					   this error and let the user know. We don't quit because otherwise the 
-					   exception will spread to the rest of the applets which is a no-no
-					 */ 
-				}
-
-				this.message = null;
-				
-				PluginDebug.debug("Consumption (priority=" + isPriorityWorker + ") completed by consumer thread " + id);
-
-	            // mark ourselves free again
-				free();
-				
-			} else {
-				
-				// Sleep when there is nothing to do
-			    try {
-			        Thread.sleep(Integer.MAX_VALUE);
-			        PluginDebug.debug("Consumer thread " + id + " sleeping...");
-			    } catch (InterruptedException ie) {
-			        PluginDebug.debug("Consumer thread " + id + " woken...");
-			        // nothing.. someone woke us up, see if there 
-			        // is work to do
-			    }
-			}
-		}
-	}
-	
-	
-	
-	public int getWorkerId() {
-		return id;
-	}
-
-	public void busy() {
-	    synchronized (this) {
-	        this.free = false;            
-        }
-	}
-	
-	public void free() {
-	    synchronized (this) {
-	        this.free = true;
-
-	        // Signal the consumer that we are done in case it was waiting
-	        consumer.notifyWorkerIsFree(this); 
-	    }
-	}
-
-	public boolean isPriority() {
-	    return isPriorityWorker;
-	}
-
-	public boolean isFree(boolean prioritized) {
-	    synchronized (this) {
-	        return free && (prioritized == isPriorityWorker);
-	    }
-	}
-
-	public String toString() {
-		return "Worker #" + this.id + "/IsPriority=" + this.isPriorityWorker + "/IsFree=" + this.free + "/Message=" + message;  
-	}
-}
--- a/plugin/icedteanp/java/sun/applet/PluginObjectStore.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/* PluginObjectStore -- manage identifier-to-object mapping
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.util.*;
-import java.lang.reflect.*;
-import java.io.*;
-
-public class PluginObjectStore
-{
-    private static HashMap<Integer, Object> objects = new HashMap();
-    private static HashMap<Integer, Integer> counts = new HashMap();
-    private static HashMap<Object, Integer> identifiers = new HashMap();
-    // FIXME:
-    //
-    // IF uniqueID == MAX_LONG, uniqueID =
-    // 0 && wrapped = true
-    //
-    // if (wrapped), check if
-    // objects.get(uniqueID) returns null
-    //
-    // if yes, use uniqueID, if no,
-    // uniqueID++ and keep checking
-    // or:
-    // stack of available ids:
-    // derefed id -> derefed id -> nextUniqueIdentifier
-    private static int nextUniqueIdentifier = 1;
-
-    public Object getObject(Integer identifier) {
-        return objects.get(identifier);
-    }
-
-    public Integer getIdentifier(Object object) {
-        if (object == null)
-            return 0;
-        return identifiers.get(object);
-    }
-    
-    public boolean contains(Object object) {
-    	if (object == null)
-    		return identifiers.containsKey(object);
-
-    	return false;
-    }
-    
-    public boolean contains(int identifier) {
-   		return objects.containsKey(identifier);
-    }
-
-    public void reference(Object object) {
-        Integer identifier = identifiers.get(object);
-        if (identifier == null) {
-            objects.put(nextUniqueIdentifier, object);
-            counts.put(nextUniqueIdentifier, 1);
-            identifiers.put(object, nextUniqueIdentifier);
-            //System.out.println("JAVA ADDED: " + nextUniqueIdentifier);
-            //System.out.println("JAVA REFERENCED: " + nextUniqueIdentifier
-            //                   + " to: 1");
-            nextUniqueIdentifier++;
-        } else {
-            counts.put(identifier, counts.get(identifier) + 1);
-            //System.out.println("JAVA REFERENCED: " + identifier +
-            //                   " to: " + counts.get(identifier));
-        }
-    }
-
-    public void unreference(int identifier) {
-        Integer currentCount = counts.get(identifier);
-        if (currentCount == null) {
-            //System.out.println("ERROR UNREFERENCING: " + identifier);
-            return;
-        }
-        if (currentCount == 1) {
-            //System.out.println("JAVA DEREFERENCED: " + identifier
-            //                   + " to: 0");
-            Object object = objects.get(identifier);
-            objects.remove(identifier);
-            counts.remove(identifier);
-            identifiers.remove(object);
-            //System.out.println("JAVA REMOVED: " + identifier);
-        } else {
-            counts.put(identifier, currentCount - 1);
-            //System.out.println("JAVA DEREFERENCED: " +
-            //                   identifier + " to: " +
-            //                   counts.get(identifier));
-        }
-    }
-
-    public void dump() {
-   		Iterator i = objects.keySet().iterator();
-   		while (i.hasNext()) {
-   			Object key = i.next();
-   			PluginDebug.debug(key + "::" +  objects.get(key));
-   		}
-    }
-}
-
--- a/plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/* PluginProxyInfoRequest -- Object representing a request for proxy information from the browser
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-
-/**
- * This class represents a request object for proxy information for a given URI
- */
-
-public class PluginProxyInfoRequest extends PluginCallRequest {
-    
-    URI internal = null;
-
-    public PluginProxyInfoRequest(String message, Long reference) {
-        super(message, reference);
-    }
-    
-    public void parseReturn(String proxyInfo) {
-
-        // try to parse the proxy information. If things go wrong, do nothing .. 
-        // this will keep internal = null which forces a direct connection
-
-    	PluginDebug.debug ("PluginProxyInfoRequest GOT: " + proxyInfo);
-    	String[] messageComponents = proxyInfo.split(" ");
-
-    	try {
-    	    String protocol = messageComponents[4].equals("PROXY") ? "http" : "socks";
-    	    String host = messageComponents[5].split(":")[0];
-    	    int port = Integer.parseInt(messageComponents[5].split(":")[1]);
-
-    	    internal = new URI(protocol, null, host, port, null, null, null);
-    	} catch (ArrayIndexOutOfBoundsException aioobe) {
-    	    // Nothing.. this is expected if there is no proxy
-    	} catch (Exception e) {
-    	    e.printStackTrace();
-    	}
-
-        setDone(true);
-    }
-
-    public URI getObject() {
-    	return this.internal;
-    }
-}
--- a/plugin/icedteanp/java/sun/applet/PluginProxySelector.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-/* PluginProxySelector -- proxy selector for all connections from applets and the plugin
-   Copyright (C) 2009  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Proxy;
-import java.net.ProxySelector;
-import java.net.SocketAddress;
-import java.net.URI;
-import java.util.Date;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * Proxy selector implementation for plugin network functions.
- * 
- * This class fetches proxy information from the web browser and 
- * uses that information in the context of all network connection 
- * (plugin specific and applet connections) as applicable
- * 
- */
-
-public class PluginProxySelector extends ProxySelector {
-
-    private TimedHashMap<String, Proxy> proxyCache = new TimedHashMap<String, Proxy>(); 
-
-
-    @Override
-    public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
-        // If the connection fails, there is little we can do here. Just print the exception
-        ioe.printStackTrace();
-    }
-
-    /**
-     * Selects the appropriate proxy (or DIRECT connection method) for the given URI
-     * 
-     * @param uri The URI being accessed
-     * @return A list of Proxy objects that are usable for this URI
-     */
-    @Override
-    public List<Proxy> select(URI uri) {
-
-        List<Proxy> proxyList = new ArrayList<Proxy>();
-
-        // check cache first
-        Proxy cachedProxy = checkCache(uri);
-        if (cachedProxy != null) {
-            proxyList.add(cachedProxy);
-            return proxyList;
-        }
-
-        // Nothing usable in cache. Fetch info from browser
-        Proxy proxy = Proxy.NO_PROXY;
-        Object o = PluginAppletViewer.requestPluginProxyInfo(uri);
-
-        // If the browser returned anything, try to parse it. If anything in the try block fails, the fallback is direct connection
-        try {
-            if (o != null) {
-                PluginDebug.debug("Proxy URI = " + o);
-                URI proxyURI = (URI) o;
-                
-                // If origin uri is http/ftp, we're good. If origin uri is not that, the proxy _must_ be socks, else we fallback to direct
-                if (uri.getScheme().startsWith("http") || uri.getScheme().equals("ftp") || proxyURI.getScheme().startsWith("socks")) {
-
-                    Proxy.Type type = proxyURI.getScheme().equals("http") ? Proxy.Type.HTTP : Proxy.Type.SOCKS; 
-                    InetSocketAddress socketAddr = new InetSocketAddress(proxyURI.getHost(), proxyURI.getPort());
-
-                    proxy = new Proxy(type, socketAddr);
-
-                    String uriKey = uri.getScheme() + "://" + uri.getHost();
-                    proxyCache.put(uriKey, proxy);
-                } else {
-                    PluginDebug.debug("Proxy " + proxyURI + " cannot be used for " + uri + ". Falling back to DIRECT");
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        proxyList.add(proxy);
-
-        PluginDebug.debug("Proxy for " + uri.toString() + " is " + proxy);
-
-        return proxyList;
-    }
-
-    /** 
-     * Checks to see if proxy information is already cached. 
-     * 
-     * @param uri The URI to check
-     * @return The cached Proxy. null if there is no suitable cached proxy. 
-     */
-    private Proxy checkCache(URI uri) {
-        
-        String uriKey = uri.getScheme() + "://" + uri.getHost();
-        if (proxyCache.get(uriKey) != null) {
-            return proxyCache.get(uriKey);
-        }
-
-        return null;
-    }
-    
-    /**
-     * Simple utility class that extends HashMap by adding an expiry to the entries.
-     * 
-     * This map stores entries, and returns them only if the entries were last accessed within time t=10 seconds
-     *
-     * @param <K> The key type
-     * @param <V> The Object type
-     */
-
-    private class TimedHashMap<K,V> extends HashMap<K,V> {
-
-        HashMap<K, Long> timeStamps = new HashMap<K, Long>();
-        Long expiry = 10000L;
-        
-        /**
-         * Store the item in the map and associate a timestamp with it
-         * 
-         * @param key The key
-         * @param value The value to store
-         */
-        public V put(K key, V value) {
-            timeStamps.put(key, new Date().getTime());
-            return super.put(key, value);
-        }
-
-        /**
-         * Return cached item if it has not already expired.
-         * 
-         * Before returning, this method also resets the "last accessed" 
-         * time for this entry, so it is good for another 10 seconds
-         * 
-         * @param key The key
-         */
-        public V get(Object key) {
-
-            Long now = new Date().getTime();
-
-            if (super.containsKey(key)) {
-                Long age = now - timeStamps.get(key);
-
-                // Item exists. If it has not expired, renew its access time and return it 
-                if (age <= expiry) {
-                    PluginDebug.debug("Returning proxy " + super.get(key) + " from cache for " + key);
-                    timeStamps.put((K) key, (new Date()).getTime());
-                    return super.get(key);
-                } else {
-                    PluginDebug.debug("Proxy cache for " + key + " has expired (age=" + age/1000.0 + " seconds)");
-                }
-            } 
-
-            return null;
-        }
-    }
-    
-}
--- a/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,454 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package sun.applet;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.StreamTokenizer;
-import java.net.MalformedURLException;
-import java.nio.charset.Charset;
-import java.util.Date;
-import java.util.LinkedList;
-
-import javax.swing.SwingUtilities;
-
-
-public class PluginStreamHandler {
-
-    private BufferedReader pluginInputReader;
-    private StreamTokenizer pluginInputTokenizer;
-    private BufferedWriter pluginOutputWriter;
-    
-    private RequestQueue queue = new RequestQueue();
-    
-    private JavaConsole console = new JavaConsole();
-
-	LinkedList<String> writeQueue = new LinkedList<String>();
-
-	PluginMessageConsumer consumer;
-	Boolean shuttingDown = false;
-	
-	PluginAppletViewer pav;
-	
-	static Date d = new Date();
-	static long startTime = d.getTime();
-	static long totalWait = 0;
-	
-    public PluginStreamHandler(InputStream inputstream, OutputStream outputstream)
-    throws MalformedURLException, IOException
-    {
-
-    	PluginDebug.debug("Current context CL=" + Thread.currentThread().getContextClassLoader());
-    	try {
-			pav = (PluginAppletViewer) ClassLoader.getSystemClassLoader().loadClass("sun.applet.PluginAppletViewer").newInstance();
-			PluginDebug.debug("Loaded: " + pav + " CL=" + pav.getClass().getClassLoader());
-		} catch (InstantiationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (IllegalAccessException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (ClassNotFoundException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-
-    	PluginDebug.debug("Creating consumer...");
-    	consumer = new PluginMessageConsumer(this);
-
-    	// Set up input and output pipes.  Use UTF-8 encoding.
-    	pluginInputReader =
-    		new BufferedReader(new InputStreamReader(inputstream,
-    				Charset.forName("UTF-8")));
-    	/*pluginInputTokenizer = new StreamTokenizer(pluginInputReader);
-    	pluginInputTokenizer.resetSyntax();
-    	pluginInputTokenizer.whitespaceChars('\u0000', '\u0000');
-    	pluginInputTokenizer.wordChars('\u0001', '\u00FF');*/
-    	pluginOutputWriter =
-    		new BufferedWriter(new OutputStreamWriter
-    				(outputstream, Charset.forName("UTF-8")));
-
-    	/*
-	while(true) {
-            String message = read();
-            PluginDebug.debug(message);
-            handleMessage(message);
-            // TODO:
-            // write(queue.peek());
-	}
-    	 */
-    }
-
-    public void startProcessing() {
-
-    	Thread listenerThread = new Thread() {
-
-    		public void run() {
-    			
-    			while (true) {
-
-    				PluginDebug.debug("Waiting for data...");
-    				
-    	    		long b4 = new Date().getTime();
-
-    				String s = read();
-                    
-    	    		long after = new Date().getTime();
-
-    	    		totalWait += (after - b4);
-    				//System.err.println("Total wait time: " + totalWait);
-
-    				if (s != null) {
-    					consumer.queue(s);
-    				} else {
-    					try {
-    						// Close input/output channels to plugin.
-    						pluginInputReader.close();
-    						pluginOutputWriter.close();
-    					} catch (IOException exception) {
-    						// Deliberately ignore IOException caused by broken
-    						// pipe since plugin may have already detached.
-    					}
-    					AppletSecurityContextManager.dumpStore(0);
-    					PluginDebug.debug("APPLETVIEWER: exiting appletviewer");
-    					System.exit(0);
-    				}
-    				
-/*    				
-    				int readChar = -1;
-    				// blocking read, discard first character
-    				try {
-    					readChar = pluginInputReader.read();
-    				} catch (IOException ioe) {
-    					// plugin may have detached
-    				}
-
-    				// if not disconnected
-    				if (readChar != -1) {
-    					String s = read();
-    					PluginDebug.debug("Got data, consuming " + s);
-    					consumer.consume(s);
-    				} else {
-    					try {
-    						// Close input/output channels to plugin.
-    						pluginInputReader.close();
-    						pluginOutputWriter.close();
-    					} catch (IOException exception) {
-    						// Deliberately ignore IOException caused by broken
-    						// pipe since plugin may have already detached.
-    					}
-    					AppletSecurityContextManager.dumpStore(0);
-    					PluginDebug.debug("APPLETVIEWER: exiting appletviewer");
-    					System.exit(0);
-    				}
-*/
-    			}
-    		}
-    	};
-    	
-    	listenerThread.start();
-    }
-    
-    public void handleMessage(String message) throws PluginException {
-
-    	int nextIndex = 0;
-    	int reference = -1;
-    	String src = null;
-    	String[] privileges = null;
-    	String rest = "";
-
-    	String[] msgComponents = message.split(" ");
-    
-		if (msgComponents.length < 2)
-			return;
-
-        if (msgComponents[0].startsWith("plugin")) {
-            handlePluginMessage(message);
-            return;
-        }
-
-    	// type and identifier are guaranteed to be there
-    	String type = msgComponents[0];
-    	final int identifier = Integer.parseInt(msgComponents[1]);
-    	nextIndex = 2;
-    	
-    	// reference, src and privileges are optional components, 
-    	// and are guaranteed to be in that order, if they occur
-
-    	// is there a reference ?
-    	if (msgComponents[nextIndex].equals("reference")) {
-    		reference = Integer.parseInt(msgComponents[nextIndex+1]);
-    		nextIndex += 2;
-    	}
-
-    	// is there a src?
-    	if (msgComponents[nextIndex].equals("src")) {
-    		src = msgComponents[nextIndex+1];
-    		nextIndex += 2;
-    	}
-
-    	// is there a privileges?
-    	if (msgComponents[nextIndex].equals("privileges")) {
-    		String privs = msgComponents[nextIndex+1];
-    		privileges = privs.split(",");
-    		nextIndex += 2;
-    	}
-
-    	// rest
-    	for (int i=nextIndex; i < msgComponents.length; i++) {
-    		rest += msgComponents[i];
-    		rest += " ";
-    	}
-
-    	rest = rest.trim();
-
-    	try {
-
-    		PluginDebug.debug("Breakdown -- type: " + type + " identifier: " + identifier + " reference: " + reference + " src: " + src + " privileges: " + privileges + " rest: \"" + rest + "\"");
-
-    		if (rest.contains("JavaScriptGetWindow")
-    				|| rest.contains("JavaScriptGetMember")
-    				|| rest.contains("JavaScriptSetMember")
-    				|| rest.contains("JavaScriptGetSlot")
-    				|| rest.contains("JavaScriptSetSlot")
-    				|| rest.contains("JavaScriptEval")
-    				|| rest.contains("JavaScriptRemoveMember")
-    				|| rest.contains("JavaScriptCall")
-    				|| rest.contains("JavaScriptFinalize")
-    				|| rest.contains("JavaScriptToString")) {
-    			
-				finishCallRequest("reference " + reference + " " + rest);
-    			return;
-    		}
-
-    		final int freference = reference;
-    		final String frest = rest;
-
-    		if (type.equals("instance")) {
-    			PluginAppletViewer.handleMessage(identifier, freference,frest);
-    		} else if (type.equals("context")) {
-    			PluginDebug.debug("Sending to PASC: " + identifier + "/" + reference + " and " + rest);
-    			AppletSecurityContextManager.handleMessage(identifier, reference, src, privileges, rest);
-    		}
-    	} catch (Exception e) {
-    		throw new PluginException(this, identifier, reference, e);
-    	}
-    }
-
-    private void handlePluginMessage(String message) {
-        if (message.equals("plugin showconsole")) {
-            showConsole();
-        } else if (message.equals("plugin hideconsole")) {
-            hideConsole();            
-        } else {
-            // else this is something that was specifically requested
-            finishCallRequest(message);
-        }
-    }
-
-    public void postCallRequest(PluginCallRequest request) {
-        synchronized(queue) {
-   			queue.post(request);
-        }
-    }
-
-    private void finishCallRequest(String message) {
-    	PluginDebug.debug ("DISPATCHCALLREQUESTS 1");
-    	synchronized(queue) {
-    		PluginDebug.debug ("DISPATCHCALLREQUESTS 2");
-    		PluginCallRequest request = queue.pop();
-
-    		// make sure we give the message to the right request 
-    		// in the queue.. for the love of God, MAKE SURE!
-
-    		// first let's be efficient.. if there was only one 
-    		// request in queue, we're already set
-    		if (queue.size() != 0) {
-
-    			int size = queue.size();
-    			int count = 0;
-
-    			while (!request.serviceable(message)) {
-
-     				PluginDebug.debug(request + " cannot service " + message);
-    			    
-    				// something is very wrong.. we have a message to 
-    				// process, but no one to service it
-    				if (count >= size) {
-    					throw new RuntimeException("Unable to find processor for message " + message);
-    				}
-
-    				// post request at the end of the queue
-    				queue.post(request);
-
-    				// Look at the next request
-    				request = queue.pop();
-
-    				count++;
-    			}
-
-    		}
-
-    		PluginDebug.debug ("DISPATCHCALLREQUESTS 3");
-    		if (request != null) {
-    			PluginDebug.debug ("DISPATCHCALLREQUESTS 5");
-    			synchronized(request) {
-    				request.parseReturn(message);
-    				request.notifyAll();
-    			}
-    			PluginDebug.debug ("DISPATCHCALLREQUESTS 6");
-    			PluginDebug.debug ("DISPATCHCALLREQUESTS 7");
-    		}
-    	}
-    	PluginDebug.debug ("DISPATCHCALLREQUESTS 8");
-    }
-
-    /**
-     * Read string from plugin.
-     *
-     * @return the read string
-     *
-     * @exception IOException if an error occurs
-     */
-    private String read()
-    {
-    	String message = null;
-
-    	try {
-    		message = pluginInputReader.readLine();
-    		PluginDebug.debug("  PIPE: appletviewer read: " + message);
-
-            if (message == null || message.equals("shutdown")) {
-                synchronized(shuttingDown) {
-                    shuttingDown = true;
-                }
-                try {
-                    // Close input/output channels to plugin.
-                    pluginInputReader.close();
-                    pluginOutputWriter.close();
-                } catch (IOException exception) {
-                    // Deliberately ignore IOException caused by broken
-                    // pipe since plugin may have already detached.
-                }
-                AppletSecurityContextManager.dumpStore(0);
-                PluginDebug.debug("APPLETVIEWER: exiting appletviewer");
-                System.exit(0);
-            }
-    	} catch (IOException e) {
-    	       e.printStackTrace();
-    	}
-
-    	return message;
-    }
-    
-    /**
-     * Write string to plugin.
-     * 
-     * @param message the message to write
-     *
-     * @exception IOException if an error occurs
-     */
-    public void write(String message)
-    {
-
-    	PluginDebug.debug("  PIPE: appletviewer wrote: " + message);
-        synchronized(pluginOutputWriter) {
-        	try {
-        		pluginOutputWriter.write(message + "\n", 0, message.length());
-        		pluginOutputWriter.write(0);
-        		pluginOutputWriter.flush();
-        	} catch (IOException e) {
-        		// if we are shutting down, ignore write failures as 
-        		// pipe may have closed
-        		synchronized(shuttingDown) {
-        			if (!shuttingDown) {
-        				e.printStackTrace();
-        			}
-        		}
-
-        		// either ways, if the pipe is broken, there is nothing 
-        		// we can do anymore. Don't hang around.
-        		PluginDebug.debug("Unable to write to PIPE. APPLETVIEWER exiting");        		
-        		System.exit(1);
-        	}
-		}
-
-		return;
-    /*	
-    	synchronized(writeQueue) {
-            writeQueue.add(message);
-            PluginDebug.debug("  PIPE: appletviewer wrote: " + message);
-    	}
-	*/
-
-    }
-
-    public boolean messageAvailable() {
-    	return writeQueue.size() != 0;
-    }
-
-    public String getMessage() {
-    	synchronized(writeQueue) {
-			String ret = writeQueue.size() > 0 ? writeQueue.poll() : "";
-    		return ret;
-    	}
-    }
-    
-    private void showConsole() {
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                console.showConsole();
-            }
-        });
-    }
-    
-    private void hideConsole() {
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                console.hideConsole();
-            }
-        });
-    }
-}
--- a/plugin/icedteanp/java/sun/applet/RequestQueue.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package sun.applet;
-
-
-public class RequestQueue {
-    PluginCallRequest head = null;
-    PluginCallRequest tail = null;
-    private int size = 0;
-
-    public void post(PluginCallRequest request) {
-    	PluginDebug.debug("Securitymanager=" + System.getSecurityManager());
-        if (head == null) {
-            head = tail = request;
-            tail.setNext(null);
-        } else {
-            tail.setNext(request);
-            tail = request;
-            tail.setNext(null);
-        }
-        
-        size++;
-    }
-
-    public PluginCallRequest pop() {
-        if (head == null)
-            return null;
-
-        PluginCallRequest ret = head;
-        head = head.getNext();
-        ret.setNext(null);
-
-        size--;
-        
-        return ret;
-    }
-    
-    public int size() {
-    	return size;
-    }
-}
--- a/plugin/icedteanp/java/sun/applet/TestEnv.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/* TestEnv -- test JavaScript-to-Java calls
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-public class TestEnv
-{
-    public static int intField = 103;
-    public int intInstanceField = 7822;
-    public String stringField = "hello";
-    // z <musical G clef> <chinese water>
-    public String complexStringField = "z\uD834\uDD1E\u6C34";
-
-    public static void TestIt() {
-        PluginDebug.debug("TestIt");
-    }
-
-    public static void TestItBool(boolean arg) {
-        PluginDebug.debug("TestItBool: " + arg);
-    }
-
-    public static void TestItByte(byte arg) {
-        PluginDebug.debug("TestItByte: " + arg);
-    }
-
-    public static void TestItChar(char arg) {
-        PluginDebug.debug("TestItChar: " + arg);
-    }
-
-    public static void TestItShort(short arg) {
-        PluginDebug.debug("TestItShort: " + arg);
-    }
-
-    public static void TestItInt(int arg) {
-        PluginDebug.debug("TestItInt: " + arg);
-    }
-
-    public static void TestItLong(long arg) {
-        PluginDebug.debug("TestItLong: " + arg);
-    }
-
-    public static void TestItFloat(float arg) {
-        PluginDebug.debug("TestItFloat: " + arg);
-    }
-
-    public static void TestItDouble(double arg) {
-        PluginDebug.debug("TestItDouble: " + arg);
-    }
-
-    public static void TestItObject(TestEnv arg) {
-        PluginDebug.debug("TestItObject: " + arg);
-    }
-
-    public static void TestItObjectString(String arg) {
-        PluginDebug.debug("TestItObjectString: " + arg);
-    }
-
-    public static void TestItIntArray(int[] arg) {
-        PluginDebug.debug("TestItIntArray: " + arg);
-        for (int i = 0; i < arg.length; i++)
-            PluginDebug.debug ("ELEMENT: " + i + " " + arg[i]);
-    }
-
-    public static void TestItObjectArray(String[] arg) {
-        PluginDebug.debug("TestItObjectArray: " + arg);
-        for (int i = 0; i < arg.length; i++)
-            PluginDebug.debug ("ELEMENT: " + i + " " + arg[i]);
-    }
-
-    public static void TestItObjectArrayMulti(String[][] arg) {
-        PluginDebug.debug("TestItObjectArrayMulti: " + arg);
-        for (int i = 0; i < arg.length; i++)
-            for (int j = 0; j < arg[i].length; j++)
-                PluginDebug.debug ("ELEMENT: " + i + " " + j + " " + arg[i][j]);
-    }
-
-    public static boolean TestItBoolReturnTrue() {
-        return true;
-    }
-
-    public static boolean TestItBoolReturnFalse() {
-        return false;
-    }
-
-    public static byte TestItByteReturn() {
-        return (byte) 0xfe;
-    }
-
-    public static char TestItCharReturn() {
-        return 'K';
-    }
-
-    public static char TestItCharUnicodeReturn() {
-        return '\u6C34';
-    }
-
-    public static short TestItShortReturn() {
-        return 23;
-    }
-
-    public static int TestItIntReturn() {
-        return 3445;
-    }
-
-    public static long TestItLongReturn() {
-        return 3242883;
-    }
-
-    public static float TestItFloatReturn() {
-        return 9.21E4f;
-    }
-
-    public static double TestItDoubleReturn() {
-        return 8.33E88;
-    }
-
-    public static Object TestItObjectReturn() {
-        return new String("Thomas");
-    }
-
-    public static int[] TestItIntArrayReturn() {
-        return new int[] { 6, 7, 8 };
-    }
-
-    public static String[] TestItObjectArrayReturn() {
-        return new String[] { "Thomas", "Brigitte" };
-    }
-
-    public static String[][] TestItObjectArrayMultiReturn() {
-        return new String[][] { {"Thomas", "Brigitte"},
-                                {"Lindsay", "Michael"} };
-    }
-
-    public int TestItIntInstance(int arg) {
-        PluginDebug.debug("TestItIntInstance: " + this + " " + arg);
-        return 899;
-    }
-}
--- a/plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/* VoidPluginCallRequest -- represent Java-to-JavaScript requests
-   Copyright (C) 2008  Red Hat
-
-This file is part of IcedTea.
-
-IcedTea is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-IcedTea is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
-
-package sun.applet;
-
-
-public class VoidPluginCallRequest extends PluginCallRequest {
-    public VoidPluginCallRequest(String message, Long reference) {
-        super(message, reference);
-        PluginDebug.debug ("VoidPluginCall " + message);
-    }
-
-    public void parseReturn(String message) {
-    	setDone(true);
-    }
-    
-    public Object getObject() {
-    	return null;
-    }
-}
--- a/plugin/tests/LiveConnect/DummyObject.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-public class DummyObject {
-     private String str;
-     
-     public DummyObject(String s) {
-        this.str = s;
-     }
-     
-     public void setStr(String s) {
-        this.str = s;
-     }
-     
-     public String toString() {
-        return str;
-     }
-}
--- a/plugin/tests/LiveConnect/OverloadTestHelper1.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-public class OverloadTestHelper1 {}
--- a/plugin/tests/LiveConnect/OverloadTestHelper2.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-public class OverloadTestHelper2 extends OverloadTestHelper1 {}
--- a/plugin/tests/LiveConnect/OverloadTestHelper3.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-public class OverloadTestHelper3 extends  OverloadTestHelper2 {}
--- a/plugin/tests/LiveConnect/PluginTest.java	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,710 +0,0 @@
-import javax.swing.JApplet;
-import java.awt.Graphics;
-import java.awt.*;
-import java.applet.*;
-import java.awt.event.*;
-import netscape.javascript.JSObject;
-import java.lang.reflect.Array;
-
-public class PluginTest extends JApplet {
-
-    public int i = 42;
-    public double d = 42.42;
-    public float f = 42.1F;
-    public long l = 4294967296L;
-    public boolean b = true;
-    public char c = '\u2323';
-    public byte by = 43;
-    public String rs = "I'm a string!";
-    public String ss = "𠁎〒£$ǣ€𝍖";
-    public Object n = null;
-    public int[] ia = new int[5];
-
-    public Integer I = 24;
-    public Double D = 24.24;
-    public Float F = 24.124F;
-    public Long L = 6927694924L;
-    public Boolean B = false;
-    public Character C = '\u1526';
-    public Byte By = 34;
-    public Double[] Da1 = new Double[10];
-    public Double[] Da2 = null;
-
-    public char[] ca = new char[3];
-    public Character[] Ca = new Character[3];
-
-    public void setUpForGMTests() {
-        i = 42;
-        d = 42.42;
-        f = 42.1F;
-        l = 4294967296L;
-        b = true;
-        c = '\u2323';
-        by = 43;
-        rs = "I'm a string!";
-        ss = "𠁎〒£$ǣ€𝍖";
-        n = null;
-
-        I = 24;
-        D = 24.24;
-        F = 24.124F;
-        L = 6927694924L;
-        B = false;
-        C = '\u1526';
-        By = 34;
-
-        ia[4] = 1024;
-        Da1[9] = D;
-    }
-
-    public void setUpForSMTests() {
-        i = 0;
-        d = 0.0;
-        f = 0F;
-        l = 0L;
-        b = false;
-        c = 'A';
-        by = 0;
-        rs = "";
-        ss = "";
-        n = new String("non-null object");
-
-        I = 0;
-        D = 0.0;
-        F = 0F;
-        L = 0L;
-        B = false;
-        C = 'A';
-        By = null;
-
-        ia[4] = 0;
-        Da1[9] = D;
-    }
-
-    /*
-     *****************************************
-     * JS -> Java Parameter conversion tests *
-     *****************************************
-    */
-    public void setUpForReturnTests() {
-        i = 41;
-        d = 41.41;
-        f = 41.411F;
-        l = 4294967297L;
-        b = true;
-        c = '\u2329';
-        by = 44;
-        rs = "I'm a string too!";
-        ss = "𠁎〒£$ǣ€𝍖";
-        n = null;
-
-        I = 14;
-        D = 14.14;
-        F = 14.114F;
-        L = 6927694925L;
-        B = false;
-        C = '\u2417';
-        By = 46;
-    }
-
-    /*
-     **************************************
-     * JS -> Java invocation return tests *
-     **************************************
-    */
-
-    public int intReturnTest() { return i; }
-
-    public double doubleReturnTest() { return d; }
-
-    public float floatReturnTest() { return f; }
-
-    public long longReturnTest() { return l; }
-
-    public boolean booleanReturnTest() { return b; }
-
-    public char charReturnTest() { return c; }
-
-    public byte byteReturnTest() { return by; }
-    
-    public char[] charArrayReturnTest() { 
-        ca[0] = '\u2410';
-        ca[1] = '\u2411';
-        ca[2] = '\u2412';
-        return ca; 
-    }
-
-    public String regularStringReturnTest() { return rs; }
-
-    public String specialStringReturnTest() { return ss; }
-
-    public void voidReturnTest() { }
-
-    public Object nullReturnTest() { return null; }
-
-    public Integer IntegerReturnTest() { return I; }
-
-    public Double DoubleReturnTest() { return D; }
-    public void DoubleSetTest(double set) { D = set; }
-
-    public Float FloatReturnTest() { return F; }
-
-    public Long LongReturnTest() { return L; }
-
-    public Boolean BooleanReturnTest() { return B; }
-
-    public Character CharacterReturnTest() { return C; }
-
-    public Byte ByteReturnTest() { return By; }
-
-    public Character[] CharacterArrayReturnTest() { 
-        Ca[0] = '\u2350';
-        Ca[1] = '\u2351';
-        Ca[2] = '\u2352';
-        return Ca; 
-    }
-
-    /*
-     **************************************
-     * JS -> Java parameter passing tests *
-     **************************************
-    */
-
-    public void setUpForParameterTests() {
-        i = 41;
-        d = 41.41;
-        f = 41.411F;
-        l = 4294967297L;
-        b = true;
-        c = '\u2329';
-        by = 44;
-        rs = "I'm a string too!";
-        ss = "𠁎〒£$ǣ€𝍖";
-        n = null;
-
-        I = 14;
-        D = 14.14;
-        F = 14.114F;
-        L = 6927694925L;
-        B = false;
-        C = '\u2417';
-        By = 46;
-    }
-
-    public String functioniParamTest(int i) {
-       String ret = Integer.toString(i);
-       return ret;
-    }
-
-    public String functiondParamTest(double d) {
-        String ret = Double.toString(d);
-        return ret;
-     }
-
-    public String functionfParamTest(float f) {
-        String ret = Float.toString(f);
-        return ret;
-     }
-
-    public String functionlParamTest(long l) {
-        String ret = Long.toString(l);
-        return ret;
-    }
-    
-    public String functionbParamTest(boolean b) {
-        String ret = Boolean.toString(b);
-        return ret;
-     }
-    
-    public String functioncParamTest(char c) {
-        String ret = Character.toString(c);
-        return ret;
-     }
-    
-    public String functionbyParamTest(byte b) {
-        String ret = Byte.toString(b);
-        return ret;
-     }
-    
-     public String functioncaParamTest(char[] ca) {
-    
-        String ret = "";
-        ret += ca[0];
-        for (int i=1 ; i < ca.length; i++) {
-            ret += ":" + ca[i];
-        }
-
-        return ret;
-    }
-    
-    public String functionsiaParamTest(String[] s) {
-    
-        String ret = s[0];
-        for (int i=1 ; i < s.length; i++) {
-            ret += ":" + s[i];
-        }
-
-        return ret;
-    }
-
-    public String functionsParamTest(String s) {
-        return s + ":" + s.getClass().getName();
-    }
-    
-    public String functionIParamTest(Integer p) {
-        String ret = p.toString() + ":" + p.getClass().getName();
-        return ret;
-    }
-    
-    public String functionDParamTest(Double p) {
-        String ret = p.toString() + ":" + p.getClass().getName();
-        return ret;
-    }
-    
-    public String functionFParamTest(Float p) {
-        String ret = p.toString() + ":" + p.getClass().getName();
-        return ret;
-    }
-    
-    public String functionLParamTest(Long p) {
-        String ret = p.toString() + ":" + p.getClass().getName();
-        return ret;
-    }
-    
-    public String functionBParamTest(Boolean p) {
-        String ret = p.toString() + ":" + p.getClass().getName();
-        return ret;
-    }
-    
-    public String functionCParamTest(Character p) {
-        String ret = p.toString() + ":" + p.getClass().getName();
-        return ret;
-    }
-    
-    public String functionBParamTest(Byte p) {
-        String ret = p.toString() + ":" + p.getClass().getName();
-        return ret;
-    }
-    
-    public String functionCaParamTest(Character p) {
-        String ret = p.toString() + ":" + p.getClass().getName();
-        return ret;
-    }
-    
-    public String functioncomplexaParamTest(DummyObject[] ca) {
-        String ret = ca[0].toString();
-        for (int i=1 ; i < ca.length; i++) {
-            ret += ":" + ca[i].toString();
-        }
-
-        return ret;
-    }
-
-    /*
-     ***********************************************
-     * JS -> Java overload resolution plugin tests *
-     ***********************************************
-    */
-
-    /* Numeric type to the analogous Java primitive type */
-    
-    public String foo_num_to_num(int p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":int"; }
-    
-    // int -> int is lower than:
-    // int to double
-    public String foo_num_to_num(long p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":long"; }
-    // int to String
-    public String foo_num_to_num(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-
-
-    /* Null to any non-primitive type */
-    public String foo_null_to_nonprim(Integer p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":Integer"; }
-    
-    // Null to non-prim is better than:
-    // null -> prim (not allowed)
-    public String foo_null_to_nonprim(int p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":int"; }
-
-
-    /* JSObject to JSObject */
-    public String foo_jso_to_jso(JSObject p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":JSObject"; }
-
-    // JSO -> JSO is better than:
-    // JSO -> String
-    public String foo_jso_to_jso(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    // JSO -> Java array
-    public String foo_jso_to_jso(String[] p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    // JSO -> Superclass (Object)
-    public String foo_jso_to_jso(Object p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-
-
-    /* Class type to Class type where the types are equal */
-    public String foo_ct_to_ct(OverloadTestHelper2 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    
-    // CT -> CT is better than:
-    // CT -> Superclass
-    public String foo_ct_to_ct(OverloadTestHelper1 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    // CT->Subclass
-    public String foo_ct_to_ct(OverloadTestHelper3 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-
-
-
-    /* Numeric type to a different primitive type */
-    public String foo_multiprim(double p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":double"; }
-    
-    // Num -> Diff. prim. is better than:
-    // Better than anything else.. using string as a dummy
-    public String foo_multiprim(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-
-
-
-    /* String to numeric */
-    public String foo_strnum(double p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":double"; }
-    
-    // Str -> Num is better than:
-    // Anything else .. using OverloadTestHelper1 as a dummy
-    public String foo_strnum(OverloadTestHelper1 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    
-
-    /* Class type to superclass type (with subclass passed) */
-    public String foo_ct_to_sc(OverloadTestHelper1 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":OverloadTestHelper1"; }
-
-    // CT -> Superclass is better than CT to String
-    public String foo_ct_to_sc(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    
-    
-
-    /* Any Java value to String */
-    public String foo_jv_to_str(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    
-    // JV -> Str is better than anything else allowed
-    public String foo_jv_to_str(JSObject p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    
-    
-    
-    /* JSO to Array (lower cost) */
-    public String foo_jso_to_array(int[] p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":int[]"; }
-
-    // JSO to array is better than:
-    // something not possible
-    public String foo_jso_to_array(Integer p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-    
-    
-    /****** Not allowed resolutions *******/
-    
-    /* null to primitive */
-    public String foo_null_to_prim(int p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":int"; }
-
-    /* JSObject to something else */
-    public String foo_jso_to_somethingelse(OverloadTestHelper1 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-
-    /* Any other conversion not described ... e.g. sending non-array to array */
-    public String foo_unsupported(Object[] p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); }
-
-    /*
-     ******************************
-     * JS -> Java type conversion *
-     ******************************
-    */
-
-    public byte byte_type = 0;
-    public char char_type = 'A';
-    public short short_type = 0;
-    public int int_type = 0;
-    public long long_type = 0L;
-    public float float_type = 0F;
-    public double double_type = 0.0;
-    public boolean boolean_type = false;
-    
-    public byte[] byte_array = null;
-    public char[] char_array = null;
-    public short[] short_array = null;
-    public int[] int_array = null;
-    public long[] long_array = null;
-    public float[] float_array = null;
-    public double[] double_array = null;
-    public char[][] char_array_array = null;
-
-    public Byte Byte_type = null;    
-    public Character Character_type = 'A';
-    public Short Short_type = 0;
-    public Integer Integer_type = 0;
-    public Long Long_type = 0L;
-    public Float Float_type = 0F;
-    public Double Double_type = 0.0;
-    public String String_type = "";
-    public Boolean Boolean_type = false;
-    public JSObject JSObject_type = null;
-
-    public Byte[] Byte_array = null;    
-    public Character[] Character_array = null;
-    public Short[] Short_array = null;
-    public Integer[] Integer_array = null;
-    public Long[] Long_array = null;
-    public Float[] Float_array = null;
-    public Double[] Double_array = null;
-    public String[] String_array = null;
-    public String[][] String_array_array = null;
-
-    public Object Object_type = null;
-
-    public String getArrayAsStr(Object array) {
-        int size = Array.getLength(array);
-        
-        String ret = "";
-        for (int i=0; i < size; i++) {
-            ret += Array.get(array, i) == null ? "null" : Array.get(array, i).toString();
-            ret += ",";
-        }
-
-        if (ret.length() > 0) {
-            ret = ret.substring(0, ret.length()-1);
-        }
-        
-        return ret;
-    }
-
-    /*
-    **************************
-    **************************
-    * Begin Java -> JS tests *
-    **************************
-    **************************
-    */
-
-    public DummyObject dummyObject = new DummyObject("DummyObject1");
-    public Object value;
-    private JSObject window;
-
-    /*
-    *************************
-    * Java -> JS read tests *
-    *************************
-    */
-
-    public boolean jjsReadIntTest() {
-        value = new Integer(window.getMember("intvar").toString());
-        return ((Integer) value).equals(1);
-    }
-
-    public boolean jjsReadDoubleTest() {
-        value = new Double(window.getMember("doublevar").toString());
-        return ((Double) value).equals(1.1);
-    }
-
-    public boolean jjsReadBooleanTest() {
-        value = new Boolean(window.getMember("boolvar").toString());
-        return ((Boolean) value).equals(true);
-    }
-
-    public boolean jjsReadStringTest() {
-        value = window.getMember("stringvar").toString();
-        return ((String) value).equals("stringvar");
-    }
-
-    public boolean jjsReadObjectTest() {
-        value = window.getMember("objectvar").toString();
-        return value.equals("DummyObject1");
-    }
-    
-    public boolean jjsRead1DArrayTest() {
-        value = ((JSObject) window.getMember("arrayvar")).getSlot(1);
-        return value.toString().equals("100");
-    }
-
-    public boolean jjsRead2DArrayTest() {
-        value = ((JSObject) ((JSObject) window.getMember("arrayvar2")).getSlot(1)).getSlot(2);
-        return value.toString().equals("200");
-    }
-
-    /*
-    **************************
-    * Java -> JS write tests *
-    **************************
-    */
-
-    public void jjsSetIntTest() {
-        window.setMember("setvar", (int) 1);
-    }
-
-    public void jjsSetIntegerTest() {
-        window.setMember("setvar", new Integer(2));
-    }
-
-    public void jjsSetdoubleTest() {
-        window.setMember("setvar", (double) 2.1);
-    }
-
-    public void jjsSetDoubleTest() {
-        window.setMember("setvar", new Double(2.2));
-    }
-
-    public void jjsSetfloatTest() {
-        window.setMember("setvar", (float) 2.3);
-    }
-
-    public void jjsSetFloatTest() {
-        window.setMember("setvar", new Float(2.4));
-    }
-
-    public void jjsSetshortTest() {
-        window.setMember("setvar", (short) 3);
-    }
-
-    public void jjsSetShortTest() {
-        window.setMember("setvar", new Short((short) 4));
-    }
-
-    public void jjsSetlongTest() {
-        window.setMember("setvar", (long) 4294967296L);
-    }
-
-    public void jjsSetLongTest() {
-        window.setMember("setvar", new Long(4294967297L));
-    }
-
-    public void jjsSetbyteTest() {
-        window.setMember("setvar", (byte) 5);
-    }
-
-    public void jjsSetByteTest() {
-        window.setMember("setvar", new Byte((byte) 6));
-    }
-
-    public void jjsSetcharTest() {
-        window.setMember("setvar", (char) '\u2323');
-    }
-
-    public void jjsSetCharacterTest() {
-        window.setMember("setvar", new Character('\u2324'));
-    }
-
-    public void jjsSetbooleanTest() {
-        window.setMember("setvar", (boolean) true);
-    }
-
-    public void jjsSetBooleanTest() {
-        window.setMember("setvar", new Boolean(false));
-    }
-
-    public void jjsSetStringTest() {
-        window.setMember("setvar", "𠁎〒£$ǣ€𝍖");
-    }
-
-    public void jjsSetObjectTest() {
-        dummyObject = new DummyObject("DummyObject2");
-        window.setMember("setvar", dummyObject);
-    }
-    
-    public void jjsSet1DArrayTest() {
-        ((JSObject) window.getMember("setvar")).setSlot(1, 100);
-    }
-
-    public void jjsSet2DArrayTest() {
-        ((JSObject) ((JSObject) window.getMember("setvar")).getSlot(1)).setSlot(2, 200);
-    }
-
-    /*
-    ****************************************
-    * Java -> JS call parameter conversion *
-    ****************************************
-    */
-
-    public String jjsCallParamTest(String type) {
-
-        Object ret = new Object();
-        
-        int i = 1;
-        double d = 1.1;
-        float f = 1.2F;
-        long l = 4294967296L;
-        short s = 2;
-        byte b = 3;
-        char c = '\u2323';
-        boolean bl = true;
-        Integer I = 4;
-        Double D = 4.1;
-        Float F = 4.2F;
-        Long L = 4294967297L;
-        Short S = 5;
-        Byte B = 6;
-        Boolean Bl = false;
-        Character C = '\u2324';
-        String str = "𠁎〒£$ǣ€𝍖";
-        Object o = new DummyObject("d1");
-        
-        String  callParamTestFuncName = "JJSParameterTypeCallTest";
-        
-        if (type.equals("int"))
-            ret = window.call(callParamTestFuncName, new Object[]{i});
-        else if (type.equals("double"))
-            ret = window.call(callParamTestFuncName, new Object[]{d});
-        else if (type.equals("float"))
-            ret = window.call(callParamTestFuncName, new Object[]{f});
-        else if (type.equals("long"))
-            ret = window.call(callParamTestFuncName, new Object[]{l});
-        else if (type.equals("short"))
-            ret = window.call(callParamTestFuncName, new Object[]{s});
-        else if (type.equals("byte"))
-            ret = window.call(callParamTestFuncName, new Object[]{b});
-        else if (type.equals("char"))
-            ret = window.call(callParamTestFuncName, new Object[]{c});
-        else if (type.equals("boolean"))
-            ret = window.call(callParamTestFuncName, new Object[]{bl});
-        else if (type.equals("java.lang.Integer"))
-            ret = window.call(callParamTestFuncName, new Object[]{I});
-        else if (type.equals("java.lang.Double"))
-            ret = window.call(callParamTestFuncName, new Object[]{D});
-        else if (type.equals("java.lang.Float"))
-            ret = window.call(callParamTestFuncName, new Object[]{F});
-        else if (type.equals("java.lang.Long"))
-            ret = window.call(callParamTestFuncName, new Object[]{L});
-        else if (type.equals("java.lang.Short"))
-            ret = window.call(callParamTestFuncName, new Object[]{S});
-        else if (type.equals("java.lang.Byte"))
-            ret = window.call(callParamTestFuncName, new Object[]{B});
-        else if (type.equals("java.lang.Boolean"))
-            ret = window.call(callParamTestFuncName, new Object[]{Bl});
-        else if (type.equals("java.lang.Character"))
-            ret = window.call(callParamTestFuncName, new Object[]{C});
-        else if (type.equals("java.lang.String"))
-            ret = window.call(callParamTestFuncName, new Object[]{str});
-        else if (type.equals("PluginTest.Packages.DummyObject"))
-            ret = window.call(callParamTestFuncName, new Object[]{o});
-        else
-            ret = "Unknown param type: " + type;
-
-        return ret.toString();
-    }
-    
-    /*
-    *******************************************
-    * Java -> JS invocation return type tests *
-    *******************************************
-    */
-
-    public String jjsReturnTypeTest(String type) {
-    
-        String  returnTypeTestFuncName = "JJSReturnTypeCallTest";
-        Object ret = window.call(returnTypeTestFuncName, new Object[]{type});
-
-        return ret.toString();        
-    }
-
-
-    /*
-    ***********************************
-    * Java -> JS invocation eval test *
-    ***********************************
-    */
-
-    public String jjsEvalTest(String str) {
-        return window.eval(str).toString();
-    }
-
-    public void init() {
-        window = JSObject.getWindow(this);
-        //JSObject.getWindow(this).call("appletLoaded", new Object[]{});
-    }
-
-}
-
--- a/plugin/tests/LiveConnect/build	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-# change to dir with tests
-cd `dirname $0`
-
-JAVAC=javac
-JAR=jar
-
-if [ ! -z $JAVA_HOME ]; then
-    JAVAC=$JAVA_HOME/bin/javac
-    JAVAC=$JAVA_HOME/bin/jar
-fi
-
-$JAVAC PluginTest.java DummyObject.java OverloadTestHelper*java
-$JAR cf PluginTest.jar PluginTest.class DummyObject.class OverloadTestHelper*class
-rm -f *class
-
-echo "Done. Now launch \"firefox file://`pwd`/index.html\""
--- a/plugin/tests/LiveConnect/common.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
- * Commonly used functions
- */
-
-        var cell, cellText; // reused
-
-        function updateTotals() {
-            document.getElementById("totals").innerHTML =  "<table class=\"results\" width=\"100%\"><tr><th>Total tests run </th><th> Passed </th><th> Failed </th><th> Errors </th></tr>" +
-                                                           "<tr><td>" + (passed+failed+errored) + " </td><td> " + passed + "  </td><td> " + failed + " </td><td> " + errored + " </td></tr>";
-        }
-
-        function pass(row) {
-            cell = document.createElement("td");
-            cell.setAttribute("style","color:green;text-align:center;font-weight: bold");
-            cellText = document.createTextNode("passed");
-            cell.appendChild(cellText);
-            row.appendChild(cell);
-
-            passed++;
-            updateTotals();
-        }
-
-        function fail(row, reason) {
-            cell = document.createElement("td");
-            cell.setAttribute("style","color:red;text-align:center;font-weight: bold");
-            if (reason)
-                cellText = document.createTextNode(reason);
-            else
-                cellText = document.createTextNode("failed");
-            cell.appendChild(cellText);
-            row.appendChild(cell);
-
-            failed++;
-            updateTotals();
-        }
-
-        function error(type, expected, e, row) {
-
-            cell = document.createElement("td");
-            cell.setAttribute("style","color:red;text-align:center;font-weight: bold");
-            cell.setAttribute("colspan","5");
-            cellText = document.createTextNode("An error occurred when running this test: " +  e);
-            cell.appendChild(cellText);
-            row.appendChild(cell);
-
-            errored++;
-            updateTotals();
-        }
-
-        function check(actual, expected, expectedtype, row) {
-           if (actual == expected) {
-                if (typeof(actual) == expectedtype) {
-                    pass(row);
-                 } else {
-                     fail(row, "Type mismatch: " + typeof(actual) + " != " + expectedtype);
-                 }
-            } else {
-                     fail(row, "Failed: " + actual + " [" + typeof(actual) + "] != " + expected + " [" + typeof(expected) + "]");
-            }
-        }
-
-        function doTest() {
-        
-            passed = 0;
-            failed = 0;
-            errored = 0;
-            document.getElementById("results").innerHTML = "";
-            updateTotals();
-       
-            try {
-                if (document.getElementById("testForm").jsjget.checked == 1)
-                    getMemberTests();
-                    
-                if (document.getElementById("testForm").jsjset.checked == 1)
-                    setMemberTests();
-
-                if (document.getElementById("testForm").jsjfp.checked == 1)
-                    fpCallTests();
-
-                if (document.getElementById("testForm").jsjfrt.checked == 1)
-                    rtCallTests();
-                    
-                if (document.getElementById("testForm").jsjfr.checked == 1)
-                    frCallTests();
-                    
-                if (document.getElementById("testForm").jsjtc.checked == 1)
-                    typeCastingTests();   
-                    
-                if (document.getElementById("testForm").jjsget.checked == 1)
-                    jjsGetMemberTests();
-                    
-                if (document.getElementById("testForm").jjsset.checked == 1)
-                    jjsSetMemberTests();
-                    
-                if (document.getElementById("testForm").jjcparam.checked == 1)
-                    jjsCallParameterTests();
-                    
-                if (document.getElementById("testForm").jjcrt.checked == 1)
-                    jjsCallReturnTypeTests();
-
-                if (document.getElementById("testForm").jjeval.checked == 1)
-                    jjsEvalTests();
-            } catch (e) {
-                document.getElementById("results").innerHTML += "<font color=\"red\">ERROR:<BR>" + e;
-            }
-        }
-        
-        function testAll() {
-            document.getElementById("testForm").jsjget.checked = 1;
-            document.getElementById("testForm").jsjset.checked = 1;
-            document.getElementById("testForm").jsjfp.checked = 1;
-            document.getElementById("testForm").jsjfrt.checked = 1;
-            document.getElementById("testForm").jsjfr.checked = 1;
-            document.getElementById("testForm").jsjtc.checked = 1;
-            document.getElementById("testForm").jjsget.checked = 1;
-            document.getElementById("testForm").jjsset.checked = 1;
-            document.getElementById("testForm").jjcparam.checked = 1;
-            document.getElementById("testForm").jjcrt.checked = 1;
-            document.getElementById("testForm").jjeval.checked = 1;
-
-            doTest();
-        }
-
-
-var intvar;
-var doublevar;
-var boolvar;
-var stringvar;
-var objectvar;
-var arrayvar;
-var arrayvar2;
-var setvar;
-
-function initVars() {
-    intvar = 1;
-    doublevar = 1.1;
-    boolvar = true;
-    stringvar = "stringvar";
-    objectvar = new PluginTest.Packages.DummyObject("DummyObject1");
-    arrayvar = new Array();
-    arrayvar[1] = 100;
-
-    arrayvar2 = new Array();
-    arrayvar2[1] = new Array();
-    arrayvar2[1][2] = 200;
-}
-
-function createResultTable(tbl, tblBody, columnNames) {
-    tbl.setAttribute("border", "5");
-    tbl.setAttribute("width", "100%");
-    tbl.setAttribute("class", "results");
-    row = document.createElement("tr");
-
-    for (var i=0; i < columnNames.length; i++) {
-        cell = document.createElement("th");
-        cellText = document.createTextNode(columnNames[i]);
-        cell.appendChild(cellText);
-        row.appendChild(cell);
-    }
-
-    tblBody.appendChild(row);
-    tbl.appendChild(tblBody);
-    document.getElementById("results").appendChild(tbl);
-}
-
-function addResult() {
-
-    var row = arguments[arguments.length-1];
-
-    // Different length arguments imply different width distributions
-
-    if (arguments.length == 4) {
-
-        cell = document.createElement("td");
-        cell.setAttribute("width","25%");
-        cellText = document.createTextNode(arguments[0]);
-        cell.appendChild(cellText);
-        row.appendChild(cell);
-
-        cell = document.createElement("td");
-        cell.setAttribute("width","20%");
-        cellText = document.createTextNode(arguments[1]);
-        cell.appendChild(cellText);
-        row.appendChild(cell);
-
-        cell = document.createElement("td");
-        cell.setAttribute("width","40%");
-        cellText = document.createTextNode(arguments[2]);
-        cell.appendChild(cellText);
-        row.appendChild(cell);
-
-    }  else if (arguments.length == 5) {
-
-        cell = document.createElement("td");
-        cell.setAttribute("width","25%");
-        cellText = document.createTextNode(arguments[0]);
-        cell.appendChild(cellText);
-        row.appendChild(cell);
-
-        cell = document.createElement("td");
-        cell.setAttribute("width","20%");
-        cellText = document.createTextNode(arguments[1]);
-        cell.appendChild(cellText);
-        row.appendChild(cell);
-
-        cell = document.createElement("td");
-        cell.setAttribute("width","20%");
-        cellText = document.createTextNode(arguments[2]);
-        cell.appendChild(cellText);
-        row.appendChild(cell);
-
-        cell = document.createElement("td");
-        cell.setAttribute("width","20%");
-        cellText = document.createTextNode(arguments[3]);
-        cell.appendChild(cellText);
-        row.appendChild(cell);
-
-    }
-}
--- a/plugin/tests/LiveConnect/index.html	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-<HTML>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-
-<HEAD>
-
-    <style type="text/css">
-        table.results {
-            background-color: white;
-            border-collapse: collapse;
-            border-color: black black black black;
-            border-spacing: 0px;
-            border-style: outset outset outset outset;
-            border-width: 0px 0px 0px 0px;
-        }
-
-        table.results th {
-            background-color: white;
-            border-style: inset inset inset inset;
-            border-color: gray gray gray gray;
-            border-width: 1px 1px 1px 1px;
-            padding: 1px 1px 1px 1px;
-        }
-
-        table.results td {
-            background-color: white;
-            border-color: gray gray gray gray;
-            border-style: inset inset inset inset;
-            border-width: 1px 1px 1px 1px;
-            padding: 2px 2px 2px 2px;
-        }
-
-    </style>
-
-    <!-- Load all tests scripts -->
-    <script language="JavaScript" src="common.js"></script>
-    <script language="JavaScript" src="jsj_get_tests.js"></script>
-    <script language="JavaScript" src="jsj_set_tests.js"></script>
-    <script language="JavaScript" src="jsj_func_rettype_tests.js"></script>
-    <script language="JavaScript" src="jsj_func_parameters_tests.js"></script>
-    <script language="JavaScript" src="jsj_func_overload_tests.js"></script>
-    <script language="JavaScript" src="jsj_type_conversion_tests.js"></script>    
-    <script language="JavaScript" src="jjs_tests.js"></script>
-    <script language="JavaScript" src="jjs_get_tests.js"></script>
-    <script language="JavaScript" src="jjs_set_tests.js"></script>
-    <script language="JavaScript" src="jjs_func_rettype_tests.js"></script>
-    <script language="JavaScript" src="jjs_func_parameters_tests.js"></script>
-    <script language="JavaScript" src="jjs_eval_test.js"></script>
-
-</HEAD>
-
-<BODY>
-
-<!-- Test selection/launch input -->
-<form id="testForm">
-    <table STYLE="width:100%; float:static">
-        <tr>
-            <td>
-                <input type=checkbox name="jsjget"><tt>JS -> Java read tests</tt><BR>
-                <input type=checkbox name="jsjset"><tt>JS -> Java set tests</tt><BR>
-                <input type=checkbox name="jsjfp"><tt>JS -> Java function parameter conversion tests</tt><BR>
-                <input type=checkbox name="jsjfrt"><tt>JS -> Java function return type tests</tt><BR>
-                <input type=checkbox name="jsjfr"><tt>JS -> Java function resolution tests</tt><BR>
-            </td>
-            <td>
-                <input type=checkbox name="jsjtc"><tt>JS -> Java type conversion tests</tt><BR>
-                <input type=checkbox name="jjsget"><tt>Java -> JS read tests</tt><BR>
-                <input type=checkbox name="jjsset"><tt>Java -> JS set tests</tt><BR>
-                <input type=checkbox name="jjcparam"><tt>Java -> JS function parameter conversion tests</tt><BR>
-                <input type=checkbox name="jjcrt"><tt>Java -> JS function return type tests</tt><BR>
-                <input type=checkbox name="jjeval"><tt>Java -> JS eval test</tt><BR>
-            </td>
-        </tr>
-        <tr>
-            <td>
-                <input type=button id="run_selected" value="Run selected tests" onclick="doTest();">
-                <input type=button id= "run_all" value="Run all tests" onclick="testAll();">
-            </td>
-        </tr>
-    </table>
-</form>
-
-<!-- Results -->
-<DIV ID="RESULTS">
-    <DIV ID="totals" STYLE="width:100%; float:static"></DIV>
-    <DIV ID="results" STYLE="width:100%; float:static"></DIV>
-</DIV>
-
-<APPLET CODE="PluginTest.class" ARCHIVE="PluginTest.jar" NAME="PluginTest" WIDTH="0" HEIGHT=0 MAYSCRIPT></APPLET><BR>
-
-</BODY>
-</HTML>
--- a/plugin/tests/LiveConnect/jjs_eval_test.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/******************************************************
- * Tests for parameter conversion between Java and JS *
- ******************************************************/
-
-
-function jjsEvalTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>Java -> JS Eval Test:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Evaluating";
-    columnNames[1] = "Expected result";
-    columnNames[2] = "Result";
-    columnNames[3] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    try {
-        row = document.createElement("tr");
-        evalstr = "document.location";
-        expectedvalue = eval(evalstr);
-        actualValue = PluginTest.jjsEvalTest(evalstr);
-        addResult(evalstr, expectedvalue, actualValue, row);
-        check(actualValue, expectedvalue, "string", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        evalstr = "1+1";
-        expectedvalue = eval(evalstr);
-        actualValue = PluginTest.jjsEvalTest(evalstr);
-        addResult(evalstr, expectedvalue, actualValue, row);
-        check(actualValue, expectedvalue, "string", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        evalstr = "typeof(true)";
-        expectedvalue = eval(evalstr);
-        actualValue = PluginTest.jjsEvalTest(evalstr);
-        addResult(evalstr, expectedvalue, actualValue, row);
-        check(actualValue, expectedvalue, "string", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-}
-
--- a/plugin/tests/LiveConnect/jjs_func_parameters_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/******************************************************
- * Tests for parameter conversion between Java and JS *
- ******************************************************/
-
-function JJSParameterTypeCallTest(type_parameter) {
-    return type_parameter + ":" + typeof(type_parameter);
-}
-
-function runSingleJjsCallParameterTest(type, control_arg, row) {
-    try {
-        expectedvalue = JJSParameterTypeCallTest(control_arg);
-        actualvalue = PluginTest.jjsCallParamTest(type);
-        addResult(type, expectedvalue, actualvalue, row);
-        check(actualvalue, expectedvalue, "string", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-}
-
-function jjsCallParameterTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>Java -> JS Call tests (Parameter Type):</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Parameter Type (Java side)";
-    columnNames[1] = "Expecting Java to receive";
-    columnNames[2] = "Java Received";
-    columnNames[3] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("int", 1, row);
-    tblBody.appendChild(row);
-
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("double", 1.1, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("float", 1.2000000476837158, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("long", 4294967296, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("short", 2, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("byte", 3, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("char", 8995, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("boolean", true, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.Integer", 4, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.Double", 4.1, row);
-    tblBody.appendChild(row);
-
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.Float", 4.199999809265137, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.Long", 4294967297, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.Short", 5, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.Byte", 6, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.Boolean", false, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.Character", 8996, row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("java.lang.String", "𠁎〒£$ǣ€𝍖", row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJjsCallParameterTest("PluginTest.Packages.DummyObject", (new PluginTest.Packages.DummyObject("d1")), row);
-    tblBody.appendChild(row);
-}
-
--- a/plugin/tests/LiveConnect/jjs_func_rettype_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/******************************************************
- * Tests for parameter conversion between Java and JS *
- ******************************************************/
-
-function JJSReturnTypeCallTest(type) {
-
-    if (type == "Number")
-        return 1;
-
-    if (type == "Boolean")        
-        return false;
-
-    if (type == "String")
-        return "𠁎〒£$ǣ€𝍖";
-
-    if (type == "Object")
-        return window;
-}
-
-function runSingleJJSReturnTypeTest(type, row) {
-    try {
-        expectedvalue = JJSReturnTypeCallTest(type);
-        actualvalue = PluginTest.jjsReturnTypeTest(type);
-        addResult(type, expectedvalue, actualvalue, row);
-        check(actualvalue, expectedvalue + "", "string", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-}
-
-function jjsCallReturnTypeTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>Java -> JS Call tests (Return Type):</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Parameter Type (Java side)";
-    columnNames[1] = "Expected return value";
-    columnNames[2] = "Actual return value";
-    columnNames[3] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    row = document.createElement("tr");
-    runSingleJJSReturnTypeTest("Number", row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJJSReturnTypeTest("Boolean", row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJJSReturnTypeTest("String", row);
-    tblBody.appendChild(row);
-    
-    row = document.createElement("tr");
-    runSingleJJSReturnTypeTest("Object", row);
-    tblBody.appendChild(row);
-}
--- a/plugin/tests/LiveConnect/jjs_get_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*****************************************
- * Tests for reading JS values from Java *
- *****************************************/
-
-function jjsGetMemberTests() {
-
-    initVars();
-
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java get tests:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Member Type";
-    columnNames[1] = "Expected Value";
-    columnNames[2] = "Actual value";
-    columnNames[3] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    try {
-        row = document.createElement("tr");
-        type = "int";
-        expectedvalue = intvar;
-        tpassed = PluginTest.jjsReadIntTest();
-        actualValue = PluginTest.value;
-        addResult(type, expectedvalue, PluginTest.value, row);
-        check(tpassed, true, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "double";
-        expectedvalue = doublevar;
-        tpassed = PluginTest.jjsReadDoubleTest();
-        actualValue = PluginTest.value;
-        addResult(type, expectedvalue, PluginTest.value, row);
-        check(tpassed, true, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "boolean";
-        expectedvalue = boolvar;
-        tpassed = PluginTest.jjsReadBooleanTest();
-        actualValue = PluginTest.value;
-        addResult(type, expectedvalue, PluginTest.value, row);
-        check(tpassed, true, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "string";
-        expectedvalue = stringvar;
-        tpassed = PluginTest.jjsReadStringTest();
-        actualValue = PluginTest.value;
-        addResult(type, expectedvalue, PluginTest.value, row);
-        check(tpassed, true, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "object";
-        expectedvalue = objectvar;
-        tpassed = PluginTest.jjsReadObjectTest();
-        actualValue = PluginTest.value;
-        addResult(type, expectedvalue, PluginTest.value, row);
-        check(tpassed, true, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "1D Array";
-        expectedvalue = 100;
-        tpassed = PluginTest.jjsRead1DArrayTest();
-        actualValue = PluginTest.value;
-        addResult(type, expectedvalue, PluginTest.value, row);
-        check(tpassed, true, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "2D Array";
-        expectedvalue = 200;
-        tpassed = PluginTest.jjsRead2DArrayTest();
-        actualValue = PluginTest.value;
-        addResult(type, expectedvalue, PluginTest.value, row);
-        check(tpassed, true, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); return;
-
-}
-
--- a/plugin/tests/LiveConnect/jjs_set_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-/*****************************************
- * Tests for setting JS values from Java *
- *****************************************/
-
-function jjsSetMemberTests() {
-
-    initVars();
-
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java set tests:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Java Member Type";
-    columnNames[1] = "Old Value";
-    columnNames[2] = "Expected value";
-    columnNames[3] = "Actual Value";
-    columnNames[4] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    try {
-        row = document.createElement("tr");
-        type = "int";
-        oldvalue = setvar;
-        PluginTest.jjsSetIntTest();
-        expectedvalue = 1;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); 
-
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.Integer";
-        oldvalue = setvar;
-        PluginTest.jjsSetIntegerTest();
-        expectedvalue = 2;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "double";
-        oldvalue = setvar;
-        PluginTest.jjsSetdoubleTest();
-        expectedvalue = 2.1;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); 
-    
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.Double";
-        oldvalue = setvar;
-        PluginTest.jjsSetDoubleTest();
-        expectedvalue = 2.2;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "float";
-        oldvalue = setvar;
-        PluginTest.jjsSetfloatTest();
-        expectedvalue = 2.299999952316284 ;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); 
-    
-    
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.Float";
-        oldvalue = setvar;
-        PluginTest.jjsSetFloatTest();
-        expectedvalue = 2.4000000953674316;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "long";
-        oldvalue = setvar;
-        PluginTest.jjsSetlongTest();
-        expectedvalue = 4294967296;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); 
-    
-    
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.Long";
-        oldvalue = setvar;
-        PluginTest.jjsSetLongTest();
-        expectedvalue = 4294967297;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "short";
-        oldvalue = setvar;
-        PluginTest.jjsSetshortTest();
-        expectedvalue = 3;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); 
-    
-    
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.Short";
-        oldvalue = setvar;
-        PluginTest.jjsSetShortTest();
-        expectedvalue = 4;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "byte";
-        oldvalue = setvar;
-        PluginTest.jjsSetbyteTest();
-        expectedvalue = 5;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); 
-    
-    
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.Byte";
-        oldvalue = setvar;
-        PluginTest.jjsSetByteTest();
-        expectedvalue = 6;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "char";
-        oldvalue = setvar;
-        PluginTest.jjsSetcharTest();
-        expectedvalue = 8995;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); 
-    
-    
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.Character";
-        oldvalue = setvar;
-        PluginTest.jjsSetCharacterTest();
-        expectedvalue = 8996;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "boolean";
-        oldvalue = setvar;
-        PluginTest.jjsSetbooleanTest();
-        expectedvalue = true;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row); 
-    
-    
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.Boolean";
-        oldvalue = setvar;
-        PluginTest.jjsSetBooleanTest();
-        expectedvalue = false;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "boolean", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "java.lang.String";
-        oldvalue = setvar;
-        PluginTest.jjsSetStringTest();
-        expectedvalue = "𠁎〒£$ǣ€𝍖";
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "string", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "(Complex java object)";
-        oldvalue = setvar;
-        PluginTest.jjsSetObjectTest();
-        expectedvalue = PluginTest.dummyObject;
-        addResult(type, oldvalue, expectedvalue, setvar, row);
-        check(setvar, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "1D Array";
-	setvar = new Array();
-        oldvalue = setvar[1];
-        PluginTest.jjsSet1DArrayTest();
-        expectedvalue = 100;
-        addResult(type, oldvalue, expectedvalue, setvar[1], row);
-        check(setvar[1], expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "2D Array";
-	setvar = new Array();
-	setvar[1] = new Array();
-        oldvalue = setvar[1][2];
-        PluginTest.jjsSet2DArrayTest();
-        expectedvalue = 200;
-        addResult(type, oldvalue, expectedvalue, setvar[1][2], row);
-        check(setvar[1][2], expectedvalue, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-}
-
-function java_to_js_call_test_info (type, expectedreply, functionreply, row) {
-
-    cell = document.createElement("td");
-    cell.setAttribute("width","25%");
-    cellText = document.createTextNode(type);
-    cell.appendChild(cellText);
-    row.appendChild(cell);
-
-    cell = document.createElement("td");
-    cell.setAttribute("width","20%");
-    cellText = document.createTextNode(expectedreply);
-    cell.appendChild(cellText);
-    row.appendChild(cell);
-    
-    cell = document.createElement("td");
-    cell.setAttribute("width","20%");
-    cellText = document.createTextNode(functionreply);
-    cell.appendChild(cellText);
-    row.appendChild(cell);
-
-}
-
--- a/plugin/tests/LiveConnect/jsj_func_overload_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
- /**************************************************************
-  * Tests for overloaded function resolution when calling Java *
-   * functions from JS                                         *
-  **************************************************************/
-
-function frCallTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java Call tests [Overload and casting]:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Available functions";
-    columnNames[1] = "Expected reply";
-    columnNames[2] = "Reply";
-    columnNames[3] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    try {
-        row = document.createElement("tr");
-        fname = "foo_null_to_nonprim";
-        available = fname + " [(Integer), (int)]";
-        expectedreply = fname + ":Integer";
-        reply = PluginTest.foo_null_to_nonprim(null);
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":Integer", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        fname = "foo_jso_to_jso";
-        available = fname + " [(JSObject), (String), (String[]), (Object)]";
-        expectedreply = fname + ":JSObject";
-        reply = PluginTest.foo_jso_to_jso(window);
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":JSObject", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        fname = "foo_ct_to_ct";
-        available = fname + " [(OverloadTestHelper1), (OverloadTestHelper2), (OverloadTestHelper3)]";
-        expectedreply = fname + ":OverloadTestHelper2";
-        reply = PluginTest.foo_ct_to_ct(new PluginTest.Packages.OverloadTestHelper2());
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":OverloadTestHelper2", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        fname = "foo_multiprim";
-        available = fname + " [(double), (String)]";
-        expectedreply = fname + ":double";
-        reply = PluginTest.foo_multiprim(1.1);
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":double", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        fname = "foo_multiprim";
-        available = fname + " [(double), (String)]";
-        expectedreply = fname + ":double";
-        reply = PluginTest.foo_multiprim(1.1);
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":double", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        fname = "foo_strnum";
-        available = fname + " [(double), (OverloadTestHelper1)]";
-        expectedreply = fname + ":double";
-        reply = PluginTest.foo_strnum(1.1);
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":double", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        fname = "foo_ct_to_sc";
-        available = fname + " [(OverloadTestHelper1), (String)]";
-        expectedreply = fname + ":double";
-        reply = PluginTest.foo_ct_to_sc(new PluginTest.Packages.OverloadTestHelper2());
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":OverloadTestHelper1", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        fname = "foo_jv_to_str";
-        available = fname + " [(String), (JSObject)]";
-        expectedreply = fname + ":String";
-        reply = PluginTest.foo_jv_to_str(new PluginTest.Packages.OverloadTestHelper1());
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":java.lang.String", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        fname = "foo_jso_to_array";
-        available = fname + " [(int[]), (Integer), (Integer[])]";
-        expectedreply = fname + ":int[]";
-        arr = new Array();
-        arr[0] = 10;
-        reply = PluginTest.foo_jso_to_array(arr);
-        addResult(available, expectedreply, reply, row);
-        check(fname + ":int[]", reply, "string", row);
-    } catch (e) {
-        error(null, null, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    // Tests where exceptions are expected
-    fname = "foo_null_to_prim";
-    available = fname + " [(int)] -- Not allowed";
-    
-    try {
-        row = document.createElement("tr");
-        expectedreply = null;
-        reply = PluginTest.foo_null_to_prim(null);
-        fail(row, "An exception was expected. Instead, got reply: " + reply);
-    } catch (e) {
-        addResult(available, "[An exception]", e.toString(), row);
-        pass(row);
-    }
-    tblBody.appendChild(row);
-    fname = "foo_jso_to_somethingelse";
-    available = fname + " [(OverloadTestHelper1)] -- Not allowed";
-    
-    try {
-        row = document.createElement("tr");
-        expectedreply = null;
-        reply = PluginTest.foo_jso_to_somethingelse(window);
-        fail(row, "An exception was expected. Instead, got reply: " + reply);
-    } catch (e) {
-        addResult(available, "[An exception]", e.toString(), row);
-        pass(row);
-    }
-    tblBody.appendChild(row);
-    fname = "foo_unsupported";
-    available = fname + " [(Object[] p)] -- Not allowed";
-    try {
-      row = document.createElement("tr");
-      expectedreply = null;
-      reply = PluginTest.foo_unsupported(25);
-       fail(row, "An exception was expected. Instead, got reply: " + reply);
-    } catch (e) {
-       addResult(available, "[An exception]", e.toString(), row);
-       pass(row);
-    }
-
-    tblBody.appendChild(row);
-}
-
--- a/plugin/tests/LiveConnect/jsj_func_parameters_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
- /********************************************************************
-  * Tests for function parameter coversion when calling Java from JS *
-  ********************************************************************/
-
-function fpCallTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java Call tests [Parameter type]:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Parameter type";
-    columnNames[1] = "Sending";
-    columnNames[2] = "Expected reply";
-    columnNames[3] = "Reply";
-    columnNames[4] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    PluginTest.setUpForReturnTests();
-
-     try {
-         row = document.createElement("tr");
-         type = "int";
-         send = 1;
-         reply = PluginTest.functioniParamTest(send);
-         addResult(type, send, send, reply, row);
-         check(send, reply, "number", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-     
-     try {
-         row = document.createElement("tr");
-         type = "double";
-         send = 1.1;
-         reply = PluginTest.functiondParamTest(send);
-         addResult(type, send, send, reply, row);
-         check(send, reply, "number", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-     
-    try {
-         row = document.createElement("tr");
-         type = "float";
-         send = 1.11;
-         reply = PluginTest.functionfParamTest(send);
-         addResult(type, send, send, reply, row);
-         check(send, reply, "number", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-     
-     try {
-         row = document.createElement("tr");
-         type = "long";
-         send = 4294967300;
-         reply = PluginTest.functionlParamTest(send);
-         addResult(type, send, send, reply, row);
-         check(send, reply, "number", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-
-     try {
-         row = document.createElement("tr");
-         type = "boolean";
-         send = true;
-         reply = PluginTest.functionbParamTest(send);
-         addResult(type, send, send, reply, row);
-         check("true", reply, "string", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-     
-     try {
-         row = document.createElement("tr");
-         type = "char";
-         send = 75;
-         reply = PluginTest.functioncParamTest(send);
-         addResult(type, send, "K", reply, row);
-         check("K", reply, "string", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-
-     try {
-         row = document.createElement("tr");
-         type = "byte";
-         send = 76;
-         reply = PluginTest.functionbyParamTest(send);
-         addResult(type, send, send, reply, row);
-         check(send, reply, "number", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);       
-     
-     try {
-         row = document.createElement("tr");
-         type = "char[] (simple primitive)";
-         arr = new Array();
-         arr[0] = 80;
-         arr[1] = 81;
-         reply = PluginTest.functioncaParamTest(arr);
-         addResult(type, "[80,81]", "P:Q", reply, row);
-         check(reply, "P:Q", "string", row);
-     } catch (e) {
-         error(type, "P:Q", e, row);
-     }
-     tblBody.appendChild(row);
-     
-     try {
-         row = document.createElement("tr");
-         type = "String";
-         send = "$〒£€𝍖𠁎ǣ";
-         expectedreply = "$〒£€𝍖𠁎ǣ:java.lang.String";
-         reply = PluginTest.functionsParamTest(send);
-         addResult(type, send, expectedreply, reply, row);
-         check(expectedreply, reply, "string", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-     
-     try {
-         row = document.createElement("tr");
-         type = "Integer";
-         send = "32";
-         expectedreply = send+":java.lang.Integer";
-         reply = PluginTest.functionIParamTest(send);
-         addResult(type, send, expectedreply, reply, row);
-         check(expectedreply, reply, "string", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-     
-     try {
-         row = document.createElement("tr");
-         type = "Double";
-         send = 32.0;
-         expectedreply = "32.0:java.lang.Double";
-         reply = PluginTest.functionDParamTest(send);
-         addResult(type, send, expectedreply, reply, row);
-         check(expectedreply, reply, "string", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);             
-     
-     try {
-         row = document.createElement("tr");
-         type = "Float";
-         send = 32.01;
-         expectedreply = send+":java.lang.Float";
-         reply = PluginTest.functionFParamTest(send);
-         addResult(type, send, expectedreply, reply, row);
-         check(expectedreply, reply, "string", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);
-
-     try {
-         row = document.createElement("tr");
-         type = "Long";
-         send = 4294967301;
-         expectedreply = send+":java.lang.Long";
-         reply = PluginTest.functionLParamTest(send);
-         addResult(type, send, expectedreply, reply, row);
-         check(expectedreply, reply, "string", row);
-     } catch (e) {
-         error(type, send, e, row);
-     }
-     tblBody.appendChild(row);   
-     
-     
-     try {
-         row = document.createElement("tr");
-         type = "String/Int [] (mixed)";
-         arr = new Array();
-         arr[0] = "s1";
-         arr[1] = 42;
-         reply = PluginTest.functionsiaParamTest(arr);
-         addResult(type, "[s1,42]", "s1:42", reply, row);
-         check(reply, "s1:42", "string", row);
-     } catch (e) {
-         error(type, "s1:42", e, row);
-     }
-     tblBody.appendChild(row);
-     
-     try {
-         row = document.createElement("tr");
-         type = "DummyObject[] (complex)";
-         arr = new Array();
-         arr[0] = new PluginTest.Packages.DummyObject("DummyObject1");
-         arr[1] = new PluginTest.Packages.DummyObject("DummyObject2");
-         reply = PluginTest.functioncomplexaParamTest(arr);
-         addResult(type, "[DummyObject1,DummyObjec2]", "DummyObject1:DummyObject2", reply, row);
-         check(reply, "DummyObject1:DummyObject2", "string", row);
-     } catch (e) {
-         error(type, "DummyObject1:DummyObject2", e, row);
-     }
-
-     tblBody.appendChild(row);
-}
-
--- a/plugin/tests/LiveConnect/jsj_func_rettype_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,262 +0,0 @@
-/***********************************************************************
- * Tests to process various return types from Java side function calls *
- ***********************************************************************/
-
-function rtCallTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java Call tests [Return Type]:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Function return type";
-    columnNames[1] = "Expected Value";
-    columnNames[2] = "Actual Value";
-    columnNames[3] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    PluginTest.setUpForParameterTests();
-
-    try {
-        row = document.createElement("tr");
-        type = "int";
-        expectedvalue = 41;
-        addResult(type, expectedvalue, PluginTest.intReturnTest(), row);
-        check(PluginTest.intReturnTest(), expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "double";
-        expectedvalue = 41.41;
-        addResult(type, expectedvalue, PluginTest.doubleReturnTest(), row);
-        check(PluginTest.doubleReturnTest(), expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "float";
-        expectedvalue = 41.4109992980957;
-        addResult(type, expectedvalue, PluginTest.floatReturnTest(), row);
-        check(PluginTest.floatReturnTest(), expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "long";
-        expectedvalue = 4294967297;
-        addResult(type, expectedvalue, PluginTest.longReturnTest(), row);
-        check(PluginTest.longReturnTest(), expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "boolean";
-        expectedvalue = true;
-        addResult(type, expectedvalue, PluginTest.booleanReturnTest(), row);
-        check(PluginTest.booleanReturnTest(), expectedvalue, "boolean", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "char";
-        expectedvalue = 9001;
-        addResult(type, expectedvalue, PluginTest.charReturnTest(), row);
-        check(PluginTest.charReturnTest(), expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "byte";
-        expectedvalue = 44;
-        addResult(type, expectedvalue, PluginTest.byteReturnTest(), row);
-        check(PluginTest.byteReturnTest(), expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "char[] (direct element access)";
-        expectedvalue = 9234;
-        addResult(type, expectedvalue, PluginTest.charArrayReturnTest()[2], row);
-        check(PluginTest.charArrayReturnTest()[2], expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Regular char string";
-        expectedvalue = "I'm a string too!";
-        addResult(type, expectedvalue, PluginTest.regularStringReturnTest(), row);
-        check(PluginTest.regularStringReturnTest(), expectedvalue, "string", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Special char string";
-        expectedvalue = "𠁎〒£$ǣ€𝍖";
-        addResult(type, expectedvalue, PluginTest.specialStringReturnTest(), row);
-        check(PluginTest.specialStringReturnTest(), expectedvalue, "string", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "void";
-        expectedvalue = null;
-        addResult(type, "undefined", PluginTest.voidReturnTest(), row);
-        check(PluginTest.voidReturnTest(), expectedvalue, "undefined", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "null";
-        expectedvalue = null;
-        addResult(type, expectedvalue, PluginTest.nullReturnTest(), row);
-        check(PluginTest.nullReturnTest(), expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Integer";
-        expectedvalue = 14;
-        addResult(type, expectedvalue, PluginTest.IntegerReturnTest(), row);
-        check(PluginTest.IntegerReturnTest(), expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Double";
-        expectedvalue = 14.14;
-        addResult(type, expectedvalue, PluginTest.DoubleReturnTest(), row);
-        check(PluginTest.DoubleReturnTest(), expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Float";
-        expectedvalue = 14.114;
-        addResult(type, expectedvalue, PluginTest.FloatReturnTest(), row);
-        check(PluginTest.FloatReturnTest(), expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Long";
-        expectedvalue = 6927694925;
-        addResult(type, expectedvalue, PluginTest.LongReturnTest(), row);
-        check(PluginTest.LongReturnTest(), expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean";
-        expectedvalue = "false";
-        addResult(type, expectedvalue, PluginTest.BooleanReturnTest(), row);
-        check(PluginTest.BooleanReturnTest(), expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Character";
-        expectedvalue = "␗";
-        addResult(type, expectedvalue, PluginTest.CharacterReturnTest(), row);
-        check(PluginTest.CharacterReturnTest(), expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Byte";
-        expectedvalue = 46;
-        addResult(type, expectedvalue, PluginTest.ByteReturnTest(), row);
-        check(PluginTest.ByteReturnTest(), expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Character[] (direct element access)";
-        expectedvalue = "⍑";
-        addResult(type, expectedvalue, PluginTest.CharacterArrayReturnTest()[1], row);
-        check(PluginTest.CharacterArrayReturnTest()[1], expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Character[] (Full array)";
-        expectedvalue = "[Ljava.lang.Character;@";
-        addResult(type, expectedvalue+"*", PluginTest.CharacterArrayReturnTest(), row);
-        if (PluginTest.CharacterArrayReturnTest().toString().substr(0,23)  == "[Ljava.lang.Character;@")
-            if (typeof(PluginTest.CharacterArrayReturnTest()) == "object") {
-                pass(row);
-            } else {
-                fail(row, "Type mismatch: " + typeof(SMPluginTest.Da) + " != object");
-            }
-        else
-            fail(row, "");                
-
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-
-    tblBody.appendChild(row);
-}
-
--- a/plugin/tests/LiveConnect/jsj_get_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-/********************************************
- * Tests for getting members from Java side *
- ********************************************/
-
-function getMemberTests() {
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java get tests:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Member Type";
-    columnNames[1] = "Expected Value";
-    columnNames[2] = "Actual Value";
-    columnNames[3] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    PluginTest.setUpForGMTests();
-
-    try {
-        row = document.createElement("tr");
-        type = "int";
-        expectedvalue = 42;
-        addResult(type, expectedvalue, PluginTest.i, row);
-        check(PluginTest.i, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "double";
-        expectedvalue = 42.42;
-        addResult(type, expectedvalue, PluginTest.d, row);
-        check(PluginTest.d, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "float";
-        expectedvalue = 42.099998474121094;
-        addResult(type, expectedvalue, PluginTest.f, row);
-        check(PluginTest.f, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "long";
-        expectedvalue = 4294967296;
-        addResult(type, expectedvalue, PluginTest.l, row);
-        check(PluginTest.l, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "boolean";
-        expectedvalue = true;
-        addResult(type, expectedvalue, PluginTest.b, row);
-        check(PluginTest.b, expectedvalue, "boolean", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "char";
-        expectedvalue = 8995;
-        addResult(type, expectedvalue, PluginTest.c, row);
-        check(PluginTest.c, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "byte";
-        expectedvalue = 43;
-        addResult(type, expectedvalue, PluginTest.by, row);
-        check(PluginTest.by, expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "int[] (element access)";
-        expectedvalue = "1024";
-        addResult(type, expectedvalue, PluginTest.ia[4], row);
-        check(PluginTest.ia[4], expectedvalue, "number", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "int[] (beyond length)";
-        expectedvalue = null;
-        addResult(type, expectedvalue, PluginTest.ia[30], row);
-        check(PluginTest.ia[30], expectedvalue, "undefined", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Regular String";
-        expectedvalue = "I'm a string!";
-        addResult(type, expectedvalue, PluginTest.rs, row);
-        check(PluginTest.rs, expectedvalue, "string", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "String with special characters";
-        expectedvalue = "𠁎〒£$ǣ€𝍖";
-        addResult(type, expectedvalue, PluginTest.ss, row);
-        check(PluginTest.ss, expectedvalue, "string", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "null";
-        expectedvalue = null;
-        addResult(type, expectedvalue, PluginTest.n, row);
-        check(PluginTest.n, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Integer";
-        expectedvalue = 24;
-        addResult(type, expectedvalue, PluginTest.I, row);
-        check(PluginTest.I, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Double";
-        expectedvalue = 24.24;
-        addResult(type, expectedvalue, PluginTest.D, row);
-        check(PluginTest.D, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Float";
-        expectedvalue = 24.124;
-        addResult(type, expectedvalue, PluginTest.F, row);
-        check(PluginTest.F, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Long";
-        expectedvalue = 6927694924;
-        addResult(type, expectedvalue, PluginTest.L, row);
-        check(PluginTest.L, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean";
-        expectedvalue = "false";
-        addResult(type, expectedvalue, PluginTest.B, row);
-        check(PluginTest.B, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Character";
-        expectedvalue = 'ᔦ';
-        addResult(type, expectedvalue, PluginTest.C, row);
-        check(PluginTest.C, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Byte";
-        expectedvalue = 34;
-        addResult(type, expectedvalue, PluginTest.By, row);
-        check(PluginTest.By, expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Double[] (element access)";
-        expectedvalue = "24.24";
-        addResult(type, expectedvalue, PluginTest.Da1[9], row);
-        check(PluginTest.Da1[9], expectedvalue, "object", row);
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Double[] (Full array)";
-        expectedvalue = "[Ljava.lang.Double;@";
-        addResult(type, expectedvalue+"*", PluginTest.Da1, row);
-        
-        if (PluginTest.Da1.toString().substr(0,20)  == expectedvalue)
-            if (typeof(PluginTest.Da1) == "object") {
-                pass(row);
-            } else {
-                fail(row, "Type mismatch: " + typeof(PluginTest.Da1) + " != object");
-            }
-        else
-            fail(row, "");
-    } catch (e) {
-        error(type, expectedvalue, e, row);
-    }
-
-    tblBody.appendChild(row);
-}
--- a/plugin/tests/LiveConnect/jsj_set_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,318 +0,0 @@
-/******************************************
- * Tests for setting members on Java side *
- ******************************************/
-
-function setMemberTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java set tests:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Member Type";
-    columnNames[1] = "Old Value";
-    columnNames[2] = "Setting To";
-    columnNames[3] = "New Value";
-    columnNames[4] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    PluginTest.setUpForSMTests();
-
-    try {
-        row = document.createElement("tr");
-        type = "int";
-        setto = 42;
-        curr = PluginTest.i;
-        PluginTest.i = setto;
-        now = PluginTest.i;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "double";
-        setto = 42.42;
-        curr = PluginTest.d;
-        PluginTest.d = setto;
-        now = PluginTest.d;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "float";
-        setto = 42.421;
-        curr = PluginTest.f;
-        PluginTest.f = setto;
-        now = PluginTest.f;
-        addResult(type, curr, 42.42100143432617, now, row);
-        check(now, 42.42100143432617, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "long";
-        setto = 4294967296;
-        curr = PluginTest.l;
-        PluginTest.l = setto;
-        now = PluginTest.l;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "boolean";
-        setto = true;
-        curr = PluginTest.b;
-        PluginTest.b = setto;
-        now = PluginTest.b;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "char";
-        setto = 58;
-        curr = PluginTest.c;
-        PluginTest.c = setto;
-        now = PluginTest.c;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "byte";
-        setto = 43;
-        curr = PluginTest.by;
-        PluginTest.by = setto;
-        now = PluginTest.by;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "int[] (element)";
-        setto = 100;
-        curr = PluginTest.ia[4];
-        PluginTest.ia[4] = setto;
-        now = PluginTest.ia[4];
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "int[] (beyond length)";
-        setto = 100;
-        curr = PluginTest.ia[30];
-        PluginTest.ia[30] = setto;
-        now = PluginTest.ia[30];
-        addResult(type, curr, setto, now, row);
-        check(now, null, "undefined", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Regular string";
-        setto = 'Test string';
-        curr = PluginTest.rs;
-        PluginTest.rs = setto;
-        now = PluginTest.rs;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "String with special chars";
-        setto = "𠁎〒£$ǣ€𝍖";
-        curr = PluginTest.ss;
-        PluginTest.ss = setto;
-        now = PluginTest.ss;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "null";
-        setto = null;
-        curr = PluginTest.n;
-        PluginTest.n = setto;
-        now = PluginTest.n;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Integer";
-        setto = 24;
-        curr = PluginTest.I;
-        PluginTest.I = setto;
-        now = PluginTest.I;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Double";
-        setto = 24.24;
-        curr = PluginTest.D;
-        PluginTest.D = setto;
-        now = PluginTest.D;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Float";
-        setto = 24.124;
-        curr = PluginTest.F;
-        PluginTest.F = setto;
-        now = PluginTest.F;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Long";
-        setto = 6927694924;
-        curr = PluginTest.L;
-        PluginTest.L = setto;
-        now = PluginTest.L;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean";
-        setto = new java.lang.Boolean("true");
-        curr = PluginTest.B;
-        PluginTest.B = setto;
-        now = PluginTest.B;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Character";
-        setto = new java.lang.Character(64);
-        curr = PluginTest.C;
-        PluginTest.C = setto;
-        now = PluginTest.C;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Byte";
-        setto = new java.lang.Byte(39);
-        curr = PluginTest.By;
-        PluginTest.By = setto;
-        now = PluginTest.By;
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Double[] (element)";
-        setto = 100.100;
-        curr = PluginTest.Da1[9];
-        PluginTest.Da1[9] = setto;
-        now = PluginTest.Da1[9];
-        addResult(type, curr, setto, now, row);
-        check(now, setto, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Double[] (Full array)";
-        curr = PluginTest.Da2;
-        PluginTest.Da2 = java.lang.reflect.Array.newInstance(java.lang.Double, 3);
-        PluginTest.Da2[0] = 1.1;
-        PluginTest.Da2[1] = 2.1;
-        addResult(type, curr, "[1.1,2.1,null]", "["+PluginTest.Da2[0]+","+PluginTest.Da2[1]+","+PluginTest.Da2[2]+"]", row);
-        check("["+PluginTest.Da2[0]+","+PluginTest.Da2[1]+","+PluginTest.Da2[2]+"]", "[1.1,2.1,null]", "string", row);
-    } catch (e) {
-        error(type, "[1.0,2.0,]", e, row);
-    }
-
-    tblBody.appendChild(row);
-}
-
--- a/plugin/tests/LiveConnect/jsj_type_casting_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,825 +0,0 @@
-/************************************************************
- * Tests for data type conversion from JS to Java variables *
- ************************************************************/
-
-function typeCastingTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java type casting tests:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Test Type";
-    columnNames[1] = "Send Value";
-    columnNames[2] = "Expected Value";
-    columnNames[3] = "Actual Value";
-    columnNames[4] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> java.lang.String (Integer)";
-        setto = 1;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, setto, now, row);
-        check(now, setto, "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> java.lang.String (Double)";
-        setto = 1.1;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, setto, now, row);
-        check(now, setto, "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> java.lang.Object (Integer)";
-        setto = 1.0;
-        PluginTest.Object_type = setto;
-        now = PluginTest.Object_type + " | Superclass = " + PluginTest.Object_type.getClass().getSuperclass().getName();
-        addResult (type, setto, setto + " | Superclass = java.lang.Number", now, row);
-        check(now, setto + " | Superclass = java.lang.Number", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> java.lang.Object (Double)";
-        setto = 1.1;
-        PluginTest.Object_type = setto;
-        now = PluginTest.Object_type + " | Superclass = " + PluginTest.Object_type.getClass().getSuperclass().getName();
-        addResult (type, setto, setto + " | Superclass = java.lang.Number", now, row);
-        check(now, setto + " | Superclass = java.lang.Number", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-   
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> boolean (0)";
-        setto = 0;
-        PluginTest.boolean_type = setto;
-        now = PluginTest.boolean_type;
-        addResult (type, setto, false, now, row);
-        check(now, false, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> boolean (1.1)";
-        setto = 1.1;
-        PluginTest.boolean_type = setto;
-        now = PluginTest.boolean_type;
-        addResult (type, setto, true, now, row);
-        check(now, true, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.Boolean (true)";
-        setto = true;
-        PluginTest.Boolean_type = setto;
-        now = PluginTest.Boolean_type;
-        addResult (type, setto, "true", now, row);
-        check(now, "true", "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.Boolean (false)";
-        setto = false;
-        PluginTest.Boolean_type = setto;
-        now = PluginTest.Boolean_type;
-        addResult (type, setto, "false", now, row);
-        check(now, "false", "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.Object";
-        setto = true;
-        PluginTest.Boolean_type = setto;
-        now = PluginTest.Boolean_type + " | Class = " + PluginTest.Boolean_type.getClass().getName();
-        addResult (type, setto, "true | Class = java.lang.Boolean", now, row);
-        check(now, "true | Class = java.lang.Boolean", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.String";
-        setto = true;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, "true", now, row);
-        check(now, "true", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.String";
-        setto = true;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, "true", now, row);
-        check(now, "true", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> byte (true)";
-        setto = true;
-        PluginTest.byte_type = setto;
-        now = PluginTest.byte_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> char (true)";
-        setto = true;
-        PluginTest.char_type = setto;
-        now = PluginTest.char_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> short (true)";
-        setto = true;
-        PluginTest.short_type = setto;
-        now = PluginTest.short_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> int (true)";
-        setto = true;
-        PluginTest.int_type = setto;
-        now = PluginTest.int_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> long (true)";
-        setto = true;
-        PluginTest.long_type = setto;
-        now = PluginTest.long_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> float (true)";
-        setto = true;
-        PluginTest.float_type = setto;
-        now = PluginTest.float_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> double (true)";
-        setto = true;
-        PluginTest.double_type = setto;
-        now = PluginTest.double_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> byte (false)";
-        setto = false;
-        PluginTest.byte_type = setto;
-        now = PluginTest.byte_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> char (false)";
-        setto = false;
-        PluginTest.char_type = setto;
-        now = PluginTest.char_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> short (false)";
-        setto = false;
-        PluginTest.short_type = setto;
-        now = PluginTest.short_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> int (false)";
-        setto = false;
-        PluginTest.int_type = setto;
-        now = PluginTest.int_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> long (false)";
-        setto = false;
-        PluginTest.long_type = setto;
-        now = PluginTest.long_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> float (false)";
-        setto = false;
-        PluginTest.float_type = setto;
-        now = PluginTest.float_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> double (false)";
-        setto = false;
-        PluginTest.double_type = setto;
-        now = PluginTest.double_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "String -> Object";
-        setto = "𠁎〒£$ǣ€𝍖";
-        PluginTest.Object_type = setto;
-        
-        // Some weird FF bug is causing getClass to not work correctly when set 
-        // to a String (hasProperty/hasMethod "getClass" doesn't come through 
-        // to the plugin at all, so it is definitely an ff issue). So for now, 
-        // we just compare values.
-
-        //now = PluginTest.Object_type + " | Class = " + PluginTest.Object_type.getClass().getSuperclass().getName();
-        //addResult (type, setto, setto + " | Class = java.lang.String", now, row);
-        //check(now, setto + " | Class = java.lang.String", "string", row);
-        
-        now = PluginTest.Object_type;
-        PluginTest.Object_type.charAt(3); // try a String specific function to be sure it is a String
-        addResult (type, setto, setto, now, row);
-        check(now, setto, "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> byte";
-        setto = "1";
-        PluginTest.byte_type = setto;
-        now = PluginTest.byte_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> short";
-        setto = "2";
-        PluginTest.short_type = setto;
-        now = PluginTest.short_type;
-        addResult (type, setto, 2, now, row);
-        check(now, 2, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> int";
-        setto = "3";
-        PluginTest.int_type = setto;
-        now = PluginTest.int_type;
-        addResult (type, setto, 3, now, row);
-        check(now, 3, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> long";
-        setto = "4";
-        PluginTest.long_type = setto;
-        now = PluginTest.long_type;
-        addResult (type, setto, 4, now, row);
-        check(now, 4, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> float";
-        setto = "0.0";
-        PluginTest.float_type = setto;
-        now = PluginTest.float_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> double";
-        setto = "6.2";
-        PluginTest.double_type = setto;
-        now = PluginTest.double_type;
-        addResult (type, setto, 6.2, now, row);
-        check(now, 6.2, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "String -> char";
-        setto = "7";
-        PluginTest.char_type = setto;
-        now = PluginTest.char_type;
-        addResult (type, setto, 7, now, row);
-        check(now, 7, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-
-    try {
-        row = document.createElement("tr");
-        type = "String -> boolean (empty/false)";
-        setto = "";
-        PluginTest.boolean_type = setto;
-        now = PluginTest.boolean_type;
-        addResult (type, setto, false, now, row);
-        check(now, false, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-
-    try {
-        row = document.createElement("tr");
-        type = "String -> boolean (non-empty/true)";
-        setto = "A non-empty string";
-        PluginTest.boolean_type = setto;
-        now = PluginTest.boolean_type;
-        addResult (type, setto, true, now, row);
-        check(now, true, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> byte[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.byte_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.byte_array);
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> char[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.char_array = setto;
-
-        // For char array, don't convert to string.. the empty/null/0 character messes it up
-        now = PluginTest.char_array[0] + "," + PluginTest.char_array[1] + "," + PluginTest.char_array[2];
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> short[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.short_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.short_array);
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> int[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.int_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.int_array);
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> long[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.long_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.long_array);
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> float[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.float_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.float_array);
-        addResult (type, setto, "1.0,0.0,2.0", now, row);
-        check(now, "1.0,0.0,2.0", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> double[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.double_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.double_array);
-        addResult (type, setto, "1.0,0.0,2.0", now, row);
-        check(now, "1.0,0.0,2.0", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> String[] (int)";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.String_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.String_array);
-        addResult (type, setto, "1,null,2", now, row);
-        check(now, "1,null,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Array -> String[] (int)";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.String_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.String_array);
-        addResult (type, setto, "1,null,2", now, row);
-        check(now, "1,null,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-    
-        var a = [];
-        a[0] = [];
-        a[1] = [];
-        a[2] = [];
-        a[0][0] = "100";
-        a[0][2] = "102";
-        a[2][0] = "120";
-        a[2][1] = "121";
-        a[2][3] = "123";
-        
-        //
-        //    a = [[00, , 02]      // normal
-        //         []              // empty
-        //         [20, 21, , 23]] // length = element0.length + 1
-        //
-
-        row = document.createElement("tr");
-        type = "Array -> char[][] (string to primitive)";
-        PluginTest.char_array_array = a;
-        now = PluginTest.char_array_array[0][0] + "," + 
-                PluginTest.char_array_array[0][1] + "," + 
-                PluginTest.char_array_array[0][2] + "," + 
-              PluginTest.char_array_array[1][0] + "," + 
-              PluginTest.char_array_array[2][0] + "," + 
-                PluginTest.char_array_array[2][1] + "," + 
-                PluginTest.char_array_array[2][2] + "," + 
-                PluginTest.char_array_array[2][3];
-        expected = "100,0,102,undefined,120,121,0,123"
-        addResult (type, a, expected, now, row);
-        check(now, expected, "string", row);
-    } catch (e) {
-        error(type, a, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        var a = [];
-        a[0] = [];
-        a[1] = [];
-        a[2] = [];
-        a[0][0] = 100;
-        a[0][2] = 102;
-        a[2][0] = 120;
-        a[2][1] = 121;
-        a[2][3] = 123;
-        
-        //
-        //    a = [[00, , 02]     // normal
-        //         []          // empty
-        //         [20, 21, , 23]] // length = element0.length + 1
-        //
-
-        row = document.createElement("tr");
-        type = "Array -> String[][] (int to complex)";
-        PluginTest.String_array_array = a;
-        now = PluginTest.String_array_array[0][0] + "," + 
-                PluginTest.String_array_array[0][1] + "," + 
-                PluginTest.String_array_array[0][2] + "," + 
-              PluginTest.String_array_array[1][0] + "," + 
-              PluginTest.String_array_array[2][0] + "," + 
-                PluginTest.String_array_array[2][1] + "," + 
-                PluginTest.String_array_array[2][2] + "," + 
-                PluginTest.String_array_array[2][3];
-        expected = "100,null,102,undefined,120,121,null,123";
-        addResult (type, a, expected, now, row);
-        check(now, expected, "string", row);
-    } catch (e) {
-        error(type, a, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        var a = [];
-        a[0] = [];
-        a[1] = [];
-        a[2] = [];
-        a[0][0] = 100;
-        a[0][2] = 102;
-        a[2][0] = 120;
-        a[2][1] = 121;
-        a[2][3] = 123;
-        
-        //
-        //    a = [[00, , 02]      // normal
-        //         []              // empty
-        //         [20, 21, , 23]] // length = element0.length + 1
-        //
-
-        row = document.createElement("tr");
-        type = "Array -> String";
-        PluginTest.String_type = a;
-        now = PluginTest.String_type;
-        expected = "100,,102,,120,121,,123";
-        addResult (type, a, expected, now, row);
-        check(now, expected, "string", row);
-    } catch (e) {
-        error(type, a, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "JSObject -> JSObject";
-        setto = window;
-        PluginTest.JSObject_type = setto;
-        now = PluginTest.JSObject_type;
-        addResult (type, setto, "[object Window]", now, row);
-        check(now, "[object Window]", "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "JSObject -> String";
-        setto = window;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, "[object Window]", now, row);
-        check(now, "[object Window]", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-        try {
-        row = document.createElement("tr");
-        type = "Java Object -> Java Object";
-        PluginTest.Float_type = 1.111;
-        orig_hash = PluginTest.Float_type.hashCode();
-        PluginTest.Object_type = PluginTest.Float_type;
-        new_hash = PluginTest.Object_type.hashCode();
-        addResult (type, "hashcode=" + orig_hash, orig_hash, new_hash, row);
-        check(new_hash, orig_hash, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Java Object -> String";
-        setto = new PluginTest.Packages.DummyObject("Test object");
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, "Test object", now, row);
-        check(now, "Test object", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "null -> Java Object (String)";
-        
-        // Assuming the set tests have passed, we know that object is non-null after this
-        PluginTest.String_type = "Not Null"; 
-
-        setto = null;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, null, now, row);
-        check(now, null, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-/*
-    // NULL -> primitive tests are disabled for now due to ambiguity.
-    // Section 2.2 here: http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect/
-    // States that null to primitive is not allowed, yet, section 2.3.7 claims it is..
-
-    try {
-        row = document.createElement("tr");
-        type = "null -> byte";
-        
-        // Assuming the set tests have passed, we know that object is non-null after this
-        PluginTest.byte_type = "100"; 
-
-        setto = null;
-        PluginTest.byte_type = setto;
-        now = PluginTest.byte_type;
-        addResult (type, setto, null, now, row);
-        check(now, null, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-*/
-
-}
-
-
-
--- a/plugin/tests/LiveConnect/jsj_type_conversion_tests.js	Wed Dec 08 20:59:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,825 +0,0 @@
-/************************************************************
- * Tests for data type conversion from JS to Java variables *
- ************************************************************/
-
-function typeCastingTests() {
-
-    document.getElementById("results").innerHTML +=  "<h2>JS -> Java type casting tests:</h2>";
-
-    var tbl = document.createElement("table");
-    var tblBody = document.createElement("tbody");
-    var columnNames = new Array();
-    columnNames[0] = "Test Type";
-    columnNames[1] = "Send Value";
-    columnNames[2] = "Expected Value";
-    columnNames[3] = "Actual Value";
-    columnNames[4] = "Status";
-    var row;
-
-    createResultTable(tbl, tblBody, columnNames);
-
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> java.lang.String (Integer)";
-        setto = 1;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, setto, now, row);
-        check(now, setto, "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> java.lang.String (Double)";
-        setto = 1.1;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, setto, now, row);
-        check(now, setto, "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> java.lang.Object (Integer)";
-        setto = 1.0;
-        PluginTest.Object_type = setto;
-        now = PluginTest.Object_type + " | Superclass = " + PluginTest.Object_type.getClass().getSuperclass().getName();
-        addResult (type, setto, setto + " | Superclass = java.lang.Number", now, row);
-        check(now, setto + " | Superclass = java.lang.Number", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> java.lang.Object (Double)";
-        setto = 1.1;
-        PluginTest.Object_type = setto;
-        now = PluginTest.Object_type + " | Superclass = " + PluginTest.Object_type.getClass().getSuperclass().getName();
-        addResult (type, setto, setto + " | Superclass = java.lang.Number", now, row);
-        check(now, setto + " | Superclass = java.lang.Number", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-   
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> boolean (0)";
-        setto = 0;
-        PluginTest.boolean_type = setto;
-        now = PluginTest.boolean_type;
-        addResult (type, setto, false, now, row);
-        check(now, false, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Numeric -> boolean (1.1)";
-        setto = 1.1;
-        PluginTest.boolean_type = setto;
-        now = PluginTest.boolean_type;
-        addResult (type, setto, true, now, row);
-        check(now, true, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.Boolean (true)";
-        setto = true;
-        PluginTest.Boolean_type = setto;
-        now = PluginTest.Boolean_type;
-        addResult (type, setto, "true", now, row);
-        check(now, "true", "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.Boolean (false)";
-        setto = false;
-        PluginTest.Boolean_type = setto;
-        now = PluginTest.Boolean_type;
-        addResult (type, setto, "false", now, row);
-        check(now, "false", "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.Object";
-        setto = true;
-        PluginTest.Boolean_type = setto;
-        now = PluginTest.Boolean_type + " | Class = " + PluginTest.Boolean_type.getClass().getName();
-        addResult (type, setto, "true | Class = java.lang.Boolean", now, row);
-        check(now, "true | Class = java.lang.Boolean", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.String";
-        setto = true;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, "true", now, row);
-        check(now, "true", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> java.lang.String";
-        setto = true;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, "true", now, row);
-        check(now, "true", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> byte (true)";
-        setto = true;
-        PluginTest.byte_type = setto;
-        now = PluginTest.byte_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> char (true)";
-        setto = true;
-        PluginTest.char_type = setto;
-        now = PluginTest.char_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> short (true)";
-        setto = true;
-        PluginTest.short_type = setto;
-        now = PluginTest.short_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> int (true)";
-        setto = true;
-        PluginTest.int_type = setto;
-        now = PluginTest.int_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> long (true)";
-        setto = true;
-        PluginTest.long_type = setto;
-        now = PluginTest.long_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> float (true)";
-        setto = true;
-        PluginTest.float_type = setto;
-        now = PluginTest.float_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> double (true)";
-        setto = true;
-        PluginTest.double_type = setto;
-        now = PluginTest.double_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> byte (false)";
-        setto = false;
-        PluginTest.byte_type = setto;
-        now = PluginTest.byte_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> char (false)";
-        setto = false;
-        PluginTest.char_type = setto;
-        now = PluginTest.char_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> short (false)";
-        setto = false;
-        PluginTest.short_type = setto;
-        now = PluginTest.short_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> int (false)";
-        setto = false;
-        PluginTest.int_type = setto;
-        now = PluginTest.int_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> long (false)";
-        setto = false;
-        PluginTest.long_type = setto;
-        now = PluginTest.long_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> float (false)";
-        setto = false;
-        PluginTest.float_type = setto;
-        now = PluginTest.float_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Boolean -> double (false)";
-        setto = false;
-        PluginTest.double_type = setto;
-        now = PluginTest.double_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "String -> Object";
-        setto = "𠁎〒£$ǣ€𝍖";
-        PluginTest.Object_type = setto;
-        
-        // Some weird FF bug is causing getClass to not work correctly when set 
-        // to a String (hasProperty/hasMethod "getClass" doesn't come through 
-        // to the plugin at all, so it is definitely an ff issue). So for now, 
-        // we just compare values.
-
-        //now = PluginTest.Object_type + " | Class = " + PluginTest.Object_type.getClass().getSuperclass().getName();
-        //addResult (type, setto, setto + " | Class = java.lang.String", now, row);
-        //check(now, setto + " | Class = java.lang.String", "string", row);
-        
-        now = PluginTest.Object_type;
-        PluginTest.Object_type.charAt(3); // try a String specific function to be sure it is a String
-        addResult (type, setto, setto, now, row);
-        check(now, setto, "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> byte";
-        setto = "1";
-        PluginTest.byte_type = setto;
-        now = PluginTest.byte_type;
-        addResult (type, setto, 1, now, row);
-        check(now, 1, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> short";
-        setto = "2";
-        PluginTest.short_type = setto;
-        now = PluginTest.short_type;
-        addResult (type, setto, 2, now, row);
-        check(now, 2, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> int";
-        setto = "3";
-        PluginTest.int_type = setto;
-        now = PluginTest.int_type;
-        addResult (type, setto, 3, now, row);
-        check(now, 3, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> long";
-        setto = "4";
-        PluginTest.long_type = setto;
-        now = PluginTest.long_type;
-        addResult (type, setto, 4, now, row);
-        check(now, 4, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> float";
-        setto = "0.0";
-        PluginTest.float_type = setto;
-        now = PluginTest.float_type;
-        addResult (type, setto, 0, now, row);
-        check(now, 0, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "String -> double";
-        setto = "6.2";
-        PluginTest.double_type = setto;
-        now = PluginTest.double_type;
-        addResult (type, setto, 6.2, now, row);
-        check(now, 6.2, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "String -> char";
-        setto = "7";
-        PluginTest.char_type = setto;
-        now = PluginTest.char_type;
-        addResult (type, setto, 7, now, row);
-        check(now, 7, "number", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-
-    try {
-        row = document.createElement("tr");
-        type = "String -> boolean (empty/false)";
-        setto = "";
-        PluginTest.boolean_type = setto;
-        now = PluginTest.boolean_type;
-        addResult (type, setto, false, now, row);
-        check(now, false, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-
-    try {
-        row = document.createElement("tr");
-        type = "String -> boolean (non-empty/true)";
-        setto = "A non-empty string";
-        PluginTest.boolean_type = setto;
-        now = PluginTest.boolean_type;
-        addResult (type, setto, true, now, row);
-        check(now, true, "boolean", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> byte[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.byte_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.byte_array);
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> char[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.char_array = setto;
-
-        // For char array, don't convert to string.. the empty/null/0 character messes it up
-        now = PluginTest.char_array[0] + "," + PluginTest.char_array[1] + "," + PluginTest.char_array[2];
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> short[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.short_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.short_array);
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> int[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.int_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.int_array);
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> long[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.long_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.long_array);
-        addResult (type, setto, "1,0,2", now, row);
-        check(now, "1,0,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> float[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.float_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.float_array);
-        addResult (type, setto, "1.0,0.0,2.0", now, row);
-        check(now, "1.0,0.0,2.0", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> double[]";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.double_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.double_array);
-        addResult (type, setto, "1.0,0.0,2.0", now, row);
-        check(now, "1.0,0.0,2.0", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Array -> String[] (int)";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.String_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.String_array);
-        addResult (type, setto, "1,null,2", now, row);
-        check(now, "1,null,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "Array -> String[] (int)";
-        setto = new Array();
-        setto[0] = 1;
-        setto[2] = 2;
-        PluginTest.String_array = setto;
-        now = PluginTest.getArrayAsStr(PluginTest.String_array);
-        addResult (type, setto, "1,null,2", now, row);
-        check(now, "1,null,2", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-    
-        var a = [];
-        a[0] = [];
-        a[1] = [];
-        a[2] = [];
-        a[0][0] = "100";
-        a[0][2] = "102";
-        a[2][0] = "120";
-        a[2][1] = "121";
-        a[2][3] = "123";
-        
-        //
-        //    a = [[00, , 02]      // normal
-        //         []              // empty
-        //         [20, 21, , 23]] // length = element0.length + 1
-        //
-
-        row = document.createElement("tr");
-        type = "Array -> char[][] (string to primitive)";
-        PluginTest.char_array_array = a;
-        now = PluginTest.char_array_array[0][0] + "," + 
-                PluginTest.char_array_array[0][1] + "," + 
-                PluginTest.char_array_array[0][2] + "," + 
-              PluginTest.char_array_array[1][0] + "," + 
-              PluginTest.char_array_array[2][0] + "," + 
-                PluginTest.char_array_array[2][1] + "," + 
-                PluginTest.char_array_array[2][2] + "," + 
-                PluginTest.char_array_array[2][3];
-        expected = "100,0,102,undefined,120,121,0,123"
-        addResult (type, a, expected, now, row);
-        check(now, expected, "string", row);
-    } catch (e) {
-        error(type, a, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        var a = [];
-        a[0] = [];
-        a[1] = [];
-        a[2] = [];
-        a[0][0] = 100;
-        a[0][2] = 102;
-        a[2][0] = 120;
-        a[2][1] = 121;
-        a[2][3] = 123;
-        
-        //
-        //    a = [[00, , 02]     // normal
-        //         []          // empty
-        //         [20, 21, , 23]] // length = element0.length + 1
-        //
-
-        row = document.createElement("tr");
-        type = "Array -> String[][] (int to complex)";
-        PluginTest.String_array_array = a;
-        now = PluginTest.String_array_array[0][0] + "," + 
-                PluginTest.String_array_array[0][1] + "," + 
-                PluginTest.String_array_array[0][2] + "," + 
-              PluginTest.String_array_array[1][0] + "," + 
-              PluginTest.String_array_array[2][0] + "," + 
-                PluginTest.String_array_array[2][1] + "," + 
-                PluginTest.String_array_array[2][2] + "," + 
-                PluginTest.String_array_array[2][3];
-        expected = "100,null,102,undefined,120,121,null,123";
-        addResult (type, a, expected, now, row);
-        check(now, expected, "string", row);
-    } catch (e) {
-        error(type, a, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        var a = [];
-        a[0] = [];
-        a[1] = [];
-        a[2] = [];
-        a[0][0] = 100;
-        a[0][2] = 102;
-        a[2][0] = 120;
-        a[2][1] = 121;
-        a[2][3] = 123;
-        
-        //
-        //    a = [[00, , 02]      // normal
-        //         []              // empty
-        //         [20, 21, , 23]] // length = element0.length + 1
-        //
-
-        row = document.createElement("tr");
-        type = "Array -> String";
-        PluginTest.String_type = a;
-        now = PluginTest.String_type;
-        expected = "100,,102,,120,121,,123";
-        addResult (type, a, expected, now, row);
-        check(now, expected, "string", row);
-    } catch (e) {
-        error(type, a, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "JSObject -> JSObject";
-        setto = window;
-        PluginTest.JSObject_type = setto;
-        now = PluginTest.JSObject_type;
-        addResult (type, setto, "[object Window]", now, row);
-        check(now, "[object Window]", "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "JSObject -> String";
-        setto = window;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, "[object Window]", now, row);
-        check(now, "[object Window]", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-        try {
-        row = document.createElement("tr");
-        type = "Java Object -> Java Object";
-        PluginTest.Float_type = 1.111;
-        orig_hash = PluginTest.Float_type.hashCode();
-        PluginTest.Object_type = PluginTest.Float_type;
-        new_hash = PluginTest.Object_type.hashCode();
-        addResult (type, "hashcode=" + orig_hash, orig_hash, new_hash, row);
-        check(new_hash, orig_hash, "number", row);
-    } catch (e) {
-        error(type, "", e, row);
-    }
-    tblBody.appendChild(row);
-
-    try {
-        row = document.createElement("tr");
-        type = "Java Object -> String";
-        setto = new PluginTest.Packages.DummyObject("Test object");
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, "Test object", now, row);
-        check(now, "Test object", "string", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-    
-    try {
-        row = document.createElement("tr");
-        type = "null -> Java Object (String)";
-        
-        // Assuming the set tests have passed, we know that object is non-null after this
-        PluginTest.String_type = "Not Null"; 
-
-        setto = null;
-        PluginTest.String_type = setto;
-        now = PluginTest.String_type;
-        addResult (type, setto, null, now, row);
-        check(now, null, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-
-/*
-    // NULL -> primitive tests are disabled for now due to ambiguity.
-    // Section 2.2 here: http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect/
-    // States that null to primitive is not allowed, yet, section 2.3.7 claims it is..
-
-    try {
-        row = document.createElement("tr");
-        type = "null -> byte";
-        
-        // Assuming the set tests have passed, we know that object is non-null after this
-        PluginTest.byte_type = "100"; 
-
-        setto = null;
-        PluginTest.byte_type = setto;
-        now = PluginTest.byte_type;
-        addResult (type, setto, null, now, row);
-        check(now, null, "object", row);
-    } catch (e) {
-        error(type, setto, e, row);
-    }
-    tblBody.appendChild(row);
-*/
-
-}
-
-
-