use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class PropertyEditorPresenter method editProperty.
private void editProperty(Project project) {
final String propertyName = view.getSelectedProperty();
final Depth depth = view.getDepth();
final String propertyValue = view.getPropertyValue();
final boolean force = view.isForceSelected();
final Resource[] resources = appContext.getResources();
checkState(!Arrays.isNullOrEmpty(resources));
checkState(resources.length == 1);
final StatusNotification notification = new StatusNotification(constants.propertyModifyStart(), PROGRESS, FLOAT_MODE);
notificationManager.notify(notification);
service.propertySet(project.getLocation(), propertyName, propertyValue, depth, force, toRelative(project, resources[0])).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
printResponse(response.getCommand(), response.getOutput(), response.getErrOutput(), constants.commandProperty());
notification.setTitle(constants.propertyModifyFinished());
notification.setStatus(SUCCESS);
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
notification.setTitle(constants.propertyModifyFailed());
notification.setStatus(FAIL);
}
});
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class SubversionApiITest method testPropDel.
/**
* Tests for {@link SubversionApi#propdel(org.eclipse.che.plugin.svn.shared.PropertyDeleteRequest)}.
*
* @throws Exception
* if anything goes wrong
*/
@Test
public void testPropDel() throws Exception {
this.subversionApi.checkout(DtoFactory.getInstance().createDto(CheckoutRequest.class).withProjectPath(tmpAbsolutePath).withUrl(repoUrl));
CLIOutputResponse response = this.subversionApi.propdel(DtoFactory.getInstance().createDto(PropertyDeleteRequest.class).withProjectPath(tmpAbsolutePath).withPath("trunk/A/B").withForce(true).withDepth(Depth.DIRS_ONLY).withName("owner"));
assertEquals(response.getOutput().size(), 1);
assertEquals(response.getOutput().get(0), "property 'owner' deleted from 'trunk" + File.separator + "A" + File.separator + "B'.");
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class SubversionApiITest method testCopy.
/**
* Tests for {@link SubversionApi#copy(CopyRequest)}.
*
* @throws Exception
* if anything goes wrong
*/
@Test
public void testCopy() throws Exception {
this.subversionApi.checkout(DtoFactory.getInstance().createDto(CheckoutRequest.class).withProjectPath(tmpAbsolutePath).withUrl(repoUrl));
CLIOutputResponse response = this.subversionApi.copy(DtoFactory.getInstance().createDto(CopyRequest.class).withProjectPath(tmpAbsolutePath).withSource("trunk/A/B/lambda").withDestination("trunk/A/B/E/lambda"));
assertEquals(response.getOutput().size(), 1);
assertTrue(response.getErrOutput().isEmpty());
String expectedPath = "trunk" + File.separator + "A" + File.separator + "B" + File.separator + "E" + File.separator + "lambda";
assertEquals(response.getOutput().get(0), "A " + expectedPath);
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class SubversionApiITest method testMove.
/**
* Tests for {@link SubversionApi#move(MoveRequest)}.
*
* @throws Exception
* if anything goes wrong
*/
@Test
public void testMove() throws Exception {
this.subversionApi.checkout(DtoFactory.getInstance().createDto(CheckoutRequest.class).withProjectPath(tmpAbsolutePath).withUrl(repoUrl));
CLIOutputResponse response = this.subversionApi.move(DtoFactory.getInstance().createDto(MoveRequest.class).withProjectPath(tmpAbsolutePath).withSource(Collections.singletonList("trunk/A/B/lambda")).withDestination("trunk/A/B/E/lambda"));
assertEquals(response.getOutput().size(), 2);
assertTrue(response.getErrOutput().isEmpty());
String expectedPath1 = "trunk" + File.separator + "A" + File.separator + "B" + File.separator + "E" + File.separator + "lambda";
assertEquals(response.getOutput().get(0), "A " + expectedPath1);
String expectedPath2 = "trunk" + File.separator + "A" + File.separator + "B" + File.separator + "lambda";
assertEquals(response.getOutput().get(1), "D " + expectedPath2);
}
use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.
the class SubversionApi method remove.
/**
* Perform an "svn remove" based on the request.
*
* @param request
* the request
* @return the response
* @throws IOException
* if there is a problem executing the command
* @throws SubversionException
* if there is a Subversion issue
*/
public CLIOutputResponse remove(final RemoveRequest request) throws IOException, SubversionException, UnauthorizedException {
final File projectPath = new File(request.getProjectPath());
final List<String> cliArgs = defaultArgs();
// Command Name
cliArgs.add("remove");
final CommandLineResult result = runCommand(null, cliArgs, projectPath, request.getPaths());
return DtoFactory.getInstance().createDto(CLIOutputResponse.class).withCommand(result.getCommandLine().toString()).withOutput(result.getStdout()).withErrOutput(result.getStderr());
}
Aggregations