You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2002/01/02 19:40:16 UTC
cvs commit: xml-axis/java/src/org/apache/axis/configuration FileProvider.java
gdaniels 02/01/02 10:40:16
Modified: java/src/org/apache/axis/configuration FileProvider.java
Log:
Allow the user to control whether or not the classpath is searched for
default configurations.
Revision Changes Path
1.13 +18 -1 xml-axis/java/src/org/apache/axis/configuration/FileProvider.java
Index: FileProvider.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/configuration/FileProvider.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- FileProvider.java 5 Dec 2001 18:33:55 -0000 1.12
+++ FileProvider.java 2 Jan 2002 18:40:16 -0000 1.13
@@ -83,6 +83,10 @@
String filename;
InputStream myInputStream = null;
+
+ // Should we search the classpath for the file if we don't find it in
+ // the specified location?
+ boolean searchClasspath = true;
/**
* Constructor which accesses a file in the current directory of the
@@ -110,6 +114,17 @@
{
myInputStream = is;
}
+
+ /**
+ * Determine whether or not we will look for a "server-config.wsdd" file
+ * on the classpath if we don't find it in the specified location.
+ *
+ * @param searchClasspath true if we should search the classpath
+ */
+ public void setSearchClasspath(boolean searchClasspath)
+ {
+ this.searchClasspath = searchClasspath;
+ }
public void configureEngine(AxisEngine engine) throws Exception
{
@@ -117,8 +132,10 @@
try {
myInputStream = new FileInputStream(basepath + sep + filename);
} catch (Exception e) {
- myInputStream = engine.
+ if (searchClasspath) {
+ myInputStream = engine.
getClass().getResourceAsStream(filename);
+ }
}
}