org.apache.tomcat.util.compat
Class JdkCompat
java.lang.Object
org.apache.tomcat.util.compat.JdkCompat
public class JdkCompat
extends java.lang.Object
General-purpose utility to provide backward-compatibility and JDK
independence. This allow use of JDK1.3 ( or higher ) facilities if
available, while maintaining the code compatible with older VMs.
The goal is to make backward-compatiblity reasonably easy.
The base class supports JDK1.3 behavior.
- Tim Funk
void | chainException(Throwable wrapper, Throwable wrapped) - Chains the wrapped throwable to the wrapper throwable.
|
static String | getJavaVersion() - Return java version as a string
|
static JdkCompat | getJdkCompat() - Get a compatibiliy helper class.
|
long | getMaxMemory() - Return the maximum amount of memory the JVM will attempt to use.
|
String | getPartialServletStackTrace(Throwable t) - Print out a partial servlet stack trace (truncating at the last
occurrence of javax.servlet.).
|
URL | getURI(File file) - Return the URI for the given file.
|
static boolean | isJava14()
|
static boolean | isJava15()
|
static boolean | isJava2()
|
String[] | split(String path, String pat) - Splits a string into it's components.
|
JAVA_1_0
public static final String JAVA_1_0
JAVA_1_1
public static final String JAVA_1_1
JAVA_1_2
public static final String JAVA_1_2
JAVA_1_3
public static final String JAVA_1_3
JAVA_1_4
public static final String JAVA_1_4
JAVA_1_5
public static final String JAVA_1_5
JdkCompat
protected JdkCompat()
Default no-arg constructor
chainException
public void chainException(Throwable wrapper,
Throwable wrapped)
Chains the wrapped throwable to the wrapper throwable.
wrapper
- The wrapper throwablewrapped
- The throwable to be wrapped
getJavaVersion
public static String getJavaVersion()
Return java version as a string
getJdkCompat
public static JdkCompat getJdkCompat()
Get a compatibiliy helper class.
getMaxMemory
public long getMaxMemory()
Return the maximum amount of memory the JVM will attempt to use.
getPartialServletStackTrace
public String getPartialServletStackTrace(Throwable t)
Print out a partial servlet stack trace (truncating at the last
occurrence of javax.servlet.).
getURI
public URL getURI(File file)
throws MalformedURLException
Return the URI for the given file. Originally created for
o.a.c.loader.WebappClassLoader
- A URI as a URL
isJava14
public static boolean isJava14()
isJava15
public static boolean isJava15()
isJava2
public static boolean isJava2()
split
public String[] split(String path,
String pat)
Splits a string into it's components.
path
- String to splitpat
- Pattern to split at
- the components of the path
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.