use of org.eclipse.che.plugin.svn.shared.ListRequest 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));
}
use of org.eclipse.che.plugin.svn.shared.ListRequest in project che by eclipse.
the class SubversionApi method listTags.
/**
* Returns list of the tags of the project.
*
* @param request
* the request
*
* @see #list(ListRequest)
* @see #info(InfoRequest)
*/
public ListResponse listTags(final ListRequest request) throws ApiException {
InfoResponse info = info(newDto(InfoRequest.class).withProjectPath(request.getProjectPath()).withTarget(".").withPassword(request.getPassword()).withUsername(request.getUsername()));
final List<String> args = defaultArgs();
args.add("list");
String repositoryRoot = getRepositoryRoot(info.getOutput());
String projectRelativeUrl = getRelativeUrl(info.getOutput());
String projectUri = recognizeProjectUri(repositoryRoot, projectRelativeUrl);
String branchesPath = projectUri == null ? "^/tags" : (projectUri + "/tags");
final CommandLineResult result = runCommand(null, args, new File(request.getProjectPath()), singletonList(branchesPath), request.getUsername(), request.getPassword());
return newDto(ListResponse.class).withCommand(result.getCommandLine().toString()).withOutput(result.getStdout().stream().filter(s -> s.endsWith("/")).map(s -> s.substring(0, s.length() - 1)).collect(Collectors.toList())).withErrorOutput(result.getStderr());
}
use of org.eclipse.che.plugin.svn.shared.ListRequest in project che by eclipse.
the class SubversionApi method listBranches.
/**
* Returns list of the branches of the project.
*
* @param request
* the request
*
* @see #list(ListRequest)
* @see #info(InfoRequest)
*/
public ListResponse listBranches(final ListRequest request) throws ApiException {
InfoResponse info = info(newDto(InfoRequest.class).withProjectPath(request.getProjectPath()).withTarget(".").withPassword(request.getPassword()).withUsername(request.getUsername()));
final List<String> args = defaultArgs();
args.add("list");
String repositoryRoot = getRepositoryRoot(info.getOutput());
String projectRelativeUrl = getRelativeUrl(info.getOutput());
String projectUri = recognizeProjectUri(repositoryRoot, projectRelativeUrl);
String path = projectUri == null ? "^/branches" : (projectUri + "/branches");
final CommandLineResult result = runCommand(null, args, new File(request.getProjectPath()), singletonList(path), request.getUsername(), request.getPassword());
return newDto(ListResponse.class).withCommand(result.getCommandLine().toString()).withOutput(result.getStdout().stream().filter(s -> s.endsWith("/")).map(s -> s.substring(0, s.length() - 1)).collect(Collectors.toList())).withErrorOutput(result.getStderr());
}
use of org.eclipse.che.plugin.svn.shared.ListRequest in project che by eclipse.
the class SubversionClientServiceImpl method listTags.
@Override
public Promise<CLIOutputResponse> listTags(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() + "/tags", request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
use of org.eclipse.che.plugin.svn.shared.ListRequest in project che by eclipse.
the class SubversionClientServiceImpl method list.
@Override
public Promise<CLIOutputResponse> list(Path project, String target, @Nullable Credentials credentials) {
ListRequest request = dtoFactory.createDto(ListRequest.class).withProjectPath(project.toString()).withTargetPath(target);
if (credentials != null) {
request.setUsername(credentials.getUsername());
request.setPassword(credentials.getPassword());
}
return asyncRequestFactory.createPostRequest(getBaseUrl() + "/list", request).loader(loader).send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class));
}
Aggregations