2018-06-21 17:08:26 +02:00
|
|
|
package org.gcube.common.storagehub.client.dsl;
|
|
|
|
|
2018-06-22 16:27:21 +02:00
|
|
|
import java.net.URL;
|
2018-10-11 18:36:21 +02:00
|
|
|
import java.util.List;
|
2018-06-22 16:27:21 +02:00
|
|
|
|
2018-06-21 17:08:26 +02:00
|
|
|
import org.gcube.common.storagehub.client.proxies.ItemManagerClient;
|
|
|
|
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
2018-10-11 18:36:21 +02:00
|
|
|
import org.gcube.common.storagehub.model.service.Version;
|
2018-06-21 17:08:26 +02:00
|
|
|
|
|
|
|
public class FileContainer extends ItemContainer<AbstractFileItem> {
|
|
|
|
|
|
|
|
protected FileContainer(ItemManagerClient itemclient, AbstractFileItem item) {
|
|
|
|
super(itemclient, item);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected FileContainer(ItemManagerClient itemclient, String fileId) {
|
|
|
|
super(itemclient, fileId);
|
|
|
|
}
|
|
|
|
|
2018-06-21 17:50:07 +02:00
|
|
|
public ContainerType getType() {
|
|
|
|
return ContainerType.FILE;
|
|
|
|
}
|
|
|
|
|
2018-06-22 16:27:21 +02:00
|
|
|
public URL getPublicLink() {
|
|
|
|
return itemclient.getPublickLink(this.itemId);
|
|
|
|
}
|
|
|
|
|
2018-10-11 18:36:21 +02:00
|
|
|
public List<Version> getVersions() {
|
|
|
|
return itemclient.getFileVersions(this.itemId);
|
|
|
|
}
|
|
|
|
|
2018-09-21 18:00:47 +02:00
|
|
|
public FileContainer copy(FolderContainer folder, String newFileName) {
|
|
|
|
return new FileContainer(itemclient, itemclient.copy(this.itemId, folder.get().getId(), newFileName));
|
|
|
|
}
|
2018-06-21 17:08:26 +02:00
|
|
|
}
|