com.atlassian.confluence.core
Class DefaultDataSourceFactory

java.lang.Object
  extended by com.atlassian.confluence.core.DefaultDataSourceFactory
All Implemented Interfaces:
DataSourceFactory, org.springframework.web.context.ServletContextAware

public class DefaultDataSourceFactory
extends Object
implements DataSourceFactory, org.springframework.web.context.ServletContextAware


Constructor Summary
DefaultDataSourceFactory(UserAccessor userAccessor, AttachmentManager attachmentManager, ContentEntityObjectDao contentEntityObjectDao, MimetypesFileTypeMap mimetypesFileTypeMap)
           
 
Method Summary
 DataSource getAvatar(com.atlassian.user.User user)
          Construct a DataSource for a user's profile picture.
 DataSource getServletContainerResource(String path, String name)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDataSourceFactory

public DefaultDataSourceFactory(UserAccessor userAccessor,
                                AttachmentManager attachmentManager,
                                ContentEntityObjectDao contentEntityObjectDao,
                                MimetypesFileTypeMap mimetypesFileTypeMap)
Method Detail

getAvatar

public DataSource getAvatar(com.atlassian.user.User user)
Description copied from interface: DataSourceFactory
Construct a DataSource for a user's profile picture.

Specified by:
getAvatar in interface DataSourceFactory
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.

getServletContainerResource

public DataSource getServletContainerResource(String path,
                                              String name)
Specified by:
getServletContainerResource in interface DataSourceFactory
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 .

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware


Copyright © 2003-2011 Atlassian. All Rights Reserved.