diff --git a/mozilla/java/webclient/Makefile.in b/mozilla/java/webclient/Makefile.in index a55fdc0a01f..5967067b346 100644 --- a/mozilla/java/webclient/Makefile.in +++ b/mozilla/java/webclient/Makefile.in @@ -25,7 +25,7 @@ include $(DEPTH)/config/autoconf.mk #// DIRS - There are subdirectories to process #// #//------------------------------------------------------------------------ -DIRS= classes_spec src_share src_moz +DIRS= import classes_spec src_share src_moz #//------------------------------------------------------------------------ #// diff --git a/mozilla/java/webclient/Makefile.win b/mozilla/java/webclient/Makefile.win index 69eeffe7a1d..a96f193aac7 100644 --- a/mozilla/java/webclient/Makefile.win +++ b/mozilla/java/webclient/Makefile.win @@ -35,7 +35,8 @@ IGNORE_MANIFEST=1 #//------------------------------------------------------------------------ DEPTH = ..\.. -DIRS = classes_spec \ +DIRS = import \ + classes_spec \ src_share \ $(NULL) diff --git a/mozilla/java/webclient/classes_spec/Makefile.in b/mozilla/java/webclient/classes_spec/Makefile.in index 8a4e50d67c1..a43d66c0446 100644 --- a/mozilla/java/webclient/classes_spec/Makefile.in +++ b/mozilla/java/webclient/classes_spec/Makefile.in @@ -32,6 +32,7 @@ include $(DEPTH)/config/autoconf.mk MODULE = webclient JMODS = org/mozilla/webclient \ + org/mozilla/webclient/stubs \ org/mozilla/webclient/wrapper_native \ org/mozilla/webclient/wrapper_native/motif \ org/mozilla/webclient/test diff --git a/mozilla/java/webclient/classes_spec/Makefile.win b/mozilla/java/webclient/classes_spec/Makefile.win index 92b650ccc57..2b12f5060e8 100644 --- a/mozilla/java/webclient/classes_spec/Makefile.win +++ b/mozilla/java/webclient/classes_spec/Makefile.win @@ -46,6 +46,7 @@ include <$(DEPTH)\java\config\localdefs.mak> JAR_WEBCLIENT_CLASSES = \ org\mozilla\webclient \ + org\mozilla\webclient\stubs \ org\mozilla\webclient\wrapper_native \ org\mozilla\webclient\wrapper_native\win32 \ org\mozilla\webclient\test \ diff --git a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/BrowserControl.java b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/BrowserControl.java index 020654f4732..36699d7f0f9 100644 --- a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/BrowserControl.java +++ b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/BrowserControl.java @@ -35,7 +35,7 @@ package org.mozilla.webclient; * - * @version $Id: BrowserControl.java,v 1.1 2000-03-04 01:10:51 edburns%acm.org Exp $ + * @version $Id: BrowserControl.java,v 1.2 2001-05-24 21:13:30 ashuk%eng.sun.com Exp $ * * @see org.mozilla.webclient.BrowserControlFactory * */ @@ -54,7 +54,7 @@ public static String CACHE_MANAGER_NAME = "webclient.cache.NetDataCacheManager"; public static String PREFERENCES_NAME = "webclient.Preferences"; public static String PRINT_NAME = "webclient.Print"; public static String WINDOW_CONTROL_NAME = "webclient.WindowControl"; - +public static String PROFILE_MANAGER_NAME = "webclient.ProfileManager"; /** diff --git a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/BrowserControlImpl.java b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/BrowserControlImpl.java index 59e18e413de..ef69c997611 100644 --- a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/BrowserControlImpl.java +++ b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/BrowserControlImpl.java @@ -71,6 +71,7 @@ private Navigation navigation = null; private History history = null; private static Bookmarks bookmarks = null; private static Preferences prefs = null; +private static ProfileManager profileManager = null; // // Constructors and Initializers @@ -157,6 +158,10 @@ static void appTerminate() throws Exception ((ImplObject)prefs).delete(); prefs = null; } + if (null != profileManager) { + ((ImplObject)profileManager).delete(); + profileManager = null; + } wrapperFactory.terminate(); } @@ -281,6 +286,13 @@ public Object queryInterface(String interfaceName) throws ClassNotFoundException } return prefs; } + if (PROFILE_MANAGER_NAME.equals(interfaceName)) { + if (null == profileManager) { + profileManager = (ProfileManager) + wrapperFactory.newImpl(PROFILE_MANAGER_NAME, this); + } + return profileManager; + } // extensibility mechanism: just see if wrapperFactory can make one! return wrapperFactory.newImpl(interfaceName, this); } @@ -296,7 +308,7 @@ public static void main(String [] args) Assert.setEnabled(true); Log.setApplicationName("BrowserControlImpl"); Log.setApplicationVersion("0.0"); - Log.setApplicationVersionDate("$Id: BrowserControlImpl.java,v 1.4 2001-04-02 21:13:43 ashuk%eng.sun.com Exp $"); + Log.setApplicationVersionDate("$Id: BrowserControlImpl.java,v 1.5 2001-05-24 21:13:30 ashuk%eng.sun.com Exp $"); } diff --git a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/ProfileManager.java b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/ProfileManager.java new file mode 100644 index 00000000000..9791d4a03b4 --- /dev/null +++ b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/ProfileManager.java @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * 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 RaptorCanvas. + * + * The Initial Developer of the Original Code is Kirk Baker and + * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are + * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All + * Rights Reserved. + * + * Contributor(s): Ashu Kulkarni + */ + +package org.mozilla.webclient; + +public interface ProfileManager +{ +public int GetProfileCount(); + +public String [] GetProfileList(int [] length); + +public boolean ProfileExists(String profileName); + +public String GetCurrentProfile(); + +public void SetCurrentProfile(String profileName); + +public void CreateNewProfile(String profileName, String nativeProfileDir, String langcode, boolean useExistingDir); + +public void RenameProfile(String currName, String newName); + +public void DeleteProfile(String profileName, boolean canDeleteFiles); + +public void CloneProfile(String currName); +} diff --git a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/test/EMWindow.java b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/test/EMWindow.java index 8dc8b830ae6..3d2128a47e3 100644 --- a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/test/EMWindow.java +++ b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/test/EMWindow.java @@ -57,7 +57,7 @@ import java.io.FileInputStream; * This is a test application for using the BrowserControl. * - * @version $Id: EMWindow.java,v 1.30 2001-05-23 22:26:51 edburns%acm.org Exp $ + * @version $Id: EMWindow.java,v 1.31 2001-05-24 21:13:45 ashuk%eng.sun.com Exp $ * * @see org.mozilla.webclient.BrowserControlFactory @@ -110,6 +110,8 @@ private UniversalDialog uniDialog = null; private MenuItem popup_ViewSource, popup_SelectAll; private PopupActionListener contextListener; + private ProfileManager profileManager = null; + private String myBinDir; public static void main(String [] arg) { @@ -123,6 +125,7 @@ private UniversalDialog uniDialog = null; creator = Creator; currentURL = url; winNum = winnum; + myBinDir = binDir; System.out.println("constructed with binDir: " + binDir + " url: " + url); setSize(defaultWidth, defaultHeight); @@ -134,6 +137,7 @@ private UniversalDialog uniDialog = null; Menu viewMenu = new Menu("View"); Menu searchMenu = new Menu("Search"); Menu editMenu = new Menu("Edit"); + Menu profileMenu = new Menu("Profile"); MenuItem newItem = new MenuItem("New Window"); MenuItem closeItem = new MenuItem("Close"); MenuItem findItem = new MenuItem("Find"); @@ -142,10 +146,19 @@ private UniversalDialog uniDialog = null; MenuItem pageInfoItem = new MenuItem("View Page Info"); MenuItem selectAllItem = new MenuItem("Select All"); MenuItem copyItem = new MenuItem("Copy"); + MenuItem createProfileItem = new MenuItem("Create Profile"); + MenuItem deleteProfileItem = new MenuItem("Delete Profile"); menuBar.add(fileMenu); menuBar.add(viewMenu); menuBar.add(searchMenu); + menuBar.add(editMenu); + menuBar.add(profileMenu); + profileMenu.add(createProfileItem); + createProfileItem.addActionListener(this); + profileMenu.add(deleteProfileItem); + deleteProfileItem.addActionListener(this); + fileMenu.add(newItem); newItem.addActionListener(this); fileMenu.add(closeItem); @@ -310,6 +323,7 @@ private UniversalDialog uniDialog = null; "network.cookie.warnAboutCookies", "This IS the Closure!"); prefs.setPref("network.cookie.warnAboutCookies", "true"); + prefs.setPref("browser.cache.disk_cache_size", "0"); // pull out the proxies, and make java aware of them Properties prefsProps = prefs.getPrefs(); @@ -417,11 +431,6 @@ public void delete() currentDocument = null; } -public BrowserControl getBrowserControl() -{ - return browserControl; -} - public void actionPerformed (ActionEvent evt) { @@ -466,6 +475,20 @@ public void actionPerformed (ActionEvent evt) } else if (command.equals("Copy")) { currentPage.copyCurrentSelectionToSystemClipboard(); + } + else if (command.equals("Create Profile")) { + if (profileManager == null) { + profileManager = (ProfileManager) + browserControl.queryInterface(BrowserControl.PROFILE_MANAGER_NAME); + } + profileManager.CreateNewProfile("Tester", myBinDir, null, true); + } + else if (command.equals("Delete Profile")) { + if (profileManager == null) { + profileManager = (ProfileManager) + browserControl.queryInterface(BrowserControl.PROFILE_MANAGER_NAME); + } + profileManager.DeleteProfile("Tester", true); } else if(command.equals("Stop")) { navigation.stop(); diff --git a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/wrapper_native/ProfileManagerImpl.java b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/wrapper_native/ProfileManagerImpl.java new file mode 100644 index 00000000000..996aa62efb9 --- /dev/null +++ b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/wrapper_native/ProfileManagerImpl.java @@ -0,0 +1,162 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * 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 RaptorCanvas. + * + * The Initial Developer of the Original Code is Kirk Baker and + * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are + * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All + * Rights Reserved. + * + * Contributor(s): Ashu Kulkarni + */ + +package org.mozilla.webclient.wrapper_native; + +import org.mozilla.util.Assert; +import org.mozilla.util.Log; +import org.mozilla.util.ParameterCheck; + +import org.mozilla.webclient.BrowserControl; +import org.mozilla.webclient.ProfileManager; +import org.mozilla.webclient.WindowControl; +import org.mozilla.webclient.WrapperFactory; + +import org.mozilla.webclient.UnimplementedException; + +import org.mozilla.xpcom.*; +import org.mozilla.webclient.stubs.*; + +public class ProfileManagerImpl extends ImplObjectNative implements ProfileManager +{ + +// local variables +private nsIXPIDLServiceManager serviceMgr; +private nsIProfile profileStub; +private CID nsProfileCID = new CID("02b0625b-e7f3-11d2-9f5a-006008a6efe9"); + + +public ProfileManagerImpl(WrapperFactory yourFactory, + BrowserControl yourBrowserControl) +{ + super(yourFactory, yourBrowserControl); + + // Make whatever native calls are required to initialize the + // BlackConnect Profile module here + InterfaceRegistry.register(nsIProfile.class); + serviceMgr = org.mozilla.xpcom.Components.getServiceManager(); + nsISupports profile = serviceMgr.getService(nsProfileCID, nsIProfile.IID); + profileStub = (nsIProfile) profile.queryInterface(nsIProfile.IID); +} + + +public int GetProfileCount() + { + myFactory.throwExceptionIfNotInitialized(); + + int count; + synchronized(myBrowserControl) { + count = profileStub.getProfileCount(); + } + return count; + } + +public String [] GetProfileList(int [] length) + { + myFactory.throwExceptionIfNotInitialized(); + + String [] list = null; + synchronized(myBrowserControl) { + list = profileStub.getProfileList(length); + } + return list; + } + +public boolean ProfileExists(String profileName) + { + myFactory.throwExceptionIfNotInitialized(); + + boolean exists = false; + synchronized(myBrowserControl) { + exists = profileStub.profileExists(profileName); + } + return exists; + } + +public String GetCurrentProfile() + { + myFactory.throwExceptionIfNotInitialized(); + + String currProfile = null; + synchronized(myBrowserControl) { + currProfile = profileStub.getCurrentProfile(); + } + return currProfile; + } + +public void SetCurrentProfile(String profileName) + { + myFactory.throwExceptionIfNotInitialized(); + + synchronized(myBrowserControl) { + profileStub.setCurrentProfile(profileName); + } + } + +public void CreateNewProfile(String profileName, String nativeProfileDir, String langcode, boolean useExistingDir) + { + myFactory.throwExceptionIfNotInitialized(); + + System.out.println("\nIn ProfileManager CreateNewProfile\n"); + synchronized(myBrowserControl) { + profileStub.createNewProfile(profileName, nativeProfileDir, langcode, useExistingDir); + } + } + +public void RenameProfile(String currName, String newName) + { + myFactory.throwExceptionIfNotInitialized(); + + synchronized(myBrowserControl) { + profileStub.renameProfile(currName, newName); + } + } + +public void DeleteProfile(String profileName, boolean canDeleteFiles) + { + myFactory.throwExceptionIfNotInitialized(); + + synchronized(myBrowserControl) { + profileStub.deleteProfile(profileName, canDeleteFiles); + } + } + + +public void CloneProfile(String currName) + { + myFactory.throwExceptionIfNotInitialized(); + + synchronized(myBrowserControl) { + profileStub.cloneProfile(currName); + } + } + +protected void finalize() + { + if (profileStub != null) { + //Release any service that we may be holding on to + nsISupports obj = (nsISupports) profileStub.queryInterface(nsISupports.IID); + serviceMgr.releaseService(nsProfileCID, obj); + } + } + +} diff --git a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/wrapper_native/WrapperFactoryImpl.java b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/wrapper_native/WrapperFactoryImpl.java index 209633265df..3b7dc404348 100644 --- a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/wrapper_native/WrapperFactoryImpl.java +++ b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/wrapper_native/WrapperFactoryImpl.java @@ -35,6 +35,11 @@ public class WrapperFactoryImpl extends WrapperFactory // Protected Constants // + final String [] stubsImplementedInterfaces = + { + BrowserControl.PROFILE_MANAGER_NAME + }; + // // Class Variables // @@ -109,7 +114,7 @@ public Object newImpl(String interfaceName, Object result = null; synchronized(this) { - if (!nativeDoesImplement(interfaceName)) { + if (!stubsDoImplement(interfaceName) && !nativeDoesImplement(interfaceName)) { throw new ClassNotFoundException("Can't instantiate " + interfaceName + ": not implemented."); @@ -144,6 +149,10 @@ public Object newImpl(String interfaceName, result = new PreferencesImpl(this, browserControl); return result; } + if (BrowserControl.PROFILE_MANAGER_NAME == interfaceName) { + result = new ProfileManagerImpl(this, browserControl); + return result; + } } return result; @@ -174,6 +183,19 @@ public boolean hasBeenInitialized() return initialized; } + +private boolean stubsDoImplement(String interfaceName) +{ + boolean foundInterface = false; + for (int i=0; i +# + +XPIDL_PROG=$(DIST)\bin\xpidl +.SUFFIXES: .java .idl +XPIDL_JAVA=$(JAVAXPIDLSRCS:.idl=.java) + +idl2java: $(XPIDL_JAVA) +.idl.java: + $(XPIDL_PROG) -m java -w $(XPIDL_INCLUDES) -I$(DEPTH)\dist\idl\ $< \ No newline at end of file diff --git a/mozilla/java/webclient/config/rules.mk b/mozilla/java/webclient/config/rules.mk new file mode 100644 index 00000000000..525999d05ef --- /dev/null +++ b/mozilla/java/webclient/config/rules.mk @@ -0,0 +1,29 @@ +#!gmake +# +# The contents of this file are subject to the Netscape 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/NPL/ +# +# 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.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Ashu Kulkarni +# + +.SUFFIXES: .java .idl +XPIDL_JAVA=$(JAVAXPIDLSRCS:.idl=.java) +XPIDL_PROG=$(DIST)/bin/xpidl +idl2java: $(XPIDL_JAVA) +.idl.java: + $(XPIDL_PROG) -m java -w $(XPIDL_INCLUDES) -I$(DEPTH)/dist/idl/ $< \ No newline at end of file diff --git a/mozilla/java/webclient/import/Makefile.in b/mozilla/java/webclient/import/Makefile.in new file mode 100644 index 00000000000..98a1162442b --- /dev/null +++ b/mozilla/java/webclient/import/Makefile.in @@ -0,0 +1,52 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. +# +# Contributor(s): +# Ashu Kulkarni +# +#//------------------------------------------------------------------------ +#// +#// Makefile to build the java stubs for Webclient +#// +#//------------------------------------------------------------------------ + + + +DEPTH = ../../.. + +JAVAXPIDLSRCS = nsIProfile.idl \ + $(NULL) +include $(DEPTH)/config/rules.mk +include ../config/rules.mk + +.SUFFIXES: .idl .java +import: $(JAVAXPIDLSRCS) + +$(JAVAXPIDLSRCS) : + cp $(DEPTH)/dist/idl/$(@F) . + +mvjava2stubs: + mv *.java ../classes_spec/org/mozilla/webclient/stubs + +chPackageinStubs: + perl chPackage.pl unix nsIProfile.java "org.mozilla.webclient.stubs" + +export:: import idl2java chPackageinStubs mvjava2stubs + +clobber_all:: + rm -rf *.idl + rm -rf ../classes_spec/org/mozilla/webclient/stubs/*.java diff --git a/mozilla/java/webclient/import/Makefile.win b/mozilla/java/webclient/import/Makefile.win new file mode 100644 index 00000000000..4f5e5216bce --- /dev/null +++ b/mozilla/java/webclient/import/Makefile.win @@ -0,0 +1,52 @@ +#!gmake +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "NPL"); you may not use this file except in +# compliance with the NPL. You may obtain a copy of the NPL at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the NPL is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +# for the specific language governing rights and limitations under the +# NPL. +# +# The Initial Developer of this code under the NPL is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All Rights +# Reserved. +# +# Contributor(s): +# Ashu Kulkarni +# +#//------------------------------------------------------------------------ +#// +#// Makefile to build the java stubs for Webclient +#// +#//------------------------------------------------------------------------ + + + +DEPTH = ..\..\.. + +JAVAXPIDLSRCS = nsIProfile.idl \ + $(NULL) +include <$(DEPTH)\config\rules.mak> +include ..\config\rules.mak + +.SUFFIXES: .idl .java +import: $(JAVAXPIDLSRCS) + +$(JAVAXPIDLSRCS) : + cp $(DEPTH)\dist\idl\$(@F) . + +mvjava2stubs: + move *.java ..\classes_spec\org\mozilla\webclient\stubs + +chPackageinStubs: + perl.exe chPackage.pl win nsIProfile.java "org.mozilla.webclient.stubs" + +export:: import idl2java chPackageinStubs mvjava2stubs + +clobber_all:: + rm -rf *.idl + rm -rf ..\classes_spec\org\mozilla\webclient\stubs\*.java diff --git a/mozilla/java/webclient/import/chPackage.pl b/mozilla/java/webclient/import/chPackage.pl new file mode 100755 index 00000000000..7e41f8f3e8b --- /dev/null +++ b/mozilla/java/webclient/import/chPackage.pl @@ -0,0 +1,70 @@ +# 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.org code. +# +# The Initial Developer of the Original Code is Sun Microsystems, +# Inc. Portions created by Sun are +# Copyright (C) 1999 Sun Microsystems, Inc. All +# Rights Reserved. +# +# Contributor(s): +# Ashu Kulkarni +# + + +# this script must be run in the directory in which it resides. + +# +# Verification, usage checking +# + +$ARGC = $#ARGV + 1; +$NUM_ARGC = 3; + +if ($NUM_ARGC != $ARGC) { + print "usage: chPackage.pl \n"; + exit -1; +} + +if ($ARGV[0] ne "unix" && $ARGV[0] ne "win") { + print "usage: chPackage.pl \n"; + print " can be either \"unix\" or \"win\" \n"; +} + +open(FILE_R, "<$ARGV[1]"); +open(FILE_W, ">tmp.tmp"); + +while ($line = ) { + if ($line =~ "package") { + $line_w = "package $ARGV[2];"; + print FILE_W $line_w; + print FILE_W "\n\nimport org.mozilla.xpcom.*;\n"; + } + else { + print FILE_W $line; + } +} + +close(FILE_R); +close(FILE_W); + +if ($ARGV[0] eq "unix") { + $cmd = "mv tmp.tmp $ARGV[1]; rm -f tmp.tmp"; + exec $cmd; +} +else { + $cmd = "move tmp.tmp $ARGV[1]"; + exec $cmd; + $cmd = "del tmp.tmp"; + exec $cmd; +} + + diff --git a/mozilla/java/webclient/src_share/runem.pl b/mozilla/java/webclient/src_share/runem.pl index 74d8f0fb9ce..624e17b6f77 100644 --- a/mozilla/java/webclient/src_share/runem.pl +++ b/mozilla/java/webclient/src_share/runem.pl @@ -121,7 +121,7 @@ else { } #tack on the java library path -$cmd = $cmd . " -Djava.library.path=" . $BINDIR; +$cmd = $cmd . " -Djava.library.path=" . $BINDIR . $CPSEP . $BINDIR . $SEP . "components"; #tack on the classpath, class name, and bin dir $cmd = $cmd . " -classpath " . $ENV{"CLASSPATH"} . " " . $CLASSNAME . " " . $BINDIR;