001    package railo.commons.io.res;
002    
003    import java.io.IOException;
004    import java.io.Serializable;
005    import java.util.Map;
006    
007    /**
008     * Interface for resource provider, loaded by "Resources",
009     * classes that implement a provider that produce resources, that match given path.
010     * 
011     */
012    public interface ResourceProvider extends Serializable {
013            
014            
015            /**
016             * this class is called by the "Resources" at startup 
017             * @param scheme of the provider (can be "null")
018             * @param arguments initals argument (can be "null")
019             */
020            public ResourceProvider init(String scheme, Map arguments);
021            
022            /**
023             * return a resource that match given path
024             * @param path 
025             * @return matching resource to path
026             */
027            public Resource getResource(String path);
028    
029            /**
030             * returns the scheme of the resource
031             * @return scheme
032             */
033            public String getScheme();
034            
035            /**
036             * returns the arguments defined for this resource
037             * @return scheme
038             */
039            public Map<String,String> getArguments();
040    
041            public void setResources(Resources resources);
042    
043            public void unlock(Resource res);
044            public void lock(Resource res) throws IOException;
045            public void read(Resource res) throws IOException;
046    
047            /** 
048         * returns if the resources of the provider are case-sensitive or not 
049         * @return is resource case-sensitive or not 
050         */ 
051        public boolean isCaseSensitive();
052    
053        /** 
054         * returns if the resource support mode for his resources 
055         * @return is mode supported or not 
056         */ 
057        public boolean isModeSupported();
058    
059        /** 
060         * returns if the resource support attributes for his resources 
061         * @return is attributes supported or not 
062         */ 
063        public boolean isAttributesSupported();
064    }