You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2004/07/11 22:40:07 UTC
cvs commit: cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java JavaLanguage.java
antonio 2004/07/11 13:40:07
Modified: src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java
JavaLanguage.java
Log:
Use commons lang
Revision Changes Path
1.2 +10 -8 cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaLanguage.java
Index: JavaLanguage.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaLanguage.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JavaLanguage.java 10 Mar 2004 12:58:07 -0000 1.1
+++ JavaLanguage.java 11 Jul 2004 20:40:07 -0000 1.2
@@ -38,6 +38,7 @@
import org.apache.cocoon.components.language.programming.LanguageCompiler;
import org.apache.cocoon.util.ClassUtils;
import org.apache.cocoon.util.JavaArchiveFilter;
+import org.apache.commons.lang.SystemUtils;
/**
* The Java programming language processor
@@ -121,13 +122,14 @@
// Initialize the classpath
String systemBootClasspath = System.getProperty("sun.boot.class.path");
- String systemClasspath = System.getProperty("java.class.path");
- String systemExtDirs = System.getProperty("java.ext.dirs");
- String systemExtClasspath = null;
+ String systemClasspath = SystemUtils.JAVA_CLASS_PATH;
+ String systemExtDirs = SystemUtils.JAVA_EXT_DIRS;
+ String systemExtClasspath;
try {
systemExtClasspath = expandDirs(systemExtDirs);
} catch (Exception e) {
+ systemExtClasspath = null;
getLogger().warn("Could not expand Directory:" + systemExtDirs, e);
}
@@ -179,8 +181,7 @@
String filename = name.substring(pos + 1);
final String basePath = baseDirectory.getCanonicalPath();
- String filepath = basePath + File.separator
- + name + "." + getSourceExtension();
+ String filepath = basePath + File.separator + name + "." + getSourceExtension();
compiler.setFile(filepath);
compiler.setSource(basePath);
@@ -258,7 +259,9 @@
File dir = new File(d);
if (!dir.isDirectory()) {
// The absence of a listed directory may not be an error.
- if (getLogger().isWarnEnabled()) getLogger().warn("Attempted to retrieve directory listing of non-directory " + dir.toString());
+ if (getLogger().isWarnEnabled()) {
+ getLogger().warn("Attempted to retrieve directory listing of non-directory " + dir.toString());
+ }
} else {
File[] files = dir.listFiles(new JavaArchiveFilter());
for (int i = 0; i < files.length; i++) {
@@ -266,7 +269,6 @@
}
}
}
-
return buffer.toString();
}