use of org.eclipse.che.api.git.shared.CloneRequest in project che by eclipse.
the class GitServiceClientImpl method cloneRepository.
@Override
public void cloneRepository(DevMachine devMachine, ProjectConfigDto project, String remoteUri, String remoteName, RequestCallback<RepoInfo> callback) throws WebSocketException {
CloneRequest cloneRequest = dtoFactory.createDto(CloneRequest.class).withRemoteName(remoteName).withRemoteUri(remoteUri).withWorkingDir(project.getPath());
String params = "?projectPath=" + project.getPath();
String url = CLONE + params;
MessageBuilder builder = new MessageBuilder(POST, url);
builder.data(dtoFactory.toJson(cloneRequest)).header(CONTENTTYPE, APPLICATION_JSON).header(ACCEPT, APPLICATION_JSON);
Message message = builder.build();
sendMessageToWS(message, callback);
}
Aggregations