/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.osgi.framework.Bundle
 */
package org.apache.logging.log4j.core.util;

import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
import org.apache.logging.log4j.core.util.ResourceLoader;
import org.osgi.framework.Bundle;

public final class BundleResourceLoader
implements ResourceLoader {
    private final Bundle bundle;

    public BundleResourceLoader(Bundle bundle) {
        this.bundle = bundle;
    }

    @Override
    public Class<?> loadClass(String name) throws ClassNotFoundException {
        return this.bundle.loadClass(name);
    }

    @Override
    public URL getResource(String name) {
        return this.bundle.getResource(name);
    }

    @Override
    public Enumeration<URL> getResources(String name) throws IOException {
        Enumeration enumeration = this.bundle.getResources(name);
        return enumeration;
    }

    public String toString() {
        return this.getClass().getCanonicalName() + ": " + this.bundle.getSymbolicName();
    }
}
