[jcifs] RE: Problem with # character in filename using SmbFileinputStream

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Mon Dec 30 11:17:02 EST 2002


Please send all messages to the jCIFS mailing list.

The '#' character is a special reserved character in URLs. At lease they are in HTTP URLs on
which the SMB URL is based. It is the 'ref' part of the URL and refers to a subsection of the
document like:

http://jcifs.samba.org/src/docs/api/jcifs/smb/SmbFile.html#TYPE_COMM

This does not really have any meaning for SMB URLs (not yet) but it is still reserved.

Also please read the Thu Sep 26, 2002 news bullet entitled "jcifs-0.6.6 released" about
important URL issues. These issues were fixed in the 0.7 series.

Also, there is a name service deadlock in 0.6.7. You can safely swap in 0.6.8 without any
adverse effects.

Also, about your sample code, there is no point in using a BufferedOutputStream since you
are using a buffer of your own and it should be larger (e.g. 8192 is PAGESIZE on Linux).

> -----Original Message-----
> From:	Lotspeich, Melodie [SMTP:MLotspe at pnm.com]
> Sent:	Friday, December 20, 2002 3:50 PM
> To:	Allen, Michael B (RSCH); Christopher R. Hertel
> Subject:	Problem with # character in filename using SmbFileinputStream
> 
> Hello, I'm finally using JCIFS effectively in retrieving PDFs from an NT share and displaying them in a browser.  However, I've found one glitch with the following:
> 
> I get a "file not found" error, at the SmbFileInputStream, when the filename contains a # character.  It handles other character fine such as %, @, !.  Just not #.  Any insight?
> 
> Here's what I'm doing. 
> 
>     SmbFileInputStream in = new SmbFileInputStream("smb://domainname;username:password@host/share/6#2k@01!.PDF"); 
>      
>     BufferedOutputStream bos = new BufferedOutputStream(out); 
> 
>     byte[] buff = new byte[2048]; 
>     int bytesRead; 
>     // Simple read/write loop. 
>     while(-1 != (bytesRead = in.read(buff, 0, buff.length))) { 
>         bos.write(buff, 0, bytesRead); 
>     } 
>     bos.flush(); 
> 
> Oh, I'm using JCIFS version 6.7.  Also, these files are autogenerated from another application. 
> 
> Thanks for any help. 
> 
> Melodie Lotspeich 
> 
> 




More information about the jcifs mailing list