storm-apt/api/src/main/java/com/turbomanage/storm/csv/CsvUtils.java
public static String escapeCsv(String str) {
		if (str == null)
			return "";
		if (containsNone(str, CSV_SEARCH_CHARS))
			return str;
		StringWriter out = new StringWriter();
		out.write(QUOTE);
		for (int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if (c == QUOTE)
				out.write(QUOTE);
			out.write(c);
		}
		out.write(QUOTE);
		return out.toString();
	}
public static String escapeCsv(String str) {
		if (str == null)
			return "";
		if (containsNone(str, CSV_SEARCH_CHARS))
			return str;
		StringWriter out = new StringWriter();
		out.write(QUOTE);
		for (int i = 0; i < str.length(); i++) {
			char c = str.charAt(i);
			if (c == QUOTE)
				out.write(QUOTE);
			out.write(c);
		}
		out.write(QUOTE);
		return out.toString();
	}
public static String escapeCsv ( String str ) { if ( str == null ) return "" ; if ( containsNone ( str , CSV_SEARCH_CHARS ) ) return str ; StringWriter out = new StringWriter ( ) ; out . write ( QUOTE ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char c = str . charAt ( i ) ; if ( c == QUOTE ) out . write ( QUOTE ) ; out . write ( c ) ; } out . write ( QUOTE ) ; return out . toString ( ) ; }
Returns a {@link String} for a CSV column enclosed in double
quotes, if required.

see <a
href="http://en.wikipedia.org/wiki/Comma-separated_values">Wikipedia</a>
and <a href="http://tools.ietf.org/html/rfc4180">RFC 4180</a>.

@param str the input String, may be null
@return the input String enclosed in double quotes if required, or null
Returns a { @link String } for a CSV column enclosed in double quotes if required .