Package com.atlassian.confluence.core
Interface DataSourceFactory
- 
- All Known Implementing Classes:
- DefaultDataSourceFactory
 
 public interface DataSourceFactoryConstructs DataSources for use in mail notifications.- Since:
- 4.0
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Optional<PluginDataSourceFactory>createForPlugin(String pluginKey)Create a factory for a specific plugin.com.atlassian.fugue.Maybe<PluginDataSourceFactory>forPlugin(String pluginKey)Deprecated.since 7.0.1.javax.activation.DataSourcegetAvatar(com.atlassian.user.User user)Construct a DataSource for a user's profile picture.javax.activation.DataSourcegetDatasource(Attachment attachment, boolean useThumbnail)javax.activation.DataSourcegetServletContainerResource(String path, String name)javax.activation.DataSourcegetSpaceLogo(Space space)Encapsulates the logo for the givenSpacein aDataSource.javax.activation.DataSourcegetURLResource(URL url, String name)
 
- 
- 
- 
Method Detail- 
getAvatarjavax.activation.DataSource getAvatar(com.atlassian.user.User user) Construct a DataSource for a user's profile picture.- Parameters:
- user- The user to retrieve the avatar for. If null, "Anonymous" will be assumed.
- Returns:
- A DataSource containing the user's profile picture. DataSource.getName() will return the string "avatar_[hash]", where [hash] is an md5 hash of the user's name plus the avatar's filename.
 
 - 
getSpaceLogojavax.activation.DataSource getSpaceLogo(Space space) Encapsulates the logo for the givenSpacein aDataSource.- Parameters:
- space- the space to retrieve the logo for
- Returns:
- a DataSourceencapsulating the ...- custom logo for a Spaceif configured
- default Spacelogo if configured
- default Confluence Spacelogo,SpaceLogo.DEFAULT_LOGO_PATH
 DataSource.getName()will return "<spacekey>-space-logo"
- custom logo for a 
- Since:
- 5.2
 
 - 
getServletContainerResourcejavax.activation.DataSource getServletContainerResource(String path, String name) - Parameters:
- path- a path that must begin with a "/" and is interpreted as relative to the current context root
- name- a custom name for the DataSource that will be returned.
- Returns:
- a DataSource containing the resource located at the path. DataSource.getName() will return the value of {@param name}.
 
 - 
getDatasourcejavax.activation.DataSource getDatasource(Attachment attachment, boolean useThumbnail) throws IOException - Throws:
- IOException
 
 - 
forPlugin@Deprecated com.atlassian.fugue.Maybe<PluginDataSourceFactory> forPlugin(String pluginKey) Deprecated.since 7.0.1. UsecreateForPlugin(String)Create a factory for a specific plugin.Allows the creation of DataSourcesfrom <resource> descriptors.- Parameters:
- pluginKey- the key used to locate the plugin
- Returns:
- maybe the factory for the plugin if it could be located
- Since:
- 5.2
 
 - 
createForPlugindefault Optional<PluginDataSourceFactory> createForPlugin(String pluginKey) Create a factory for a specific plugin.Allows the creation of DataSourcesfrom <resource> descriptors.- Parameters:
- pluginKey- the key used to locate the plugin
- Returns:
- maybe the factory for the plugin if it could be located
- Since:
- 7.0.1
 
 
- 
 
-