private RemoteOperationResult createParentFolder(String parentPath, OwnCloudClient client) { RemoteOperation operation = new CreateFolderRemoteOperation(parentPath, mCreateFullPath); return operation.execute(client); }
@Test public void testCreateFolderFailure() { String path = "/testFolder/"; // create folder assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); // create folder a second time will fail assertFalse(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); // remove folder assertTrue(new RemoveFileRemoteOperation(path).execute(client).isSuccess()); }
@Test public void testCreateNonExistingSubFolder() { String path = "/testFolder/1/2/3/4/5/"; String top = "/testFolder/"; assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); // verify folder assertTrue(new ReadFolderRemoteOperation(path).execute(client).isSuccess()); // remove folder assertTrue(new RemoveFileRemoteOperation(top).execute(client).isSuccess()); } }
@Test public void testCreateFolderSuccess() { String path = "/testFolder/"; // create folder assertTrue(new CreateFolderRemoteOperation(path, true).execute(client).isSuccess()); // verify folder assertTrue(new ReadFolderRemoteOperation(path).execute(client).isSuccess()); // remove folder assertTrue(new RemoveFileRemoteOperation(path).execute(client).isSuccess()); }