ManageBy info added

This commit is contained in:
Lucio Lelii 2021-10-25 16:16:26 +02:00
parent 8d11063f6b
commit ca23f94e09
3 changed files with 6 additions and 4 deletions

View File

@ -370,7 +370,7 @@ public class ItemHandler {
@Override
public MetaInfo call() throws Exception {
try(InputStream is1 = mos.get()){
log.debug("UPLOAD: upload on storage - start");
log.debug("UPLOAD: upload on - start");
MetaInfo info = storageBackend.upload(is1, relPath, name);
log.debug("UPLOAD: upload on storage - stop");
return info;
@ -396,7 +396,8 @@ public class ItemHandler {
handler.getContent().setData(NodeConstants.CONTENT_NAME);
handler.getContent().setStorageId(info.getStorageId());
handler.getContent().setSize(info.getSize());
handler.getContent().setRemotePath(info.getRemotePath());
handler.getContent().setRemotePath(info.getRemotePath());
handler.getContent().setManagedBy(info.getRemotePath());
return handler;
}catch (Exception e) {
throw new BackendGenericError(e);

View File

@ -1,6 +1,5 @@
package org.gcube.data.access.storagehub.services;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;

View File

@ -4,6 +4,7 @@ import java.io.InputStream;
import java.util.UUID;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
import org.gcube.common.storagehub.model.Constants;
import org.gcube.common.storagehub.model.items.AbstractFileItem;
import org.gcube.common.storagehub.model.items.nodes.Content;
import org.gcube.common.storagehub.model.storages.MetaInfo;
@ -33,7 +34,7 @@ public class GCubeStorageBackend implements StorageBackend {
@Override
public String getName() {
return GCubeStorageBackend.class.getName();
return Constants.mongoStorageConstant;
}
@Override
@ -61,6 +62,7 @@ public class GCubeStorageBackend implements StorageBackend {
info.setSize(size);
info.setStorageId(storageId);
info.setRemotePath(remotePath);
info.setManagedBy(Constants.mongoStorageConstant);
return info;
}