[jcifs] SmbFile doesn't implement getInputStream() and getOut putStream()

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Thu Jan 16 13:27:35 EST 2003


Yeah, I just completely forgot about this. I don't want to open pandora's box so
I've just implemented what we have in 0.6 which is:

  getContentLength
  getDate
  getLastModified
  getInputStream

no getOutputStream yet. The URLConnection implementation really needs work.
Unfortunately I don't understand it very well. What's with doOutput, doInput,
getAllowUserInteraction?

jcifs-0.7.1 release imminent.

> -----Original Message-----
> From:	Thomas Krammer [SMTP:TKrammer at nxn-software.com]
> Sent:	Wednesday, January 15, 2003 4:49 PM
> To:	'jcifs at lists.samba.org'
> Subject:	[jcifs] SmbFile doesn't implement getInputStream() and getOutputStream()
> 
> Hi,
> 
> I get a "UnknownServiceException: protocol doesn't support input" when I
> execute the following code using jcifs 0.7.0 (it works fine with 0.6.8):
> 
> ------------------------------------------
> 
> URL url = new URL("smb://...");
> 
> URLConnection connection = url.openConnection();
> 
> InputStream in = connection.getInputStream();
> 
> ------------------------------------------
> 
> That's because SmbFile extends URLConnection but doesn't overwrite
> getInputStream() and getOutputStream().
> 
> When I add the following lines to SmbFile.java everything works fine.
> 
> ------------------------------------------
> 
> public InputStream getInputStream()
>     throws IOException
> {
>     return new SmbFileInputStream(this);
> }
> 
> public OutputStream getOutputStream()
>     throws IOException
> {
>     return new SmbFileOutputStream(this);
> }
> 
> ------------------------------------------
> 
> 
>    Thomas




More information about the jcifs mailing list