This commit is contained in:
Lucio Lelii 2018-12-18 15:24:08 +00:00
parent 0c898b051f
commit a6dceeec83
3 changed files with 28 additions and 4 deletions

View File

@ -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);
}

View File

@ -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));

View File

@ -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);