[jcifs] jcifs-0.6b6 Compiler Error and listFiles() bug

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Thu Jan 10 09:49:59 EST 2002


Ahh, ok. Thanks. I guess I'll just copy over the URLDecoder from 1.3 into jcifs.util and solve both the 1.1 issue and exception.

Mike

> -----Original Message-----
> From:	Shawn Carnahan [SMTP:Shawn_Carnahan at Telestream.net]
> Sent:	Wednesday, January 09, 2002 11:55 AM
> To:	'Allen, Michael B (RSCH)'
> Subject:	RE: [jcifs] jcifs-0.6b6 Compiler Error and listFiles() bug
> 
> Mike: 
> 
> In JDK 1.3, Sun changed URLDecoder.decode so it does not throw an exception, previous versions did... 
> 
> Shawn 
> 
> 
> 
> -----Original Message----- 
> From: Allen, Michael B (RSCH) [ <mailto:Michael_B_Allen at ml.com>] 
> Sent: Tuesday, January 08, 2002 7:37 PM 
> To: 'jcifs at samba.org' 
> Subject: [jcifs] jcifs-0.6b6 Compiler Error and listFiles() bug 
> 
> 
> For some reason this wasn't caught by whatever version of javac I am using at home but I'm getting a compiler error now with 0.6b6:
> 
>     [javac] jcifs_0.6b6/src/jcifs/smb/SmbFile.java:393: Exception java.lang.Exception must be caught, 
> or it must be declared in the throws clause of this constructor. 
>     [javac]          uncPath = URLDecoder.decode( canonicalPath.replace( '/', '\\' )); 
> 
> So decode() throws Exception. Change the end of the last SmbFile constructor to. 
> 
>     390         if( canonicalPath == null ) { 
>     391             uncPath = "\\"; 
>     392         } else { 
>     393             try { 
>     394                 uncPath = URLDecoder.decode( canonicalPath.replace( '/', '\\' )); 
>     395             } catch( Exception e ) { 
>     396                 throw new MalformedURLException( "URL decoding failed: " + canonicalPath ); 
>     397             } 
>     398         } 
>     399     } 
> 
> There's also a major problem with using listFiles() with a workgroup URL like listFiles( "smb://mygroup" ). Because the SmbFile constructor results in a name service query, jCIFS's trys to resolve
> 
> every hostname in the group which is pretty slow not to mention stupid. This renders listFiles() on a workgroup names pretty much useless (small workgroups should be ok for now).
> 
> Coupled with the null pointer exception and 1.1 issue's I'd say 0.6b6 is pretty much a dud :~( 
> 
> Mike 
> 





More information about the jcifs mailing list