Package com.atlassian.confluence.core
Interface DataSourceFactory
public interface DataSourceFactory
Constructs DataSources for use in mail notifications.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateForPlugin
(String pluginKey) Create a factory for a specific plugin.javax.activation.DataSource
getAvatar
(com.atlassian.user.User user) Construct a DataSource for a user's profile picture.javax.activation.DataSource
getDatasource
(Attachment attachment, boolean useThumbnail) javax.activation.DataSource
getServletContainerResource
(String path, String name) javax.activation.DataSource
getSpaceLogo
(Space space) Encapsulates the logo for the givenSpace
in aDataSource
.javax.activation.DataSource
getURLResource
(URL url, String name)
-
Method Details
-
getAvatar
javax.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.
-
getSpaceLogo
Encapsulates the logo for the givenSpace
in aDataSource
.- Parameters:
space
- the space to retrieve the logo for- Returns:
- a
DataSource
encapsulating the ...- custom logo for a
Space
if configured - default
Space
logo if configured - default Confluence
Space
logo,SpaceLogo.DEFAULT_LOGO_PATH
DataSource.getName()
will return "<spacekey>-space-logo" - custom logo for a
- Since:
- 5.2
-
getServletContainerResource
- Parameters:
path
- a path that must begin with a "/" and is interpreted as relative to the current context rootname
- 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 .
-
getURLResource
-
getDatasource
javax.activation.DataSource getDatasource(Attachment attachment, boolean useThumbnail) throws IOException - Throws:
IOException
-
createForPlugin
Create a factory for a specific plugin.Allows the creation of
DataSources
from <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
-