git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@169429 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4453aba24f
commit
4af9f3bf64
|
@ -47,4 +47,8 @@ public abstract class ItemContainer<I extends Item> {
|
|||
return itemclient.getAnchestors(this.itemId, NodeConstants.ACCOUNTING_NAME);
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
itemclient.delete(this.itemId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -206,15 +206,13 @@ public class DefaultItemManager implements ItemManagerClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void moveToTrash(String id) {
|
||||
public void delete(String id) {
|
||||
Call<WebTarget, Void> call = new Call<WebTarget, Void>() {
|
||||
@Override
|
||||
public Void call(WebTarget manager) throws Exception {
|
||||
WebTarget myManager = manager.path(id)
|
||||
.path("moveToTrash");
|
||||
WebTarget myManager = manager.path(id);
|
||||
Invocation.Builder builder = myManager.request();
|
||||
|
||||
builder.put(Entity.text("Thrash"), Response.class);
|
||||
builder.delete();
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@ public interface ItemManagerClient {
|
|||
|
||||
List<ACL> getACL(String id);
|
||||
|
||||
void moveToTrash(String id);
|
||||
void delete(String id);
|
||||
|
||||
URL getPublickLink(String id);
|
||||
|
||||
|
|
|
@ -61,6 +61,14 @@ public class TestCall {
|
|||
System.in.read();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void delete() throws Exception{
|
||||
ItemManagerClient itemclient = AbstractPlugin.item().build();
|
||||
itemclient.delete("6d712458-cbba-4141-b7ef-c9bf6b9537c7");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getById() throws Exception{
|
||||
final ItemManagerClient client = AbstractPlugin.item().build();
|
||||
|
@ -76,11 +84,7 @@ public class TestCall {
|
|||
|
||||
|
||||
|
||||
@Test
|
||||
public void moveToThrash() throws Exception{
|
||||
final ItemManagerClient client = AbstractPlugin.item().build();
|
||||
client.moveToTrash("ac630298-e45e-4003-afca-950447612ff6");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue