public static String encode ( String str ) { if ( str == null ) { return "" ; } return ESCAPER . escape ( str ) . replaceAll ( "\\!" , "%21" ) . replaceAll ( "\\$" , "%24" ) . replaceAll ( "\\&" , "%26" ) . replaceAll ( "\\'" , "%27" ) . replaceAll ( "\\(" , "%28" ) . replaceAll ( "\\)" , "%29" ) . replaceAll ( "\\*" , "%2A" ) . replaceAll ( "\\+" , "%2B" ) . replaceAll ( "\\," , "%2C" ) . replaceAll ( "\\/" , "%2F" ) . replaceAll ( "\\:" , "%3A" ) . replaceAll ( "\\;" , "%3B" ) . replaceAll ( "\\=" , "%3D" ) . replaceAll ( "\\@" , "%40" ) . replaceAll ( "\\[" , "%5B" ) . replaceAll ( "\\]" , "%5D" ) ; }
Returns S3 encoded string .