mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-01 14:41:46 +00:00
[feature/MNT-24127-EndpointToCalculateFolderSize] Added Endpoint to calculate folder size
This commit is contained in:
@@ -282,7 +282,7 @@ public class ResourceWebScriptGet extends AbstractResourceWebScript implements P
|
||||
if (StringUtils.isNotBlank(params.getEntityId()))
|
||||
{
|
||||
if (EntityResourceAction.RetrieveFolderSize.class.isAssignableFrom(resource.getResource().getClass())
|
||||
&& GET_FOLDERSIZE.equals(resource.getMetaData().getUniqueId()))
|
||||
&& (GET_FOLDERSIZE.equals(resource.getMetaData().getUniqueId()) || params.getEntityId().contains("get-folder-size")))
|
||||
{
|
||||
if (resource.getMetaData().isDeleted(EntityResourceAction.RetrieveFolderSize.class))
|
||||
{
|
||||
|
@@ -106,7 +106,6 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
private static final String URL_CHILDREN = "children";
|
||||
private static final String URL_CONTENT = "content";
|
||||
private static final String URL_CALCULATEFOLDERSIZE = "calculate-folder-size";
|
||||
private static final String URL_GETFOLDERSIZE = "get-folder-size";
|
||||
|
||||
protected static final String TYPE_CM_FOLDER = "cm:folder";
|
||||
protected static final String TYPE_CM_CONTENT = "cm:content";
|
||||
@@ -1127,9 +1126,5 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
{
|
||||
return URL_NODES + "/" + nodeId + "/" + URL_CALCULATEFOLDERSIZE;
|
||||
}
|
||||
protected String getFolderSizeDataUrl(String nodeId)
|
||||
{
|
||||
return URL_NODES + "/" + nodeId + "/" + URL_GETFOLDERSIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -139,7 +139,7 @@ public class NodeFolderSizeApiTest extends AbstractBaseApiTest
|
||||
setRequestContext(user1);
|
||||
|
||||
// Check if response and JSON parsing were successful
|
||||
HttpResponse response = getSingle(NodesEntityResource.class, folderId + "/content", null, 200);
|
||||
HttpResponse response = getSingle(NodesEntityResource.class, folderId + "/get-folder-size", null, 200);
|
||||
|
||||
String jsonResponse = String.valueOf(response.getJsonResponse());
|
||||
assertNotNull("JSON response should not be null", jsonResponse);
|
||||
|
Reference in New Issue
Block a user