fixing issues

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/storagehub-client-wrapper@171555 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-09-20 16:14:43 +00:00
parent facb49543b
commit c96d95cd70
4 changed files with 37 additions and 24 deletions

View File

@ -243,6 +243,8 @@ public class StorageHubClientService {
}
/**
* Gets the user acl for folder id.
*

View File

@ -526,6 +526,21 @@ public final class WorkspaceStorageHubClientService implements Workspace{
}
/**
* Gets the VRE folders id.
*
* @return the VRE folders id
* @throws Exception
*/
public String getVREFoldersId() throws Exception{
try{
return storageHubClientService.getVREFoldersId();
}catch(Exception e){
throw new Exception("Error getting vre folder id: "+e.getMessage());
}
}
@ -824,16 +839,6 @@ public final class WorkspaceStorageHubClientService implements Workspace{
return null;
}
/* (non-Javadoc)
* @see org.gcube.portal.storagehubwrapper.shared.Workspace#getVREFolderByScope(java.lang.String)
*/
@Override
public WorkspaceSharedFolder getVREFolderByScope(String scope)
throws ItemNotFoundException, InternalErrorException {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.gcube.portal.storagehubwrapper.shared.Workspace#getDiskUsage()

View File

@ -31,7 +31,6 @@ import org.gcube.common.storagehubwrapper.shared.tohl.impl.PropertyMap;
import org.gcube.common.storagehubwrapper.shared.tohl.impl.URLFile;
import org.gcube.common.storagehubwrapper.shared.tohl.impl.WorkspaceFolder;
import org.gcube.common.storagehubwrapper.shared.tohl.impl.WorkspaceSharedFolder;
import org.gcube.common.storagehubwrapper.shared.tohl.impl.WorkspaceVREFolder;
import org.gcube.common.storagehubwrapper.shared.tohl.items.FileItemType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -132,6 +131,7 @@ public class HLMapper {
String itemName = item.getName();
boolean isRoot = false;
//THE ITEM IS A KIND OF FOLDER
if (item instanceof FolderItem){
@ -144,10 +144,13 @@ public class HLMapper {
theItem = new WorkspaceSharedFolder();
type = WorkspaceItemType.SHARED_FOLDER;
itemName = sharedfolder.getTitle(); //IN CASE OF SHARED FOLDER THE NAME IS AN UUID, I'M USING THE TITLE
if (sharedfolder.isVreFolder()){
VreFolder vreFolder = (VreFolder) item;
theItem = new WorkspaceVREFolder();
((WorkspaceSharedFolder) theItem).setVreFolder(true);
//logger.debug("Converting shared folder: "+theItem.getClass());
//VreFolder vreFolder = (VreFolder) item;
//theItem = new WorkspaceVREFolder(); //NEVER INSTANCE THE WorkspaceVREFolder because VreFolder is never used by HL/StorageHub
itemName = sharedfolder.getDisplayName(); //IN CASE OF VRE FOLDER I'M USING THE DISPLAYNAME
((WorkspaceSharedFolder) theItem).setVreFolder(true);
type = WorkspaceItemType.VRE_FOLDER;
}
}
@ -234,7 +237,7 @@ public class HLMapper {
theItem.setAccounting(accountingEntries);
theItem.setType(type);
theItem.setFolder(isFolder);
theItem.setRoot(false);
theItem.setRoot(isRoot); //IS ALWAYS FALSE
theItem.setPropertyMap(pm);
return (T) theItem;

View File

@ -211,6 +211,18 @@ public interface Workspace{
public boolean isItemShared(String itemId) throws Exception;
/**
* Gets the VRE folders id.
*
* @return the VRE folders id
* @throws Exception
*/
public String getVREFoldersId() throws Exception;
@ -562,15 +574,6 @@ public interface Workspace{
public List<WorkspaceItem> searchByProperties(List<String> properties)
throws InternalErrorException;
/**
* Get VRE Folder By Scope.
*
* @param scope the scope
* @return the VRE folder associated to such scope
* @throws ItemNotFoundException the item not found exception
* @throws InternalErrorException the internal error exception
*/
public WorkspaceSharedFolder getVREFolderByScope(String scope) throws ItemNotFoundException, InternalErrorException;
/**
* Get the disk usage of a worskpace.