當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。