001    package de.deepamehta.core.service;
002    
003    import java.io.InputStream;
004    
005    
006    
007    public interface Plugin {
008    
009        /**
010         * Accesses a static resource of the plugin. A static resource is some data (images, audio, text, etc) that is
011         * contained in the plugin bundle (that is the jar file).
012         *
013         * @param   name    The resource name: a "/"-separated path name, relative to the plugin bundle's root directory.
014         *                  It may or may not begin with "/" (it makes no difference).
015         *
016         * @return  An InputStream to read the static resource content.
017         *
018         * @throws  RuntimeException    If no such static resource is contained in the plugin bundle.
019         */
020        InputStream getStaticResource(String name);
021    
022        /**
023         * Checks if this plugin bundle contains a static resource with the given name.
024         *
025         * @param   name    The resource name: a "/"-separated path name, relative to the plugin bundle's root directory.
026         *                  It may or may not begin with "/" (it makes no difference).
027         */
028        boolean hasStaticResource(String name);
029    }