Search in sources :

Example 1 with CloneRequest

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);
}
Also used : MessageBuilder(org.eclipse.che.ide.websocket.MessageBuilder) Message(org.eclipse.che.ide.websocket.Message) CloneRequest(org.eclipse.che.api.git.shared.CloneRequest)

Aggregations

CloneRequest (org.eclipse.che.api.git.shared.CloneRequest)1 Message (org.eclipse.che.ide.websocket.Message)1 MessageBuilder (org.eclipse.che.ide.websocket.MessageBuilder)1