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


Java StringUtils.isNotEmpty方法代码示例

本文整理汇总了Java中org.codehaus.plexus.util.StringUtils.isNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.isNotEmpty方法的具体用法?Java StringUtils.isNotEmpty怎么用?Java StringUtils.isNotEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.plexus.util.StringUtils的用法示例。


在下文中一共展示了StringUtils.isNotEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canTransformResource

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
public boolean canTransformResource( String r )
{
    if ( StringUtils.isNotEmpty( resource ) && r.endsWith( resource ) )
    {
        return true;
    }
    
    if ( resources != null )
    {
        for ( String resourceEnd : resources )
        {
            if ( r.endsWith( resourceEnd ) )
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:javiersigler,项目名称:apache-maven-shade-plugin,代码行数:21,代码来源:DontIncludeResourceTransformer.java

示例2: addBounds

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private static void addBounds( PropertyVersionsBuilder builder, String rawVersionRange, String propertyRef,
                               String evaluatedVersionRange )
{
    Pattern lowerBound = Pattern.compile( "([(\\[])([^,]*)," + RegexUtils.quote( propertyRef ) + "([)\\]])" );
    Pattern upperBound = Pattern.compile( "([(\\[])" + RegexUtils.quote( propertyRef ) + ",([^,]*)([)\\]])" );
    Matcher m = lowerBound.matcher( rawVersionRange );
    if ( m.find() )
    {
        boolean includeLower = "[".equals( m.group( 1 ) );
        String lowerLimit = m.group( 2 );
        if ( StringUtils.isNotEmpty( lowerLimit ) )
        {
            builder.addLowerBound( lowerLimit, includeLower );
        }
    }
    m = upperBound.matcher( rawVersionRange );
    if ( m.find() )
    {
        boolean includeUpper = "[".equals( m.group( 3 ) );
        String upperLimit = m.group( 2 );
        if ( StringUtils.isNotEmpty( upperLimit ) )
        {
            builder.addUpperBound( upperLimit, includeUpper );
        }
    }
}
 
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:27,代码来源:PomHelper.java

示例3: getDependencySets

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
/**
 * 
 * Method creates filters and filters the projects dependencies. This method
 * also transforms the dependencies if classifier is set. The dependencies
 * are filtered in least specific to most specific order
 * 
 * @param stopOnFailure
 * @return DependencyStatusSets - Bean of TreeSets that contains information
 *         on the projects dependencies
 * @throws MojoExecutionException 
 */
protected DependencyStatusSets getDependencySets( boolean stopOnFailure )
    throws MojoExecutionException
{
    // add filters in well known order, least specific to most specific
    FilterArtifacts filter = new FilterArtifacts();

    filter.addFilter( new TransitivityFilter( project.getDependencyArtifacts(), this.excludeTransitive ) );
    filter.addFilter( new ScopeFilter( this.includeScope, this.excludeScope ) );
    filter.addFilter( new TypeFilter( this.includeTypes, this.excludeTypes ) );
    filter.addFilter( new ClassifierFilter( this.includeClassifiers, this.excludeClassifiers ) );
    filter.addFilter( new GroupIdFilter( this.includeGroupIds, this.excludeGroupIds ) );
    filter.addFilter( new ArtifactIdFilter( this.includeArtifactIds, this.excludeArtifactIds ) );

    // start with all artifacts.
    Set artifacts = project.getArtifacts();

    // perform filtering
    try
    {
        artifacts = filter.filter( artifacts );
    }
    catch ( ArtifactFilterException e )
    {
        throw new MojoExecutionException(e.getMessage(),e);
    }

    // transform artifacts if classifier is set
    DependencyStatusSets status = null;
    if ( StringUtils.isNotEmpty( classifier ) )
    {
        status = getClassifierTranslatedDependencies( artifacts, stopOnFailure );
    }
    else
    {
        status = filterMarkedDependencies( artifacts );
    }

    return status;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:51,代码来源:AbstractDependencyFilterMojo.java

示例4: getClassifierTranslatedDependencies

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
/**
 * 
 * Transform artifacts
 * 
 * @param artifacts
 * @param stopOnFailure
 * @return DependencyStatusSets - Bean of TreeSets that contains information
 *         on the projects dependencies
 * @throws MojoExecutionException
 */
protected DependencyStatusSets getClassifierTranslatedDependencies( Set artifacts, boolean stopOnFailure )
    throws MojoExecutionException
{
    Set unResolvedArtifacts = new HashSet();
    Set resolvedArtifacts = artifacts;
    DependencyStatusSets status = new DependencyStatusSets();

    // possibly translate artifacts into a new set of artifacts based on the
    // classifier and type
    // if this did something, we need to resolve the new artifacts
    if ( StringUtils.isNotEmpty( classifier ) )
    {
        ArtifactTranslator translator = new ClassifierTypeTranslator( this.classifier, this.type, this.factory );
        artifacts = translator.translate( artifacts, getLog() );

        status = filterMarkedDependencies( artifacts );

        // the unskipped artifacts are in the resolved set.
        artifacts = status.getResolvedDependencies();

        // resolve the rest of the artifacts
        ArtifactsResolver artifactsResolver = new DefaultArtifactsResolver( this.resolver, this.local,
                                                                            this.remoteRepos, stopOnFailure );
        resolvedArtifacts = artifactsResolver.resolve( artifacts, getLog() );

        // calculate the artifacts not resolved.
        unResolvedArtifacts.addAll( artifacts );
        unResolvedArtifacts.removeAll( resolvedArtifacts );
    }

    // return a bean of all 3 sets.
    status.setResolvedDependencies( resolvedArtifacts );
    status.setUnResolvedDependencies( unResolvedArtifacts );

    return status;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:47,代码来源:AbstractDependencyFilterMojo.java

示例5: getFormattedFileName

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
/**
 * Builds the file name. If removeVersion is set, then the file name must be
 * reconstructed from the artifactId, Classifier (if used) and Type.
 * Otherwise, this method returns the artifact file name.
 * 
 * @param artifact
 *            File to be formatted.
 * @param removeVersion
 *            Specifies if the version should be removed from the file name.
 * @return Formatted file name in the format
 *         artifactId-[version]-[classifier].[type]
 */
public static String getFormattedFileName( Artifact artifact, boolean removeVersion )
{
    String destFileName = null;

    // if there is a file and we aren't stripping the version, just get the
    // name directly
    if ( artifact.getFile() != null && !removeVersion )
    {
        destFileName = artifact.getFile().getName();
    }
    else
    // if offline
    {
        String versionString = null;
        if ( !removeVersion )
        {
            versionString = "-" + artifact.getVersion();
        }
        else
        {
            versionString = "";
        }

        String classifierString = "";

        if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
        {
            classifierString = "-" + artifact.getClassifier();
        }

        destFileName = artifact.getArtifactId() + versionString + classifierString + "."
            + artifact.getArtifactHandler().getExtension();
    }
    return destFileName;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:48,代码来源:DependencyUtil.java

示例6: getDependencyId

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private static String getDependencyId( Artifact artifact, boolean removeVersion )
{
    StringBuffer sb = new StringBuffer();

    sb.append( artifact.getArtifactId() );

    if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
    {
        sb.append( "-" );
        sb.append( artifact.getClassifier() );
    }

    if ( !removeVersion )
    {
        sb.append( "-" );
        sb.append( artifact.getVersion() );
        sb.append( "-" );
        sb.append( artifact.getType() );
    }
    else
    {
        // if the classifier and type are the same (sources), then don't
        // repeat.
        // avoids names like foo-sources-sources
        if ( !StringUtils.equals( artifact.getClassifier(), artifact.getType() ) )
        {
            sb.append( "-" );
            sb.append( artifact.getType() );
        }
    }
    return sb.toString();
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:33,代码来源:DependencyUtil.java

示例7: getMarkerFile

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
protected File getMarkerFile()
  {
File markerFile = null;
if ( this.artifactItem == null 
	|| ( StringUtils.isEmpty( this.artifactItem.getIncludes() )
	&&	StringUtils.isEmpty( this.artifactItem.getExcludes() ) ) )
{
	markerFile = new StubMarkerFile( this.markerFilesDirectory, this.artifact.getId().replace( ':', '-' ) + ".marker" );
}
else
{
	int includeExcludeHash = 0;
	
	if ( StringUtils.isNotEmpty( this.artifactItem.getIncludes() ) )
	{
		includeExcludeHash += this.artifactItem.getIncludes().hashCode();
	}
	
	if ( StringUtils.isNotEmpty( this.artifactItem.getExcludes() ) )
	{
		includeExcludeHash += this.artifactItem.getExcludes().hashCode();
	}
	
	markerFile = new StubMarkerFile( this.markerFilesDirectory, this.artifact.getId().replace( ':', '-' ) + includeExcludeHash );
}

return markerFile;
  }
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:29,代码来源:StubUnpackFileMarkerHandler.java

示例8: getDockerImageType

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
public static DockerImageType getDockerImageType(final ContainerSetting containerSetting) {
    if (containerSetting == null || StringUtils.isEmpty(containerSetting.getImageName())) {
        return DockerImageType.NONE;
    }

    final boolean isCustomRegistry = StringUtils.isNotEmpty(containerSetting.getRegistryUrl());
    final boolean isPrivate = StringUtils.isNotEmpty(containerSetting.getServerId());

    if (isCustomRegistry) {
        return isPrivate ? DockerImageType.PRIVATE_REGISTRY : DockerImageType.UNKNOWN;
    } else {
        return isPrivate ? DockerImageType.PRIVATE_DOCKER_HUB : DockerImageType.PUBLIC_DOCKER_HUB;
    }
}
 
开发者ID:Microsoft,项目名称:azure-maven-plugins,代码行数:15,代码来源:WebAppUtils.java

示例9: getAuthType

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
public String getAuthType() {
    final AuthenticationSetting authSetting = getAuthenticationSetting();
    if (authSetting == null) {
        return "AzureCLI";
    }
    if (StringUtils.isNotEmpty(authSetting.getServerId())) {
        return "ServerId";
    }
    if (authSetting.getFile() != null) {
        return "AuthFile";
    }
    return "Unknown";
}
 
开发者ID:Microsoft,项目名称:azure-maven-plugins,代码行数:14,代码来源:AbstractAzureMojo.java

示例10: getRunSingleFunctionCommand

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
protected String[] getRunSingleFunctionCommand() {
    String command = format(getRunFunctionTemplate(), getDeploymentStageDirectory(), getTargetFunction());
    if (StringUtils.isNotEmpty(getInputString())) {
        command = command.concat(" -c ").concat(getInputString());
    } else if (getInputFile() != null) {
        command = command.concat(" -f ").concat(getInputFile().getAbsolutePath());
    }
    return buildCommand(command);
}
 
开发者ID:Microsoft,项目名称:azure-maven-plugins,代码行数:10,代码来源:RunMojo.java

示例11: select

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private String select( String dominant, String recessive )
{
    if ( StringUtils.isNotEmpty( dominant ) )
    {
        return dominant;
    }
    else
    {
        return recessive;
    }
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:12,代码来源:DefaultDaemonMerger.java

示例12: stringToFile

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private static File stringToFile( String string )
{
    if ( StringUtils.isNotEmpty( string ) )
    {
        return new File( string );
    }

    return null;
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:10,代码来源:BisectCliRequest.java

示例13: createResultingErrorMessage

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
/**
 * Either return the submitted errorMessage or replace it with the custom message set in the rule extended
 * by the property name.
 *
 * @param errorMessage
 * @return
 */
String createResultingErrorMessage( String errorMessage )
{
    if ( StringUtils.isNotEmpty( message ) )
    {
        return "Property '" + property + "' must be overridden:\n" + message;
    }
    else
    {
        return errorMessage;
    }
}
 
开发者ID:mojohaus,项目名称:extra-enforcer-rules,代码行数:19,代码来源:RequirePropertyDiverges.java

示例14: getSplittedProperties

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
private List<String> getSplittedProperties( String commaSeparatedProperties )
{
    List<String> propertiesList = Collections.emptyList();
    if ( StringUtils.isNotEmpty( commaSeparatedProperties ) )
    {
        String[] splittedProps = StringUtils.split( commaSeparatedProperties, "," );
        propertiesList = Arrays.asList( StringUtils.stripAll( splittedProps ) );
    }
    return propertiesList;
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:11,代码来源:DefaultVersionsHelper.java

示例15: createKeytoolRequest

import org.codehaus.plexus.util.StringUtils; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected R createKeytoolRequest()
{
    R request = super.createKeytoolRequest();

    if ( StringUtils.isNotEmpty( keystore ) )
    {

        File file = getFile( keystore );

        // make sure the parent directory of the keystore exists

        boolean mkdirs = file.getParentFile().mkdirs();
        getLog().debug( "mdkirs: " + mkdirs + " " + file.getParentFile() );

        // force to not use this parameter
        request.setKeystore( file.getAbsolutePath() );
    }

    request.setProviderarg( providerarg );
    request.setProviderclass( providerclass );
    request.setProvidername( providername );
    request.setProviderpath( providerpath );
    request.setStorepass( storepass );
    request.setStoretype( storetype );
    return request;
}
 
开发者ID:mojohaus,项目名称:keytool,代码行数:31,代码来源:AbstractKeyToolRequestWithKeyStoreParametersMojo.java


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