 <p>Solved: replace '@' character with '%40' at parse time it will automatically got converted to '@'.</p> <pre><code>URL url = new URL("ftp://p%40g.com:g%401234@ftp.xyz.com/testjar/2014-03-06-p.txt;type=i"); URLConnection urlc = url.openConnection(); OutputStream os = urlc.getOutputStream(); // To upload OutputStream buffer = new BufferedOutputStream(os); PrintStream output = new PrintStream(buffer); output.print("wowhii"); buffer.close(); os.close(); output.close(); </code></pre>