git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@169378 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
dc1fdecdf2
commit
6975c5648a
|
@ -4,7 +4,6 @@ import java.io.InputStream;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.common.storagehub.client.proxies.ItemManagerClient;
|
||||
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
||||
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
|
@ -37,4 +36,9 @@ public class FolderContainer extends ItemContainer<FolderItem>{
|
|||
return itemclient.uploadFile(stream, this.itemId , filename, description);
|
||||
}
|
||||
|
||||
public FolderContainer newFolder(String name, String description) throws Exception {
|
||||
String newFolderId = itemclient.createFolder(this.itemId, name, description);
|
||||
return new FolderContainer(itemclient, newFolderId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package org.gcube.common.storagehub.client.dsl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.common.storagehub.client.StreamDescriptor;
|
||||
import org.gcube.common.storagehub.client.proxies.ItemManagerClient;
|
||||
import org.gcube.common.storagehub.model.NodeConstants;
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
public abstract class ItemContainer<I extends Item> {
|
||||
public class ItemContainer<I extends Item> {
|
||||
|
||||
protected ItemManagerClient itemclient;
|
||||
|
||||
|
@ -29,4 +32,8 @@ public abstract class ItemContainer<I extends Item> {
|
|||
return itemclient.download(this.itemId);
|
||||
}
|
||||
|
||||
public List<? extends Item> getAnchestors() {
|
||||
return itemclient.getAnchestors(this.itemId, NodeConstants.ACCOUNTING_NAME);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,5 +21,8 @@ public class OpenResolver {
|
|||
else throw new RuntimeException("this item is not a folder");
|
||||
}
|
||||
|
||||
public ItemContainer<Item> asItem() {
|
||||
return new ItemContainer<Item>(itemclient, item);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue