[feature/MNT-24127-EndpointToCalculateFolderSize] Added Endpoint to calculate folder size

This commit is contained in:
Mohit Singh
2024-08-01 23:49:27 +05:30
parent 1073677dc7
commit 44f42992dd
3 changed files with 2 additions and 7 deletions

View File

@@ -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))
{

View File

@@ -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;
}
}

View File

@@ -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);