private String urlEncode ( final String unencoded ) throws DockerException { try { final String encode = URLEncoder . encode ( unencoded , UTF_8 . name ( ) ) ; return encode . replaceAll ( "\\+" , "%20" ) ; } catch ( UnsupportedEncodingException e ) { throw new DockerException ( e ) ; } }
URL - encodes a string when used as a URL query parameter s value .