Added checks to not track live usage if the main content usage service is not enabled.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19845 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2010-04-14 07:44:40 +00:00
parent c56442c1c2
commit 08c2d9c773

View File

@@ -19,11 +19,9 @@
package org.alfresco.filesys.repo;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import org.alfresco.filesys.state.FileStateTable;
import org.alfresco.jlan.server.SrvSession;
import org.alfresco.jlan.server.filesys.DiskDeviceContext;
import org.alfresco.jlan.server.filesys.DiskFullException;
@@ -115,6 +113,11 @@ public class ContentQuotaManager implements QuotaManager, Runnable {
*/
public long getUserFreeSpace(SrvSession sess, TreeConnection tree) {
// Check if content usage is enabled
if ( m_usageService.getEnabled() == false)
return 0L;
// Check if there is a live usage record for the user
UserQuotaDetails userQuota = getQuotaDetails(sess, true);
@@ -139,6 +142,11 @@ public class ContentQuotaManager implements QuotaManager, Runnable {
public long allocateSpace(SrvSession sess, TreeConnection tree, NetworkFile file, long alloc)
throws IOException {
// Check if content usage is enabled
if ( m_usageService.getEnabled() == false)
return alloc;
// Check if there is a live usage record for the user
UserQuotaDetails userQuota = getQuotaDetails(sess, true);
@@ -205,6 +213,11 @@ public class ContentQuotaManager implements QuotaManager, Runnable {
public void releaseSpace(SrvSession sess, TreeConnection tree, int fid, String path, long alloc)
throws IOException {
// Check if content usage is enabled
if ( m_usageService.getEnabled() == false)
return;
// Check if there is a live usage record for the user
UserQuotaDetails userQuota = getQuotaDetails(sess, true);