git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@171637 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3cc5d58351
commit
6c68b6c142
|
@ -1,6 +1,5 @@
|
|||
package org.gcube.common.storagehub.client.plugins;
|
||||
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
import javax.xml.transform.dom.DOMResult;
|
||||
import javax.xml.ws.EndpointReference;
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
|||
import org.gcube.common.storagehub.client.StreamDescriptor;
|
||||
import org.gcube.common.storagehub.model.acls.ACL;
|
||||
import org.gcube.common.storagehub.model.acls.AccessType;
|
||||
import org.gcube.common.storagehub.model.exceptions.BackendGenericError;
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
import org.gcube.common.storagehub.model.service.ItemList;
|
||||
import org.gcube.common.storagehub.model.service.ItemWrapper;
|
||||
|
@ -341,10 +342,12 @@ public class DefaultItemManager implements ItemManagerClient {
|
|||
formData.add("description", description);
|
||||
|
||||
|
||||
GXInboundResponse response = myManager.setAcceptedResponseType(MediaType.TEXT_PLAIN_TYPE).post(Entity.form(formData));
|
||||
GXInboundResponse response = myManager.setAcceptedResponseType(MediaType.APPLICATION_FORM_URLENCODED_TYPE).post(Entity.entity(formData, MediaType.APPLICATION_FORM_URLENCODED));
|
||||
|
||||
if (response.hasGXError())
|
||||
if (response.hasGXError() || response.hasException())
|
||||
throw response.getException();
|
||||
if (response.hasErrorCode())
|
||||
throw new BackendGenericError();
|
||||
|
||||
return response.getSource().readEntity(String.class);
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class TestCall {
|
|||
|
||||
WorkspaceManagerClient client = AbstractPlugin.workspace().build();
|
||||
Item ws = client.getWorkspace();
|
||||
String id = itemclient.createFolder(ws.getId(), "ok6SharingTest", "shared folder for test SHM");
|
||||
String id = itemclient.createFolder(ws.getId(), "ok7SharingTest", "shared folder for test SHM");
|
||||
String sharedId = itemclient.shareFolder(id, new HashSet<String>(Arrays.asList("giancarlo.panichi")), AccessType.WRITE_OWNER);
|
||||
itemclient.uploadFile(new FileInputStream("/home/lucio/Downloads/upload.pdf"), sharedId, "sharedFile.pdf" , "shared file in a shared folder");
|
||||
|
||||
|
|
Loading…
Reference in New Issue