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);
}
Aggregations