use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class DiffPresenter method showDiff.
public void showDiff() {
final Project project = appContext.getRootProject();
checkState(project != null);
final Resource[] resources = appContext.getResources();
checkState(!Arrays.isNullOrEmpty(resources));
performOperationWithCredentialsRequestIfNeeded(new RemoteSubversionOperation<CLIOutputResponse>() {
@Override
public Promise<CLIOutputResponse> perform(Credentials credentials) {
return service.showDiff(project.getLocation(), toRelative(project, resources), "HEAD", credentials);
}
}, null).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
printResponse(response.getCommand(), response.getOutput(), response.getErrOutput(), constants.commandDiff());
;
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
notificationManager.notify(error.getMessage(), FAIL, FLOAT_MODE);
}
});
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class LockUnlockPresenter method doUnlockAction.
private void doUnlockAction(final boolean force, final Path[] paths) {
final Project project = appContext.getRootProject();
checkState(project != null);
performOperationWithCredentialsRequestIfNeeded(new RemoteSubversionOperation<CLIOutputResponse>() {
@Override
public Promise<CLIOutputResponse> perform(Credentials credentials) {
return service.unlock(project.getLocation(), paths, force, credentials);
}
}, null).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
printResponse(response.getCommand(), response.getOutput(), response.getErrOutput(), constants.commandUnlock());
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
notificationManager.notify(error.getMessage(), FAIL, FLOAT_MODE);
}
});
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class SubversionClientServiceImpl method showLog.
@Override
public Promise<CLIOutputResponse> showLog(Path project, Path[] paths, String revision) {
final String url = getBaseUrl() + "/showlog";
final ShowLogRequest request = dtoFactory.createDto(ShowLogRequest.class).withProjectPath(project.toString()).withPaths(toList(paths)).withRevision(revision);
return asyncRequestFactory.createPostRequest(url, request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class SubversionClientServiceImpl method cleanup.
@Override
public Promise<CLIOutputResponse> cleanup(Path project, Path[] paths) {
final String url = getBaseUrl() + "/cleanup";
final CleanupRequest request = dtoFactory.createDto(CleanupRequest.class).withPaths(toList(paths)).withProjectPath(project.toString());
return asyncRequestFactory.createPostRequest(url, request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class SubversionClientServiceImpl method listBranches.
@Override
public Promise<CLIOutputResponse> listBranches(Path project, @Nullable Credentials credentials) {
ListRequest request = dtoFactory.createDto(ListRequest.class).withProjectPath(project.toString());
if (credentials != null) {
request.setUsername(credentials.getUsername());
request.setPassword(credentials.getPassword());
}
return asyncRequestFactory.createPostRequest(getBaseUrl() + "/branches", request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
Aggregations