Search in sources :

Example 41 with CLIOutputResponse

use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.

the class SubversionClientServiceImpl method copy.

@Override
public Promise<CLIOutputResponse> copy(Path project, Path source, Path destination, String comment, Credentials credentials) {
    final CopyRequest request = dtoFactory.createDto(CopyRequest.class).withProjectPath(project.toString()).withSource(source.toString()).withDestination(destination.toString()).withComment(comment);
    if (credentials != null) {
        request.setUsername(credentials.getUsername());
        request.setPassword(credentials.getPassword());
    }
    return asyncRequestFactory.createPostRequest(getBaseUrl() + "/copy", request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
Also used : CopyRequest(org.eclipse.che.plugin.svn.shared.CopyRequest) CLIOutputResponse(org.eclipse.che.plugin.svn.shared.CLIOutputResponse)

Example 42 with CLIOutputResponse

use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.

the class SubversionClientServiceImpl method unlock.

@Override
public Promise<CLIOutputResponse> unlock(Path project, Path[] paths, boolean force, Credentials credentials) {
    final String url = getBaseUrl() + "/unlock";
    final LockRequest request = dtoFactory.createDto(LockRequest.class).withProjectPath(project.toString()).withTargets(toList(paths)).withForce(force);
    if (credentials != null) {
        request.setUsername(credentials.getUsername());
        request.setPassword(credentials.getPassword());
    }
    return asyncRequestFactory.createPostRequest(url, request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
Also used : CLIOutputResponse(org.eclipse.che.plugin.svn.shared.CLIOutputResponse) LockRequest(org.eclipse.che.plugin.svn.shared.LockRequest)

Example 43 with CLIOutputResponse

use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.

the class SubversionClientServiceImpl method showDiff.

@Override
public Promise<CLIOutputResponse> showDiff(Path project, Path[] paths, String revision, Credentials credentials) {
    final String url = getBaseUrl() + "/showdiff";
    final ShowDiffRequest request = dtoFactory.createDto(ShowDiffRequest.class).withProjectPath(project.toString()).withPaths(toList(paths)).withRevision(revision);
    if (credentials != null) {
        request.setUsername(credentials.getUsername());
        request.setPassword(credentials.getPassword());
    }
    return asyncRequestFactory.createPostRequest(url, request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
Also used : CLIOutputResponse(org.eclipse.che.plugin.svn.shared.CLIOutputResponse) ShowDiffRequest(org.eclipse.che.plugin.svn.shared.ShowDiffRequest)

Example 44 with CLIOutputResponse

use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.

the class SubversionClientServiceImpl method lock.

@Override
public Promise<CLIOutputResponse> lock(Path project, Path[] paths, boolean force, Credentials credentials) {
    final String url = getBaseUrl() + "/lock";
    final LockRequest request = dtoFactory.createDto(LockRequest.class).withProjectPath(project.toString()).withTargets(toList(paths)).withForce(force);
    if (credentials != null) {
        request.setUsername(credentials.getUsername());
        request.setPassword(credentials.getPassword());
    }
    return asyncRequestFactory.createPostRequest(url, request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
Also used : CLIOutputResponse(org.eclipse.che.plugin.svn.shared.CLIOutputResponse) LockRequest(org.eclipse.che.plugin.svn.shared.LockRequest)

Example 45 with CLIOutputResponse

use of org.eclipse.che.plugin.svn.shared.CLIOutputResponse in project che by eclipse.

the class SubversionClientServiceImpl method move.

@Override
public Promise<CLIOutputResponse> move(Path project, Path source, Path destination, String comment, Credentials credentials) {
    final MoveRequest request = dtoFactory.createDto(MoveRequest.class).withProjectPath(project.toString()).withSource(Collections.singletonList(source.toString())).withDestination(destination.toString()).withComment(comment);
    if (credentials != null) {
        request.setUsername(credentials.getUsername());
        request.setPassword(credentials.getPassword());
    }
    return asyncRequestFactory.createPostRequest(getBaseUrl() + "/move", request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
Also used : MoveRequest(org.eclipse.che.plugin.svn.shared.MoveRequest) CLIOutputResponse(org.eclipse.che.plugin.svn.shared.CLIOutputResponse)

Aggregations

CLIOutputResponse (org.eclipse.che.plugin.svn.shared.CLIOutputResponse)49 Operation (org.eclipse.che.api.promises.client.Operation)21 OperationException (org.eclipse.che.api.promises.client.OperationException)21 PromiseError (org.eclipse.che.api.promises.client.PromiseError)21 Project (org.eclipse.che.ide.api.resources.Project)18 File (java.io.File)14 Resource (org.eclipse.che.ide.api.resources.Resource)14 CommandLineResult (org.eclipse.che.plugin.svn.server.upstream.CommandLineResult)14 StatusNotification (org.eclipse.che.ide.api.notification.StatusNotification)7 Promise (org.eclipse.che.api.promises.client.Promise)6 Credentials (org.eclipse.che.ide.api.subversion.Credentials)6 ArrayList (java.util.ArrayList)5 CheckoutRequest (org.eclipse.che.plugin.svn.shared.CheckoutRequest)5 Test (org.junit.Test)4 Path (org.eclipse.che.ide.resource.Path)3 ListRequest (org.eclipse.che.plugin.svn.shared.ListRequest)3 PropertyListRequest (org.eclipse.che.plugin.svn.shared.PropertyListRequest)3 CLIOutputResponseList (org.eclipse.che.plugin.svn.shared.CLIOutputResponseList)2 Depth (org.eclipse.che.plugin.svn.shared.Depth)2 LockRequest (org.eclipse.che.plugin.svn.shared.LockRequest)2