当前位置: 首页>>代码示例>>Java>>正文


Java StringUtil.isNotEmpty方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:16,代码来源:SSHSessionProvider.java

示例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
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-vmware-plugin,代码行数:28,代码来源:VMWarePropertiesReader.java

示例7: hasMsTeamsUsername

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public boolean hasMsTeamsUsername(){
    return msteamsUserName != null && StringUtil.isNotEmpty(msteamsUserName);
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:4,代码来源:Commit.java

示例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);
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:6,代码来源:MsTeamsNotificator.java

示例9: getSessionString

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public String getSessionString() {
  return (StringUtil.isNotEmpty(myRemotePath) ? "[" + myRemotePath + "] on " : "") + "host [" + myHost + ":" + myPort + "]";
}
 
开发者ID:JetBrains,项目名称:teamcity-deployer-plugin,代码行数:4,代码来源:SSHSessionProvider.java

示例10: userHasYammerUserNameConfigured

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
private boolean userHasYammerUserNameConfigured(SUser user) {
    String username = user.getPropertyValue(yammerUsername);
    return username != null && StringUtil.isNotEmpty(username);
}
 
开发者ID:iguissouma,项目名称:teamcity-yammer-notifier,代码行数:5,代码来源:YammerNotificator.java

示例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);
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-vmware-plugin,代码行数:7,代码来源:VmwareCloudImage.java

示例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);
}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:6,代码来源:SlackNotificator.java

示例13: hasSlackUsername

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public boolean hasSlackUsername(){
    return slackUserName != null && StringUtil.isNotEmpty(slackUserName);
}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:4,代码来源:Commit.java

示例14: isWellFormed

import jetbrains.buildServer.util.StringUtil; //导入方法依赖的package包/类
public boolean isWellFormed() {
  return StringUtil.isNotEmpty(myAccount) && StringUtil.isNotEmpty(myTeamRoomName) && StringUtil.isNotEmpty(myUsername) && StringUtil.isNotEmpty(myPassword);
}
 
开发者ID:JetBrains,项目名称:tc-vso-rooms,代码行数:4,代码来源:VSONotificationUserSettingsBean.java

示例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");
}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:14,代码来源:AgentConfiguration.java


注:本文中的jetbrains.buildServer.util.StringUtil.isNotEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。