git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@181396 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b5b9a862e0
commit
5a17aff818
|
@ -433,6 +433,42 @@ public class ItemsManager {
|
|||
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")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
|
@ -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…
Reference in New Issue