mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
125781 rmunteanu: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1) 125603 rmunteanu: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2) 125484 slanglois: MNT-16155 Update source headers - remove old Copyrights from Java and JSP dource files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127808 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
48 lines
1.7 KiB
Java
48 lines
1.7 KiB
Java
package org.alfresco.repo.tenant;
|
|
|
|
import java.io.File;
|
|
import java.io.Serializable;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
import org.alfresco.repo.content.ContentLimitProvider;
|
|
import org.alfresco.repo.content.ContentLimitProvider.NoLimitProvider;
|
|
import org.alfresco.repo.content.ContentStore;
|
|
import org.alfresco.repo.content.filestore.FileContentStore;
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
/**
|
|
* MT-aware File Content Store
|
|
*/
|
|
public class TenantRoutingFileContentStore extends AbstractTenantRoutingContentStore
|
|
{
|
|
private ContentLimitProvider contentLimitProvider = new NoLimitProvider();
|
|
|
|
/**
|
|
* Sets a new {@link ContentLimitProvider} which will provide a maximum filesize for content.
|
|
*/
|
|
public void setContentLimitProvider(ContentLimitProvider contentLimitProvider)
|
|
{
|
|
this.contentLimitProvider = contentLimitProvider;
|
|
}
|
|
|
|
protected ContentStore initContentStore(ApplicationContext ctx, String contentRoot)
|
|
{
|
|
Map<String, Serializable> extendedEventParams = new HashMap<String, Serializable>();
|
|
if (!TenantService.DEFAULT_DOMAIN.equals(tenantService.getCurrentUserDomain()))
|
|
{
|
|
extendedEventParams.put("Tenant", tenantService.getCurrentUserDomain());
|
|
}
|
|
|
|
FileContentStore fileContentStore = new FileContentStore(ctx, new File(contentRoot), extendedEventParams);
|
|
|
|
// Set the content filesize limiter if there is one.
|
|
if (this.contentLimitProvider != null)
|
|
{
|
|
fileContentStore.setContentLimitProvider(contentLimitProvider);
|
|
}
|
|
|
|
return fileContentStore;
|
|
}
|
|
}
|