(1) a property is set: cops.monitoredDirectory.win=\\\\dove\\copsxml\\Final
(2) It's then loaded into a Configuration class
(3) It's then passed as a parameter: pathname and the following code is run:
try {
File file = new File(pathname);
if (file.exists() && file.canRead()) {
watchedFilesVec.add(file);
logger.info("add monitored directory "
+ file.getAbsolutePath());
} else {
if (file.exists()) {
logger.warn(file.getAbsolutePath() + " exist but cannot read");
} else {
logger.warn(file.getAbsolutePath() + " not exist");
}
}
} catch (Exception e) {
logger.error("addWatchedFile(String pathname) "
+ e);
}
No Rrror or Exception as file.exists() returns false. It's just not seeing the
directory.
log file output:
2005-04-07 12:09:50,171 DEBUG (ArticleMonitor.java:117) - addWatchedFile(String
pathname) start
2005-04-07 12:09:50,187 WARN (ArticleMonitor.java:133) - \\dove\copsxml\Final
not exist
2005-04-07 12:09:50,187 DEBUG (ArticleMonitor.java:163) - addWatchedFile(String
pathname) end
Peiyun
-----Original Message-----
From: Jason Bainbridge [mailto:[EMAIL PROTECTED]
Sent: April 7, 2005 12:19 PM
To: Tomcat Users List
Subject: Re: tomcat as Windows service - access to resources
On Apr 7, 2005 11:11 AM, Jiang, Peiyun <[EMAIL PROTECTED]> wrote:
> I escaped them. It's working if tomcat started from a script. The servlet
> cannot see the directory as a java File.
> Testing for file.exist() returns false.
So your path within your servlet looks like:
\\\\computer\\dir\\mydir
(Note the four back slashes at the beginning)?
And this is while the service is running under the user account? IS
the User Account a domain account?
Again posting details will help a lot, posting a snippet of code isn't
that hard.
Regards,
--
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]