@Test public void testQuoteList1() { assertEquals("", CommandLineSupport.quote(Arrays.<String>asList())); }
public static String quote(final String arg) { final StringBuilder escaped = new StringBuilder(); for (final char c : arg.toCharArray()) { if (c == QUOTE || c == SLASH) { escaped.append(SLASH); } escaped.append(c); } if (arg.indexOf(BLANK) != -1 || arg.indexOf(QUOTE) != -1) { escaped.insert(0, QUOTE).append(QUOTE); } return escaped.toString(); }
CommandLineSupport { public static String quote(final String arg) { final StringBuilder escaped = new StringBuilder(); for (final char c : arg.toCharArray()) { if (c == QUOTE || c == SLASH) { escaped.append(SLASH); } escaped.append(c); } if (arg.indexOf(BLANK) != -1 || arg.indexOf(QUOTE) != -1) { escaped.insert(0, QUOTE).append(QUOTE); } return escaped.toString(); } }
CommandLineSupport { public static String quote(final String arg) { final StringBuilder escaped = new StringBuilder(); for (final char c : arg.toCharArray()) { if (c == QUOTE || c == SLASH) { escaped.append(SLASH); } escaped.append(c); } if (arg.indexOf(BLANK) != -1 || arg.indexOf(QUOTE) != -1) { escaped.insert(0, QUOTE).append(QUOTE); } return escaped.toString(); }  }
CommandLineSupport { public static String quote(final String arg) { final StringBuilder escaped = new StringBuilder(); for (final char c : arg.toCharArray()) { if (c == QUOTE || c == SLASH) { escaped.append(SLASH); } escaped.append(c); } if (arg.indexOf(BLANK) != -1 || arg.indexOf(QUOTE) != -1) { escaped.insert(0, QUOTE).append(QUOTE); } return escaped.toString(); }  static String quote(final String arg); static String quote(final List<String> args); static List<String> split(final String commandline); }
CommandLineSupport { public static String quote(final String arg) { final StringBuilder escaped = new StringBuilder(); for (final char c : arg.toCharArray()) { if (c == QUOTE || c == SLASH) { escaped.append(SLASH); } escaped.append(c); } if (arg.indexOf(BLANK) != -1 || arg.indexOf(QUOTE) != -1) { escaped.insert(0, QUOTE).append(QUOTE); } return escaped.toString(); }  static String quote(final String arg); static String quote(final List<String> args); static List<String> split(final String commandline);  }