use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.
the class CommandParametersResolutionModule method resolveWorkingDirectory.
@NotNull
private File resolveWorkingDirectory(@NotNull Command command) {
SvnTarget target = command.getTarget();
File workingDirectory = target.isFile() ? target.getFile() : null;
// TODO: Do we really need search existing parent - or just take parent directory if target is file???
workingDirectory = CommandUtil.findExistingParent(workingDirectory);
return workingDirectory != null ? workingDirectory : getDefaultWorkingDirectory(myVcs.getProject());
}
use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.
the class ProxyModule method ensureGroupForHost.
@NotNull
private String ensureGroupForHost(@NotNull Command command, @NotNull String host) {
IdeaSVNConfigFile configFile = new IdeaSVNConfigFile(myAuthenticationService.getSpecialConfigDir());
String groupName = SvnAuthenticationManager.getGroupForHost(host, configFile);
if (StringUtil.isEmptyOrSpaces(groupName)) {
groupName = IdeaSVNConfigFile.getNewGroupName(host, configFile);
command.put("--config-option");
command.put(String.format("servers:groups:%s=%s*", groupName, host));
}
return groupName;
}
use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.
the class DefaultBranchConfigInitializer method getDefaultConfiguration.
@NotNull
private static SvnBranchConfigurationNew getDefaultConfiguration(@NotNull SvnVcs vcs, @NotNull SVNURL url) throws SVNException, VcsException {
SvnBranchConfigurationNew result = new SvnBranchConfigurationNew();
result.setTrunkUrl(url.toString());
SVNURL branchLocationsParent = getBranchLocationsParent(url);
if (branchLocationsParent != null) {
SvnTarget target = SvnTarget.fromURL(branchLocationsParent);
vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, createHandler(result, target.getURL()));
}
return result;
}
use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.
the class SshTunnelRuntimeModule method buildTunnelCommandLine.
@NotNull
private GeneralCommandLine buildTunnelCommandLine(@NotNull String sshPath) {
GeneralCommandLine result = new GeneralCommandLine(sshPath);
boolean isPuttyLinkClient = StringUtil.endsWithIgnoreCase(FileUtil.getNameWithoutExtension(sshPath), "plink");
SvnConfigurationState state = getState();
// quiet mode
if (!isPuttyLinkClient) {
result.addParameter("-q");
}
result.addParameters(isPuttyLinkClient ? "-P" : "-p", String.valueOf(state.sshPort));
if (!StringUtil.isEmpty(state.sshUserName)) {
result.addParameters("-l", state.sshUserName);
}
if (SvnConfiguration.SshConnectionType.PRIVATE_KEY.equals(state.sshConnectionType) && !StringUtil.isEmpty(state.sshPrivateKeyPath)) {
result.addParameters("-i", FileUtil.toSystemIndependentName(state.sshPrivateKeyPath));
}
return result;
}
use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.
the class TestNGConsoleProperties method initScope.
@NotNull
@Override
protected GlobalSearchScope initScope() {
final TestNGConfiguration configuration = getConfiguration();
final String testObject = configuration.getPersistantData().TEST_OBJECT;
if (TestType.CLASS.getType().equals(testObject) || TestType.METHOD.getType().equals(testObject)) {
return super.initScope();
} else {
final SourceScope sourceScope = configuration.getPersistantData().getScope().getSourceScope(configuration);
return sourceScope != null ? sourceScope.getGlobalSearchScope() : GlobalSearchScope.allScope(getProject());
}
}
Aggregations