git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@181652 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9d59308a21
commit
76bd21e063
2
pom.xml
2
pom.xml
|
@ -12,7 +12,7 @@
|
|||
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-client-library</artifactId>
|
||||
<version>1.0.6-SNAPSHOT</version>
|
||||
<version>1.0.7-SNAPSHOT</version>
|
||||
<name>storagehub-client-library</name>
|
||||
|
||||
<dependencyManagement>
|
||||
|
|
|
@ -1005,6 +1005,44 @@ public class DefaultItemManager implements ItemManagerClient {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String removeSharedFolderAdmin(String id, String user) throws StorageHubException {
|
||||
Call<GXWebTargetAdapterRequest, String> call = new Call<GXWebTargetAdapterRequest, String>() {
|
||||
@Override
|
||||
public String call(GXWebTargetAdapterRequest manager) throws Exception {
|
||||
Objects.requireNonNull(id, "id cannot be null");
|
||||
Objects.requireNonNull(user, "user cannot be null");
|
||||
|
||||
|
||||
GXWebTargetAdapterRequest myManager = manager.path(id).path("acls").path(user);
|
||||
|
||||
|
||||
GXInboundResponse response = myManager.delete();
|
||||
|
||||
|
||||
if (response.isErrorResponse()) {
|
||||
if (response.hasException())
|
||||
throw response.getException();
|
||||
else
|
||||
throw new BackendGenericError();
|
||||
}
|
||||
|
||||
return response.getSource().readEntity(String.class);
|
||||
|
||||
}
|
||||
};
|
||||
try {
|
||||
return delegate.make(call);
|
||||
}catch(StorageHubException e) {
|
||||
throw e;
|
||||
}catch(Exception e1) {
|
||||
throw new RuntimeException(e1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String copy(String id, String destinationFolderId, String newFilename) throws StorageHubException {
|
||||
Call<GXWebTargetAdapterRequest, String> call = new Call<GXWebTargetAdapterRequest, String>() {
|
||||
|
|
|
@ -49,6 +49,8 @@ public interface ItemManagerClient {
|
|||
|
||||
String changeACL(String id, String user, AccessType accessType) throws StorageHubException;
|
||||
|
||||
String removeSharedFolderAdmin(String id, String user) throws StorageHubException;
|
||||
|
||||
@Deprecated
|
||||
void delete(String id) throws StorageHubException;
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ public class Items {
|
|||
|
||||
@BeforeClass
|
||||
public static void setUp(){
|
||||
SecurityTokenProvider.instance.set("b7c80297-e4ed-42ab-ab42-fdc0b8b0eabf-98187548");
|
||||
ScopeProvider.instance.set("/gcube");
|
||||
SecurityTokenProvider.instance.set("257800d8-24bf-4bae-83cd-ea99369e7dd6-843339462");
|
||||
ScopeProvider.instance.set("/d4science.research-infrastructures.eu");
|
||||
}
|
||||
|
||||
|
||||
|
@ -110,8 +110,8 @@ public class Items {
|
|||
StorageHubClient shc = new StorageHubClient();
|
||||
|
||||
FileContainer file = null;
|
||||
try(InputStream is = new FileInputStream(new File("/home/lucio/Downloads/PortletTesting.xlsx"))){
|
||||
file = shc.open("1672d620-543e-4c76-b0af-4c46f52cbc82").asFolder().uploadFile(is, "PortletTestingSenzaExt", "graphs");
|
||||
try(InputStream is = new FileInputStream(new File("/home/lucio/Downloads/.richiesta speroni.pdf"))){
|
||||
file = shc.getWSRoot().uploadFile(is, ".richiesta speroni.pdf", "test");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue