/** * @param text The text to be split. * @param separator The separator at which the text will be split. * @return The resulting array. * @see #split(String, String, int) */ @Nonnull public static String[] split( @Nonnull String text, @Nullable String separator ) { return split( text, separator, -1 ); }
/** * <p>Splits the provided text into a array, using whitespace as the * separator.</p> * <p/> * <p>The separator is not included in the returned String array.</p> * * @param str the String to parse * @return an array of parsed Strings */ @Nonnull public static String[] split( @Nonnull String str ) { return split( str, null, -1 ); }
/** * Returns a string array of the includes to be used when adding dependent WARs as an overlay onto this WAR. * * @return an array of tokens to include */ protected String[] getDependentWarIncludes() { return StringUtils.split( StringUtils.defaultString( dependentWarIncludes ), "," ); }
/** * Returns a string array of the includes to be used when assembling/copying the WAR. * * @return an array of tokens to include */ protected String[] getIncludes() { return StringUtils.split( StringUtils.defaultString( warSourceIncludes ), "," ); }
/** * Returns a string array of the excludes to be used when adding dependent WAR as an overlay onto this WAR. * * @return an array of tokens to exclude */ protected String[] getDependentWarExcludes() { return StringUtils.split( StringUtils.defaultString( dependentWarExcludes ), "," ); }
private List<ServicePort> extractPortsFromConfig() { List<ServicePort> ret = new LinkedList<>(); String ports = getConfig(Config.port); if (ports != null) { for (String port : StringUtils.split(ports, ",")) { ret.add(parsePortMapping(port)); } } return ret; }
private List<ServicePort> extractPortsFromConfig() { List<ServicePort> ret = new LinkedList<>(); String ports = getConfig(Config.port); if (ports != null) { for (String port : StringUtils.split(ports, ",")) { ret.add(parsePortMapping(port)); } } return ret; }
/** * <p>Reverses a String that is delimited by a specific character.</p> * <p/> * <p>The Strings between the delimiters are not reversed. * Thus java.lang.String becomes String.lang.java (if the delimiter * is <code>'.'</code>).</p> * * @param str the String to reverse * @param delimiter the delimiter to use * @return the reversed String */ @Nonnull public static String reverseDelimitedString( @Nonnull String str, String delimiter ) { // could implement manually, but simple way is to reuse other, // probably slower, methods. String[] strs = split( str, delimiter ); reverseArray( strs ); return join( strs, delimiter ); }
public TestListResolver( Collection<String> tests ) { final IncludedExcludedPatterns patterns = new IncludedExcludedPatterns(); final Set<ResolvedTest> includedFilters = new LinkedHashSet<>( 0 ); final Set<ResolvedTest> excludedFilters = new LinkedHashSet<>( 0 ); for ( final String csvTests : tests ) { if ( isNotBlank( csvTests ) ) { for ( String request : split( csvTests, "," ) ) { request = request.trim(); if ( !request.isEmpty() && !request.equals( "!" ) ) { resolveTestRequest( request, patterns, includedFilters, excludedFilters ); } } } } this.includedPatterns = unmodifiableSet( includedFilters ); this.excludedPatterns = unmodifiableSet( excludedFilters ); this.hasIncludedMethodPatterns = patterns.hasIncludedMethodPatterns; this.hasExcludedMethodPatterns = patterns.hasExcludedMethodPatterns; }
/** * 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()] ); }
static void nonRegexClassAndMethods( String clazz, String methods, boolean isExcluded, IncludedExcludedPatterns patterns, Collection<ResolvedTest> includedFilters, Collection<ResolvedTest> excludedFilters ) { for ( String method : split( methods, "+" ) ) { method = method.trim(); ResolvedTest test = new ResolvedTest( clazz, method, false ); if ( !test.isEmpty() ) { updatedFilters( isExcluded, test, patterns, includedFilters, excludedFilters ); } } }
private static String[] getIncludedFiles( File directory, String includes, String excludes ) { DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir( directory ); scanner.setIncludes( split( includes, "," ) ); scanner.setExcludes( split( excludes, "," ) ); scanner.scan(); return scanner.getIncludedFiles(); } }
String[] split = StringUtils.split( debuglevel, "," ); for ( String aSplit : split )
String[] split = StringUtils.split( debuglevel, "," ); for ( String aSplit : split )