FileDocCategorySizeDatePackage
Jdk14Compat.javaAPI DocGlassfish v2 API4430Fri May 04 22:33:14 BST 2007org.apache.tomcat.util.compat

Jdk14Compat

public class Jdk14Compat extends JdkCompat
See JdkCompat. This is an extension of that class for Jdk1.4 support.
author
Tim Funk
author
Remy Maucherat

Fields Summary
Constructors Summary
protected Jdk14Compat()
Default no-arg constructor

    
Methods Summary
public longgetMaxMemory()
Return the maximum amount of memory the JVM will attempt to use.

        return Runtime.getRuntime().maxMemory();
    
public java.lang.StringgetPartialServletStackTrace(java.lang.Throwable t)
Print out a partial servlet stack trace (truncating at the last occurrence of javax.servlet.).

        StringBuffer trace = new StringBuffer();
        trace.append(t.toString()).append('\n");
        StackTraceElement[] elements = t.getStackTrace();
        int pos = elements.length;
        for (int i = 0; i < elements.length; i++) {
            if ((elements[i].getClassName().startsWith
                 ("org.apache.catalina.core.ApplicationFilterChain"))
                && (elements[i].getMethodName().equals("internalDoFilter"))) {
                pos = i;
            }
        }
        for (int i = 0; i < pos; i++) {
            if (!(elements[i].getClassName().startsWith
                  ("org.apache.catalina.core."))) {
                trace.append('\t").append(elements[i].toString()).append('\n");
            }
        }
        return trace.toString();
    
public java.net.URLgetURI(java.io.File file)
Return the URI for the given file. Originally created for o.a.c.loader.WebappClassLoader

param
File to wrap into URI
return
A URI as a URL


        File realFile = file;
        try {
            realFile = realFile.getCanonicalFile();
        } catch (IOException e) {
            // Ignore
        }

        return realFile.toURI().toURL();
    
public java.lang.String[]split(java.lang.String path, java.lang.String pat)

        return path.split(pat);