public class Loader extends Object
Constructor and Description |
---|
Loader() |
Modifier and Type | Method and Description |
---|---|
static URL |
getResource(String resource)
This method will search for
resource in different places. |
static URL |
getResource(String resource,
Class clazz)
Deprecated.
as of 1.2.
|
static boolean |
isJava1()
Always returns false since Java 1.x support is long gone.
|
static Class |
loadClass(String clazz)
Loads the specified class using the
Thread contextClassLoader , if that fails try
Class.forname. |
public static URL getResource(String resource)
resource
in different places. The search order is as follows:
resource
using the thread context class loader under Java2. If that fails, search for
resource
using the class loader that loaded this class (Loader
).
ClassLoader.getSystemResource(resource)
.
@Deprecated public static URL getResource(String resource, Class clazz)
resource
- resource nameclazz
- class, ignored.public static boolean isJava1()
public static Class loadClass(String clazz) throws ClassNotFoundException
Thread
contextClassLoader
, if that fails try
Class.forname.clazz
- The class to load.ClassNotFoundException
- Never thrown, declared for compatibility.Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.