ResourceLoader.java :  » Portal » jportlet » net » sf » jportlet » util » Java Open Source

Java Open Source » Portal » jportlet 
jportlet » net » sf » jportlet » util » ResourceLoader.java
/*
 * Created on Apr 1, 2003
 */
package net.sf.jportlet.util;

import java.io.InputStream;

import java.net.URL;

import java.util.Locale;


/**
 * The <code>ResourceLoader</code> load resources as <code>java.io.InputStream</code>
 * or bind resources to their path in the application context.
 *
 * If a resource named <code>foo.txt</code> is requested to the resource loader,
 * it will search the following files:
 * <ol>
 *         <li> &lt;client-markup>/foo_&lt;locale-language>_&lt;locale-country>_&lt;locale-variant>.txt
 *         <li> &lt;client-markup>/foo_&lt;locale-language>_&lt;locale-country>.txt
 *         <li> &lt;client-markup>/foo_&lt;locale-language>.txt
 *         <li> &lt;client-markup>/foo.txt
 * </ol>
 *
 * @author <a href="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
 */
public interface ResourceLoader
{
    //~ Methods ----------------------------------------------------------------

    public URL getResource( String path );

    public InputStream getResourceAsStream( String path );

    public InputStream getResourceAsStream( String path,
                                            String markup );

    public InputStream getResourceAsStream( String path,
                                            String markup,
                                            Locale locale );

    public String getResourcePath( String path );

    public String getResourcePath( String path,
                                   String markup );

    public String getResourcePath( String path,
                                   String markup,
                                   Locale locale );
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.