This commit is contained in:
Lucio Lelii 2018-10-05 13:02:47 +00:00
parent 1a9eaa1ecd
commit 4263b026cc
1 changed files with 15 additions and 5 deletions

View File

@ -27,8 +27,11 @@ public abstract class ItemContainer<I extends Item> {
this.itemId = item.getId(); this.itemId = item.getId();
} }
protected String getId() {
return this.itemId;
}
public abstract ContainerType getType(); public abstract ContainerType getType();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -37,6 +40,11 @@ public abstract class ItemContainer<I extends Item> {
else return item; else return item;
} }
private I get(boolean reset) {
this.item = (I)itemclient.get(itemId);
return this.item;
}
public StreamDescriptor download(String ... nodeIdsToExclude) { public StreamDescriptor download(String ... nodeIdsToExclude) {
return itemclient.download(this.itemId, nodeIdsToExclude); return itemclient.download(this.itemId, nodeIdsToExclude);
} }
@ -49,12 +57,14 @@ public abstract class ItemContainer<I extends Item> {
itemclient.delete(this.itemId); itemclient.delete(this.itemId);
} }
public void rename(String newName) { public OpenResolver rename(String newName) {
itemclient.rename(this.itemId, newName); return new OpenResolver(this.get(true), itemclient);
} }
public void move(FolderContainer folder) { public OpenResolver move(FolderContainer folder) {
itemclient.move(this.itemId, folder.get().getId()); return new OpenResolver(this.get(true), itemclient);
} }
public FolderContainer getRootSharedFolder() { public FolderContainer getRootSharedFolder() {