Search in sources :

Example 1 with FetchRequest

use of org.eclipse.che.api.git.shared.FetchRequest in project che by eclipse.

the class GitServiceClientImpl method fetch.

@Override
public Promise<Void> fetch(DevMachine devMachine, Path project, String remote, List<String> refspec, boolean removeDeletedRefs) {
    FetchRequest fetchRequest = dtoFactory.createDto(FetchRequest.class).withRefSpec(refspec).withRemote(remote).withRemoveDeletedRefs(removeDeletedRefs);
    String url = devMachine.getWsAgentBaseUrl() + FETCH + "?projectPath=" + project;
    return asyncRequestFactory.createPostRequest(url, fetchRequest).send();
}
Also used : FetchRequest(org.eclipse.che.api.git.shared.FetchRequest)

Example 2 with FetchRequest

use of org.eclipse.che.api.git.shared.FetchRequest in project che by eclipse.

the class GitServiceClientImpl method fetch.

@Override
public void fetch(DevMachine devMachine, ProjectConfigDto project, String remote, List<String> refspec, boolean removeDeletedRefs, RequestCallback<String> callback) throws WebSocketException {
    FetchRequest fetchRequest = dtoFactory.createDto(FetchRequest.class).withRefSpec(refspec).withRemote(remote).withRemoveDeletedRefs(removeDeletedRefs);
    String url = FETCH + "?projectPath=" + project.getPath();
    MessageBuilder builder = new MessageBuilder(POST, url);
    builder.data(dtoFactory.toJson(fetchRequest)).header(CONTENTTYPE, 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) FetchRequest(org.eclipse.che.api.git.shared.FetchRequest)

Aggregations

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