git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/Common/storagehub-client@175990 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0c898b051f
commit
a6dceeec83
|
@ -39,7 +39,12 @@ public class FolderContainer extends ItemContainer<FolderItem>{
|
|||
}
|
||||
|
||||
public FolderContainer newFolder(String name, String description) throws Exception {
|
||||
String newFolderId = itemclient.createFolder(this.itemId, name, description);
|
||||
String newFolderId = itemclient.createFolder(this.itemId, name, description, false);
|
||||
return new FolderContainer(itemclient, newFolderId);
|
||||
}
|
||||
|
||||
public FolderContainer newHiddenFolder(String name, String description) throws Exception {
|
||||
String newFolderId = itemclient.createFolder(this.itemId, name, description, true);
|
||||
return new FolderContainer(itemclient, newFolderId);
|
||||
}
|
||||
|
||||
|
|
|
@ -491,19 +491,35 @@ public class DefaultItemManager implements ItemManagerClient {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String createFolder(String parentId, String name, String description) {
|
||||
Call<GXWebTargetAdapterRequest, String> call = new Call<GXWebTargetAdapterRequest, String>() {
|
||||
@Override
|
||||
public String call(GXWebTargetAdapterRequest manager) throws Exception {
|
||||
return createFolder(parentId, name, description, false);
|
||||
}
|
||||
};
|
||||
try {
|
||||
return delegate.make(call);
|
||||
}catch(Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String createFolder(String parentId, String name, String description) {
|
||||
public String createFolder(String parentId, String name, String description, boolean hidden) {
|
||||
Call<GXWebTargetAdapterRequest, String> call = new Call<GXWebTargetAdapterRequest, String>() {
|
||||
@Override
|
||||
public String call(GXWebTargetAdapterRequest manager) throws Exception {
|
||||
GXWebTargetAdapterRequest myManager = manager.path(parentId)
|
||||
.path("create").path("FOLDER");
|
||||
|
||||
MultivaluedMap<String, String> formData = new MultivaluedHashMap<String, String>();
|
||||
MultivaluedMap<String, Object> formData = new MultivaluedHashMap<String, Object>();
|
||||
formData.add("name", name);
|
||||
formData.add("description", description);
|
||||
formData.add("hidden", hidden);
|
||||
|
||||
|
||||
GXInboundResponse response = myManager.post(Entity.entity(formData, MediaType.APPLICATION_FORM_URLENCODED));
|
||||
|
|
|
@ -37,6 +37,9 @@ public interface ItemManagerClient {
|
|||
|
||||
String uploadFile(InputStream stream, String parentId, String fileName, String description);
|
||||
|
||||
String createFolder(String parentId, String name, String description, boolean hidden);
|
||||
|
||||
@Deprecated
|
||||
String createFolder(String parentId, String name, String description);
|
||||
|
||||
List<ACL> getACL(String id);
|
||||
|
|
Loading…
Reference in New Issue