Methods Summary |
---|
public static java.lang.String | getJavaVersion()Return java version as a string
return javaVersion;
|
public static org.apache.tomcat.util.compat.JdkCompat | getJdkCompat()Get a compatibiliy helper class.
return jdkCompat;
|
public long | getMaxMemory()Return the maximum amount of memory the JVM will attempt to use.
return (-1L);
|
public java.lang.String | getPartialServletStackTrace(java.lang.Throwable t)Print out a partial servlet stack trace (truncating at the last
occurrence of javax.servlet.).
StringWriter stackTrace = new StringWriter();
t.printStackTrace(new PrintWriter(stackTrace));
String st = stackTrace.toString();
int i = st.lastIndexOf
("org.apache.catalina.core.ApplicationFilterChain.internalDoFilter");
if (i > -1) {
return st.substring(0, i - 4);
} else {
return st;
}
|
public java.net.URL | getURI(java.io.File file)Return the URI for the given file. Originally created for
o.a.c.loader.WebappClassLoader
File realFile = file;
try {
realFile = realFile.getCanonicalFile();
} catch (IOException e) {
// Ignore
}
return realFile.toURL();
|
private static void | init()
init();
try {
javaVersion = JAVA_1_0;
Class.forName("java.lang.Void");
javaVersion = JAVA_1_1;
Class.forName("java.lang.ThreadLocal");
java2=true;
javaVersion = JAVA_1_2;
Class.forName("java.lang.StrictMath");
javaVersion = JAVA_1_3;
Class.forName("java.lang.CharSequence");
javaVersion = JAVA_1_4;
java14=true;
} catch (ClassNotFoundException cnfe) {
// swallow as we've hit the max class version that we have
}
if( java14 ) {
try {
Class c=Class.forName(JAVA14_SUPPORT);
jdkCompat=(JdkCompat)c.newInstance();
} catch( Exception ex ) {
jdkCompat=new JdkCompat();
}
} else {
jdkCompat=new JdkCompat();
// Install jar handler if none installed
}
|
public static boolean | isJava14()
return java14;
|
public static boolean | isJava2()
return java2;
|
public java.lang.String[] | split(java.lang.String path, java.lang.String pat)Splits a string into it's components.
Vector comps = new Vector();
int pos = path.indexOf(pat);
int start = 0;
while( pos >= 0 ) {
if(pos > start ) {
String comp = path.substring(start,pos);
comps.add(comp);
}
start = pos + pat.length();
pos = path.indexOf(pat,start);
}
if( start < path.length()) {
comps.add(path.substring(start));
}
String [] result = new String[comps.size()];
for(int i=0; i < comps.size(); i++) {
result[i] = (String)comps.elementAt(i);
}
return result;
|