1 回答

TA貢獻1844條經驗 獲得超8個贊
由于某種原因,尾隨的“/”已被省略URIUtil.toURI(...)
。但在它的描述中URIRealtiveLocationConverter
說
注意:提供的基本 URI 必須以正斜杠結尾
因此,我從 String 創(chuàng)建一個 URI 實例,并將“/”附加到該字符串。
@Override
public IPDOMDescriptor[] getDescriptors(ICConfigurationDescription config) {
final IPath fileBase = Path.fromOSString("/home/sadik/eclipse-2019-06/eclipse/");
final IPath projectBase = config.getProjectDescription().getProject().getFullPath();
return new IPDOMDescriptor[] { new IPDOMDescriptor() {
public IIndexLocationConverter getIndexLocationConverter() {
URI baseURI;
try {
baseURI = new URI(projectBase.toString()+"/");
return new URIRelativeLocationConverter(baseURI);
} catch (URISyntaxException e) {
e.printStackTrace();
}
baseURI = URIUtil.toURI(projectBase);
return new URIRelativeLocationConverter(URIUtil.toURI(projectBase));
}
public IPath getLocation() {
IPath path = fileBase.append("pdomExample.pdom");
return path;
}
}};
}
添加回答
舉報