當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils.isNotBlank方法代碼示例

本文整理匯總了Java中org.codehaus.plexus.util.StringUtils.isNotBlank方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.isNotBlank方法的具體用法?Java StringUtils.isNotBlank怎麽用?Java StringUtils.isNotBlank使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.codehaus.plexus.util.StringUtils的用法示例。


在下文中一共展示了StringUtils.isNotBlank方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertToJvmSettingsWithDefaultHandling

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
private JvmSettings convertToJvmSettingsWithDefaultHandling( Program program )
{
    JvmSettings jvmSettings = new JvmSettings();

    if ( program.getJvmSettings() != null )
    {
        // Some kind of settings done on per program base so they take
        // precendence.
        jvmSettings = program.getJvmSettings();
    }
    else
    {
        // No settings in the program done so we use the default behaviour
        if ( StringUtils.isNotBlank( this.extraJvmArguments ) )
        {
            jvmSettings.setExtraArguments( parseTokens( this.extraJvmArguments ) );
        }
    }

    return jvmSettings;
}
 
開發者ID:nkasvosve,項目名稱:beyondj,代碼行數:22,代碼來源:AssembleMojo.java

示例2: getExtension

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
private String getExtension(File artifact, Gav gav) {
    if (gav != null && StringUtils.isNotBlank(gav.getExtension())) {
        return gav.getExtension();
    }

    // last resort, the extension of the file
    String artifactFileName = artifact.getName().toLowerCase();

    // tar.gz? and other "special" combinations
    if (artifactFileName.endsWith("tar.gz")) {
        return "tar.gz";
    } else if (artifactFileName.equals("tar.bz2")) {
        return "tar.bz2";
    }

    // get the part after the last dot
    return FileUtils.getExtension(artifactFileName);
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:19,代碼來源:VfsMinimalArtifactInfoIndexCreator.java

示例3: computeSubPackageName

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
/**
 * If useSourceHierarchy is true and sourceDirectory is set, return a sub package name that reflects the
 * relative position of the ramlFile to sourceDirectory.  Otherwise return an empty string.
 * 
 * @param ramlFile
 * @return computed sub package name
 */
protected String computeSubPackageName(File ramlFile) {
	String subName = "";
	if (useSourceHierarchyInPackageName && sourceDirectory != null) {
		Path rel = sourceDirectory.toPath().relativize(ramlFile.toPath());
		if (rel != null && rel.getParent() != null) {
			String parent = rel.getParent().toString();
			String rpn = parent.replace(File.separator, ".");
			if (StringUtils.isNotBlank(rpn)) {
				subName = ".".concat(rpn);
			}
		}
	}
	return subName;
}
 
開發者ID:OnPositive,項目名稱:aml,代碼行數:22,代碼來源:RamlJaxrsCodegenMojo.java

示例4: hasInnerResources

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
public boolean hasInnerResources(String message) {
  boolean isParametric = false;
  if (StringUtils.isNotBlank(message)) {
    isParametric = innerResourcePresencePattern.matcher(message).matches();
  }
  return isParametric;
}
 
開發者ID:rquinio,項目名稱:l10n-maven-plugin,代碼行數:8,代碼來源:InnerResourcesFormatter.java

示例5: captureInnerResources

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
public List<String> captureInnerResources(String message) {
  List<String> innerKeys = new LinkedList<String>();
  if (StringUtils.isNotBlank(message)) {
    Matcher matcher = innerResourcePattern.matcher(message);
    while (matcher.find()) {
      String innerKey = matcher.group(1);
      if (StringUtils.isNotBlank(innerKey)) {
        innerKeys.add(innerKey);
      }
    }
  }
  return innerKeys;
}
 
開發者ID:rquinio,項目名稱:l10n-maven-plugin,代碼行數:14,代碼來源:InnerResourcesFormatter.java

示例6: getVersion

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
@Override
public String getVersion( MavenProject mavenProject )
    throws ExternalVersionException
{
    String newVersion = System.getProperty( EXTERNAL_VERSION, mavenProject.getVersion() );
    String qualifier = StringUtils.trim( System.getProperty( EXTERNAL_VERSION_QUALIFIER ) );

    if ( StringUtils.isNotBlank( qualifier ) )
    {
        // TODO: this needs to be cleaned up, the calling method will re-add the -SNAPSHOT if needed, but this is dirty
        newVersion = newVersion.replaceFirst( "-SNAPSHOT", "" ) + "-" + qualifier;
    }

    return newVersion;
}
 
開發者ID:bdemers,項目名稱:maven-external-version,代碼行數:16,代碼來源:SystemPropertyStrategy.java

示例7: setFilename

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
@Override
public void setFilename(String filename) {
    if (StringUtils.isNotBlank(filename)) {
        response.setHeader(ArtifactoryRequest.FILE_NAME, HttpUtils.encodeQuery(filename));
    } else {
        log.debug("Could not register a null filename with the response.");
    }
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:9,代碼來源:HttpArtifactoryResponse.java

示例8: setFilename

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
@Override
public void setFilename(String filename) {
    if (StringUtils.isNotBlank(filename)) {
        response.header(ArtifactoryRequest.FILE_NAME, HttpUtils.encodeQuery(filename));
    } else {
        log.debug("Could not register a null filename with the response.");
    }
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:9,代碼來源:JerseyArtifactoryResponse.java

示例9: createProject

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
/**
 * Creates the custom project structure at the specified location and name
 * The Project will have below natures:<br>
 * <b>Java</b> and Custom nature as per <b>ETL</b> project
 * @param projectName Project name
 * @param location Where should the project be saved
 * @return
 */
public IProject createProject(String projectName, URI location){
	if (StringUtils.isNotBlank(projectName) && projectName.contains(" ")){
		MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR | SWT.OK);
		messageBox.setText("Error");
		messageBox.setMessage("The Project Name has spaces");
		if(messageBox.open()==SWT.OK)
		{
			return null;
		}
	}
	else if(StringUtils.isBlank(projectName)){
		throw new InvalidProjectNameException();
	}
	IProject project = null;
	try {
		project = createBaseProject(projectName, location);
		if(project!=null)
		{
			addNature(project);
			addToProjectStructure(project, paths);
			IJavaProject javaProject = JavaCore.create(project);

			IFolder binFolder = project.getFolder(CustomMessages.ProjectSupport_BIN);
			javaProject.setOutputLocation(binFolder.getFullPath(), null);

			List<IClasspathEntry> entries = addJavaLibrariesInClassPath();

			IFolder libFolder = project.getFolder(CustomMessages.ProjectSupport_LIB);

			//add libs to project class path 
			String installLocation = Platform.getInstallLocation().getURL().getPath();

			//copyExternalLibAndAddToClassPath(installLocation + CustomMessages.ProjectSupport_LIB, libFolder, entries);

			copyBuildFile(installLocation + CustomMessages.ProjectSupport_CONFIG_FOLDER + "/" + 
					CustomMessages.ProjectSupport_GRADLE + "/" + BUILD, project);
			
			copyBuildFile(installLocation + CustomMessages.ProjectSupport_CONFIG_FOLDER + "/" + 
					CustomMessages.ProjectSupport_GRADLE + "/" + PROPERTIES, project);
			
			copyBuildFile(installLocation + CustomMessages.ProjectSupport_CONFIG_FOLDER + "/" + 
					MAVEN, project);
			
			updateMavenFile(POM_XML, project);
			
			javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[entries.size()]), null);

			//set source folder entry in classpath
			javaProject.setRawClasspath(setSourceFolderInClassPath(project, javaProject), null);
		}
	} catch (CoreException e) {
		logger.debug("Failed to create Project with parameters as projectName : {} location : {}, exception : {}", 
				new Object[]{projectName, location, e});
		project = null;
	}

	return project;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:67,代碼來源:ProjectStructureCreator.java

示例10: execute

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
public void execute( EnforcerRuleHelper helper )
    throws EnforcerRuleException
{
    try
    {
        if ( StringUtils.isBlank( encoding ) )
        {
            encoding = (String) helper.evaluate( "${project.build.sourceEncoding}" );
        }
        Log log = helper.getLog();
        if ( encoding.equals( StandardCharsets.US_ASCII.name() ) )
        {
            log.warn( "Encoding US-ASCII is hard to detect. Use UTF-8 or ISO-8859-1" );
        }
        String basedir = (String) helper.evaluate( "${basedir}" );
        DirectoryScanner ds = new DirectoryScanner();
        ds.setBasedir( basedir );
        if ( StringUtils.isNotBlank( includes ) )
        {
            ds.setIncludes( includes.split( "[,\\|]" ) );
        }
        if ( StringUtils.isNotBlank( excludes ) )
        {
            ds.setExcludes( excludes.split( "[,\\|]" ) );
        }
        if ( useDefaultExcludes )
        {
            ds.addDefaultExcludes();
        }
        ds.scan();
        StringBuilder filesInMsg = new StringBuilder();
        for ( String file : ds.getIncludedFiles() )
        {
            String fileEncoding = getEncoding( encoding, new File( basedir, file ), log );
            if ( log.isDebugEnabled() )
            {
                log.debug( file + "==>" + fileEncoding );
            }
            if ( fileEncoding != null && !fileEncoding.equals( encoding ) )
            {
                filesInMsg.append( file );
                filesInMsg.append( "==>" );
                filesInMsg.append( fileEncoding );
                filesInMsg.append( "\n" );
                if ( failFast )
                {
                    throw new EnforcerRuleException( filesInMsg.toString() );
                }
            }
        }
        if ( filesInMsg.length() > 0 )
        {
            throw new EnforcerRuleException( "Files not encoded in " + encoding + ":\n" + filesInMsg );
        }
    }
    catch ( IOException ex )
    {
        throw new EnforcerRuleException( "Reading Files", ex );
    }
    catch ( ExpressionEvaluationException e )
    {
        throw new EnforcerRuleException( "Unable to lookup an expression " + e.getLocalizedMessage(), e );
    }
}
 
開發者ID:mojohaus,項目名稱:extra-enforcer-rules,代碼行數:65,代碼來源:RequireEncoding.java

示例11: executeThrift

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
/**
 * Call {@link #executeOperation(Cassandra.Client)} on the provided operation
 * @throws MojoExecutionException
 * @throws MojoFailureException
 */    
public static void executeThrift(ThriftApiOperation thriftApiOperation) throws MojoExecutionException
{
    TSocket socket = new TSocket(thriftApiOperation.getRpcAddress(), thriftApiOperation.getRpcPort());
    TTransport transport = new TFramedTransport(socket);

    TBinaryProtocol binaryProtocol = new TBinaryProtocol(transport, true, true);
    Cassandra.Client cassandraClient = new Cassandra.Client(binaryProtocol);

    try 
    {
        transport.open();
        if ( StringUtils.isNotBlank(thriftApiOperation.getKeyspace()) ) 
        {
            cassandraClient.set_keyspace(thriftApiOperation.getKeyspace());
        }
        cassandraClient.set_cql_version(thriftApiOperation.getCqlVersion());
        thriftApiOperation.executeOperation(cassandraClient);
    } catch (ThriftApiExecutionException taee) 
    {
        throw new MojoExecutionException("API Exception calling Apache Cassandra", taee);
    } catch (Exception ex) 
    {
        throw new MojoExecutionException("General exception from Thrift", ex);
    }
    
    finally 
    {
        if ( transport != null && transport.isOpen() )
        {
            try 
            {
                transport.flush();
                transport.close();
            } catch (Exception e) 
            { 
                throw new MojoExecutionException("Something went wrong cleaning up", e);
            }
        }
    }

}
 
開發者ID:mojohaus,項目名稱:cassandra-maven-plugin,代碼行數:47,代碼來源:Utils.java

示例12: getCodeEnumValue

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
public String getCodeEnumValue() {
	String retVal = myDisplay;
	if (StringUtils.isBlank(retVal)) {
		retVal = myCode;
		if (Character.isDigit(myCode.charAt(0))) {
			if (StringUtils.isNotBlank(myDefinition)) {
				if (myDefinition.length() < 100) {
					String newValue = myDefinition;
					if (newValue.contains(",")) {
						newValue = newValue.substring(0, newValue.indexOf(','));
					}
					if (newValue.contains("(")) {
						newValue = newValue.substring(0, newValue.indexOf('('));
					}
					newValue = newValue.replace(" / ", " OR ");
					while (!Character.isLetterOrDigit(newValue.charAt(newValue.length() - 1))) {
						newValue = newValue.substring(0, newValue.length() - 1);
					}
					ourLog.info("[{}] Replacing numeric code {} with description: {}", new Object[] { myName, retVal, newValue });
					retVal = newValue;
				}
			}
		}
	}

	if ("=".equals(retVal)) {
		retVal = "EQUALS";
	}
	if ("<=".equals(retVal)) {
		retVal = "LESSTHAN_OR_EQUALS";
	}
	if ("<".equals(retVal)) {
		retVal = "LESSTHAN";
	}
	if (">=".equals(retVal)) {
		retVal = "GREATERTHAN_OR_EQUALS";
	}
	if (">".equals(retVal)) {
		retVal = "GREATERTHAN";
	}

	StringBuilder b = new StringBuilder();
	for (char next : retVal.toUpperCase().replace("'", "").replace("(", "").replace(")", "").toCharArray()) {
		if (Character.isJavaIdentifierPart(next)) {
			b.append(next);
		} else {
			b.append("_");
		}
	}
	retVal = b.toString();

	if (!Character.isJavaIdentifierStart(retVal.charAt(0))) {
		retVal = '_' + retVal;
	}

	return retVal;
}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:58,代碼來源:ValueSetTm.java

示例13: isHasDefinition

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
public boolean isHasDefinition() {
	return StringUtils.isNotBlank(myDefinition);
}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:4,代碼來源:ValueSetTm.java

示例14: isHasDisplay

import org.codehaus.plexus.util.StringUtils; //導入方法依賴的package包/類
public boolean isHasDisplay() {
	return StringUtils.isNotBlank(myDisplay);
}
 
開發者ID:gajen0981,項目名稱:FHIR-Server,代碼行數:4,代碼來源:ValueSetTm.java


注:本文中的org.codehaus.plexus.util.StringUtils.isNotBlank方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。