/** * Moves the {@code source} item to given {@code target} with {@code newName}. * * @param source the source path to be moved * @param target the target path, should be a container (project or folder) * @param newName the new name of the moved item * @param overwrite overwrite target is such has already exists * @return {@link Promise} with empty response * @see Path * @since 4.4.0 */ public Promise<Void> move(Path source, Path target, String newName, boolean overwrite) { final String url = getBaseUrl() + MOVE + encodePath(source) + "?to=" + encodePath(target); final MoveOptions moveOptions = dtoFactory.createDto(MoveOptions.class); moveOptions.setName(newName); moveOptions.setOverWrite(overwrite); return reqFactory .createPostRequest(url, moveOptions) .loader(loaderFactory.newLoader("Moving...")) .send(); }