/** * Sets the file encoding of the hook scripts. * * @param encoding The file encoding of the hook scripts, may be <code>null</code> or empty to use the platform's * default encoding. */ public void setScriptEncoding( String encoding ) { this.encoding = StringUtils.isNotEmpty( encoding ) ? encoding : null; }
/** * Constructor. * * @param file the JAR file * @param manifest the JAR manifest * @param entries the JAR entries */ public JarData( File file, Manifest manifest, List entries ) { this.file = file; this.manifest = manifest; this.entries = Collections.unmodifiableList( entries ); boolean sealed = false; if ( this.manifest != null ) { String sval = this.manifest.getMainAttributes().getValue( Attributes.Name.SEALED ); if ( StringUtils.isNotEmpty( sval ) ) { sealed = "true".equalsIgnoreCase( sval.trim() ); } } this.sealed = sealed; }
private String pickSmallest( List list ) { String smallest = null; if ( !list.isEmpty() ) { int size = Integer.MAX_VALUE; Iterator it = list.iterator(); while ( it.hasNext() ) { String val = (String) it.next(); if ( StringUtils.isNotEmpty( val ) ) { if ( val.length() < size ) { smallest = val; size = val.length(); } } } } return smallest; }
private String pickLargest( List list ) { String largest = null; if ( !list.isEmpty() ) { int size = Integer.MIN_VALUE; Iterator it = list.iterator(); while ( it.hasNext() ) { String val = (String) it.next(); if ( StringUtils.isNotEmpty( val ) ) { if ( val.length() > size ) { largest = val; size = val.length(); } } } } return largest; }
/** * Finds the specified command in any of the given sub directories of the specified JDK/JRE home directory. * * @param command The command to find, must not be <code>null</code>. * @param homeDir The home directory to search in, may be <code>null</code>. * @param subDirs The sub directories of the home directory to search in, must not be <code>null</code>. * @return The (absolute) path to the command if found, <code>null</code> otherwise. */ private String findExecutable( String command, String homeDir, String... subDirs ) { String result = null; if ( StringUtils.isNotEmpty( homeDir ) ) { for ( String subDir : subDirs ) { File file = new File( new File( homeDir, subDir ), command ); if ( file.isFile() ) { result = file.getAbsolutePath(); break; } } } return result; } }
/** * Returns a string array of the excludes to be used when copying the content of the WAR source directory. * * @return an array of tokens to exclude */ protected String[] getExcludes() { List<String> excludeList = new ArrayList<String>(); if ( StringUtils.isNotEmpty( warSourceExcludes ) ) { excludeList.addAll( Arrays.asList( StringUtils.split( warSourceExcludes, "," ) ) ); } // if webXML is specified, omit the one in the source directory if ( webXml != null && StringUtils.isNotEmpty( webXml.getName() ) ) { excludeList.add( "**/" + WEB_INF + "/web.xml" ); } // if contextXML is specified, omit the one in the source directory if ( containerConfigXML != null && StringUtils.isNotEmpty( containerConfigXML.getName() ) ) { excludeList.add( "**/" + META_INF + "/" + containerConfigXML.getName() ); } return excludeList.toArray( new String[excludeList.size()] ); }
private void warnOfUnsupportedBuildElements( org.apache.maven.model.v3_0_0.Build v3Build ) { if ( notEmpty( v3Build.getSourceModifications() ) ) { warnings.add( "Ignoring <sourceModifications/> section. It is not supported in v4 POMs." ); } if ( StringUtils.isNotEmpty( v3Build.getAspectSourceDirectory() ) ) { warnings.add( "Ignoring <aspectSourceDirectory/>. It is not supported in v4 POMs." ); } if ( StringUtils.isNotEmpty( v3Build.getIntegrationUnitTestSourceDirectory() ) ) { warnings.add( "Ignoring <integrationUnitTestSourceDirectory/>. It is not supported in v4 POMs." ); } }
try if ( StringUtils.isNotEmpty( encoding ) )
protected void buildConfiguration( Xpp3Dom configuration, org.apache.maven.model.v3_0_0.Model v3Model, Properties projectProperties ) throws ProjectConverterException { final String propertyName = "maven.tasklist.taskTag"; String value = projectProperties.getProperty( propertyName ); if ( StringUtils.isNotEmpty( value ) ) { Xpp3Dom tags = new Xpp3Dom( "tags" ); addConfigurationChild( tags, projectProperties, propertyName, "tag" ); configuration.addChild( tags ); } } }
private IssueManagement translateIssueManagement( org.apache.maven.model.v3_0_0.Model v3Model ) { IssueManagement issueMgmt = null; String issueTrackingUrl = v3Model.getIssueTrackingUrl(); if ( StringUtils.isNotEmpty( issueTrackingUrl ) ) { issueMgmt = new IssueManagement(); issueMgmt.setUrl( issueTrackingUrl ); } return issueMgmt; }
if ( isNotEmpty( testMethodName ) ) if ( isNotEmpty( msg ) )
private void warnOfUnsupportedMainModelElements( org.apache.maven.model.v3_0_0.Model v3Model ) if ( StringUtils.isNotEmpty( v3Model.getExtend() ) ) if ( StringUtils.isNotEmpty( v3Model.getGumpRepositoryId() ) ) if ( StringUtils.isNotEmpty( v3Model.getPackage() ) ) if ( StringUtils.isNotEmpty( v3Model.getLogo() ) ) if ( StringUtils.isNotEmpty( v3Model.getShortDescription() ) )
if ( StringUtils.isNotEmpty( line ) )
if ( StringUtils.isNotEmpty( ts ) )
private Organization translateOrganization( org.apache.maven.model.v3_0_0.Organization v3Organization ) { Organization organization = null; if ( v3Organization != null ) { organization = new Organization(); organization.setName( v3Organization.getName() ); organization.setUrl( v3Organization.getUrl() ); if ( StringUtils.isNotEmpty( v3Organization.getLogo() ) ) { warnings.add( "Ignoring <organization><logo/></organization>. It is not supported in v4 POMs." ); } } return organization; }
private CiManagement translateCiManagementInfo( org.apache.maven.model.v3_0_0.Build v3Build ) { CiManagement ciMgmt = null; if ( v3Build != null ) { String nagEmailAddress = v3Build.getNagEmailAddress(); if ( StringUtils.isNotEmpty( nagEmailAddress ) ) { Notifier notifier = new Notifier(); notifier.setType( "mail" ); notifier.addConfiguration( "address", nagEmailAddress ); ciMgmt = new CiManagement(); ciMgmt.addNotifier( notifier ); } } return ciMgmt; }
if ( StringUtils.isNotEmpty( id ) ) if ( StringUtils.isNotEmpty( scope ) ) if ( StringUtils.isNotEmpty( optional ) )
if ( debug && StringUtils.isNotEmpty( debuglevel ) ) if ( key.startsWith( "-A" ) && StringUtils.isNotEmpty( value ) )
if ( debug && StringUtils.isNotEmpty( debuglevel ) ) if ( key.startsWith( "-A" ) && StringUtils.isNotEmpty( value ) )
if ( StringUtils.isNotEmpty( id ) )