private static String tryBlank( String s ) { if ( s == null ) { return null; } else { String trimmed = s.trim(); return StringUtils.isEmpty( trimmed ) ? null : trimmed; } }
/** * Sets the name of the file used to log build output. * * @param logFileName The name of the log file, relative to the base directory, must not be empty or * <code>null</code>. * @since 1.2 */ public void setLogFileName( String logFileName ) { if ( StringUtils.isEmpty( logFileName ) ) { throw new IllegalArgumentException( "log file name unspecified" ); } this.logFileName = logFileName; }
private Writer getFileWriter( String encoding, File to ) throws IOException { if ( StringUtils.isEmpty( encoding ) ) { return new FileWriter( to ); } else { FileOutputStream outstream = new FileOutputStream( to ); return new OutputStreamWriter( outstream, encoding ); } }
private Reader getFileReader( String encoding, File from ) throws FileNotFoundException, UnsupportedEncodingException { // buffer so it isn't reading a byte at a time! if ( StringUtils.isEmpty( encoding ) ) { return new BufferedReader( new FileReader( from ) ); } else { FileInputStream instream = new FileInputStream( from ); return new BufferedReader( new InputStreamReader( instream, encoding ) ); } }
private Verifier( String basedir, String settingsFile, boolean debug, Boolean forkJvm, String[] defaultCliOptions ) throws VerificationException { this.basedir = basedir; this.forkJvm = forkJvm; this.forkMode = System.getProperty( "verifier.forkMode" ); if ( !debug ) { originalOut = System.out; originalErr = System.err; } setDebug( debug ); findLocalRepo( settingsFile ); findDefaultMavenHome(); if ( StringUtils.isEmpty( defaultMavenHome ) && StringUtils.isEmpty( forkMode ) ) { forkMode = "auto"; } this.defaultCliOptions = defaultCliOptions == null ? new String[0] : defaultCliOptions.clone(); }
@Override public String getReportName() { return isEmpty( SurefireReportMojo.this.getTitle() ) ? toLocalizedValue( "report.surefire.name" ) : SurefireReportMojo.this.getTitle(); }
@Override public String getReportDescription() { return isEmpty( FailsafeReportMojo.this.getDescription() ) ? toLocalizedValue( "report.failsafe.description" ) : FailsafeReportMojo.this.getDescription(); }
@Override public String getReportName() { return isEmpty( FailsafeReportMojo.this.getTitle() ) ? toLocalizedValue( "report.failsafe.name" ) : FailsafeReportMojo.this.getTitle(); }
@Override public String getReportHeader() { return isEmpty( FailsafeReportMojo.this.getTitle() ) ? toLocalizedValue( "report.failsafe.header" ) : FailsafeReportMojo.this.getTitle(); } };
@Override public String getReportHeader() { return isEmpty( SurefireReportMojo.this.getTitle() ) ? toLocalizedValue( "report.surefire.header" ) : SurefireReportMojo.this.getTitle(); } };
@Override public String getReportName() { return isEmpty( FailsafeReportMojo.this.getTitle() ) ? toLocalizedValue( "report.failsafe.name" ) : FailsafeReportMojo.this.getTitle(); }
@Override public String getReportHeader() { return isEmpty( FailsafeReportMojo.this.getTitle() ) ? toLocalizedValue( "report.failsafe.header" ) : FailsafeReportMojo.this.getTitle(); } };
@Override public String getReportHeader() { return isEmpty( SurefireReportMojo.this.getTitle() ) ? toLocalizedValue( "report.surefire.header" ) : SurefireReportMojo.this.getTitle(); } };
@Override public String getReportDescription() { return isEmpty( SurefireReportMojo.this.getDescription() ) ? toLocalizedValue( "report.surefire.description" ) : SurefireReportMojo.this.getDescription(); }
@Override public String getReportName() { return isEmpty( SurefireReportMojo.this.getTitle() ) ? toLocalizedValue( "report.surefire.name" ) : SurefireReportMojo.this.getTitle(); }
@Override public String getReportDescription() { return isEmpty( SurefireReportMojo.this.getDescription() ) ? toLocalizedValue( "report.surefire.description" ) : SurefireReportMojo.this.getDescription(); }
private void appendValue( Xpp3Dom xdoc, String value ) { String currentValue = xdoc.getValue(); if ( StringUtils.isEmpty( currentValue ) ) { xdoc.setValue( value ); } else { xdoc.setValue( currentValue + "," + value ); } }
@Override public String getReportDescription() { return isEmpty( FailsafeReportMojo.this.getDescription() ) ? toLocalizedValue( "report.failsafe.description" ) : FailsafeReportMojo.this.getDescription(); }
private void initEmbeddedLauncher() throws LauncherException { if ( embeddedLauncher == null ) { if ( StringUtils.isEmpty( defaultMavenHome ) ) { embeddedLauncher = Embedded3xLauncher.createFromClasspath(); } else { embeddedLauncher = Embedded3xLauncher.createFromMavenHome( defaultMavenHome, defaultClassworldConf, getClasspath() ); } } }
private void normalize( JarIdentification taxon ) { if ( StringUtils.isEmpty( taxon.getGroupId() ) ) { taxon.setGroupId( pickSmallest( taxon.getPotentialGroupIds() ) ); } if ( StringUtils.isEmpty( taxon.getArtifactId() ) ) { taxon.setArtifactId( pickLargest( taxon.getPotentialArtifactIds() ) ); } if ( StringUtils.isEmpty( taxon.getVersion() ) ) { taxon.setVersion( pickSmallest( taxon.getPotentialVersions() ) ); } if ( StringUtils.isEmpty( taxon.getName() ) ) { taxon.setName( pickLargest( taxon.getPotentialNames() ) ); } if ( StringUtils.isEmpty( taxon.getVendor() ) ) { taxon.setVendor( pickLargest( taxon.getPotentialVendors() ) ); } }