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

Thomas Krammer TKrammer at nxn-software.com
Thu Jan 16 08:48:58 EST 2003


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