@Override public Promise<Revision> commit(Path project, String message, boolean amend, Path[] files) { CommitRequest commitRequest = dtoFactory .createDto(CommitRequest.class) .withMessage(message) .withAmend(amend) .withFiles( stream(files) .filter(file -> !file.isEmpty()) .map(Path::toString) .collect(toList())); String url = getWsAgentBaseUrl() + COMMIT + "?projectPath=" + encodePath(project); return asyncRequestFactory .createPostRequest(url, commitRequest) .loader(loader) .send(dtoUnmarshallerFactory.newUnmarshaller(Revision.class)); }