summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-19 03:38:30 +0000
committereea1 <eea1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-19 03:38:30 +0000
commit652e3f652c2f1616e32a1843db53852bfb6db1d2 (patch)
tree608ff89cf60f6cbfa7007a82423675b1d83711d6
parentbd37b081fe40aefb8d5d8486a4b649e3f913d249 (diff)
downloadATCD-652e3f652c2f1616e32a1843db53852bfb6db1d2.tar.gz
Trying to remove dependency on www.cs.wustl.edu's filter.conf file.
This should make it so there is a mandatory configFile param in the HTML. If not, then no filters are loaded.
-rw-r--r--java/ImageProcessing/framework/ImageApp.java69
1 files changed, 38 insertions, 31 deletions
diff --git a/java/ImageProcessing/framework/ImageApp.java b/java/ImageProcessing/framework/ImageApp.java
index 1c6f3a85912..c75beea6a4f 100644
--- a/java/ImageProcessing/framework/ImageApp.java
+++ b/java/ImageProcessing/framework/ImageApp.java
@@ -173,44 +173,51 @@ public class ImageApp extends Applet
// Check if the filename has been previously specified and
// if not then check if the user has specified the name of the
// config file
- if (this.configFile_ == null) {
+ if (this.configFile_ == null)
this.configFile_ = getParameter ("configFile");
- System.out.println ("Configuration File (1): " + this.configFile_);
- }
- if (this.configFile_ == null)
- this.configFile_ = "http://www.cs.wustl.edu/~pjain/java/ACE_wrappers/java/ImageProcessing/framework/filter.conf";
- URL url;
- String configInfo= null;
- try
- {
- System.out.println ("Configuration File: " + this.configFile_);
- // Create a new URL
- url = new URL (this.configFile_);
-
- // Get the input stream and pipe it to a DataInputStream
- DataInputStream iStream = new DataInputStream (url.openStream ());
-
- // Create a buffer to hold all the data we get
- StringBuffer tempBuf = new StringBuffer ();
- // Keep reading the data until we are done
- String tempString = iStream.readLine ();
- while (tempString != null)
+ /*
+ if (this.configFile_ == null)
+ this.configFile_ = "http://www.cs.wustl.edu/~pjain/java/ACE_wrappers/java/ImageProcessing/framework/filter.conf";
+ */
+
+ String configInfo = null;
+
+ // Only get the file as a URL if it was specified as a parameter!
+ if ((this.configFile_ == null) || (!this.configFile_.startsWith("http://"))) {
+
+ URL url;
+
+ try
+ {
+ System.out.println ("Configuration File: " + this.configFile_);
+ // Create a new URL
+ url = new URL (this.configFile_);
+
+ // Get the input stream and pipe it to a DataInputStream
+ DataInputStream iStream = new DataInputStream (url.openStream ());
+
+ // Create a buffer to hold all the data we get
+ StringBuffer tempBuf = new StringBuffer ();
+ // Keep reading the data until we are done
+ String tempString = iStream.readLine ();
+ while (tempString != null)
{
tempBuf.append (tempString);
tempBuf.append (" ");
tempString = iStream.readLine ();
}
- configInfo = tempBuf.toString ();
- }
- catch (MalformedURLException e)
- {
- System.err.println (e);
- }
- catch (IOException e)
- {
- System.err.println (e);
- }
+ configInfo = tempBuf.toString ();
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println (e);
+ }
+ catch (IOException e)
+ {
+ System.err.println (e);
+ }
+ }
if (configInfo != null)
{