的getResource
资源的getResource( URI URI,布尔loadOnDemand)
Returns the resource resolved by the URI.
资源集有望实现以下策略,以便将给定的URI解析为资源。首先,它使用URI转换器对URI进行规范化,然后将其与每个资源的规范化URI进行比较;如果发现匹配,则该资源成为结果。如果没有,它委托允许URI在其他地方解决。例如,程序包注册表用于将程序包的名称空间URI解析为该程序包的静态实例。所以重要的一点是任意实现可能会将URI解析为任何资源,而不一定是包含在此特定资源集中的资源。如果委派步骤未能提供结果,并且如果loadOnDemand为true,则创建资源并且该资源成为结果。如果loadOnDemand为true并且结果资源未加载,则它将在返回之前加载。
Parameters:
uri - the URI to resolve.
loadOnDemand - whether to create and load the resource, if it doesn't
already exists.
Returns:
the resource resolved by the URI, or null if there isn't one and it's not
being demand loaded.
Throws:
java.lang.RuntimeException - if a resource can't be demand created.
WrappedException - if a problem occurs during demand load.
所以,找不到资源,并在您的主目录中创建任意资源。
但我的项目是在“/home/medy75/Eclipse/dev_workspace/cz.cvut.visualization”和前一个路径(“../models/task.cm”)从“/ home/medy /” 。所以我不明白... – medy75
@ medy75:这是一个RCP /插件应用程序?如果是这样,你的临时工作空间在哪里创建(rcp_workspace左右)? – home
是的,它应该是Eclipse插件和关于临时工作空间我绝对不知道... – medy75