com.atlassian.confluence.core
Class DefaultPluginDataSourceFactory

java.lang.Object
  extended by com.atlassian.confluence.core.DefaultPluginDataSourceFactory
All Implemented Interfaces:
PluginDataSourceFactory

public class DefaultPluginDataSourceFactory
extends java.lang.Object
implements PluginDataSourceFactory


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.confluence.core.PluginDataSourceFactory
PluginDataSourceFactory.FilterByType, PluginDataSourceFactory.ResourceView
 
Constructor Summary
DefaultPluginDataSourceFactory(javax.activation.FileTypeMap fileTypeMap, com.google.common.base.Function<com.atlassian.fugue.Pair<com.atlassian.plugin.Plugin,PluginDataSourceFactory.ResourceView>,java.io.InputStream> resourceStreamFactory, com.atlassian.plugin.Plugin plugin)
           
 
Method Summary
 com.atlassian.fugue.Maybe<javax.activation.DataSource> resourceFromModuleByName(java.lang.String moduleKey, java.lang.String resourceName)
          Extract a resource identified by name from a module and expose it as DataSource.
 com.atlassian.fugue.Maybe<java.lang.Iterable<javax.activation.DataSource>> resourcesFromModules(java.lang.String moduleKey)
          Extract all resources from a module and expose them as DataSources.
 com.atlassian.fugue.Maybe<java.lang.Iterable<javax.activation.DataSource>> resourcesFromModules(java.lang.String moduleKey, com.atlassian.plugin.util.collect.Predicate<PluginDataSourceFactory.ResourceView> filter)
          Extract resources from a module and expose them as DataSources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPluginDataSourceFactory

public DefaultPluginDataSourceFactory(javax.activation.FileTypeMap fileTypeMap,
                                      com.google.common.base.Function<com.atlassian.fugue.Pair<com.atlassian.plugin.Plugin,PluginDataSourceFactory.ResourceView>,java.io.InputStream> resourceStreamFactory,
                                      com.atlassian.plugin.Plugin plugin)
Method Detail

resourcesFromModules

public com.atlassian.fugue.Maybe<java.lang.Iterable<javax.activation.DataSource>> resourcesFromModules(java.lang.String moduleKey)
Description copied from interface: PluginDataSourceFactory
Extract all resources from a module and expose them as DataSources.

Specified by:
resourcesFromModules in interface PluginDataSourceFactory
See Also:
PluginDataSourceFactory.resourcesFromModules(String, Predicate)

resourcesFromModules

public com.atlassian.fugue.Maybe<java.lang.Iterable<javax.activation.DataSource>> resourcesFromModules(java.lang.String moduleKey,
                                                                                                       @Nullable
                                                                                                       com.atlassian.plugin.util.collect.Predicate<PluginDataSourceFactory.ResourceView> filter)
Description copied from interface: PluginDataSourceFactory
Extract resources from a module and expose them as DataSources.

Specified by:
resourcesFromModules in interface PluginDataSourceFactory
Parameters:
moduleKey - the key used to locate the module
filter - an optional filter for resources
Returns:
maybe the DataSources if the module could be located, the container is empty if the filter did not match anything

resourceFromModuleByName

public com.atlassian.fugue.Maybe<javax.activation.DataSource> resourceFromModuleByName(java.lang.String moduleKey,
                                                                                       java.lang.String resourceName)
Description copied from interface: PluginDataSourceFactory
Extract a resource identified by name from a module and expose it as DataSource.

Specified by:
resourceFromModuleByName in interface PluginDataSourceFactory
Parameters:
moduleKey - the key used to locate the module
resourceName - the name of the resource
Returns:
maybe the DataSource if the module could be located and contained a resource with the given name


Copyright © 2003-2014 Atlassian. All Rights Reserved.