git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@169393 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4e96a43653
commit
a7170522d1
|
@ -0,0 +1,9 @@
|
|||
package org.gcube.common.storagehub.client.dsl;
|
||||
|
||||
public enum ContainerType {
|
||||
|
||||
FOLDER,
|
||||
FILE,
|
||||
GENERIC_ITEM
|
||||
|
||||
}
|
|
@ -13,4 +13,8 @@ public class FileContainer extends ItemContainer<AbstractFileItem> {
|
|||
super(itemclient, fileId);
|
||||
}
|
||||
|
||||
public ContainerType getType() {
|
||||
return ContainerType.FILE;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package org.gcube.common.storagehub.client.dsl;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.common.storagehub.client.proxies.ItemManagerClient;
|
||||
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
public class FolderContainer extends ItemContainer<FolderItem>{
|
||||
|
||||
|
@ -19,6 +17,10 @@ public class FolderContainer extends ItemContainer<FolderItem>{
|
|||
super(itemclient, folderId);
|
||||
}
|
||||
|
||||
public ContainerType getType() {
|
||||
return ContainerType.FOLDER;
|
||||
}
|
||||
|
||||
public ListResolver list() {
|
||||
return new ListResolver(itemclient, itemId);
|
||||
}
|
||||
|
|
|
@ -28,6 +28,12 @@ public class ItemContainer<I extends Item> {
|
|||
this.itemId = item.getId();
|
||||
}
|
||||
|
||||
public ContainerType getType() {
|
||||
return ContainerType.GENERIC_ITEM;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public I get() throws Exception {
|
||||
if (item==null) return (I)itemclient.get(itemId);
|
||||
|
|
|
@ -8,8 +8,6 @@ import java.util.stream.Collectors;
|
|||
|
||||
import org.gcube.common.storagehub.client.proxies.ItemManagerClient;
|
||||
import org.gcube.common.storagehub.model.NodeConstants;
|
||||
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
||||
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
public class ListResolver {
|
||||
|
|
Loading…
Reference in New Issue