public class

DefaultDataSourceFactory

extends Object
implements DataSourceFactory ServletContextAware
java.lang.Object
   ↳ com.atlassian.confluence.core.DefaultDataSourceFactory

Summary

Public Constructors
DefaultDataSourceFactory(UserAccessor userAccessor, AttachmentManager attachmentManager, ContentEntityObjectDao contentEntityObjectDao, MimetypesFileTypeMap mimetypesFileTypeMap, ThumbnailManager thumbnailManager)
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)
//TODO caching datasource
void setServletContext(ServletContext servletContext)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.core.DataSourceFactory
From interface org.springframework.web.context.ServletContextAware

Public Constructors

public DefaultDataSourceFactory (UserAccessor userAccessor, AttachmentManager attachmentManager, ContentEntityObjectDao contentEntityObjectDao, MimetypesFileTypeMap mimetypesFileTypeMap, ThumbnailManager thumbnailManager)

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)

public DataSource getURLResource (URL url, String name)

//TODO caching datasource

public void setServletContext (ServletContext servletContext)