handled more errors while retreving folder's files
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@132923 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cb6df188bf
commit
75046a3920
|
@ -123,8 +123,8 @@ public class WorkspaceUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ResourceBeanWrapper> listOfResources = getWorkspaceResourcesInformation(childrenIds, ws, userName);
|
// set them into the bean
|
||||||
bean.setResources(listOfResources);
|
bean.setResources(getWorkspaceResourcesInformation(childrenIds, ws, userName));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,19 +133,16 @@ public class WorkspaceUtils {
|
||||||
* @param resourceIds
|
* @param resourceIds
|
||||||
* @param ws
|
* @param ws
|
||||||
* @param username
|
* @param username
|
||||||
* @return
|
* @return a list of resource wrapper beans
|
||||||
*/
|
*/
|
||||||
public static List<ResourceBeanWrapper> getWorkspaceResourcesInformation(
|
public static List<ResourceBeanWrapper> getWorkspaceResourcesInformation(
|
||||||
List<String> resourceIds, Workspace ws, String username){
|
List<String> resourceIds, Workspace ws, String username){
|
||||||
|
|
||||||
List<ResourceBeanWrapper> toReturn = null;
|
List<ResourceBeanWrapper> toReturn = new ArrayList<>();
|
||||||
|
|
||||||
try{
|
|
||||||
|
|
||||||
toReturn = new ArrayList<>();
|
|
||||||
|
|
||||||
for (String resourceId : resourceIds) {
|
for (String resourceId : resourceIds) {
|
||||||
|
|
||||||
|
try{
|
||||||
logger.debug("RESOURCE ID IS " + resourceId);
|
logger.debug("RESOURCE ID IS " + resourceId);
|
||||||
|
|
||||||
ResourceBeanWrapper newResource = new ResourceBeanWrapper();
|
ResourceBeanWrapper newResource = new ResourceBeanWrapper();
|
||||||
|
@ -157,10 +154,10 @@ public class WorkspaceUtils {
|
||||||
newResource.setToBeAdded(true); // default is true
|
newResource.setToBeAdded(true); // default is true
|
||||||
newResource.setMimeType(((FolderItem)item).getMimeType());
|
newResource.setMimeType(((FolderItem)item).getMimeType());
|
||||||
toReturn.add(newResource);
|
toReturn.add(newResource);
|
||||||
|
|
||||||
}
|
|
||||||
}catch(Exception e ){
|
}catch(Exception e ){
|
||||||
logger.error("Unable to retrieve resources' info", e);
|
logger.error("Unable to add resource with id " + resourceId + " to the product bean");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return toReturn;
|
return toReturn;
|
||||||
|
|
Loading…
Reference in New Issue