Search in sources :

Example 1 with AddRequest

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

the class GitServiceClientImpl method add.

@Override
public void add(DevMachine devMachine, ProjectConfig project, boolean update, @Nullable List<String> filePattern, RequestCallback<Void> callback) throws WebSocketException {
    AddRequest addRequest = dtoFactory.createDto(AddRequest.class).withUpdate(update);
    if (filePattern == null) {
        addRequest.setFilePattern(AddRequest.DEFAULT_PATTERN);
    } else {
        addRequest.setFilePattern(filePattern);
    }
    String url = ADD + "?projectPath=" + project.getPath();
    MessageBuilder builder = new MessageBuilder(POST, url);
    builder.data(dtoFactory.toJson(addRequest)).header(CONTENTTYPE, APPLICATION_JSON);
    Message message = builder.build();
    sendMessageToWS(message, callback);
}
Also used : AddRequest(org.eclipse.che.api.git.shared.AddRequest) RemoteAddRequest(org.eclipse.che.api.git.shared.RemoteAddRequest) MessageBuilder(org.eclipse.che.ide.websocket.MessageBuilder) Message(org.eclipse.che.ide.websocket.Message)

Aggregations

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