1
我正在开发在FUSE服务器上运行的骆驼应用程序,我试图从资源文件夹中读取我的项目中的xsd文件,如下所示。但问题是我无法读取资源中文件的确切路径或文件内容。如何访问骆驼进程中的资源文件?
我尝试读取内部流程“的employee.xsd”文件,如下代码,但它并没有成功。
File file = new File(classLoader.getResource("Employee.xsd").getFile());
String fileContent=FileUtils.readFileToString(file);// Using Commons-IO
如果给出java.io.FileNotFoundException: File '\Employee.xsd' does not exist
例外。有没有人能够解决这类问题。