Lucio Lelii 5 years ago
parent b5b9a862e0
commit 5a17aff818

@ -432,6 +432,42 @@ public class ItemsManager {
String filePublicUrl = String.format("%s/%s%s",basepath, enchriptedPrefix, enchriptedString);
return filePublicUrl;
}
@PUT
@Path("{id}/publish")
@Produces(MediaType.APPLICATION_JSON)
public String makeFolderPublic(@FormParam("publish") boolean publish){
InnerMethodName.instance.set("makeFolderPublic("+publish+")");
Session ses = null;
Item folder= null;
try{
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
authChecker.checkWriteAuthorizationControl(ses, id, false);
Node currentNode =ses.getNodeByIdentifier(id);
log.trace("current node is {}",currentNode.getPath());
folder = node2Item.getItem(currentNode, Excludes.ALL);
if (!(folder instanceof FolderItem))
throw new InvalidCallParameters("item is not a folder");
currentNode.setProperty(NodeProperty.IS_PUBLIC.toString(), publish);
ses.save();
}catch(RepositoryException re ){
log.error("jcr error getting rootSharedFolder", re);
GXOutboundErrorResponse.throwException(new BackendGenericError(re));
}catch(StorageHubException she ){
log.error(she.getErrorMessage(), she);
GXOutboundErrorResponse.throwException(she, Response.Status.fromStatusCode(she.getStatus()));
}finally{
if (ses!=null)
ses.logout();
}
return id;
}
@GET
@Path("{id}/rootSharedFolder")

@ -72,13 +72,13 @@ public class GCubeStorageBackend implements StorageBackend {
@Override
public String getTotalSizeStored() {
IClient storageClient = getStorageClient(AuthorizationProvider.instance.get().getClient().getId()).getClient();
return storageClient.getUserTotalItems();
return storageClient.getTotalUserVolume();
}
@Override
public String getTotalItemsCount() {
IClient storageClient = getStorageClient(AuthorizationProvider.instance.get().getClient().getId()).getClient();
return storageClient.getTotalUserVolume();
return storageClient.getUserTotalItems();
}

@ -25,7 +25,7 @@ no. 654119), SoBigData (grant no. 654024), AGINFRA PLUS (grant no. 731001).
Version
--------------------------------------------------
1.0.7-SNAPSHOT (2019-07-29)
1.0.7-SNAPSHOT (2019-08-01)
Please see the file named "changelog.xml" in this directory for the release notes.

Loading…
Cancel
Save