public interface

DataSourceFactory

com.atlassian.confluence.core.DataSourceFactory
Known Indirect Subclasses

Class Overview

Constructs DataSources for use in mail notifications.

Summary

Public Methods
DataSource getAvatar(User user)
Construct a DataSource for a user's profile picture.
DataSource getDatasource(Attachment attachment, boolean useThumbnail)
DataSource getServletContainerResource(String path, String name)
DataSource getURLResource(URL url, String name)

Public Methods

public DataSource getAvatar (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.

public DataSource getDatasource (Attachment attachment, boolean useThumbnail)

Throws
IOException

public 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 .

public DataSource getURLResource (URL url, String name)