Renamed method from SHub interface:

gePropertyMap -> getMetadata
getValues -> getMap

updated pom version at 0.4.0


git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/storagehub-client-wrapper@174506 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-12-03 10:36:59 +00:00
parent 4c0d1d7df5
commit 610504689b
4 changed files with 9 additions and 8 deletions

View File

@ -10,7 +10,7 @@
</parent> </parent>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-wrapper</artifactId> <artifactId>storagehub-client-wrapper</artifactId>
<version>0.3.0-SNAPSHOT</version> <version>0.4.0-SNAPSHOT</version>
<name>storagehub-client-wrapper</name> <name>storagehub-client-wrapper</name>
<description>This is a wrapper of storagehub-client library. It allows to interact with storagehub in a simplified way by exposing several utilities. Moreover, It exposes object as defined in (the old) HL interfaces</description> <description>This is a wrapper of storagehub-client library. It allows to interact with storagehub in a simplified way by exposing several utilities. Moreover, It exposes object as defined in (the old) HL interfaces</description>
<scm> <scm>

View File

@ -111,7 +111,7 @@ public class HLMapper {
PropertyMap pm = null; PropertyMap pm = null;
if(metadata!=null) if(metadata!=null)
pm = new PropertyMap(metadata.getValues()); pm = new PropertyMap(metadata.getMap());
//IN CASE OF EMPTY MAP RETURNS NULL //IN CASE OF EMPTY MAP RETURNS NULL
if(pm!=null && pm.getValues()!=null && pm.getValues().isEmpty()) if(pm!=null && pm.getValues()!=null && pm.getValues().isEmpty())
@ -198,7 +198,7 @@ public class HLMapper {
// for (String key : map.keySet()) { // for (String key : map.keySet()) {
// logger.debug("Key: "+key+ "value: "+map.get(key)); // logger.debug("Key: "+key+ "value: "+map.get(key));
// } // }
String isPublic = (String) item.getPropertyMap().getValues().get("isPublic"); String isPublic = (String) item.getMetadata().getMap().get("isPublic");
logger.debug("The item name: "+item.getName()+ " has isPublic property like: "+isPublic); logger.debug("The item name: "+item.getName()+ " has isPublic property like: "+isPublic);
isPublicItem = isPublic!=null?isPublic.toLowerCase().contains("true"):false; isPublicItem = isPublic!=null?isPublic.toLowerCase().contains("true"):false;
}catch(Exception e){ }catch(Exception e){
@ -269,7 +269,7 @@ public class HLMapper {
PropertyMap pm = null; PropertyMap pm = null;
if(withMapProperties || isFolder){ if(withMapProperties || isFolder){
//System.out.println("Setting map: "+item.getPropertyMap().getValues()); //System.out.println("Setting map: "+item.getPropertyMap().getValues());
pm = toPropertyMap(item.getPropertyMap()); pm = toPropertyMap(item.getMetadata());
} }
//CONVERTING TRASH ITEM //CONVERTING TRASH ITEM

View File

@ -34,7 +34,7 @@ public class ObjectMapper {
public static List<String> toListLogins(SharedFolder sharedfolder){ public static List<String> toListLogins(SharedFolder sharedfolder){
Metadata users = sharedfolder.getUsers(); Metadata users = sharedfolder.getUsers();
Map<String, Object> mapMember = users.getValues(); Map<String, Object> mapMember = users.getMap();
List<String> listUsers = new ArrayList<String>(mapMember.size()); List<String> listUsers = new ArrayList<String>(mapMember.size());
listUsers.addAll(mapMember.keySet()); listUsers.addAll(mapMember.keySet());
logger.debug("Returning "+listUsers.size()+" member/s for sharedFolder with id: "+sharedfolder.getId()); logger.debug("Returning "+listUsers.size()+" member/s for sharedFolder with id: "+sharedfolder.getId());

View File

@ -15,6 +15,7 @@ import org.gcube.common.storagehubwrapper.shared.tohl.impl.FileItem;
import org.gcube.common.storagehubwrapper.shared.tohl.impl.ImageFile; import org.gcube.common.storagehubwrapper.shared.tohl.impl.ImageFile;
import org.gcube.common.storagehubwrapper.shared.tohl.impl.PDFFile; import org.gcube.common.storagehubwrapper.shared.tohl.impl.PDFFile;
import org.junit.Before; import org.junit.Before;
import org.junit.Test;
/** /**
@ -78,7 +79,7 @@ public class WorkspaceInstance {
} }
//@Test @Test
public void getChildren() throws Exception{ public void getChildren() throws Exception{
System.out.println("Get children test"); System.out.println("Get children test");
@ -90,8 +91,8 @@ public class WorkspaceInstance {
int i = 0; int i = 0;
for (WorkspaceItem workspaceItem : children) { for (WorkspaceItem workspaceItem : children) {
System.out.println(++i+")"+workspaceItem); System.out.println(++i+")"+workspaceItem.getId() + " name: "+workspaceItem.getName() + " type: "+workspaceItem.getType() +" class: "+workspaceItem.getClass());
System.out.println(workspaceItem.getType() +" "+workspaceItem.getClass()); //System.out.println(workspaceItem.getType() +" "+workspaceItem.getClass());
// System.out.println(++i+")"); // System.out.println(++i+")");