List of usage examples for org.apache.commons.exec.util StringUtils fixFileSeparatorChar
public static String fixFileSeparatorChar(final String arg)
From source file:npanday.executable.ArgUtils.java
/** * Takes care of quoting individually per part. For example, * if you pass <code>"/go:", new File("c:\\with space")</code>, it will yield * <code>/go:"c:\with space"</code> *//* w w w . j av a 2 s.co m*/ public static String combine(Object... objects) { StringBuilder command = new StringBuilder(); for (Object item : objects) { if (item == null) { continue; } if (item instanceof File) { command.append(StringUtils .quoteArgument(StringUtils.fixFileSeparatorChar(((File) item).getAbsolutePath()))); } else if (item instanceof String) { command.append(StringUtils.quoteArgument((String) item)); } else { command.append(StringUtils.quoteArgument(item.toString())); } } return command.toString(); }