[jcifs] SmbException Supercedes boolean?

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Tue Oct 30 11:49:06 EST 2001

> -----Original Message-----
> From:	James Nord [SMTP:teilo at teilo.net]
> Sorry I was not clear enough, I was meaning to use both..
> For example
> isDirectory()
	Not all methods of SmbFile will throw exceptions. Only the methods that do
	serious IO with the server. And some methods will still return boolean. These
	are the ones with obvious additional context I mentioned previously such as
> psudeocode ;-)
> SMBFile f1 = new SMBFile(someSMBURL);
> SMBFIle f2=new SMBFile(f, documentname);
> try {
>     if (f1.isDirectory()) {
>         try {
>             if (f2.makeFile()) {
	I don't think the code would come out to be this hairy. Look at my previous
	example and think about it again. You can try/catch witout anything in the
	catch and you can probably use one where you might otherwise use several
	because you can test the errorClass and errorCode.


More information about the jcifs mailing list