This commit is contained in:
Lucio Lelii 2018-06-25 14:50:43 +00:00
parent 4453aba24f
commit 4af9f3bf64
4 changed files with 17 additions and 11 deletions

View File

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

View File

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

View File

@ -32,7 +32,7 @@ public interface ItemManagerClient {
List<ACL> getACL(String id);
void moveToTrash(String id);
void delete(String id);
URL getPublickLink(String id);

View File

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