本文整理汇总了Java中jetbrains.buildServer.util.StringUtil.isNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.isNotEmpty方法的具体用法?Java StringUtil.isNotEmpty怎么用?Java StringUtil.isNotEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jetbrains.buildServer.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.isNotEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getContent
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
@NotNull
@Override
public InputStream getContent(@NotNull StoredBuildArtifactInfo storedBuildArtifactInfo) throws IOException {
final Map<String, String> params;
try {
params = S3Util.validateParameters(storedBuildArtifactInfo.getStorageSettings());
} catch (IllegalArgumentException e) {
throw new IOException("Failed to get artifact " + storedBuildArtifactInfo.getArtifactData() + " content from S3: " + e.getMessage(), e);
}
final String bucketName = S3Util.getBucketName(params);
final String key = S3Util.getPathPrefix(storedBuildArtifactInfo.getCommonProperties()) + storedBuildArtifactInfo.getArtifactData().getPath();
try {
return S3Util.withS3Client(params, client -> client.getObject(bucketName, key).getObjectContent());
} catch (Throwable t) {
final AWSException awsException = new AWSException(t);
final String details = awsException.getDetails();
if (StringUtil.isNotEmpty(details)) {
LOG.warn(details);
}
throw new IOException("Failed to get artifact " + storedBuildArtifactInfo.getArtifactData() + " content from S3 bucket " + bucketName + ": " + awsException.getMessage(), awsException);
}
}
开发者ID:JetBrains,项目名称:teamcity-s3-artifact-storage-plugin,代码行数:27,代码来源:S3ArtifactContentProvider.java
示例2: checkConnectivity
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private void checkConnectivity(Map<String, String> properties, ArrayList<InvalidProperty> invalidProps, String url, String apiKey, UUID correlationId) {
try {
final Integer connectionTimeoutInMilliseconds = buildTriggerProperties.getConnectionTimeoutInMilliseconds();
final OctopusConnectivityChecker connectivityChecker = octopusConnectivityCheckerFactory.create(url, apiKey, connectionTimeoutInMilliseconds, metricRegistry);
final String err = connectivityChecker.checkOctopusConnectivity(correlationId);
if (StringUtil.isNotEmpty(err)) {
invalidProps.add(new InvalidProperty(BuildTriggerConstants.OCTOPUS_URL, err));
}
final String project = properties.get(BuildTriggerConstants.OCTOPUS_PROJECT_ID);
if (StringUtil.isEmptyOrSpaces(project)) {
invalidProps.add(new InvalidProperty(BuildTriggerConstants.OCTOPUS_PROJECT_ID, "Project must be specified"));
}
} catch (Exception e) {
invalidProps.add(new InvalidProperty(BuildTriggerConstants.OCTOPUS_URL, e.getMessage()));
}
}
开发者ID:matt-richardson,项目名称:teamcity-octopus-build-trigger-plugin,代码行数:19,代码来源:ReleaseCreatedTriggerPropertiesProcessor.java
示例3: processThrowable
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
@NotNull
private BuildTriggerException processThrowable(@NotNull Throwable e) {
if (e instanceof BuildTriggerException) return (BuildTriggerException) e;
final AWSException awse = new AWSException(e);
final String details = awse.getDetails();
if (StringUtil.isNotEmpty(details)) LOG.error(details);
LOG.error(awse.getMessage(), awse);
return new BuildTriggerException(
e instanceof AWSCodePipelineException ?
((AWSCodePipelineException) e).getErrorMessage() : e.getMessage(), awse);
}
开发者ID:JetBrains,项目名称:teamcity-aws-codepipeline-plugin,代码行数:14,代码来源:CodePipelineAsyncPolledBuildTrigger.java
示例4: initSessionKeyFile
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private Session initSessionKeyFile(String username, String password, File keyFile, JSch jsch) throws JSchException {
try {
if (StringUtil.isNotEmpty(password)) {
myLog.debug("Adding password");
jsch.addIdentity(keyFile.getCanonicalPath(), password);
} else {
jsch.addIdentity(keyFile.getCanonicalPath());
}
final Session session = jsch.getSession(username, myHost, myPort);
session.setConfig("PreferredAuthentications", "publickey");
return session;
} catch (IOException e) {
throw new JSchException("Failed to use key file", e);
}
}
示例5: checkConnectivity
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private void checkConnectivity(ArrayList<InvalidProperty> invalidProps, String url, String apiKey, UUID correlationId) {
try {
final Integer connectionTimeoutInMilliseconds = buildTriggerProperties.getConnectionTimeoutInMilliseconds();
final OctopusConnectivityChecker connectivityChecker = octopusConnectivityCheckerFactory.create(url, apiKey, connectionTimeoutInMilliseconds, metricRegistry);
final String err = connectivityChecker.checkOctopusConnectivity(correlationId);
if (StringUtil.isNotEmpty(err)) {
invalidProps.add(new InvalidProperty(BuildTriggerConstants.OCTOPUS_URL, err));
}
} catch (Exception e) {
invalidProps.add(new InvalidProperty(BuildTriggerConstants.OCTOPUS_URL, e.getMessage()));
}
}
开发者ID:matt-richardson,项目名称:teamcity-octopus-build-trigger-plugin,代码行数:14,代码来源:MachineAddedTriggerPropertiesProcessor.java
示例6: getToolPath
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
@Nullable
private static String getToolPath(@NotNull final BuildAgentConfiguration configuration) {
final String rpctoolPath = TeamCityProperties.getProperty(RPC_TOOL_PARAMETER);
if (StringUtil.isNotEmpty(rpctoolPath)){
return rpctoolPath;
}
if (SystemInfo.isUnix) { // Linux, MacOSX, FreeBSD
final Map<String, String> envs = configuration.getBuildParameters().getEnvironmentVariables();
final String path = envs.get("PATH");
if (path != null) for (String p : StringUtil.splitHonorQuotes(path, File.pathSeparatorChar)) {
final File file = new File(p, VMWARE_RPCTOOL_NAME);
if (file.exists()) {
return file.getAbsolutePath();
}
}
}
if (SystemInfo.isLinux) {
return getExistingCommandPath(LINUX_COMMANDS);
} else if (SystemInfo.isWindows) {
return getExistingCommandPath(WINDOWS_COMMANDS);
} else if (SystemInfo.isMac) {
return getExistingCommandPath(MAC_COMMANDS);
} else {
return getExistingCommandPath(LINUX_COMMANDS); //todo: update for other OS'es
}
}
示例7: hasMsTeamsUsername
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public boolean hasMsTeamsUsername(){
return msteamsUserName != null && StringUtil.isNotEmpty(msteamsUserName);
}
示例8: userHasMsTeamsNameConfigured
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private boolean userHasMsTeamsNameConfigured(SUser sUser){
String userName = sUser.getPropertyValue(USERNAME_KEY);
return userName != null && StringUtil.isNotEmpty(userName);
}
示例9: getSessionString
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public String getSessionString() {
return (StringUtil.isNotEmpty(myRemotePath) ? "[" + myRemotePath + "] on " : "") + "host [" + myHost + ":" + myPort + "]";
}
示例10: userHasYammerUserNameConfigured
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private boolean userHasYammerUserNameConfigured(SUser user) {
String username = user.getPropertyValue(yammerUsername);
return username != null && StringUtil.isNotEmpty(username);
}
示例11: updateActualSourceState
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public void updateActualSourceState(@NotNull final VmwareSourceState state){
if (StringUtil.isNotEmpty(state.getSnapshotName()) && !state.equals(myActualSourceState.get())){
myActualSourceState.set(state);
LOG.info("Updated actual vm source state name for " + myImageDetails.getSourceId() + " to " + state);
}
}
示例12: userHasSlackNameConfigured
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private boolean userHasSlackNameConfigured(SUser sUser){
String userName = sUser.getPropertyValue(USERNAME_KEY);
return userName != null && StringUtil.isNotEmpty(userName);
}
示例13: hasSlackUsername
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public boolean hasSlackUsername(){
return slackUserName != null && StringUtil.isNotEmpty(slackUserName);
}
示例14: isWellFormed
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public boolean isWellFormed() {
return StringUtil.isNotEmpty(myAccount) && StringUtil.isNotEmpty(myTeamRoomName) && StringUtil.isNotEmpty(myUsername) && StringUtil.isNotEmpty(myPassword);
}
示例15: getAnnounceUrl
import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
@Nullable
public String getAnnounceUrl() {
String announceUrlLocal = myBuildAgentConfiguration.getConfigurationParameters().get(ANNOUNCE_URL_KEY);
if (StringUtil.isNotEmpty(announceUrlLocal)) return announceUrlLocal;
String serverUrlLocal = myBuildAgentConfiguration.getServerUrl();
if (serverUrlLocal == null) return null;
serverUrlLocal = StringUtil.removeTailingSlash(serverUrlLocal);
return call("getAnnounceUrl", serverUrlLocal + "/trackerAnnounce.html");
}