use of org.eclipse.che.ide.websocket.Message in project che by eclipse.
the class GitServiceClientImpl method init.
@Override
public void init(DevMachine devMachine, ProjectConfigDto project, boolean bare, final RequestCallback<Void> callback) throws WebSocketException {
String url = INIT + "?projectPath=" + project.getPath() + "&bare=" + bare;
Message message = new MessageBuilder(POST, url).header(ACCEPT, TEXT_PLAIN).build();
sendMessageToWS(message, callback);
}
use of org.eclipse.che.ide.websocket.Message in project che by eclipse.
the class NavigateToFilePresenter method onFileNameChanged.
@Override
public void onFileNameChanged(String fileName) {
if (fileName.isEmpty()) {
view.showItems(new ArrayList<ItemReference>());
return;
}
// add '*' to allow search files by first letters
final String url = SEARCH_URL + "/?name=" + URL.encodePathSegment(fileName + "*");
final Message message = new MessageBuilder(GET, url).header(ACCEPT, APPLICATION_JSON).build();
final Unmarshallable<List<ItemReference>> unmarshaller = dtoUnmarshallerFactory.newWSListUnmarshaller(ItemReference.class);
try {
wsMessageBus.send(message, new RequestCallback<List<ItemReference>>(unmarshaller) {
@Override
protected void onSuccess(List<ItemReference> result) {
view.showItems(result);
}
@Override
protected void onFailure(Throwable exception) {
Log.error(getClass(), exception);
}
});
} catch (WebSocketException e) {
Log.error(getClass(), e);
}
}
Aggregations