git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@171597 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
328583d21b
commit
f3895c91cf
|
@ -480,4 +480,35 @@ public class DefaultItemManager implements ItemManagerClient {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String copy(String id, String destinationFolderId, String newFilename) {
|
||||
Call<GXWebTargetAdapterRequest, String> call = new Call<GXWebTargetAdapterRequest, String>() {
|
||||
@Override
|
||||
public String call(GXWebTargetAdapterRequest manager) throws Exception {
|
||||
GXWebTargetAdapterRequest myManager = manager.path(id)
|
||||
.path("copy");
|
||||
|
||||
MultivaluedMap<String, String> formData = new MultivaluedHashMap<String, String>();
|
||||
formData.add("destinationId", destinationFolderId);
|
||||
formData.add("fileName", newFilename);
|
||||
|
||||
|
||||
GXInboundResponse response = myManager.setAcceptedResponseType(MediaType.TEXT_PLAIN_TYPE).post(Entity.form(formData));
|
||||
|
||||
if (response.hasGXError())
|
||||
throw response.getException();
|
||||
|
||||
return response.getSource().readEntity(String.class);
|
||||
}
|
||||
};
|
||||
try {
|
||||
return delegate.make(call);
|
||||
}catch(Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ public interface ItemManagerClient {
|
|||
Item getRootSharedFolder(String id);
|
||||
|
||||
String shareFolder(String id, Set<String> users, AccessType accessType);
|
||||
|
||||
String copy(String id, String destinationFolderId, String newFilename);
|
||||
|
||||
String uploadArchive(InputStream stream, String parentId, String extractionFolderName);
|
||||
|
||||
|
|
Loading…
Reference in New Issue