0
ここでは、Cntl +スペースにヘルプ.htmlファイルを追加しようとしています。私のラップトップでは、私はソースコードを持っているので、サーバー上では動作しません。エラーは発生しませんが、サーバー上のパスは返されません。eclipseプラグインのjarファイルからリソースファイルのパスを取得する方法
Bundle bundle=Platform.getBundle("my plugin ID");
URL url = FileLocator.find(bundle, new Path("/doc/myfile/file/"), null);
//Here in file folder my html files.
String fPath = "";
try {
URL fileURL = FileLocator.toFileURL(url);
fPath=fileURL.getPath();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String fullPath = filePath + name+"."+ myfileextension;
return fullPath;//returning myfile path
ファイルのフルネームを追加しました。しかし、それでも動作しません。私は何か間違っている。 – Var20
build.propertiesファイルをチェックすると、プラグインにdocフォルダが実際に含まれています。 –
NullPointerExceptionを与えます。 – Var20