Update of /cvsroot/babeldoc/babeldoc/modules/init/src/com/babeldoc/init
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28777/modules/init/src/com/babeldoc/init
Modified Files:
Main.java
Log Message:
Load lib files to BABELDOC_USER/lib directory into the classpath
Index: Main.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/init/src/com/babeldoc/init/Main.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Main.java 4 Jan 2008 13:47:05 -0000 1.10
--- Main.java 7 Jan 2008 09:36:59 -0000 1.11
***************
*** 84,87 ****
--- 84,88 ----
* applications. This class loads all the library files in the
* %BABELDOC_HOME/lib directory into the classpath.
+ * %BABELDOC_USER/lib directory into the classpath.
*/
public class Main {
***************
*** 177,181 ****
/**
* The starting point for commandline Babeldoc. This then checks the
! * BABELDOC_HOME variable. Gets all the jar and zip files. Proceed with
* this.
*
--- 178,182 ----
/**
* The starting point for commandline Babeldoc. This then checks the
! * BABELDOC_HOME i BABELDOC_USER variables. Gets all the jar and zip files. Proceed with
* this.
*
***************
*** 185,188 ****
--- 186,194 ----
public static void main(String[] args) {
String home = System.getProperty(BABELDOC_HOME);
+ String user = System.getProperty(BABELDOC_USER);
+
+ File[] filesUser = null;
+ File[] filesHome = null;
+ File[] files = null;
if (home != null) {
***************
*** 190,198 ****
if (fileHome.exists() && fileHome.isDirectory()) {
! runBabeldocMain(getLibraryFiles(home), args);
! return;
}
}
System.err.println("Babeldoc home: " + home + " is invalid");
--- 196,222 ----
if (fileHome.exists() && fileHome.isDirectory()) {
! filesHome = getLibraryFiles(home);
! }
! }
! if (user != null) {
! File fileUser = new File(user);
! if (fileUser.exists() && fileUser.isDirectory()) {
! filesUser = getLibraryFiles(user);
}
}
+
+ files = copyTo(filesHome, filesUser);
+ /*
+ for(int i=0; i<files.length;i++){
+ System.out.println(files[i].getAbsoluteFile());
+ }
+ */
+
+ if(files!=null){
+ runBabeldocMain(files, args);
+
+ return;
+ }
System.err.println("Babeldoc home: " + home + " is invalid");
***************
*** 330,334 ****
private static File[] copyTo(File[] files1, File[] files2) {
! if (files1 != null) {
return files2;
}
--- 354,358 ----
private static File[] copyTo(File[] files1, File[] files2) {
! if (files1 == null) {
return files2;
}
|