[jcifs] jCIFS NetworkExplorer example

Jonathon Simon jsimon at ud.com
Thu Oct 5 02:16:15 GMT 2006


Hello,
 
The "stock" code is this:
 
            if( ntlm != null ) {
                file = new SmbFile( "smb:/" + pathInfo , ntlm );
            } else if( server == null ) {
                file = new SmbFile( "smb://" );
            } else {
                file = new SmbFile( "smb:/" + pathInfo );
            }
 
 
And if I use http://localhost:8080/sollerasa/common/NetworkExplorer/ <http://localhost:8080/sollerasa/common/NetworkExplorer/>  (trailing slash) with the "stock" code above, I get:
HTTP Status 404 - The requested resource (/sollerasa/common/NetworkExplorer/) is not available.
 
 
If I use http://localhost:8080/sollerasa/common/NetworkExplorer (without trailing slash) with the "stock" code above, I get the following exception:
 
jcifs.smb.SmbException: smb:/null directory must end with '/'
 jcifs.smb.SmbFile.doNetEnum(SmbFile.java:1610)
 jcifs.smb.SmbFile.listFiles(SmbFile.java:1585)
 jcifs.smb.SmbFile.listFiles(SmbFile.java:1495)
 com.sollerasystems.sollerasa.common.NetworkExplorer.doDirectory(NetworkExplorer.java:179)
 com.sollerasystems.sollerasa.common.NetworkExplorer.doGet(NetworkExplorer.java:485)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
 
 
Any ideas?
 
Thanks very much,
Jonathon

 

________________________________

From: Eric Glass [mailto:eric.glass at gmail.com]
Sent: Wed 10/4/2006 6:55 PM
To: Jonathon Simon
Cc: jcifs at lists.samba.org
Subject: Re: [jcifs] jCIFS NetworkExplorer example



Try removing the below (i.e. back to the "stock" code) and instead of going to:

http://localhost:8080/sollerasa/common/NetworkExplorer

try

http://localhost:8080/sollerasa/common/NetworkExplorer/

(include a trailing slash).


Eric


On 10/4/06, Jonathon Simon <jsimon at ud.com> wrote:
>
>
> Hello,
>
> I got NetworkExplorer to work by editing the java with a static path to my
> smb share.
>
> i.e.
> .
> .
> if ( ntlm != null ) {
>     file = new SmbFile ( "smb://jst422/wwwsoftcache/from/"
> );
> } else if ( server == null ) {
>     file = new SmbFile ( "smb://jst422/wwwsoftcache/from/"
> );
> } else {
>     file = new SmbFile ( "smb://jst422/wwwsoftcache/from/"
> );
> }
> .
> .
> .
>
> Now, in my browser, when I access NetworkExplorer as
> http://localhost:8080/sollerasa/common/NetworkExplorer, I
> get a listing of the files in the /from/ directory, as expected.  However,
> when I mouse hover over any one of the files, the resulting link is not the
> smb share path + filename.  Instead, the resulting link is actually
> something like
> http://localhost:8080/sollerasa/common/file1.exe...  as if
> the file is within my web container.  But it's not; the file is located on a
> network cifs share.
>
> Shouldn't the resulting link actually resolve to the smb share + filename,
> which would then allow me to download the file by clicking the link?
>
> Thanks very much,
> Jonathon
>
>
> ---------------------------------------------------------------------
>
>  Notice from United Devices Postmaster:
>  This email message is for the sole use of the intended recipient(s) and may
> contain confidential and privileged information. Any unauthorized review,
> use, disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all copies
> of the original message. This message has been content scanned by the UD
> Tumbleweed MailGate.
>
> ---------------------------------------------------------------------
>



---------------------------------------------------------------------

Notice from United Devices Postmaster:


This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. This message has been content scanned by the UD Tumbleweed MailGate.


---------------------------------------------------------------------


More information about the jcifs mailing list