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
例外。有沒有人能夠解決這類問題。