|
|
|
@ -13,10 +13,9 @@ import javax.xml.xpath.XPath;
|
|
|
|
|
import javax.xml.xpath.XPathFactory;
|
|
|
|
|
|
|
|
|
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
|
|
|
import org.gcube.common.homelibrary.home.HomeLibrary;
|
|
|
|
|
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
|
|
|
|
import org.gcube.common.portal.PortalContext;
|
|
|
|
|
import org.gcube.common.scope.api.ScopeProvider;
|
|
|
|
|
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
|
|
|
|
import org.gcube.portal.custom.communitymanager.SiteManagerUtil;
|
|
|
|
|
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
|
|
|
|
|
import org.gcube.portal.databook.server.DatabookStore;
|
|
|
|
@ -145,8 +144,8 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
|
|
|
|
if(storageInUseLong == null){
|
|
|
|
|
String userToken = PortalContext.getConfiguration().getCurrentUserToken(ScopeProvider.instance.get(), statisticsOfUsername);
|
|
|
|
|
SecurityTokenProvider.instance.set(userToken);
|
|
|
|
|
Workspace workspace = HomeLibrary.getUserWorkspace(statisticsOfUsername);
|
|
|
|
|
storageInUseLong = workspace.getDiskUsage();
|
|
|
|
|
StorageHubClient shClient = new StorageHubClient();
|
|
|
|
|
storageInUseLong = shClient.getTotalVolume();
|
|
|
|
|
cacheWorkspace.insert(statisticsOfUsername, storageInUseLong);
|
|
|
|
|
}
|
|
|
|
|
storageInUse = ServerUtils.formatFileSize(storageInUseLong);
|
|
|
|
|