Get plugin path

Veröffentlicht von

This snippets gets the local folder for a plugin:

public static File getPluginFolder() {
    if(pluginFolder == null) {
        URL url = Platform.getBundle("my.plugin.id").getEntry("/");
        try {
            url = Platform.resolve(url);
        }
        catch(IOException ex) {
            ex.printStackTrace();
        }
        pluginFolder = new File(url.getPath());
    }

    return pluginFolder;
}

Kommentar hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert