Skip to content

Commit 94825e3

Browse files
authored
Fix rename folder endpoint
1 parent 52d8f8f commit 94825e3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cloudinary-core/src/main/java/com/cloudinary/Api.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,10 @@ public ApiResponse analyze(String inputType, String analysisType, String uri, Ma
802802

803803
public ApiResponse renameFolder(String path, String toPath, Map options) throws Exception {
804804
if (options == null || options.isEmpty()) options = ObjectUtils.asMap();
805-
List<String> url = Arrays.asList("folder_operations", "rename");
805+
List<String> url = Arrays.asList("folders", path);
806806

807807
final Map params = new HashMap();
808-
params.put("path", path);
809-
params.put("to_path", toPath);
808+
params.put("to_folder", toPath);
810809

811810
return callApi(HttpMethod.PUT, url, params, options);
812811

cloudinary-test-common/src/main/java/com/cloudinary/test/AbstractApiTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,11 +1278,11 @@ public void testVisualSearch() {
12781278
@Test
12791279
@Ignore("Skip test till FD is enabled for test accounts")
12801280
public void testRenameFolder() throws Exception {
1281-
Map result = api.createFolder("apTestCreateFolder", null);
1281+
Map result = api.createFolder("apiTestCreateFolder" + SUFFIX, null);
12821282
assertNotNull(result);
12831283

12841284
String folderName = (String) result.get("path");
1285-
Map response = api.renameFolder(folderName, "newFolderName", ObjectUtils.emptyMap());
1285+
Map response = api.renameFolder(folderName, "newFolderName" + SUFFIX, ObjectUtils.emptyMap());
12861286
assertNotNull(response);
12871287
}
12881288

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy