ref 11724: SAI - Update to StorageHUB
https://support.d4science.org/issues/11724 Updated to StorageHub git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@171664 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a23c56395b
commit
443ead033c
6
pom.xml
6
pom.xml
|
@ -76,12 +76,6 @@
|
|||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xerces</artifactId>
|
||||
<version>2.4.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- StorageHub -->
|
||||
<dependency>
|
||||
|
|
|
@ -448,18 +448,18 @@ public class FilesStorage {
|
|||
|
||||
FolderContainer folderContainer = openResolver.asFolder();
|
||||
ListResolver listResolver = folderContainer.findByName(STATISTICAL_ALGORITHM_PROJECT_FILE_NAME);
|
||||
List<? extends Item> items = listResolver.getItems();
|
||||
if (items == null || items.isEmpty()) {
|
||||
List<ItemContainer<? extends Item>> itemsContainer = listResolver.getContainers();
|
||||
if (itemsContainer == null || itemsContainer.isEmpty()) {
|
||||
logger.debug("No project found in this folder!");
|
||||
throw new StatAlgoImporterServiceException("No project found in this folder!");
|
||||
} else {
|
||||
Item item = items.get(0);
|
||||
logger.debug("Item: " + item);
|
||||
if (item != null) {
|
||||
logger.debug("Item Id=" + item.getId());
|
||||
StreamDescriptor streamDescr = shc.open(item.getId()).asFile().download();
|
||||
ItemContainer<? extends Item> itemContainer = itemsContainer.get(0);
|
||||
logger.debug("ItemContainer: " + itemContainer);
|
||||
if (itemContainer != null) {
|
||||
logger.debug("Item Id: "+itemContainer.get().getId());
|
||||
StreamDescriptor streamDescr = itemContainer.download();
|
||||
logger.debug("Stream Descriptor: "+streamDescr);
|
||||
return streamDescr.getStream();
|
||||
|
||||
} else {
|
||||
logger.debug("No project found in this folder!");
|
||||
throw new StatAlgoImporterServiceException("No project found in this folder!");
|
||||
|
|
Loading…
Reference in New Issue