set hidden and visible on item added
This commit is contained in:
parent
6e8600bbf3
commit
4135ed017a
2
pom.xml
2
pom.xml
|
@ -18,7 +18,7 @@
|
|||
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-client-library</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1-SNAPSHOT</version>
|
||||
<name>storagehub-client-library</name>
|
||||
|
||||
<dependencyManagement>
|
||||
|
|
|
@ -91,6 +91,16 @@ public abstract class ItemContainer<I extends Item> {
|
|||
itemclient.setMetadata(this.getId(), metadata);
|
||||
invalidateItem();
|
||||
}
|
||||
|
||||
public void setHidden() throws StorageHubException {
|
||||
itemclient.setHidden(this.getId(), true);
|
||||
invalidateItem();
|
||||
}
|
||||
|
||||
public void setVisible() throws StorageHubException {
|
||||
itemclient.setHidden(this.getId(), false);
|
||||
invalidateItem();
|
||||
}
|
||||
|
||||
public FolderContainer getRootSharedFolder() throws StorageHubException {
|
||||
return new FolderContainer(itemclient, (FolderItem)itemclient.getRootSharedFolder(this.itemId));
|
||||
|
|
|
@ -33,16 +33,18 @@ public class Items {
|
|||
|
||||
@BeforeClass
|
||||
public static void setUp(){
|
||||
SecurityTokenProvider.instance.set("b7c80297-e4ed-42ab-ab42-fdc0b8b0eabf-98187548");
|
||||
ScopeProvider.instance.set("/gcube");
|
||||
SecurityTokenProvider.instance.set("cf9eb57b-62c0-485d-ae56-d8a32b882808-843339462");
|
||||
ScopeProvider.instance.set("/d4science.research-infrastructures.eu");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void search() throws Exception{
|
||||
StorageHubClient shc = new StorageHubClient();
|
||||
List<? extends Item> s = shc.getWSRoot().search("%data%").getItems();
|
||||
s.forEach(i -> System.out.println(i.getPath()+" "+i.getName()));
|
||||
/*List<? extends Item> s = shc.getWSRoot().search("WD%",false).getItems();
|
||||
s.forEach(i -> System.out.println(i.getName()+" "+i.getId()));*/
|
||||
Item item = shc.restoreThrashItem("b7ad6691-ae43-4b61-9538-0961b0b98c5d").get();
|
||||
System.out.println("item id "+item.getId()+" path "+item.getPath()+" parent "+item.getParentId());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -129,8 +131,8 @@ public class Items {
|
|||
StorageHubClient shc = new StorageHubClient();
|
||||
|
||||
|
||||
StreamDescriptor streamDescr = shc.open("1104d6fc-b2ab-4915-b480-cb60257320a4").asFile().download();
|
||||
|
||||
StreamDescriptor streamDescr = shc.open("abb59b44-e3cb-408d-a1ff-73d6d8ad2ca1").asFile().downloadSpecificVersion("1.1");
|
||||
System.out.println("length "+streamDescr.getContentLenght());
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
File output = Files.createTempFile("down", streamDescr.getFileName()).toFile();
|
||||
|
|
Loading…
Reference in New Issue