/** * @return the default excludes pattern as comma separated string. * @see DirectoryScanner#DEFAULTEXCLUDES * @see StringUtils#join(Object[], String) */ public static String getDefaultExcludesAsString() { return StringUtils.join( DirectoryScanner.DEFAULTEXCLUDES, "," ); }
/** * <p> * Concatenates elements of an array into a single String. * </p> * <p> * The difference from join is that concatenate has no delimiter. * </p> * * @param array the array of values to concatenate. * @return the concatenated string. */ public static String concatenate( Object[] array ) { return join( array, "" ); }
private void addOptimisation() { if (runCmds != null && !runCmds.isEmpty() && shouldOptimise) { String optimisedRunCmd = StringUtils.join(runCmds.iterator(), " && "); runCmds.clear(); runCmds.add(optimisedRunCmd); } }
public String toString() { return StringUtils.join( getShellCommandline(), " " ); }
private String remainingImagesDescription() { StringBuffer ret = new StringBuffer(); ret.append("Unresolved images:\n"); for (Resolvable config : secondPass) { ret.append("* ") .append(config.getAlias()) .append(" depends on ") .append(StringUtils.join(config.getDependencies().toArray(), ",")) .append("\n"); } return ret.toString(); }
public String getLifecyclePhaseList() { Set<String> phases = new LinkedHashSet<>(); for ( Lifecycle lifecycle : getLifeCycles() ) { phases.addAll( lifecycle.getPhases() ); } return StringUtils.join( phases.iterator(), ", " ); }
/** * Simple way to make a directory * * @param dir the directory to create * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS. * @see #INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME */ public static void mkdir( String dir ) { File file = new File( dir ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) && !isValidWindowsFileName( file ) ) { throw new IllegalArgumentException( "The file (" + dir + ") cannot contain any of the following characters: \n" + StringUtils.join( INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME, " " ) ); } if ( !file.exists() ) { file.mkdirs(); } }
+ StringUtils.join( INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME, " " ) );
/** * <p> * Reverses a String that is delimited by a specific character. * </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 */ public static String reverseDelimitedString( 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 ); }
/** * {@inheritDoc} * * @see Object#toString() */ @Override public String toString() { return "Addition (\n resource= " + resource + "\n directory= " + directory + "\n destination= " + destination + "\n permissions= " + permissions + "\n includes= " + ( includes == null ? "-none-" : StringUtils.join( includes, ", " ) ) + "\n excludes= " + ( excludes == null ? "-none-" : StringUtils.join( excludes, ", " ) ) + "\n)"; }
log.info("%s: Watch for %s", imageConfig.getDescription(), StringUtils.join(tasks.toArray(), " and "));
/** * <p>Concatenates elements of an array into a single String.</p> * * <p>The difference from join is that concatenate has no delimiter.</p> * * @param array the array of values to concatenate. * @return the concatenated string. */ public static String concatenate( Object[] array ) { return join( array, "" ); }
/** * @return Returns the include as a string pattern suitable for eclipse */ public String getIncludeAsString() { return StringUtils.join( include.iterator(), PATTERN_SEPARATOR ); }
private String convertInExcludes(List<String> cludes) { if (cludes == null) { return null; } final String converted = StringUtils.join(cludes.iterator(), ","); if (converted.length() == 0) { return null; } return converted; }
public List<File> files() throws IOException { if (!sourceDirectory.exists()) { return ImmutableList.of(); } String includesStr = StringUtils.join(includes.iterator(), ","); String excludesStr = StringUtils.join(excludes.iterator(), ","); return FileUtils.getFiles(sourceDirectory, includesStr, excludesStr); }
private String remainingImagesDescription() { StringBuffer ret = new StringBuffer(); ret.append("Unresolved images:\n"); for (Resolvable config : secondPass) { ret.append(config.getName()) .append(" depends on ") .append(StringUtils.join(config.getDependencies().toArray(), ",")); } return ret.toString(); }
public static String getDirectory(String file, int level) { file=convertPathForOS(file); String[] fileAsArray=StringUtils.split(file, File.separator); List<String> directoryAsArray=new ArrayList<String>(); for (int i=0; (i < level) && (i < (fileAsArray.length - 1)); i++) { directoryAsArray.add(fileAsArray[i]); } return StringUtils.join(directoryAsArray.toArray(new String[directoryAsArray.size()]), File.separator); } }
public Variable getPathVariable() { if (paths.isEmpty()) return null; final Variable pathVariable = new Variable(); pathVariable.setKey("PATH"); pathVariable.setValue(StringUtils.join(paths.iterator(), File.pathSeparator)); return pathVariable; }
public void assertCommandLine( String expectedCommand, File expectedWorkingDirectory, Commandline actualCommand ) throws IOException { Commandline cl = new Commandline( expectedCommand ); if ( expectedWorkingDirectory != null ) { cl.setWorkingDirectory( expectedWorkingDirectory.getAbsolutePath() ); } String expectedCommandLineAsExecuted = StringUtils.join( cl.getShellCommandline(), " " ); String actualCommandLineAsExecuted = StringUtils.join( actualCommand.getShellCommandline(), " " ); assertEquals( expectedCommandLineAsExecuted, actualCommandLineAsExecuted ); }