|
|
|
@ -18,11 +18,9 @@ package org.gcube.resourcemanagement.support.server.managers.resources;
|
|
|
|
|
|
|
|
|
|
import java.io.StringReader;
|
|
|
|
|
|
|
|
|
|
import javax.xml.bind.JAXBContext;
|
|
|
|
|
import javax.xml.bind.Unmarshaller;
|
|
|
|
|
|
|
|
|
|
import org.gcube.common.resources.gcore.HostingNode;
|
|
|
|
|
import org.gcube.common.resources.gcore.Resource;
|
|
|
|
|
import org.gcube.common.resources.gcore.Resources;
|
|
|
|
|
import org.gcube.common.scope.api.ScopeProvider;
|
|
|
|
|
import org.gcube.common.scope.impl.ScopeBean;
|
|
|
|
|
import org.gcube.common.vremanagement.ghnmanager.client.GHNManagerLibrary;
|
|
|
|
@ -193,10 +191,7 @@ public class GHNManager extends AbstractResourceManager {
|
|
|
|
|
@Override
|
|
|
|
|
protected final Resource buildResource(final String xmlRepresentation) throws AbstractResourceException {
|
|
|
|
|
try {
|
|
|
|
|
JAXBContext ctx = JAXBContext.newInstance(HostingNode.class);
|
|
|
|
|
Unmarshaller unmarshaller = ctx.createUnmarshaller();
|
|
|
|
|
StringReader reader = new StringReader(xmlRepresentation);
|
|
|
|
|
HostingNode deserialised = (HostingNode) unmarshaller.unmarshal(reader);
|
|
|
|
|
HostingNode deserialised = Resources.unmarshal(HostingNode.class, new StringReader(xmlRepresentation));
|
|
|
|
|
return deserialised;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new ResourceAccessException("Cannot load the stub for resource " + this.getType(), e);
|
|
|
|
|