<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-AU link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>mike, this can be scratched from
the todo list<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>updating on this again.&nbsp; i
am back working at the site where there are a number of files and folders with
leading whitespaces<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>my initial guess that spaces
were being trimmed in jcifs code was wrong.&nbsp; <o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>the problem lies with the
java.net.URL constructor.&nbsp; it gets rid of leading and trailing whitespace<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>java.net.URL&nbsp; (lines:
506-512)<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>---------------<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp; limit =
spec.length();<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp; while ((limit &gt;
0) &amp;&amp; (spec.charAt(limit - 1) &lt;= ' ')) {<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
limit--;&nbsp;&nbsp; //eliminate trailing whitespace<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp; }<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>&nbsp; &nbsp;while ((start &lt;
limit) &amp;&amp; (spec.charAt(start) &lt;= ' ')) {<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
start++;&nbsp;&nbsp; // eliminate leading whitespace<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp; }<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>---------------<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>so, short of modifying the code
for URL or patching the code at SmbFile (line 620), where the URL is
instantiated, i'm not sure any other path<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>if anyone has a suggestion, i'd
most appreciate it<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>-craig<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Craig Stires
[mailto:craig.stires@gmail.com] <br>
<b>Sent:</b> Friday, 4 June 2010 10:59 PM<br>
<b>To:</b> 'jcifs@lists.samba.org'<br>
<b>Subject:</b> smbfolder.listFiles(SmbFileFilter) drops folders with a leading
whitespace<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>wanted to followup with an update on an issue i had found in
January.&nbsp; hopefully, this will help isolate the problem<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>I'm using jcifs 1.3.14<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>The problem happens whenever a folder name starts with a
' '.&nbsp; When smbfolder.listFiles(SmbFileFilter) is called on a folder
containing subfolders with leading spaces, the SmbFile[] list returned has the
leading space stripped off.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>e.g.<o:p></o:p></p>

<p class=MsoPlainText>actual &nbsp;&nbsp;&gt;&nbsp;&nbsp;smb://mysrv/user/c/
foldername/<o:p></o:p></p>

<p class=MsoPlainText>returned &gt;&nbsp; smb://mysrv/user/c/foldername/<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>I traced it down through the send stack <o:p></o:p></p>

<p class=MsoPlainText>(SmbFile.send(ServerMessageBlock request,
ServerMessageBlock response)&nbsp; <o:p></o:p></p>

<p class=MsoPlainText>-&gt; SmbTransport.send(request, response)<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>beyond that, i think it may be caused by a String.trim() further
on in this code<o:p></o:p></p>

<p class=MsoNormal>(Handler.java &gt; getDefaultStreamHandler : 114)<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp; String provider =
tokenizer.nextToken().trim();&nbsp;&nbsp; // Does this need to be trimmed?<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>other files that have a call to trim, but i'm not sure are
relevant to this<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp; src/jcifs/dcerpc/Dcerpc/DcerpcHandle &gt;
parseBinding : 72,82,85<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp; src/jcifs/UniAddress &gt; constructor : 95<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp; src/jcifs/http/NtlmHttpURLConnection &gt;
attemptNegotiation : 511,520<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp; src/jcifs/netbios/NameServiceClient &gt;
constructor : 107<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp; src/jcifs/netbios/Lmhosts &gt; populate :
86,109<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>