【发布时间】:2016-04-29 09:30:34
【问题描述】:
我有以下 Java 代码来检查远程目录是否存在:“\\server_web\\Covers”
File CoversPathFile = new File(Options.CoversPath);
if (!CoversPathFile.getAbsoluteFile().exists()) throw new Exception();
通过命令行或.Bat文件执行时效果很好, 但是如果我使用JavaService.exe 将java 类包装在Windows 服务中,File.exists() 方法返回false;
如果使用本地路径,则不会出现此问题。
是 JavaService.exe 的错误吗?
JavaService.exe 版本:2.0.10.0 平台:Windows 2008 Java 版本:8.0_40
【问题讨论】:
标签: java file-exists java-service-wrapper