dblevins 2005/07/09 04:51:01
Modified: modules/webadmin/src/java/org/openejb/webadmin/main
CMPMappingBean.java ListLogsBean.java
Log:
I can't fix this Tomcat integration issue with all the silly statics.
Killing the statics. Death to the statics!
Added a class called SystemInstance, which is a singleton and hopefully the
only important static for the 1.0 codebase someday.
Changed FileUtils to get its instances from SystemInstance, then inlined all
that code.
Changed ClasspathUtils to get its Loader instance from SystemInstance and
managed to inline all the remaining code.
Revision Changes Path
1.3 +6 -5
openejb1/modules/webadmin/src/java/org/openejb/webadmin/main/CMPMappingBean.java
Index: CMPMappingBean.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb1/modules/webadmin/src/java/org/openejb/webadmin/main/CMPMappingBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CMPMappingBean.java 16 Jun 2005 22:29:56 -0000 1.2
+++ CMPMappingBean.java 9 Jul 2005 08:51:00 -0000 1.3
@@ -69,6 +69,7 @@
import org.openejb.webadmin.WebAdminBean;
import org.openejb.core.EnvProps;
import org.openejb.util.FileUtils;
+import org.openejb.loader.SystemInstance;
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Tim Urberg</a>
@@ -196,8 +197,8 @@
}
//assemble the file names
- String path =
-
FileUtils.getBase().getDirectory("conf").getAbsolutePath()
+ String path =
+
SystemInstance.get().getBase().getDirectory("conf").getAbsolutePath()
+ System.getProperty("file.separator")
+ databaseData.getFileName();
@@ -255,8 +256,8 @@
//here we want to move the jdbc driver over to the bin dir
File jdbcDriverSource = new
File(request.getFormParameter(CMPMappingWriter.FORM_FIELD_JDBC_DRIVER));
- String libDir =
-
FileUtils.getBase().getDirectory("lib").getAbsolutePath()
+ String libDir =
+
SystemInstance.get().getBase().getDirectory("lib").getAbsolutePath()
+ System.getProperty("file.separator")
+ jdbcDriverSource.getName();
File destFile = new File(libDir);
1.3 +3 -2
openejb1/modules/webadmin/src/java/org/openejb/webadmin/main/ListLogsBean.java
Index: ListLogsBean.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb1/modules/webadmin/src/java/org/openejb/webadmin/main/ListLogsBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ListLogsBean.java 16 Jun 2005 22:29:56 -0000 1.2
+++ ListLogsBean.java 9 Jul 2005 08:51:00 -0000 1.3
@@ -60,6 +60,7 @@
import org.openejb.webadmin.HttpResponse;
import org.openejb.webadmin.WebAdminBean;
import org.openejb.util.FileUtils;
+import org.openejb.loader.SystemInstance;
/** This bean lists the openejb.log and transaction.log files
*
@@ -110,7 +111,7 @@
}
// Get the logs directory
- File logsDir = FileUtils.getBase().getDirectory("logs");
+ File logsDir = SystemInstance.get().getBase().getDirectory("logs");
String path;
File[] openejbLogs = logsDir.listFiles(new FilenameFilter() {