tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Crowther <peter.crowt...@melandra.com>
Subject Re: How to access files in network drive
Date Sun, 03 Jan 2010 10:48:49 GMT
2010/1/3 WM C <doublecrest@live.com>

> In my web app, I need to read files from a network drive folder, which has
> access restriction (my account is permitted).
>
> During development time, since I am using Eclipse and Tomcat is integrated
> inside, so both were run under my account, everything works fine, but when
> deployed onto a testing server, where Tomcat runs using a system account,
> file access was denied.
>
> How to resolve this problem? Is there a way when accessing file, I can pass
> in a user identity as parameter, or "log on" first just like access
> database? Seems java File API does not have this option.
>
> Java is intended to be portable to different OSs.  Some don't allow what
you want, so the File API doesn't provide it.

You will have to resolve the problem through configuration.  Run Tomcat on
the testing server as a user that has access to the network drive folder.
You could do this either by changing the user ID under which Tomcat runs on
the testing server, or by granting the test Tomcat's user ID access to the
network drive folder.

- Peter

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message