[Mathlib-commitlog] SF.net SVN: mathlib:[837] JMathLib/trunk/src/jmathlib/core/functions/ WebFuncti
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-02-08 17:48:07
|
Revision: 837
http://mathlib.svn.sourceforge.net/mathlib/?rev=837&view=rev
Author: st_mueller
Date: 2009-02-08 17:47:57 +0000 (Sun, 08 Feb 2009)
Log Message:
-----------
removed applet-parameter from Interpreter-constructor
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2009-02-08 17:11:10 UTC (rev 836)
+++ JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2009-02-08 17:47:57 UTC (rev 837)
@@ -11,24 +11,25 @@
{
boolean pFileCachingEnabledB = false;
- private URL codeBase;
+
private String directory;
// paths to external function for applet usage
private Vector functionListV = new Vector(30);
-
/**Default constructor*/
- public WebFunctionLoader(URL _codeBase, String _directory)
+ public WebFunctionLoader()
{
- codeBase = _codeBase;
- directory = _directory;
try
{
- System.out.println("WebFunctionLoader: new url"+ codeBase.toString());
- URL url = new URL(codeBase, "webFunctionsList.dat");
- InputStream in = url.openStream();
+ //if (codeBase!=null)
+ // System.out.println("WebFunctionLoader: new url"+ codeBase.toString());
+ //URL url = new URL(codeBase, "webFunctionsList.dat");
+ //InputStream in = url.openStream();
+
+ // load list relative to the path of THIS class.
+ InputStream in = WebFunctionLoader.class.getResourceAsStream("../../../webFunctionsList.dat");
BufferedReader br = new BufferedReader(new InputStreamReader(in));
// read each line of the functions list
@@ -51,10 +52,10 @@
*
* @return
*/
- public URL getCodeBase()
- {
- return codeBase;
- }
+ //public URL getCodeBase()
+ //{
+ // return codeBase;
+ //}
/**
*
@@ -146,12 +147,16 @@
// open file and read m-file line by line
try
{
- ErrorLogger.debugLine("WebFunctionLoader: "+codeBase+" "+directory+"/"+functionName+".m");
+ ErrorLogger.debugLine("WebFunctionLoader: "+directory+"/"+functionName+".m");
+ //ErrorLogger.debugLine("WebFunctionLoader: "+codeBase+" "+directory+"/"+functionName+".m");
//URL url = new URL(codeBase, directory+"/"+functionName+".m");
- URL url = new URL(codeBase, functionPath);
+ //URL url = new URL(codeBase, functionPath);
+ //InputStream in = url.openStream();
- InputStream in = url.openStream();
+ // load class or resource relative to the path of THIS class.
+ InputStream in = WebFunctionLoader.class.getResourceAsStream("../../../"+functionPath);
BufferedReader inReader = new BufferedReader(new InputStreamReader(in));
+
String line;
while ((line = inReader.readLine()) != null)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|