title: How to extract sftp url sftp://<user>@<host>[:<port>][/<directory>] in java
body: <p>Below is the S FTP config in properties file where its contains all attribute in a single line.</p>
  
  <p>Properties file:</p>
  
  <pre><code>xyz.sftp=sftp://user@india123.systems.in:9090/&lt;directory&gt;
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>sftp://&lt;user&gt;@&lt;host&gt;[:&lt;port&gt;][/&lt;directory&gt;]
  </code></pre>
  
  <p>I want to parse it and get the following values out of this URL:</p>
  
  <ol>
  <li>user</li>
  <li>host </li>
  <li>port</li>
  <li>path</li>
  </ol>