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

ca.grimoire.maven.ResourceProvider Maven / Gradle / Ivy

package ca.grimoire.maven;

import java.io.InputStream;

import javax.servlet.ServletContext;

/**
 * A generalization over {@link ClassLoader#getResourceAsStream(String)},
 * {@link ServletContext#getResourceAsStream(String)}, and friends.
 */
public interface ResourceProvider {

    /**
     * Opens a stream over the named resource. If there is no resource with the
     * passed name, then the provider must return null.
     * 

* Paths that are "absolute" relative to this resource provider are not * required to begin with a slash. Implementations are responsible for * translating paths to an appropriate local form. * * @param resource * the resource to open. * @return an open stream at the beginning of the named resource, or * null. * @see ClassLoader#getResourceAsStream(String) */ public InputStream getResourceAsStream(String resource); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy