Java Utililty Methods ClassLoader

List of utility methods to do ClassLoader

Description

The list of methods to do ClassLoader are organized into topic(s).

Method

MatcherhasLogDatePatternMatcher(final String line)
Implementation Routine hasLogDatePatternMatcher.
final Matcher mSysOut = PAT_SYS_OUT_LOG.matcher(line);
final boolean chk1 = mSysOut.find();
if (chk1) {
    return mSysOut;
final Matcher mLog4j = PAT_LOG4J.matcher(line);
final boolean chk2 = mLog4j.find();
if (chk2) {
...
booleanisExist(String path)
is Exist
return getResourceUrl(path) != null;
booleanisVMAlive(String procId)
is VM Alive
if (procId == null || "".equals(procId)) {
    return false;
initJVMToolJarClassLoader();
try {
    Object vm = method_AttachToVM.invoke(null, procId);
    if (vm != null) {
        return true;
...
Propertiesload(File propsFile)
load
Properties props = new Properties();
FileInputStream fis = new FileInputStream(propsFile);
props.load(fis);
fis.close();
return props;
Propertiesload(final String filename)
Load a properties file from the classpath
final Properties props = new Properties();
final URL url = ClassLoader.getSystemResource(filename);
if (url != null) {
    try {
        props.load(url.openStream());
    } catch (final IOException e) {
        e.printStackTrace();
        props.put("stamp", "loading from url " + url + " for " + filename + " failed " + e);
...
Propertiesload(String propertiesName)
Utility to load a properties file from the classpath.
Properties p = new Properties();
URL url = ClassLoader.getSystemResource(propertiesName);
if (url == null) {
    throw new FileNotFoundException("Properties file not on classpath: " + propertiesName);
InputStream is = url.openStream();
try {
    p.load(is);
...
Propertiesload(String propsName)
Load a properties file from the classpath.
Properties props = new Properties();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url = cl.getResource(propsName);
props.load(url.openStream());
return props;
ClassloadAttachApi()
Loads the com.sun.tools.attach.VirtualMachine class as the entry point to the attach API.
File toolsJar = locateToolsJar();
ClassLoader cl = wrapIntoClassLoader(toolsJar);
try {
    return cl.loadClass("com.sun.tools.attach.VirtualMachine");
} catch (ClassNotFoundException e) {
    throw new IllegalStateException("Unable to find com.sun.tools.attach.VirtualMachine", e);
PropertiesloadCorrectedConfiguration(String configurationFilename)
load Corrected Configuration
try {
    String configsDataDir = System.getProperty("repox.data.dir");
    String configurationFile;
    if (configDataDirAlreadyExists(configsDataDir, configurationFilename))
        configurationFile = URLDecoder.decode(configsDataDir + File.separator + configurationFilename,
                "ISO-8859-1");
    else {
        URL configurationURL = Thread.currentThread().getContextClassLoader()
...
FileloadFile(String file)
load File
URL fileURL = Thread.currentThread().getContextClassLoader().getResource(file);
if (fileURL == null) {
    throw new FileNotFoundException(file);
return new File(fileURL.toURI());