废话不说,直接上代码。
eg:
Bundle bundle = org.eclipse.core.runtime.Platform.getBundle(Activator.PLUGIN_ID);
URL url = bundle.getEntry("reports/IncomeAndExpenses.rptdesign");
String reportFilename = FileLocator.toFileURL(url).getPath();
FileInputStream fs = new FileInputStream(reportFilename);
取得了根目录下的reports下面的IncomeAndExpenses.rptdesign文件
本文详细介绍了如何使用Eclipse平台的API获取并读取指定目录下的资源文件,包括获取资源包、URL路径和使用FileInputStream进行文件读取。
1570

被折叠的 条评论
为什么被折叠?



