Date sent: Tue, 05 Aug 2008 15:45:26 -0600
From: Nathan Thatcher <[EMAIL PROTECTED]>
Subject: List remote files in Servlet
To: [email protected]
Send reply to: Tomcat Users List <[email protected]>
> I am experiencing a little problem with Tomcat 6.0 and I haven't been
> able to determine the cause or solution. In a standalone Java
> application I can list the files from a remote directory like this:
>
> File[] list = new File("//192.168.0.1/shared_dir").listFiles();
>
> When I execute the same code in a servlet running on the same machine
> the call to listFiles() always returns null. Is this a security
> problem? I am not seeing any errors in the logs and I haven't changed
> any of the default security settings for Tomcat of Java. Since I don't
> know what the problem is I have had a hard time tracking down a
> solution online. Any idea why listFiles() doesn't work in a servlet?
>
The most likely problem is that Tomcat is running under a user that doesn't
have permission
to that share.
-Steve O.
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]