<div dir="ltr">On Thu, Feb 4, 2016 at 9:12 AM, Guertler Mario <span dir="ltr"><<a href="mailto:m.guertler@znt.de" target="_blank">m.guertler@znt.de</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div link="#0563C1" vlink="#954F72" lang="DE">
<div>
<p class="MsoNormal"><span lang="EN-US">Hi all,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I think I found a bug in your implementation. We are using JCIFS in many applications successfully, but if the number sign (‘#’) is used in password then we get problems.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I already figured out where the problem is; the passed URL string of constructor ‘public SmbFile(String url)’ is not correctly parsed.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The following code:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">String connectString ="smb://user:passwort#123456789@host/share/Test/”;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">SmbFile polledFile = new SmbFile(connectString);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Results in following field variables of class SmbFile or better of class URL<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">authority             "user:test#123456789@host"<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">file                         "#123456789@host/share/Test/"<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">path                      "#123456789@host/share/Test/"<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">protocol              "smb"<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">userInfo              "user:test#123456789"<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">So you can see that the file/path is not correct und the access to this file will fail because it does not exist.</span></p></div></div></blockquote><div><br><div><div><div>Hi Mario,<br><br></div>This is actually not a bug. You 
must URL encode any characters in a URL that are special characters for URLs. The # sign is a ref marker. Try 
substituting with %23.<br><br></div>However, you should not put the 
password in the URL in the first place. That is only for quick and dirty
 things like running something once from a commandline. The correct way to pass credentials is to create an NtlmPasswordAuthentication object and use that with the 
appropriate constructor.<br><br></div><div>Mike<br></div></div></div></div></div>