mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
83542: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud) 82265: Merged DEV to V4.2-BUG-FIX (4.2.4) 82260: MNT-10766: User quotas diminished due to orphan, undetectable, non-deletable, temporary download files generated by "Download as Zip" - functionality that allows to configure excluded types, that will ignore user usage recalculation for these types. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@84562 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -77,6 +77,8 @@ public class ContentUsageImpl implements ContentUsageService,
|
||||
|
||||
private List<String> stores;
|
||||
|
||||
private Set<QName> excludedTypes = new HashSet<QName>();
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
@@ -122,6 +124,14 @@ public class ContentUsageImpl implements ContentUsageService,
|
||||
return this.stores;
|
||||
}
|
||||
|
||||
public void setExcludedTypes(List<String> excludedTypes)
|
||||
{
|
||||
for (String exType : excludedTypes)
|
||||
{
|
||||
this.excludedTypes.add(QName.createQName(exType));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The initialise method
|
||||
*/
|
||||
@@ -431,7 +441,7 @@ public class ContentUsageImpl implements ContentUsageService,
|
||||
|
||||
private void incrementUserUsage(String userName, long contentSize, NodeRef contentNodeRef)
|
||||
{
|
||||
if (! authenticationContext.isSystemUserName(userName))
|
||||
if (!authenticationContext.isSystemUserName(userName) && !excludedTypes.contains(nodeService.getType(contentNodeRef)))
|
||||
{
|
||||
// increment usage - add positive delta
|
||||
if (logger.isDebugEnabled()) logger.debug("incrementUserUsage: username="+userName+", contentSize="+contentSize+", contentNodeRef="+contentNodeRef);
|
||||
|
Reference in New Issue
Block a user