All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.newrelic.weave.utils.ClassLoaderFinder Maven / Gradle / Ivy

There is a newer version: 8.17.0
Show newest version
/*
 *
 *  * Copyright 2020 New Relic Corporation. All rights reserved.
 *  * SPDX-License-Identifier: Apache-2.0
 *
 */

package com.newrelic.weave.utils;

import java.net.URL;

/**
 * A {@link ClassFinder} that finds class URLs using a {@link ClassLoader}.
 */
public class ClassLoaderFinder implements ClassFinder {

    private final ClassLoader classLoader;

    public ClassLoaderFinder(ClassLoader classLoader) {
        this.classLoader = classLoader;
    }

    @Override
    public URL findResource(String internalName) {
        return classLoader.getResource(WeaveUtils.getClassResourceName(internalName));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy